Jump to content
  • entries
    10
  • comments
    21
  • views
    22,128

Blog start


Chris Paulson

2,198 views

 Share

I haven't been blogging since I started with Leadwerks so this blog will be a bit of a catchup until now. Unlike most people working with Leadwerks I thought I'd ignore all the graphic eye candy as icing on the cake and concentrate on the importing matter of making things happen ie. AI

 

The bacis of AI is:-

 

Physics

-------

 

Knowing whats bumped into what. This is already taken care of in Leadwerks.

 

 

Sight

-----

 

NPC's need to have a sense of sight, this is mimicked by doing Line of sight tests using raycasts. In leadwerks you use LinePick, the knack is though where to linepick. I post example code latter.

 

 

Pathfinding

-----------

 

NPCs need to know how to get from A to B. This is a big one and quite complicated. Older games used AI Nodes bit this is now seen as outdated, the thing to use in a modern game is a NAVMESH. I wrote Blitzmax stuff to generate my own navmeshes by analysing the level with linepicks however this proved to be too slow. I dumped Blitz and went onto C++ and intergrated in recast ( http://code.google.com/p/recastnavigation/ ). This library is really good and fast. My NPCs knows now how to get from A to B.

 

See http://www.ai-blog.net/archives/000152.html

 

My blitzmax navmesh

 

 

 

Locomotion

----------

 

Once a NPC knows how to get from A to B they need to do the actual physical move. Moving the character controller along will not derive a quality appearance as it will bump into things, other NPC dynamic moving objects etc. To get the actual controller to move nicely I have implemented OpenSteer on top of the pathfinding. Using combined steering forces allows collision avoidence of moving objects.

 

See http://opensteer.sourceforge.net/

 

I am only 80% satisfied with this solution an may abandon it for something better in the future.

 

A dark video example of navmesh and opensteer working

 

 

Animation

---------

 

To avoid foot skating/moonwalking I play the movement animation the correct proportion of frames to match the distance travelled by the locomotion. I pre analyis the animation sequence to calculate how for a sequence my travel.

 

Descesion making

----------------

 

Another big one. A lot of people implement FPS games using finite state machines - a posh was of saying lots of if then else ifs.. I wrote my own FSM machine again in Blitz but decided this did not have the quality I was looking for. I have dropped this for behavoir trees and I am using a library called A++.

 

See http://forums.aigamedev.com for more info on BTs and A++

 

 

 

I can't comment any further than as this is as far as I've got, I am currently implementing all the different behaviours for my AI.

 Share

2 Comments


Recommended Comments

Hi Chris, yes I was following your work with Navmeshes and AI on the old forum, all very interesting and good stuff. I am glad its still ongoing and look forward to seeing more on this. ;)

Link to comment

I assume you are working with the visual geometry, not the physics geometry. This must make the raycasting and other algorithms an order of magnitude slower than if you had the physics data?

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...