(E.g in Dust)
Enemies find a path to a place a certain distance away from you,
Enemies find a path to a place a certain distance close to you,
Enemies find a path away from you when they're running away,
Enemies refresh paths so they'll move around while attacking.
I get what you're saying though, even with these over the top path juggling it can get like that, though I find it necessary if you need your AI to do more than attack the player (like go find something in level, track down the player, etc).
And nice approach to the collision thing!
BrotSagtMist wrote: ↑Mon Jun 06, 2022 11:29 pm, trails are cool for various stuff.
Couldn't be truer!
The risk I took was calculated,
but man, am I bad at math.
BrotSagtMist wrote: ↑Mon Jun 06, 2022 11:29 pm
...
Best method i found is to have precalculated pathways like a tree. This allows for enemies to eg avoid you just to reappear from behind.
I certainly do not talk about fancy made up words, i talk about a tree, does that look like a tree? No.
The tree idea performs poorly on an open field or for following you.
You will need a "find the goal" game type. From that goal you create a path and save each step of that bound to the tile.
So say if you are on tile [3][3] this tile returns its next piece [3][4].
From any tiles on that path you create additional paths, branches, from that sub branches etc until the map is covered.
Enemies follow you by trying to get on your branch and from there simply follow it.
The catch is that for most of the map the enemy will take the way over the main path to reach your branch. Also you cant see these branches. This means that instead following the enemy may try to reach the goal first on a side track next to you, then turns around and blocks your path.
Then if you flee, it goes anywhere into the map for no reason BUT reappears on the same spot if you try that route again.
Or in other words: Imagine a rectangle with you in the upper left and the goal in the lower right, lift/down corners are the main path, the other the branch. A normal AI will chase you around this block, but this branch type will have it turn back to the goal as soon as you try to lure it away. Effectively making it impossible to outsmart it in this scenario.
BrotSagtMist wrote: ↑Tue Jun 07, 2022 10:39 pm
I certainly do not talk about fancy made up words, i talk about a tree, does that look like a tree? No.
The tree idea performs poorly on an open field or for following you.
You will need a "find the goal" game type. From that goal you create a path and save each step of that bound to the tile.
So say if you are on tile [3][3] this tile returns its next piece [3][4].
From any tiles on that path you create additional paths, branches, from that sub branches etc until the map is covered.
Enemies follow you by trying to get on your branch and from there simply follow it.
The catch is that for most of the map the enemy will take the way over the main path to reach your branch. Also you cant see these branches. This means that instead following the enemy may try to reach the goal first on a side track next to you, then turns around and blocks your path.
Then if you flee, it goes anywhere into the map for no reason BUT reappears on the same spot if you try that route again.
Or in other words: Imagine a rectangle with you in the upper left and the goal in the lower right, lift/down corners are the main path, the other the branch. A normal AI will chase you around this block, but this branch type will have it turn back to the goal as soon as you try to lure it away. Effectively making it impossible to outsmart it in this scenario.
You're funny Brot. You basically just defined Dijkstra maps.
Dijkstra is ultimately a pre-calculated set of this-node-leads-to-that-node directives that lead to a given goal(s). It can be a simple tree structure (read far enough down the link to see clearer examples), or a more complicated field with multiple goals.
But call it whatever makes you happy.
Gunroar:Cannon() wrote: ↑Tue Jun 07, 2022 10:49 pm
Does this branch method work on procedural Maps?
I don't see why not. Once you generate the map you can compute whatever path branches you desire.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.