Page 2 of 2

Re: How to make non turnbased movement

Posted: Mon Jun 06, 2022 11:57 pm
by Gunroar:Cannon()
It's ...adjusted :crazy:

(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! :rofl:

Re: How to make non turnbased movement

Posted: Tue Jun 07, 2022 1:54 am
by togFox
If you want A* then construct your map first, accounting for widths, then invoke the jumper lib.

If you're looking for something more random then invoke jumper multiple times and queue all the waypoints for execution in sequence.

Re: How to make non turnbased movement

Posted: Tue Jun 07, 2022 12:59 pm
by milon
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.
Sounds like you're talking about Dijkstra Maps.

Re: How to make non turnbased movement

Posted: Tue Jun 07, 2022 10:39 pm
by BrotSagtMist
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.

Re: How to make non turnbased movement

Posted: Tue Jun 07, 2022 10:49 pm
by Gunroar:Cannon()
:rofl: Brogue uses Dijkstra maps to a good effect.

Does this branch method work on procedural Maps?

Re: How to make non turnbased movement

Posted: Thu Jun 09, 2022 1:37 pm
by milon
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.

Re: How to make non turnbased movement

Posted: Thu Jun 09, 2022 2:21 pm
by BrotSagtMist
That looks/sounds nothing like the page you linked. Its rather the complete opposite.
Also i refuse to define anything.
Gunroar:Cannon() wrote: Tue Jun 07, 2022 10:49 pm Does this branch method work on procedural Maps?
Last i used this i applied the map generation directly to the paths. I simply recycled data junk.