Finding your way about

December 3, 2009
by Nathan Whitehouse (nw08)

I’ve rehauled the entire waypoint system to allow more intellegent navigation of an indoor environment.

The waypoint system I had before simply said ‘if you can’t find the player, just loop around these waypoints until you do”. That’s alright when the AI has a large field of vision, or is near the player, but in an indoor environment with multiple paths and many barriers, that just doesn’t cut it.

Here’s a shot of the current system. It’s probably about 80% done:

What you see here is a small section of the level I’m using to test navigation. The textures are slightly random and all very free. Hence the goofy fluorescence. Scattered throughout the level are waypoints. They show up in the editor as cubes of various colors, but they are invisible in the actual game. Waypoints are grouped into ‘paths,’ marked by color. Each waypoint stores information about itself, such as what path it is in, its position in that path, and what paths are connected to that waypoint.

Waypoints are split into paths for several reasons. The prime reason is that it allows the AI to reach a specific destination much more quickly. If the AI is alerted to the player’s presence by an alarm (something which, in this system, would be extremely easy to implement), the AI can figure out how to get to the player from even a great distance away. It simply checks what path the player is on, then, if the AI is not on that path, can check the nearest connected path, until it figures out a route and begins traveling it.

It’s not quite working yet. I’m having some problems keeping the AI from getting confused if it sees the player, chases him, and then loses sight. It should just grab the nearest waypoint that leads to where it lost sight of the player, and travel along that path, but oftentimes it grabs an impractical waypoint as its target (at one point I was crashing the game with a possibly infinite loop. Oops).

Other minor tweaks abound, too, including tighter movement for the enemy more suited to indoor environments.

2 Responses to “Finding your way about”

  1.   RONALD Says: Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. Low price pills. Order drugs online

    Buy:Cialis.Cialis Super Active+.Viagra Super Force.Propecia.Cialis Soft Tabs.Viagra Soft Tabs.Levitra.Viagra.Viagra Super Active+.Zithromax.Cialis Professional.Maxaman.VPXL.Soma.Super Active ED Pack.Viagra Professional.Tramadol….

  2.   AUSTIN Says:

    CheapTabletsOnline.Com. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. High quality pills. Order drugs online

    Buy:Advair.Aricept.Zetia.Seroquel.Nymphomax.Lipitor.Female Cialis.Lipothin.Female Pink Viagra.Lasix.Prozac.Wellbutrin SR.Ventolin.Benicar.Zocor.SleepWell.Cozaar.Buspar.Acomplia.Amoxicillin….

Leave a Reply

You must be logged in to post a comment.