[1.7.4] Map effects process while game is paused

Make all T-Engine/ToME 4 bug reports here

Moderator: Moderator

Post Reply
Message
Author
minmay
Wyrmic
Posts: 286
Joined: Fri Sep 07, 2012 1:34 am
Contact:

[1.7.4] Map effects process while game is paused

#1 Post by minmay »

When the player's turn comes up, game.paused is set to prevent further actors from getting energy and acting until the player gives their input and uses the player character's energy. This works fine.
However, Game:onTurn() is still called and this results in map effects like Glacial Vapour processing while the game is paused - after Player:act() has been called but before the player has actually given their input. That is, map effects that should have processed after the player's turn (and the turns of any actors that should act on that tick after the player) instead process in the middle of the player's turn (and before the turns of those other actors).

The biggest gameplay implication of this bug is its impact on the Cauterize talent. When an actor with Cauterize would die, it instead becomes invulnerable until the next time its act() is called. The expectation here is that Cauterize ensures the actor gets to act one more time before they can take more damage, no matter what, and for NPCs this is true. However, for the player-controlled character, Cauterize's invulnerability can go away and then a damaging map effect can process on the same tick due to this bug, before the player has actually given their input. Here is an example of a character actually dying to this; notice that Cauterize invulnerability prevents the damage from a timed effect (Burning) but the character is then killed by Glacial Vapour without acting.

While this is technically a ToME bug, similar bugs are likely to appear in any other t-engine game that uses a similar system for player input and uses Game:onTurn() for gameplay-affecting things. Perhaps it should be separated into two functions, one called like the current one (to use for things like the truncate_printlog() call in ToME's onTurn()) and one that's only called after actors are finished acting (to use for things like the Map:processEffects() call in ToME's onTurn())?

Post Reply