strangeness with Pegasi movement in groups

If you find a bug please report it here

strangeness with Pegasi movement in groups

Postby nagrogin » Wed Apr 10, 2013 11:04 pm

I have noticed a couple instances of odd behavior when a Pegasus
moves with a stack.

In one case, the Pegasus was moving with a ground stack including
a hero (HL), and the Pegasus got to move along a road at Mv1 per tile
instead of Mv2.

In another case, a Pegasus joined a ground-moving group (non-heroes)
that did not have Forest move discount, and seemed to confer this discount
to the stack --- 2Mv cost through Forest rather than 4Mv.
nagrogin
 
Posts: 24
Joined: Mon Jun 18, 2012 2:47 am

Re: strangeness with Pegasi movement in groups

Postby SnotlinG » Thu Apr 11, 2013 7:36 am

Hello,

When a flyer is grouped with a land-moving unit it will use roads as a preference (if distance is equal).
Also when moving you see only the group total move that is being counted down. So if you had a Pegasi + Hero moving on a road and the hero had say 10 move points and Pegasi hade 20 movepoints, it would show up as 10-9-8-7-6 while moving. But your units would be paying:
Hero: 10-9-8-7-6
Pegasi: 20-18-16-14-12
Hope this explains :-)
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

There is a bug with Pegasi+Dwarven+Hero movement!

Postby Chazar » Thu Apr 11, 2013 11:12 am

Hm, I actually pretty sure that I recently saw a definitely wrong behaviour:

The stack had a paladin (no move specials), a pegasus and a dwarf (and other no-flyers), located in a city next to hills. Without the pegasus, the stack could reach another city by going only through the hills. With the pegasus selected, the entire stack could not reach the other city: it would then route one square over grassland costing 2, and then over roads. However, the dwarf (and thus the stack) could not reach the other city anymore. For the pegasus itself, the route did not matter. The hero would also pay one more (for the grassland instead of 1 in the hills with the famous dwarven taxi), so not a single unit had more move left by going along the road - each individual unit would loose move!

Darkh's Illuria[4.0], units located in the lower left corner of Maridun, going towards the HorseLords' captial of Dunethel. That should be easy to replicate (although I am not sure how many moves the dwarf had saved from the previous turn).
Chazar
 
Posts: 670
Joined: Tue Feb 28, 2012 7:51 pm

Re: strangeness with Pegasi movement in groups

Postby KGB » Thu Apr 11, 2013 1:30 pm

Chazar,

What you describe makes sense. The A* path finding algorithm can only determine the path for the whole stack and doesn't know about different movement totals (it assumes all units have same number of movement points). When the Pegasi is in the stack the worst case move cost is 2 (Pegasi) even though it's 1 for Hero/Dwarf on hills. So the algorithm won't attempt to make a hill move only path because it correctly determines this costs 2 points (Pegasi) and that the direct line path is the shortest.

This is why sometimes is pays to split out fliers and check the path to see if there is a slightly more optimal path that covers a bit more distance.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: strangeness with Pegasi movement in groups

Postby Chazar » Thu Apr 11, 2013 1:33 pm

KGB wrote:...because it correctly determines this costs 2 points (Pegasi) and that the direct line path is the shortest.

Except that the chosen path is NOT a direct line, but a zigzag course following the road.
Chazar
 
Posts: 670
Joined: Tue Feb 28, 2012 7:51 pm

Re: strangeness with Pegasi movement in groups

Postby SnotlinG » Thu Apr 11, 2013 1:56 pm

Yes KGB is mostly correct. There is an exception in the code for flyers to follow a road in case the path is as long as an direct path, and if they are grouped with any non-fliers.
I understand what you mean, ideally the pegasi should then follow the hills instead of the road.
Ill see if it is possible to add, but basically the road-path is already an exception :-)
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: strangeness with Pegasi movement in groups

Postby KGB » Thu Apr 11, 2013 2:06 pm

SnotlinG,

Then you are going to need the same exception code for Sandworms/Sand, Boats/Water etc. Basically any place you can achieve a 1 move rate. Which means in the future any new unit / skill that can achieve this is going to require you to come back and modify the movement algorithm.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: strangeness with Pegasi movement in groups

Postby SnotlinG » Thu Apr 11, 2013 2:09 pm

Yes, thats why I am sceptic about it. Ill have to think a little bit about this, but it is not high on the prio-list as you might understand :-)
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: strangeness with Pegasi movement in groups

Postby KGB » Thu Apr 11, 2013 2:44 pm

I do indeed.

I think it makes sense that you wrote a special case for roads which are very common. Not sure the others are worth the effort.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: strangeness with Pegasi movement in groups

Postby Chazar » Thu Apr 11, 2013 2:46 pm

Instead of an exception for roads, couldnt you just compute the path for flyers and non-flyers separately, and then determine an overall path as follows:

If they come up with the same path, fine.
If they come up with different paths, then compute the cost of the flyers following the path already computed for the non-flyers. If the cost is the same for the flyers, then use that path for the entire stack. Otherwise, use the path for the entire stack that leaves the most moves for everyone (i.e. return the flyer's path, if the flyer's left-over move on the non-flyer path is lower than the left over-move of the non-flyers on the flyer's path.

So no need for a special treatment of roads here, you just use what you have, but do the pathfinding twice (doubling the time to compute a path for mixed stacks). Computing the leftover move points along two given paths probably does not add much time.
Chazar
 
Posts: 670
Joined: Tue Feb 28, 2012 7:51 pm

Next

Return to Bug reports

Who is online

Users browsing this forum: No registered users and 30 guests

cron
Not able to open ./cache/data_global.php