View Single Post
  #6  
Old 02-21-2024, 10:06 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 229

Thought I'd attach this here, if anyone else wants to play around with this. This is a simple experimental set up.

I did some refining to it, but it works about the same. Using waypoints as simple markers for "nodes".

Each waypoint has a value that represents it, these values are all set to 0. A WAC script gets the players position when the player is a few meters away from a node. Now that it knows which node you are at, it begins increasing that node's value by 1 which triggers every node linked to it to also begin increasing. So the values begin to climb, spreading out from the player's node position. This continues until all node values are greater than 0 then it stops. So now the nodes that are the furthest path from the player should have a value of 1, the players node will have the highest value.

If you move away from the node, all nodes will go back to 0.

There's several scripts that direct the bot to each node according to the nodes that are linked to the bot's current position. These scripts direct the bot to go to the next node that has the highest value.

As the bot follows the nodes with the higher values, it will always lead it to the player's node within one node step of the player.

Play around with it if you want, maybe see if you can come up with a better system. The problem with the current set-up is that if you try to set up 3 or 4 bots, the game begins to crash. Not sure but it may have something to do with too many variables being changed at once. But I just don't know of a more optimized way to do it. Maybe some programmer out there can come up with a better system. I'm not a programmer, so the way I'm doing it might be very inefficient. It's the best I could come up with given the limitations of the mapping tools and WAC.

Run the map and press J to see each node's current value. Then move to one of the nodes (Marked by green lights) and watch the nodes begin to work their magic. Watch the friendly team mate on the map as he finds the shortest path to you.

Try it out and see if you can make him get stuck or lost. lol
Attached Files
File Type: zip AI Node experiment.zip (9.2 KB, 2 views)
Reply With Quote