ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.73k stars 377 forks source link

Adventure map, optimization of the hero's predefined path #4510

Closed LeHerosInconnu closed 2 years ago

LeHerosInconnu commented 3 years ago

Preliminary checks

Platform

Windows

Describe the bug

In the original game, the hero's predefined path favors horizontal and vertical moves first, rather than diagonal moves, which allows the hero to benefit from the bonus given to the last move (if the hero can move horizontally or vertically then he can move diagonally).

In fheroes2, this is not the case, and it penalizes the hero by reducing his movement.

In the original game (the hero's predefined path favors horizontal and vertical moves first):

Optimize hero path 001

In fheroes2 (the hero's predefined path first makes a diagonal move and the hero cannot reach the last square):

Optimize hero path 002 Optimize hero path 003 Optimize hero path 004

In fheroes2 (by "manually" moving the hero horizontally as far as possible, the hero can move diagonally into the last square): Optimize hero path 005 Optimize hero path 006

I noticed a lot of differences between the original game and fheroes2 in the hero's predefined path due to this during my test on passability. Here are all screenshots for passibility and predefined path differences: https://drive.google.com/file/d/12eG_uOTrI7wSsnGJBagfvu8AGQ-qxAD0/view?usp=sharing

Save file

Here is the test scenario file: 0 9953a4.zip

Additional info

No response

oleg-derevenetz commented 3 years ago

Hi @LeHerosInconnu

bonus given to the last move (if the hero can move horizontally or vertically then he can move diagonally).

Does the "last move" mean "last move in the path" or "last move hero can make before he runs out of move points"? If the latter, then how about paths that take more than one day?

LeHerosInconnu commented 3 years ago

Hello @oleg-derevenetz,

Hi @LeHerosInconnu

bonus given to the last move (if the hero can move horizontally or vertically then he can move diagonally).

Does the "last move" mean "last move in the path" or "last move hero can make before he runs out of move points"?

It's the "last move hero can make before he runs out of move points".

If the latter, then how about paths that take more than one day?

The path should be adapted according to the terrain penalties encountered the next round(s), like this:

In original game:

Päth optimization 001

Päth optimization 002

oleg-derevenetz commented 3 years ago

@LeHerosInconnu

The path should be adapted according to the terrain penalties encountered the next round(s)

What I meant is "should this effect be applied to each last-of-the-day move of multi-day paths"? :) In other words, should the each last-of-the-day move in multi-day paths ignore the diagonal penalty too? Because otherwise we will face the same issue - it would be more optimal to move day-by-day instead of paving the multi-day path.

Honestly, all this logic looks weird, like some ancient logic flaw.

LeHerosInconnu commented 3 years ago

@oleg-derevenetz.

@LeHerosInconnu

The path should be adapted according to the terrain penalties encountered the next round(s)

What I meant is "should this effect be applied to each last-of-the-day move of multi-day paths"? :) In other words, should the each last-of-the-day move in multi-day paths ignore the diagonal penalty too? Because otherwise we will face the same issue - it would be more optimal to move day-by-day instead of paving the multi-day path.

Yes of course, the predefined path over several turns should take into account the movement bonus of the hero's last move for each turn.

Honestly, all this logic looks weird, like some ancient logic flaw.

I think this is a compensation for the fact that a diagonal movement costs 1.5 movement points instead of 1.41 movement points. :D

Edit.

Also, it might be a bit "weird" from the player's point of view to be able to take a last step but not in every direction. And also, without this, it would "force" the player to take "one last step" (horizontally or vertically) at the end of each turn if the hero has movement points left (before going on to the next turn without having the message "One or more heroes may still move, are you sure you want to end your turn?").

oleg-derevenetz commented 3 years ago

@LeHerosInconnu

Also, it might be a bit "weird" from the player's point of view to be able to take a last step but not in every direction.

I would accept this argument, however it seems that in HoMM3 "last diagonal move" is allowed only on non-penalty terrains - at least that's what said here:

https://heroes.thelazy.net/index.php/Movement#Consumption_of_the_movement_points

So on terrain with penalty player still will not be able to make diagonal move although he will still be able to make a straight one, which is still "weird" :)

LeHerosInconnu commented 3 years ago

@oleg-derevenetz.

@LeHerosInconnu

Also, it might be a bit "weird" from the player's point of view to be able to take a last step but not in every direction.

I would accept this argument, however it seems that in HoMM3 "last diagonal move" is allowed only on non-penalty terrains - at least that's what said here:

https://heroes.thelazy.net/index.php/Movement#Consumption_of_the_movement_points

So on terrain with penalty player still will not be able to make diagonal move although he will still be able to make a straight one, which is still "weird" :)

Yes, they changed the way it works in Heroes 3 (also with the addition of native terrain for creatures). You may also notice that the penalty for diagonal movement has also been adjusted to a value closer to "reality", 141 movement points in Heroes 3 instead of the 150 movement points in Heroes 2.

oleg-derevenetz commented 3 years ago

@LeHerosInconnu

Yes, they changed the way it works in Heroes 3 (also with the addition of native terrain for creatures).

In fact, I tested this today in HoMM3 and it seems that this wiki is not correct - I still able to do a last diagonal move over the Rough terrain (125% penalty) by a Knight with Knight's native army with 130 MP left (at least in SoD).

LeHerosInconnu commented 3 years ago

Hello @oleg-derevenetz,

@LeHerosInconnu

Yes, they changed the way it works in Heroes 3 (also with the addition of native terrain for creatures).

In fact, I tested this today in HoMM3 and it seems that this wiki is not correct - I still able to do a last diagonal move over the Rough terrain (125% penalty) by a Knight with Knight's native army with 130 MP left (at least in SoD).

Oh. :) I never tested in depth how it works in Heroes 3. And Heroes 3 is no longer installed on my computer, and I don't intend to reinstall it. I find Heroes 2 more fun to play and now that fheroes2 is getting closer to Heroes 2... :D