Search the web
Sign In
New User? Sign Up
robowar · Robowar: A programming games where robots duel each other.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Stripped-down RoboWar engine   Message List  
Reply | Forward Message #3192 of 3221 |
Re: [robowar] Re: Stripped-down RoboWar engine

> Excellent! I have mono, but I'm not actually sure how to go about
> compiling anything that doesn't come with a neat Makefile.

There's a MonoDevelop solution included. You can either use MonoDevelop,
or if you use something else, it looks like "mdtool build" does a
complete build from the command line.

For simple stuff, like adding a source file, you might even be able to
edit the project files with a text editor.

> Okay, so from your list, here are the things that I will be trying to
> get done for my project::
>
> - Interrupts
> - Many weapons (just bullets and missiles implemented)
> - Still a couple of special operators and registers
> (history, channel, signal, for example)
> - Headless / command-line interface
>
> I don't particularly need a built-in:
>
> - Editor
> - Debugger
>
> but I'll want to edit robots in a text editor -- does one of the
> formats make this easy? I don't remember.

Not really, they both contain non-textual stuff. But it shouldn't be
hard to implement. You'll find the file formats in LibRoboWarX/FileFormats.

The RobotFile class in there is the in-memory representation of a
robot's data. (Not to confuse with LibRoboWarX/Arena/Robot, which
contains runtime state.)

The other classes simply open a file, create such a RobotFile instance
and fill it.

In fact, this might do it for reading a text file as a test:

================================================================================
using System;
using System.IO;

namespace LibRoboWarX
{
public static class SourceTestLoader
{
public static RobotFile read(String filename)
{
RobotFile result = new RobotFile();
StreamReader f = new StreamReader(filename);

// Induce the robot name from the filename
f.name = Path.GetFileNameWithoutExtension(filename);
// Read the source
f.code = so.ReadToEnd();
// Immediately compile for convenience
f.compile();

// Default hardware is rather minimal, see
LibRoboWarX/Arena/Robot.cs
// Perhaps set some useful values here for testing
f.hardware.hasMissiles = true; // These already work! Woo!

return f;
}
}
}
================================================================================

Come to think of it, a text only format would be nice. Maybe we can get
hardware settings from a comment block near the top of the file? In
YAML? Hmmm... :)

> Given these goals, can you estimate what's needed to get it done? Any
> general pointers as to where I (or whoever) would start?

Let's see.


Interrupts are stubbed out in places. Most notable is the
processInterrupts method in LibRoboWarX/VirtualMachine/Interpreter.cs.
This is called from LibRoboWarX/Arena/Robot.cs, and I believe that's the
correct position where RoboWar used to process interrupts as well.

You'll find that all (interrupt) registers subclass from the abstract
class LibRoboWarX/Arena/Register.cs and implement the
LibRoboWarX/Global/ITemplateRegister interface. (I'm not sure why I made
those separate.) The Register class has methods called fireInterrupt,
checkInterrupt and updateInterruptState.

I suppose checkInterrupt would be called from processInterrupts.

fireInterrupt would be called if checkInterrupt returned positive, but
it might be obsolete if all interrupts do is push to the stack and
change the PC.

updateInterruptState is a mystery even to me. Must've seemed like a good
idea at the time.

One thing I remember is that I didn't take into account the order in
which interrupts are fired yet.


Weapons are hopefully easy to implement. That was one of my original goals!

You'll find the Missile is probably the simplest example. Simply a
Register class that the compiler and virtual machine can use, and a
Projectile class to do your worst.


You can probably scrap the 'remaining operators' from your list. They're
things like: print, debug, snd, beep, icon and mrb(?). Things you
shouldn't care much about, especially for a headless and debuggerless
interface. For reference, they live in
LibRoboWarX/VirtualMachine/Operators.cs. There's some commented original
RoboWar C code in places that are still lacking.

The registers are more interesting. Especially the team communication
stuff like channel and signal. See LibRoboWarX/Arena/StockRegisters.cs
for those. I've included excerpts from the original RoboWar manual as
comments.


A headless interface also should not be difficult to get running
quickly. The bulk of the code in the current GUI frontends really only
touches the GUI. You should be able to figure that out.

I have not given the public interface of LibRoboWarX much thought yet.
But it works for getting a game going.


That's as much as I can ramble about without getting specific questions. ;)

-- Stéphan



Thu Jan 15, 2009 9:55 pm

stephan@...
Send Email Send Email

Forward
Message #3192 of 3221 |
Expand Messages Author Sort by Date

I am interested in running some tournaments with different structures, and I want to be able to specify battles myself. I don't care about being able to see...
Randall
antiglommer
Offline Send Email
Dec 13, 2008
8:00 pm

Does this means that the game is still alive? I'm sort of surprised ^^ Ohh bye the way Randall you write a nice comic, it is sort of adictive... /Viktor...
Viktor Tullgren
vtullgren
Offline Send Email
Dec 15, 2008
1:54 am

Actually in the last few months I've been thinking that it would be a fun project to rewrite Robowar and give it a Qt user interface. Lots of nostalgia...
Paul
plisdku04
Offline Send Email
Dec 15, 2008
9:26 pm

Robowar in Matlab... Why does that sounds scary......
Viktor Tullgren
vtullgren
Offline Send Email
Dec 22, 2008
5:54 am

Camden: That would be awesome. Do let me know if you find anything -- I just spent a while on the phone with Prfnoff seeing if he could put together a copy of...
Randall Munroe
randall@...
Send Email
Dec 23, 2008
10:19 pm

Not two days ago I started thinking about Robowar for the first time in a while.  Damn universal mind. *kick* Given how sparce RW has been, I've thinking of...
Camden
the1true2all
Offline Send Email
Dec 19, 2008
4:33 am

I think I remember someone about 1.5 years ago posting that they had rebuilt RW exactly as you describe, with no graphics or sound or anything, but command...
Camden
the1true2all
Offline Send Email
Dec 19, 2008
4:39 am

Pre-script: I believe what I might have been remembering was Stéphan Kochen's message 3122, which had the compiler running from the command line, but it looks...
Camden
the1true2all
Offline Send Email
Jan 14, 2009
12:24 am

... Kochen's message 3122, which had the compiler running from the command line, but it looks like the tournament utility wasn't fully functional yet. Hmm......
Stéphan Kochen
stephan@...
Send Email
Jan 14, 2009
7:16 am

If anyone can get me the source for either of these, I will sit down with some programmers and try to do the remaining work that's needed. I'm excited right...
Randall Munroe
randall@...
Send Email
Jan 14, 2009
4:34 pm

... Having more people chip in does make it exciting. :) How are you planning to work on this? Is your sit-down an offline or online thing? If it's an offline...
Stéphan Kochen
stephan@...
Send Email
Jan 14, 2009
4:59 pm

... Well, I have a couple offline friends who might be interested in taking a look, but I don't know how I'm doing this yet. It sort of depends on how much...
Randall Munroe
randall@...
Send Email
Jan 14, 2009
9:51 pm

... Me neither. I'm more casually interested; I am excited to see people jumping in on getting the game back alive again. In reality, I have precious little ...
Stéphan Kochen
stephan@...
Send Email
Jan 15, 2009
6:51 pm

... Excellent! I have mono, but I'm not actually sure how to go about compiling anything that doesn't come with a neat Makefile. ... Okay, so from your list,...
Randall Munroe
randall@...
Send Email
Jan 15, 2009
8:37 pm

... There's a MonoDevelop solution included. You can either use MonoDevelop, or if you use something else, it looks like "mdtool build" does a complete build...
Stéphan Kochen
stephan@...
Send Email
Jan 15, 2009
9:55 pm

Replying to self. :) As a starting point, a Google Code project has been created. You can find it at: http://code.google.com/p/robowarx/ I've checked in the...
Stéphan Kochen
stephan@...
Send Email
Jan 18, 2009
4:40 pm

As for a sophisticated way of verifying, I'm not sure I can think of one.  But I think Kevin, Eric Foley, and I have a pretty intimate feel for the mechanics...
Camden
the1true2all
Offline Send Email
Jan 19, 2009
4:30 pm

... one. But I think Kevin, Eric Foley, and I have a pretty intimate feel for the mechanics since we were all reviewing the old mac source at important points...
Stéphan Kochen
stephan@...
Send Email
Jan 19, 2009
7:48 pm

I can ask Prfnoff about this tonight. I'll relay the answer here. I don't feel confident enough to do much with the current code, such as fill in the code for...
Randall Munroe
randall@...
Send Email
Jan 21, 2009
3:39 pm

It looks like, to get a headless mode working, I should just skip the RoboWarX.GTK and instead make a new program that just instantiates an arena object using...
Randall Munroe
randall@...
Send Email
Jan 21, 2009
5:02 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help