# RoverTron: AI sandbox game, spore inspired

This topic is 4242 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
Come on dudes, give me something... good? bad? boring? why?

##### Share on other sites
I have thought about makeing a similar game, but with spaceships, so the entire game is in 3D (not just 3D graphics, but 3D movment as well).

One aspect to it was not to have the players code the robots in a programing language (as that could turn people off), but to have a "Block" based system where the player joins blocks that represent different sections of code/commands/variables/etc.

So there might be an "IF" block that allowed the player to link variables or litterals into it and have 2 links off it for the "Then" "Else" conditions. Another command block might be "Scan" with valuse for the Scanner to use, the ange, range, resolution, etc and it would then return (ie: link to a variable) the details of the scan.

This would be more intuitive for player to use than text scripting and can achieve much the same thing (I wonder if you could make something like this for a programming language and then compile it?).

One of the components I was going to include on the Ships/Bots was a processor. The processors would be able to excecute a certain number of Command Blocks each tick and the better the processors included the more blocks would get excecuted. This would have added another chalenge for the Scripters in that the only factor was the functionality of the script, but also the efficiency of it (smaller cade would be better).

Have a look at this version (this is what gave me the idea for the block based scripting): http://roboships.sourceforge.net/

##### Share on other sites
i think a visual programming system would be good for beginners definitely.
Definitely worth having.
However text scripting is necessary for very advanced stuff. So it would be a choice.

##### Share on other sites
You should check out MindRover. It has a great "blocks" system for programming battlebots.

##### Share on other sites
I think that the RoboShips game actually stores the scripts as XML files, so you could just edit the XML file directly ofr the more advanced scripting.

But I think that a sufficently advanced block method could do everything that a simmerly advanced text based scripting language could do.

The system I was considdereing useing was that each block had a pointer to the next block (in the case of if statement it would be 2 pointers - one for the true condition and one for the false condidtion). Each block would essentially be a function with the inputs as the requiered variables, etc.

As psudo code:
function BlockAssignVariableInt(pointer VariableObject, int Value)begin      VariableObject.Int=Valueend

or an If statement (you might use overloading to allow for different variable types)
pointer function BlockIf (int Value1, int Value2, char Comparison, pointer ConditionTrue, pointer ConditionFalse)begin      Case (Comparison)           ...           "=":           begin                 if (Value1 = Value2)                 Then                       return ConditionTrue                 Else                       return ConditionFalse           end           ...end

You could design a block system that would give you access to all the same comands that a text based scripting language would do. A scripting language that uses pointers to the next "line" of code will even eliminate the need for a "Loop" command as to create a loop you just point to a previous command (to make a for loop you would just use an if block and a counter).

A block based language will be slower than a text based language, because of the need to use pointers to the next block (like in a linked list), but it would be more intuitave for people to use.

##### Share on other sites
interesting. Sounds like a good idea.

However speed would be a priority because all of the robots would be on the server and all of there actions would be computed there.

How would i implement saya predictive aiming system with a flow diagram?
you would still need to understand the maths.

Really tho, how much easier would it be to use a flow diagram?

i mean,

if(x>y)
{
fire(1)
}
else
{
fire(2)
}

when all the override events are already setup just how hard is it for a beginner programmer to code if's and for's. With a good tutorial its not going to be THAT much harder than a visual system. The logic is still there. And when a visual system gets very large it would be very cluttery imo.

I am going to try a visual system eventually, but for the first few betas it will be text.

##### Share on other sites
The big problem with the visual system is that it can get cluttered, but for a beginner programmer the flow of the program can be hard to understand. Although most code will excecute in a linear fassion (ie one cammand after the other), once you put an IF statements in it can get hard to understand, where as witha visual ther are 2 distinct lines that you can see that show the excecution path.

To reduce the clutter you could introduce "Fuctions". All you need to do is have a Block that can call another Block script and return after the excecution of that sub script is done and you have a function call. If you use a linked list of variables you can even pass and return parameters to and from the function.

Quote:
 However speed would be a priority because all of the robots would be on the server and all of there actions would be computed there.

This was one reason I though of introduceing a limit to the number of code blocks that a robot could execut each tick. If you have a limited number of commands that get excecuted each tick, it will reduce the load on the server (as the entire script wont have to be excecuted each tick). It also puts a limit on the compexity of the scripts, which adds an extra chalenge to the game.

##### Share on other sites
I might get shot for saying this, but have you had a look at gamemaker?

I only mention it because it has such a simple interface which can be used by almost anyone to create "fairly" complex behaviours by means of a simple drag and drop interface. Creating a similar interface to GM would certainly open the game up to a slightly wider audience.
I know someone suggested something similar to this (mindrover), but imho, gm has got it right when it comes to doing things like this, kinda like turning game-programming into a game.

##### Share on other sites
Quote:
 Original post by TempleI might get shot for saying this, but have you had a look at gamemaker?

hahaha