A goal driven bot
After some productive hours I managed to assemble a bot with a few goals, reusing some old code and adding some new.
In the example below I added four goals
1) LookAround – the head of the bot looking in random directions (visualized with the flashlight)
2) RandomWalk – the bot picks a random spot in the sandbox and move there.
3) Investigate – if the player accidentally bumps into a wall within a limited distance from the bot, the bot will hear this and the investigate goal will kick in to find out whats going on.
4) Chase – if the player is in the seeing frustum (flashlight) the bot will start to chase the player
I am trying to set up a simple model that allow the bot to run multiple goals at the same time. So for example the RandomWalk goal can run at the same time as the LookAround goal. This is managed by booking resources on the bot. E.g. LookAround only utilized the head, while the RandomWalk utilized its wheels – therefore they can run simultaneously. So basically all goals that can run at the same time are selected from a prioritized queue.
To add some flavor I made a little tag game, try tagging the bot without him seeing you, sneaking up from behind, for each successful tag a new level is generated the bot will get more vision and speed. However if the bot catches you in the flashlight the game will fall back one “level”. (USE ARROWS)
Move the ball with arrows, avoid being seen by the red bots, try bumping into them from behind unseen.
Again, possible future articles:
– Goal selection
– Controlling a bot with physics (forces)
– 2D shadow casting
Not sure what to do next, perhaps drop down multiple bots and to play along in the sandbox. This usually involves making sure they don’t want to go to the same spot all the time, or collide into each other and instead not getting anywhere. Not sure if this is needed for the plan, a reactive tower defense game, but for a little shooter or so it would be cool.