top of page

Planning Procedural Generation AI

Before I start I'll give you an overview of what pieces of the tile sets that will be used in the procedural generation.

Color Meaning:

Black - Road

Green - Nodes within tile

Pictures:

Straight:

Corner Piece:

Cross Road Piece:

T-Intersection Piece:

Procedural Generation Connection To AI

When the procedural map is made, the tiles will be set. After the tiles are set an A Star algorithm will create a path for the mission. This way we know which tiles the player will be taking to reach the end goal. We then start with the starting node within the start tile. We take the connection(s) of the node and check for the nearest distance to the next tile set. This will give us a list that we will feed into the AI Navigation Director to give to the flocking AI to use within the game.

AI Getting On The Right Track

For better performance and to keep in line with our procedural generation, we will be spawning in AI at different pieces of the map. These parts will be connection points when the player is going to turn. If we just feed the entire list of navigation points to the AI without giving them some sort of index correction, they won’t be able to work correctly. There are a couple ways to get around this:

  • Keeping track of the target node’s index and sending it to the spawned AI for when they are activated

  • Finding the closest node making it the target index, thus slightly merging into the process

We will be using the closest node method for the project. To get rid of potential problems we will be doing the following process:

  • Spawn the AI in

  • Get nodes on current tile

  • Make path to the tile of nearest path

  • Follow path to the actual flock path

  • Merge into the flock path

This method will allow the AI to spawn on any tile set. If we were to simply spawn the AI into a tile then give them instruction to go after the nearest node, they might crash into a wall while trying to instantly merge. This phenomenon would most likely happen if the AI spawned on opposite sides of a T-Corner Road, Cross Road, or Corner Road. To minimize risk we add on the extra path to make sure they actually get on track.


bottom of page