View Single Post
  #5  
Old 12-02-2023, 07:01 AM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 229

Quote:
Originally Posted by jabo1SFH View Post
good luck.

almost every single coop mapper just made sure there were no obstructions to impede the AI in a coop map and/or we just set up waypoints for them to follow around objects.



Problem with this is that it is so generic. If nodes worked, you could have AI move to ever changing objectives without getting lost. They could hunt down the player no matter where they hide.

I tried to make my own node system with a WAC script using waypoints as nodes. I set up a test map with a small set of city blocks and only about 20 waypoints which would help AI navigate around buildings and such.

I then created a virtual adjacency matrix which assigned each node's neighbor. The WAC would tell the AI that if you are at X node, you can go to Y or Z.

The hardest part was creating a wac script that would tell the AI the shortest path to the objective. In this case, the player.

I did this by assigning each nodes variable as a number that represented the correct direction. Then which ever node the player was closest to, that variable would be set to 1 then all of their neighbors variables would increase by 1.

This creates a path for the AI because when it gets to the node, it has to decide the next one to go to. In this case, as long as it goes to the node with the lowest variable, it will be lead to the player.

This all worked beautiful. No matter where i went in those city blocks, my test AI would follow my nodes to me.

The problem is that it took a lot of lines of wac code for just one AI. After setting up scripts for about 4 total AI on my test map with only about 20 nodes for navigation, it crashed the game. LOL

Not sure why, probably too many variables changing and such. A real bummer though because it worked great with 2 or 3 AI.
Reply With Quote