I promised to write about it, here we go. I re-started the Bot totally from scratch some years ago and I wasn't able to keep working on it every day like I could with the previous one. This means that sometimes there were months or even a year where I didn't do anything. However with this source it is fun to try out new things or just re-iterate through the code to make it more modular or changing stuff which wasn't so obvious when you did it in first place. This means the new code is a lot more mature than the old one ever was and it's chopped into small modular pieces to easily exchange units.
I spent a a lot of time checking out different types of navigations and the first version was 'recording' waypoints like our so beloved Parabot did. That was about the time when Johannes did this with his Joebot XP too. Actually, it's kind of rewarding to see your Bots do the really cool nav tricks but when I finally came to the high-level behaviours I realized you can't do them if you can't rely on a proper laid out waypoint grid. So I ditched the whole waypoint stuff and wrote a BSP -> NavMesh Converter using Botman's Viewer. This worked well, but I also had to abandon this because I wanted to support other games which used their own, perhaps totally different game structure. Besides, it would have needed designer assistance too which I want to avoid at all costs. So now I'm auto-generating a navigation mesh using tracelines which should exist in some form or another in any game engine and it's surprisingly fast. Drawback: since it is a flood-filling approach in (customizable) steps it always results in 4-sided rectangles and the generated mesh isn't optimal like a parsed BSP but it's close and I don't generate polys from unreachable locations like my previous mesh builder did. As you can see the most time consuming thing is coding the navigation and it just doesn't seem to stop
Ok, time's short again and here's the technical (new) stuff:
- Dynamic Goal Planner which tries to arrange actions as they fit. very much inspired by Jeff Orkin's F.e.a.r. Planner (lookup his docs, they are worth it)
- Templated & fast A* Pathfinder which used a Mem Pool and is even used by the Goal Planner to find the sequence of Actions
- A Blackboard (shared memory space) for general knowledge and one for each Bot to store individual knowledge (and letting subsystems communicate with each other without knowing)
- Several Modular Systems (Motor Controller, Item Mgr, View Controller) which can be overloaded, specialized and in the case of the motor controller be exchanged
- Several XML configuration files, easily expandible.
- Configurable auto-generator for the underlying Navigation Mesh. Also does a bit of tactical analysis and adds special places like cover spots on the fly (note that this is just to lower the search-space, they are used dynamically in-game)
- Hierarchical Movement System, again using Goals to split them into tiny pieces. E.a. to move to a position might look like:
GOAL_GOTO_POSITION
-GOAL_GOTO_NODE (holding this Pos)
-GOAL_FOLLOW_LINK
-GOAL_FOLLOW_LINK
-GOAL_MOVE_ON_ENTITY (if an Elevator must be used)
-GOAL_FOLLOW_LINK
This makes it so much easier to debug behaviours I should have done it a long time ago.
- The spring-based viewing/aiming which seems to be the standard now
- An Event System
- A Trigger System which e.a. can create triggers upon firing of some events. Removes a lot of polling.
The Bot DLL is not tightly coupled to any game like it was before, instead there's a wrapper interface which translates events and structures back & forth between the game and the Bot API. Due to that I can plugin the bot in a game very quickly from what I've tested so far.
It's currently working in a number of Half-Life Mods (HLDM, CS, HolyWars, DMC, DOD), the old Enemy Territory (albeit not everything is finished) and Quake 4. These are very similar and I'm waiting for a game to come out which doesn't use a Quake Engine, perhaps uses a right-handed coordinate system and allows me to inject the DLL. Maybe one could hack Fear to spawn NPCs to fake enemies but I didn't dig in yet (read that Post from Dr.Evil some time ago that he took a look).
Release Date ? Unknown, if ever. ATM I'm enjoying to do this besides my regular full-time job and some things are just never finished like