Re: [TuxKart-devel] Ideas for AI
Status: Alpha
Brought to you by:
sjbaker
From: Charles G. <ch...@ve...> - 2004-06-30 04:13:04
|
On Tue, 2004-06-29 at 22:41 -0500, Steve Baker wrote: > The thing I'd like to consider is something like a 'vector field'. > > A large array (and as I explained earlier - it would be LOTS of memory) > where for every (say) 2meter x 2meter square there would be (say) two bytes. I really think this is an unecessary approach. If you model each waypoint as a vector with a direction (or two vectors in the case of turns) then you can easily work out where to head and how. A giant array full of vectors is memory consuming, hard to set up (imagine doing it manually) and complicated when things change. That's just doing it the hard way. Here's an example solution for the 'next waypoint' method. If you say a waypoint is a vector, when a kart passes the normal plane to the vector then it targets the next vector. This way, even if a kart takes a really wide birth or jumps over it, the kart cannot miss the waypoint. To make sure bad behaviour doesn't occur, you can add in extra conditions for when the angle to the normal is acute. It can all be done with simple (single or double) vector way points. A trackwide grid of vectors is just so overkill and so problematic. I would go as far to say that it would be _madness_! ;) -- - Charlie Charles Goodwin <ch...@ve...> Online @ www.charlietech.com |