1
Newbie / Hello!!! =) looking for help!
« on: November 21, 2007, 04:44:15 PM »
bump
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
You can certainly code bots as FSMs. You can even declare state variables to maintain the state and code genes to be conditional on what state the bot is in. One can think of the DNA as specifying rules for state transition based upon environmental input. e.g. If I see another bot smaller than I, move to an attack state otherwise if smaller than I move to a defense state.
There are no looping constructs in the DNA, each cycle is like a CPU clock tick of sorts, so bots can only make one state transition per FSM per cycle. But bots can be coded with multiple FSMs - e.g. one for body management, one for direction and navigation, one for waste disposal, etc. State transitions can occur in each one of the FSM each cycle. At the extreme, each gene can be thought of as it's own FSM. It's not table driven, but that is essentially what the DNA is - state transition rules which operate on memory array values. The bot's memory maintains the state, whether you use DNA-defined custom variable locations, locations changed implicitly or explicitly by the DNA itself (.up, .dn, etc) or locations changed by enviromental circumstances (like the .eye sysvars). The mem array defines the bot's state, the DNA the rules for state transitions.
Here's a trivial example. Take a bot with the following gene:
cond
0 *.eye5 >
start
5 .aimdx store
stop
The bot has two states defined by the value of the .eye5 location in it's memory array. Either it sees something and .eye5 is nonzero (lets call this state 0) or it does not and .eye5 is 0 (lets call this state 1). If it does, the gene fires. If does not, the gene does not. When the bot sees something and is in state 0, the gene will fire, slowly turning the bot until it no longer sees anything, which will move it to state 1, where it sill stay until something comes into view again, which will move the bot back to state 0.
Hope that helps.
if you can find some good settings.