Alex Rivera | Logout

Developing a Robocode type game with .Net, for a School Assignment

Asked 2009-02-02T21:33:35.867
12

I am currently in my final year at school, studying for a Higher National Diploma in Computer Studies, and basically in this final semester, we need to develop a Software Project, that basically incorporates a whole system.

Now, what I'm thinking of doing is something along the lines of Robocode, but instead of Java, I will be doing this with the .Net Framework.


What is Robocode ?

For those of you don't know what Robocode is, it's basically a sort of programming game in where people develop their own robots using methods from the class interfaces and downloadable classes that exist, and then they fight each other in an autonomous battle in an arena...like such:

alt text
(source: com.com)


So basically, as I said, I want to recreate this sort of scenario using the .Net Framework..and I am posting this question here on StackOverflow in hope that more experienced developers will be able to guide me in the right direction for this project.

What I have in mind up till now is basically to create:

  • An Offline application that will serve as the battle arena and the user-interface to create new battles with existing robots and such.
  • An Online interface that players will able to use to register new robots, view past tournament scores etc...
  • And obviously the Class Interfaces that players will need to use to create their robots.

Animation and Graphics (for the actual battles)

Now, of course there will be some sort of animation and movement when the battle occurs, and I haven't decided what yet to use as a medium for this.

Edit
Report

1 Answer

6

When I began working with WPF (which is much the same as Silverlight) I ended up spending a lot of time figuring out how to do things. It is a very different way of making a GUI than what else I've tried and there seems to be a billion different ways to do things. My point is, that if you have no experience with WPF/Silverlight I suspect it is going to take a lot of time for you to wrap your mind around. I guess it depends on what you already know.

Apart from than, I wholeheartedly support ChrisW's suggstion about incremental development. I'll give you an idea of how you can approach the design of the game. Start out with a very simple API for the bots, say two functions with no events, input or knowledge of the world. Just start by getting the bots to move. The point is to get a fully functioning program with the simple functionality, including all parts from loading the client code to showing the resulting 'battle'.

Each bot should implement an interface with a single method run() and be in their own dll file. When the battle starts, each dll with the interface implemented is loaded (using reflection) from a certain location and instantiated. Then start a battle with a loop until 1 minute has passed (or whatever, just to see that something is going on):

while (time is not up)
   generate random sequence for bots
   call run() on each bot
   draw(world)

When the time is up, the battle is over. Now you have a skeleton application which you can begin to flesh out and which will let you have a working program, even if you won't have time to make all the functionality you would like. In the run method, the bots can call the couple of move actions you have defined in the API. Calling these will change the state of the world - probably just a grid of tiles, and the location of each bot.

The next step could be to add a view of the world to the bots' run method, changing the loop to this:

while (t
answered 2009-02-02T23:01:27.843

Your Answer