Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moat does not stop the troops #471

Closed
shprotru opened this issue May 5, 2020 · 14 comments
Closed

Moat does not stop the troops #471

shprotru opened this issue May 5, 2020 · 14 comments
Labels
bug Something doesn't work logic Things related to game logic
Milestone

Comments

@shprotru
Copy link
Contributor

shprotru commented May 5, 2020

When a unit is caught in a moat tile it must spend the rest of the turn moves.

Edit:
Currently a creature, stopped by a moat can move over it next turn in any direction.
Creature should be able to move only for 1 cell, while walking over moat.
Moat

@ihhub ihhub added logic Things related to game logic bug Something doesn't work labels May 7, 2020
@ihhub ihhub added this to the 0.8 milestone May 7, 2020
@ihhub ihhub modified the milestones: 0.8, 0.9 May 30, 2020
@ihhub
Copy link
Owner

ihhub commented May 30, 2020

Battle::Indexes Battle::Board::GetAStarPath( const Unit & b, const Position & dst, bool debug ) method is responsible for path calculation and requires changes there.

@Branikolog
Copy link
Collaborator

Currently moat is working. Any walking creature, that steps into moat, stops. And can enter castle only the next turn.
@shprotru, can you, please, make sure, that you still experience this issue?

@Killbrum
Copy link
Contributor

I can confirm that the issue isn't reproducible anymore. Can we close it?

@Branikolog
Copy link
Collaborator

Branikolog commented Nov 10, 2020

Moat is still not working properly.
image
If a creature stands in a moat, the next turn it can move over moat any distance. (On a screenshot Unicorns can move to the lowest cell and then enter castle in one turn.
To enter a castle Unicrons should spend 2 turns. One for moving in a lowest cell of the moat. And the next turn Unicorns can enter the castle.

@Branikolog
Copy link
Collaborator

Sure, we are talking about non-flying troops.
Flying creatures shouldn't be affected by moat.)

@Killbrum
Copy link
Contributor

Thank you! I will try to look into the code tomorrow

@Branikolog
Copy link
Collaborator

@Killbrum
You're welcome! Always be free to ask me any question or advice here or at our discord. :)

@Killbrum
Copy link
Contributor

Before I start. I see that moat has some sort of additional feature. So the code says next:

The Moat reduces by -%{count} the defense skill of any unit and slows to half movement rate.

is it some sort of fheroes feature/additional config?

@LeHerosInconnu
Copy link

Hello @Killbrum,

In the original game, the moat information window indicates that the troops are slowed down and become more vulnerable to attacks.

In original game:

Moat penalty H2 01

In the original game, during combat, troops end their movement when they enter the moat.
For vulnerability to attack, I never calculated if they really received more damage when they were in the moat.

Maybe @idshibanov could have more information about this.

The information text for the defense of the castle regarding the moat currently in fheroes2 (-3 to creature defense and halved movement) is one of my proposals for the previous fheroes2 project, but it does not seem to have been fully implemented in the previous project since troops do not suffer a movement penalty to get out of the moat; for the -3 defense penalty, I did not check either.

Since this proposal changes the original way the game works, it should only be included as an option.
But this can wait for Beyond 1.0 version of the game.

In fheroes2:

Moat penalty fh2 01

Moat penalty fh2 02

@Killbrum
Copy link
Contributor

Thanks a lot for the great explanation! @LeHerosInconnu could you confirm that fheroes implementation works correctly according to fheroes description?

We have two choices here:

  1. Moat works as described in fheroes documentation/hints and etc. In this case, we need to re-implement/re-work the whole feature or leave it as is.
  2. Moat works incorrectly according to fheroes documentation. In this case, this is a bug.

@LeHerosInconnu
Copy link

@Killbrum.

Thanks a lot for the great explanation! @LeHerosInconnu could you confirm that fheroes implementation works correctly according to fheroes description?

We have two choices here:

  1. Moat works as described in fheroes documentation/hints and etc. In this case, we need to re-implement/re-work the whole feature or leave it as is.
  2. Moat works incorrectly according to fheroes documentation. In this case, this is a bug.

So, I did some tests.

In the original game, the defense of the troop in the moat is reduced (but this is not shown in the creature info window) because the Rangers do more damage when the troop is in the moat (2 damage when the troop is not in the moat, and 3 damage when the troop is in the moat).
In the original game, the speed of the troop in or out of the moat remains the same.

In original game:

Moat penalty H2 10
Moat penalty H2 12
Moat penalty H2 11
Moat penalty H2 13

In fheroes2 currently, troops in the moat do have a penalty of -3 in defense, but their speed is not reduced as indicated.

Troop of Champions: Defense Skill "11" outside the moat and Defense Skill "8" in the moat.
Troop of Archers: Defense Skill "5" outside the moat and Defense Skill "2" in the moat.

Troop of Champions: Speed "7" outside and in the moat.
Troop of Archers: Speed "2" outside and in the moat.

In fheroes2:

Moat penalty fh2 10
Moat penalty fh2 11
Moat penalty fh2 12
Moat penalty fh2 13

Normally with the proposal, the speed should be halved (same effect as the Slow spell).
And if the Slow spell is active on a troop in the moat, the speed is halved again.
In any case, the speed cannot be less than "1".

For the current fheroes2 project, the intention is to stay as close as possible to the original game at first (at least until version 1.0 of fheroes2).
This is why this change must be applied as an option, so that version 1.0 of fheroes2 is as close as possible to the original game.

So for the moment, fheroes2 does not work as shown in this screen (for halved movement), and at the same time, with the new fheroes2 project, this should be an option.
And this option can be implemented later (if it requires a lot of development time) for Beyond 1.0 of fheroes2.
Moat penalty fh2 02

So there are two possibilities: :)

  1. Either, leave it as it is now and modify the text (the "-" of "-3" is redundant):

"The moat reduces by 3 the defense skill of any unit."

Instead of:

"The Moat reduces by -3 the defense skill of any unit and slows to half movement rate."

  1. Or (this can be done later), add the option "Battle: The moat halves the speed of the creatures" and modify the text when the option is activated:

"The Moat reduces by 3 the defense skill of any unit and slows to half movement rate."

@ihhub ihhub modified the milestones: 0.9, 0.9.1 Feb 4, 2021
@ihhub
Copy link
Owner

ihhub commented Feb 28, 2021

Hi @Branikolog , could you please verify this issue?

@Branikolog
Copy link
Collaborator

@ihhub
Issue is still on.
Creatures continue walking on a water without penalties...

@Branikolog
Copy link
Collaborator

The issue is gone. Troops cannot walk over the moat freely anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work logic Things related to game logic
Projects
None yet
Development

No branches or pull requests

5 participants