Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Monday, 4 July 2011

Of Off World AI

So I have finally got around to creating some screen shots that show the AI working in a test arena. The 100 black spheres (etherics) are swarming and targeting the player in green. The blue NPC is just currently wandering with no particular purpose, but that will change very shortly.
All the behaviours are controlled by behaviour trees and will now get the behaviours filled in. All the structures and decision making for the BTs have already been created for the AI controlled entities, but most are empty.

The shown textures are not representative of the final game,
but are there to provide some simple context.

The black spherical objects represent the 100 etherics (look of them is not what they will look like eventually) swarming and targeting the player (in green). Shot 1 shows a broken swarm, Shot 2 shows the rejoining of the swarm and then the last 2 show the etherics moving towards the target (player in green). Once we get something more representative, I will upload some video.

Collison avoidance is used by ray tracing to discover collisions that then get added to a AI entity queue so they get processed as and when time allows. Currently this is every tick but can be setup to do otherwise to preserve precious CPU cycles.

The plan now, as I said above, is to fill in all the behaviours for the AI.

Current thinking for the AI direction is:
  • Investigate evolutionary BT creation for NPCs
  • Update 2D AStar path planning and create a 3D version for the etherics
  • See how neuro evolution can be included, if practical
  • Hunting behaviour
  • Fighting AI by threat analysis
  • Others TBC!
Any questions, just ask, more than happy to share my thoughts, experiences etc.

Cheers

Matt

Tuesday, 7 June 2011

Of physics and AI

Have been working on getting the AI integrated with the Bullet Physics Engine. Finally I have managed to get it working as I want it to so I have a swarm of nasties moving around the stage without disappearing of the edges. Next step is to add buildings and make it look more like a proper stage rather than an open field :). So the swarming is all controlled through the AI, and physics engine is doing collision detection for the various obstacles. The step to add buildings will be very straight forward as they are created in exactly the same way as the stage boundaries. Essentially, the AI uses bullet to query for collisions and adds any collisions for a character to its collision queue. On the next tick, the character takes into account the queued collisions. This should allow the various parts to be separately threaded to make best use of available CPU resource - well that's the plan anyway, we'll see how it goes.


The bullet physics engine is reasonably easy to use with most of the concepts illustrated through demonstration projects. The rest of the documentation is reasonably brief but it does point you to the appropriate demo project. Once the concepts are understood, integration is pretty straightforward. I should add that I have no background in physics engines or previous experience so I have learnt this from the ground up.



Will add some shots, maybe video in the next few days.