Scraped "flee" behavior altogether, as this is now implicitly handled by the
combination of both "spectate" and "seek-friendlies" mechanics ... DONE
Big one: get all the ifelse double blocks out of the program code -- hm, now that's courious. By simply removing these blocks (while functioning as expected) I'm seeing a HUGE performance drop here. Don't really know what causes this, but I guess I revert the changes for the time being, and stick to the proven method... UNDONE!
... okay, I just came back to this issue - I'm not quite sure what is responsible for this performance drop, but as long as it is still bearable, I'm going to stick to the new version after all. Part of the reason for this decision is that I have adapted a means to separate perception and action, by having the agents "scan" their environment only once every 10 ticks, in accordance to the Jager model (note that I still scan a lot more often than Jager did, for the reasons mentioned in an earlier post). Not only does this make sense in the 1-tick-one-second context, but it also brings the lag down to a bearable level. (This should also add some persistence to the behavior of individual agents, which is a nice thing to have).
The big theoretical thing to do today is to collapse my "aggression-level" and "arousal-level" into only one variable (which will keep the name "aggression-level") - I could explain the reasoning behind that with a quick picture, but the general idea is that the motivation towards violent behavior (which I previously handled as HIGH aggression AND HIGH arousal) is really just a combination of these two concepts. All in all, it seems favourable to have as few internal variables as possible.
Been reworking the violence-mechanic. In accordance to the Jager model, violence is now bi-directional. I also coupled it to the energy level of the agent - an agent will fight for 100 ticks, no more, no less, an then disengage. I also introduced booleans for "attacking" and "defending", to distinguish both types of violence. While violent? is true, the agent simply remains immobile.
Add violence-check to behavior node.... DONE
Handle color control in one of the top-level functions (instead of doing this distributed throughout the code)... DONE
Made a test run over 500 ticks - obviously there's some bug in the disengagement handling. Investigating ... D'OH! Found it. Fix'd it.
Made another test run over 800 ticks - beautiful! Agents are clustering slowly, took a lot of time (300-400 ticks) until the first incidents, then violence spread throughout the clusters and kept relatively stable, even given the new energy-level dependency of fighters. The ratio of violent behavior in the whole population leveled out at about 30 %, distributed over three sizable (2 bigger, 1 smaller) clusters.
The next big thing: implementing the "seek-friends" behavior (as a preferable alternative/sub-case to "seek-friendlies"). This should also improve clustering... DONE
Thursday, June 5, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment