Mechanized Assault & eXploration Reloaded



#1 Oct 02, 2015 10:45 am
InsOp Offline
Mitglied
Registered since: Sep 12, 2015
Posts: 3


Subject: Pathfinding
Hey folks,
how is pathfinding implemented in maxr?
is there a given library used? because most of them calculate distances in chebyshev metric, given that adjacenting fields may be
occupied.
ex1:
A|#
-----
#|B
(A:start, B:goal, #occupied)

But max uses afaik the manhattan metric (diagonal fields cost 2 actionpoints instead of one) but units
are able to move through diagonal choke points (as described in ex1)

If that wouldnt be enough max takes into account that water doubles the need of actionpoints and streets halven them,
so its pathfinding leads the units through roads so that less acitonpoints are needed.

Another part of the max pathfinding is the somewhat cooperative pathfinding.
well its not real cooperative pathfinding (as you might noticed if you send two units through a choke point and as the first one reaches it,
the second one recalculates its path and ends up driving a huge detour because the first unit now blocks the passage)
but - if you send multiple units to a destination, they keep their formation and have each single destinations relative to their formation.
plus, theyre always move as wide as the unit with the fewest amount of actionpoints is able to move (i dont know how this approach of pathfinding is called, maybe you know it?).

another thing about airplanes, they use the same distance metric but are able to leap over fields like the knightchessfigure, how is this implemented?

as you see im having some headaches related to this topic. it would be great to get some insight!
and if i assumed something wrong it would be kind of you to correct these.
↑  ↓

#2 Oct 05, 2015 2:24 pm
nonsinn nonsinn Offline
G-Mod, Approved Member
Registered since: Apr 02, 2012
Posts: 254


Subject: Re: Pathfinding
Hey InsOp,
the diagonal field cost to move are not 2times it's 1.5 times. And afaik, if there is 0.5 speed leftover at turnend, the 0.5 speed is added to the next turn move (at least as long as it is a more-turn-move-job). Don't know if this 0.5 speedpoint is saved/loaded too but I guess not.

In general, the aircraft move behavior should be like the ground units one but iirc with disabled collision check because they can be stacked too. Would be interesting what happens if one square is blocked with a max. amount of aircraft…

Nevertheless there are some worst-case-scenario we are totally aware of, with which maxR will have trouble, but unfortunately we have a lack of manpower to fix this asap :| (so we have some issues to fix -> https://git.maxr.org/maxr/maxr/issues?utf8=✓&issue_search=path&state=opened&scope=all )
[15:23:19] nonsinn [..] heißt nun bug-hunter
[19:58:09] Eiko_ [..] heißt nun mother-of-bugs
[20:38:11] <bug-hunter> mother-of-bugs: ..argh..
[20:38:26] <@mother-of-bugs> want some new bugs?
↑  ↓

Pages (1): 1

All times are GMT +02:00. Current time: 7:01 am.