Friday, May 15, 2009

Man I'm Beta!

The team has just finished week two of a five week period before beta hand-in and the pressure is starting to mount. During this time, the main focus for the team has been to try and fix features that have been implemented so far as well as getting the gamer experience properly implemented.

My task has been the AI routing. This has given me a lot of trouble over the course of this project. The main challenge has been the fact that the environment is almost completely dynamic. I have been running into cases where the AI agents will almost always get stuck running to a waypoint because the path that it calculated has become invalidated. At the moment, AI agents are using a combination of pathfinding and steering behaviour. This kind of works but I still need fallbacks incase something wrong happens. Some suggestions have been given to me from peers, Darius, and Jon, our new GD Tutor and resident go-to guy. Here are the approaches that I will be trying over the next few days:

- Keep track of waypoints that have been successfully traversed. If the AI agent takes too long to get to its next waypoint, have it backtrack. Add a working memory fact that will change the cost of the edge that could not be traversed so that future AI agents will avoid going that way when pathfinding. Once the fact has expired, reset the edge cost back to the correct cost again. By setting a time limit on how long that edge cost can stay modified, it should stop the edge cost from being invalid for too long (NB: The time limit probably would not be needed if the environment was not dynamic....then again, the agents would probably not get stuck either).

- Place trigger areas around the map that could be problematic for simple pathfinding. If the agent gets into this area, have them perform some action to minimise the possibility of it getting stuck. For example, there are stairs in the area where agents tend to get stuck. I could place a trigger area at the bottom of the stairs that could make the agents jump to the top rather than just walk up it.

- Have designated areas in the map where AI agents can return to where they can easily get to certain areas in the level. If the agent gets stuck, have it try to get to one of these areas where it can begin its search again.

At the moment, I am leaning towards the first one. I'll be back with my progress in the next few days. Keep posted, later days.

1 comment:

  1. Wow Luke! Quite a bit to do on this AI but seems that you have it sorted!
    I cannot wait to be able to play the game! Good on you guys! Bring on the Beta!

    ReplyDelete