Page 2 of 2

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 3:30 pm
by Endru1241
But it's not second movement.

Second move is only applied if at the exact moment of casting target unit already moved.

It's inconsistent - that is the problem.



Looking at some old posts I thought, that general plan for movement was:
- normal units always move only 1 time at max
- normal speed boosts only give more movement
- there is some plan for unit spec or effect, that allows 2nd move or total move split
Only for special effect ot units.
Not as a standard, that on top of being too common (especially when you'll look at bard and druid common usage in SoS) is working in different ways for different cases.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 3:38 pm
by Stratego (dev)
i still not think it is a problem.

ok, so here we are
Q: shall i undo what i did was that better situation?

or with this simple (red) modification will that be better?

int rangeWalkSave = u.rangeWalk;
boolean wasMoved = u.getRemainingMovement() == 0 && u.getMovementRange() > 0;
u.rangeWalk += addMagnitude(uc.rangeWalk * m, addendum); // how far it can walk
//now add to the remaining movement the same addendum, only if it was not moved yet!
if (!wasMoved) {
int delta = u.rangeWalk - rangeWalkSave;
if (delta != 0) {
int finalSpeed = u.getRemainingMovement() + delta;
if (finalSpeed < 0)
finalSpeed = 0;
if (finalSpeed > u.getMovementRange())
finalSpeed = u.getMovementRange();
if (finalSpeed != u.getRemainingMovement())
u.setRemainingMovement(finalSpeed, false);
}
}

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 3:51 pm
by Endru1241
Is there really no other way than two options:
a) reverse changes
b) keep changes
?

Because honestly - neither is very consistent.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:04 pm
by makazuwr32
Old system is better. I even have an idea how to abuse it.

For example in aof warfell right now has 4 ways to buff speed on pegasus knight unit. And 2 of them are auras which you can use this way: move unit, move aura, get extra movement, move again outside from aura, repeat the process.

.

Alas we still need to remove that inability to move when unit looses debuff for speed.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:07 pm
by Stratego (dev)
i posted above my suggestions.
(atm i dont have will to modify the code in several (40+) places to introduce a "wasMoved" flag - and not even to modify but to test all out :))

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:08 pm
by makazuwr32
I prefer current situation.
If unit moved than no matter for buffs it must stop.

Ofc we wanted to add a tag for some units that will allow for them to move and retreat in same turn if they did not use full their movement when moved BUT that is for some specific units and not as mechanic for every unit who gains any bonus speed.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:09 pm
by Stratego (dev)
i mean i posted this:
Stratego (dev) wrote: Wed Oct 13, 2021 3:38 pm i still not think it is a problem.

ok, so here we are
Q: shall i undo what i did was that better situation?

or with this simple (red) modification will that be better?

int rangeWalkSave = u.rangeWalk;
boolean wasMoved = u.getRemainingMovement() == 0 && u.getMovementRange() > 0;
u.rangeWalk += addMagnitude(uc.rangeWalk * m, addendum); // how far it can walk
//now add to the remaining movement the same addendum, only if it was not moved yet!
if (!wasMoved) {
int delta = u.rangeWalk - rangeWalkSave;
if (delta != 0) {
int finalSpeed = u.getRemainingMovement() + delta;
if (finalSpeed < 0)
finalSpeed = 0;
if (finalSpeed > u.getMovementRange())
finalSpeed = u.getMovementRange();
if (finalSpeed != u.getRemainingMovement())
u.setRemainingMovement(finalSpeed, false);
}
}

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:12 pm
by makazuwr32
Stratego (dev) wrote: Wed Oct 13, 2021 4:09 pm i mean i posted this:
Stratego (dev) wrote: Wed Oct 13, 2021 3:38 pm i still not think it is a problem.

ok, so here we are
Q: shall i undo what i did was that better situation?

or with this simple (red) modification will that be better?

int rangeWalkSave = u.rangeWalk;
boolean wasMoved = u.getRemainingMovement() == 0 && u.getMovementRange() > 0;
u.rangeWalk += addMagnitude(uc.rangeWalk * m, addendum); // how far it can walk
//now add to the remaining movement the same addendum, only if it was not moved yet!
if (!wasMoved) {
int delta = u.rangeWalk - rangeWalkSave;
if (delta != 0) {
int finalSpeed = u.getRemainingMovement() + delta;
if (finalSpeed < 0)
finalSpeed = 0;
if (finalSpeed > u.getMovementRange())
finalSpeed = u.getMovementRange();
if (finalSpeed != u.getRemainingMovement())
u.setRemainingMovement(finalSpeed, false);
}
}
Nope. If unit moved and got after that extra speed it still must not be able to move.

Unless i got it wrong.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:18 pm
by Endru1241
Yeah it's better to leave old one.

New modification makes things too abusable.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:25 pm
by Stratego (dev)
did u see the code change with red?
that means it will NOT ADD the extra speed if unit already moved.
it will add dthe extra if the unit have yet moved this turn.

istn that you wanted?

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:41 pm
by makazuwr32
than what the difference with current situation?
in current situation we also can add movement and move.

I don't understand.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:49 pm
by Endru1241
Stratego (dev) wrote: Wed Oct 13, 2021 4:25 pm did u see the code change with red?
that means it will NOT ADD the extra speed if unit already moved.
it will add dthe extra if the unit have yet moved this turn.

istn that you wanted?
Sorry.

I mist have misunderstood something.

If this code works for every speed change, then it should block the thing I was afraid of.

Could you please build and upload, just to check in game and be sure?

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 4:55 pm
by Stratego (dev)
ok, this is the fiunal code though

int rangeWalkSave = u.rangeWalk;
boolean wasMoved = u.getRemainingMovement() == 0 && u.getMovementRange() > 0;
u.rangeWalk += addMagnitude(uc.rangeWalk * m, addendum); // how far it can walk
//now add to the remaining movement the same addendum, only if it was not moved yet!
int delta = u.rangeWalk - rangeWalkSave;
if (delta != 0 && (delta <0 || !wasMoved)) {
int finalSpeed = u.getRemainingMovement() + delta;
if (finalSpeed < 0)
finalSpeed = 0;
if (finalSpeed > u.getMovementRange())
finalSpeed = u.getMovementRange();
if (finalSpeed != u.getRemainingMovement())
u.setRemainingMovement(finalSpeed, false);
}

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 5:12 pm
by Stratego (dev)
uos 5

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 5:52 pm
by Endru1241
Stratego (dev) wrote: Wed Oct 13, 2021 4:55 pm ok, this is the fiunal code though

int rangeWalkSave = u.rangeWalk;
boolean wasMoved = u.getRemainingMovement() == 0 && u.getMovementRange() > 0;
u.rangeWalk += addMagnitude(uc.rangeWalk * m, addendum); // how far it can walk
//now add to the remaining movement the same addendum, only if it was not moved yet!
int delta = u.rangeWalk - rangeWalkSave;
if (delta != 0 && (delta <0 || !wasMoved)) {
int finalSpeed = u.getRemainingMovement() + delta;
if (finalSpeed < 0)
finalSpeed = 0;
if (finalSpeed > u.getMovementRange())
finalSpeed = u.getMovementRange();
if (finalSpeed != u.getRemainingMovement())
u.setRemainingMovement(finalSpeed, false);
}
It seems to work perfectly like asked.

Tested and:
- when unit is affected by slowing poison - it regains movement upon healing
- when unit already moved and move geass is casted on it - IT DOES NOT regain any movement this turn. Nothing changes even when adventure song is casted on top of it.
- when unit was affected by speed reducing effect and it ends naturally - unit regains movement on the turn effect stopped, so essentially it is now fully consistent with other debuffs - 1 turn debuff won't last up to enemy turn.

As far as I think about it - it is elegantly working, like player or modder could expect.

Many thanks.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 6:26 pm
by makazuwr32
If endru says so than i agree with this change.

Re: Slow poison effect issue IMPLEMENTED

Posted: Wed Oct 13, 2021 7:01 pm
by Endru1241
makazuwr32 wrote: Wed Oct 13, 2021 6:26 pm If endru says so than i agree with this change.
Just beware, as previously last turn of speed decrease gave lower movement and it won't anymore, so effectively all slowdown effects are 1 turn shorter.

Just like any other decrease of parameters, that need to be used on unit turn.

Re: Slow poison effect issue IMPLEMENTED

Posted: Thu Oct 14, 2021 3:09 am
by makazuwr32
I know that.
We will update some abilities acfording to that.