Advertisement

Simple robot "ai"

Started by December 19, 2005 05:45 PM
0 comments, last by Nit 18 years, 11 months ago
I am interested in writing my own version of this game, but in C#: Robot Battle The game above is pretty complex. I am looking for source code / articles, etc. that talk about the same concept....but much much simpler and dummied down!!! I am looking for some source code, C++ or preferrably C#, that demonstrates how to create and "set loose" a simulated robot in a "world". The main function of the world is to "contain" other objects, some of which will be "robots" or obstacles / items that the robot must go around or can interact with. I need source code that demonstrates how a robot can have "sensors" and how it can make decisions based upon "input" A "game loop" would sort of go like this: //loop through "world" //if object is a "robot" then have robot "look around" //based on what robot sees...make a decision. //for example...if nothing is around, go in a certain direction //for example...if robot is nearby and health is > 50, then attack //for example...if robot is nearby but health is < 50, then run //if wall is encountered, push the wall //if power source encountered, then soak-up the power until max power is reached. //start at beginning of loop again. The robots will continue to function according to their programming until they die and only one robot is left standing. I need websites / source code that specifically talk about THIS kind of programming "robot simulation". The genre for this game would be sort of like a "Sim Life" or "Sim City" or "The Sims" .... but in a tutorial format.
Sounds like you need to look into either state machines or rule based systems. There are two good state machine tutorial/code scattered all over the place. In particular, the Game Programming Gems 1 book has two good articles. You might also want to look at http://www.generation5.org/content/2003/FSM_Tutorial.asp for an online tutorial.

As far as rule based systems go, I have only used Soar (http://sitemaker.umich.edu/soar). Browse through the tutorials by John Laird (Part 2 and 3 will probably be most interesting to you).

EDIT:
Oh and as far as using Soar, you will want to use either SGIO, a Soar API written in C, or SML, a C++ API that uses an XML messaging layer. As of present, SGIO is still faster than SML, but this will probably change upon the release of Soar 8.6.2. SGIO is poorly documented, and no longer supported by the community, so it'll be in your best interest to pick up SML.

This topic is closed to new replies.

Advertisement