Re: [TuxKart-devel] Ideas for AI
Status: Alpha
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2004-06-30 23:40:49
|
Charles Goodwin wrote: > I was really (in my mind) giving double-meaning to waypoints, not just > associating them with single points but also with areas. Your diagrams > are an exact illustration of how I visualised it. Cool - so it looks like we are all in basic agreement. Let's flesh it out a little so we're all on the same page: 1) In addition to the 'visual' model of each track, we make a separate 'AI' model. The two will in general cover the same area of ground - but the AI model will usually be *way* simpler...fewer polygons that is. 2) For the purposes of visualising this model in blender (or whatever) and when debugging - we make a texture map with a bunch of arrows pointing up the map. In ASCI art: [^^^] :-) 3) In the modeller (blender, whatever) our track designers apply the arrow-map to each polygon to reflect the general direction a Kart should be driving whilst driving over that polygon. We could also vary the SCALE of the texture in the S and T directions to provide additional data (eg: The longer the arrows, the faster the kart should attempt to go - the fatter the arrows, the more laxity the kart is allowed in choosing a direction. (eg when crossing a narrow bridge - short, skinny arrows mean drive slowly and stick closely to the desired direction. Long skinny arrows make him drive faster but stay on target, long, fat arrows mean you can drive fast but you don't have to stay accurately on direction if there are powerups nearby.) We can probably use the colour of the polygon to store yet more data, etc, etc. 4) The game loads this AI model at the same time as the visual model. The (s,t) texture coordinate at each polygon vertex can then be used to reconstruct the direction that the arrow map was pointing and turn that into a 'heading' number for each polygon (and a speed and turn 'laxity'. This should be saved along with the polygon for future reference. 5) As the game runs collision detection on the visual model, so it'll also run collision detection on the AI model. PLIB can return the data for whichever polygons are vertically beneath the kart. The nearest one of those will provide the 'ideal direction' indication to the AI software for the following frame. -- ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |