Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Setting player HP < 0
New Topic New Poll Post Reply
Poster Message
Dr. Murphy
Level: Disabled
Rank Points: 46
Registered: 08-11-2009
IP: Logged
icon Setting player HP < 0 (+4)  
If a script command sets the players health to be less than 0, various unusual behaviors occur.

1) Fighting monsters by bumping into them causes a... C++ Visual Runtime Error? When the player clicks okay, the game crashes and the normal processing error comes up.

2) Stepping on hot tiles will reduce the players health assuming the players health is the max integer (2.1 billion). It takes precisely 14 burns before the health meter actually registers. Once the health does register, the player has an enormous HP amount.

3) Evil eyes do average damage when the player steps in front of them. The floating numbers appear but the HP meter never changes from zero. No crashes occur until the player enters combat with the eye.

4) Aumtlich beams do damage similar to the hot tile; it assumes the player had 2.1 billion health. The health meter registers the first time, however. The player is allowed to walk away with an enormous amount of health.

5) Sworded monsters are similar to evil eyes in the fact that stepping on the sword results in the floating numbers. There was one time when I could enter combat with the opponent while I was standing on his sword, but it never happened after that.

6) Custom sworded monsters with two billion attack can kill the player in a few hits by reducing the players health from 0 to 2.1 billion to 0 very quickly. Odd behavior.

7) Bombs are extremely unusual. After the players health is reduced to 0, bombs will not hurt you or even come up with a floating number. After you take damage (even a single point), bombs will do negative damage to you and reduce your health to a positive number. If that number is over 500, the player dies. The damage taken can be ballpark predicted by how much damage the player took prior to hitting the bomb.

This is horribly buggy behavior. Any progress towards fixing it will be wonderful.

[Last edited by mrimer at 01-15-2016 08:39 PM]
08-16-2009 at 12:20 AM
View Profile Show all user's posts Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Another Hilarious Bug (+1)  
Most of those are natural consequences of having negative HP (which when taken as an unsigned number, would be having more than 2147483647 HP). But all of these effects are more based around a single bug: that it's only possible for scripting to cause this effect on Turn 0. At any other time, setting the player's HP to a negative number will instead cause the player's death.

So this bug will likely be fixed when this other thread is also finally looked at: there's a rather large backlog of RPG bugs to get through. (I will note, however, that unlike what the other thread states, I've been unable to have any other source of damage activate on Turn 0.)
08-16-2009 at 11:58 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Dr. Murphy
Level: Disabled
Rank Points: 46
Registered: 08-11-2009
IP: Logged
icon Re: Another Hilarious Bug (+1)  
There were a couple of things I forgot to test.

8) Falling into pits and water work normally. Since falling simply sets the player's status to "dead" without any HP changes, no crashes occur.

9) Briar works just as well as falling into pits and water. Briar will kill you normally with no bad things happening.

10) Mimics cause crashing as well. When engaging a monster that requires several hits to kill with a mimic, the game crashes as soon as the opponent strikes the mimic (thus striking you).

11) When the player presses the restart button after his health is reduced below 0, the player will naturally die. If you press the backspace button, all the non-combative objects disappear while monsters and the player stay visible. This behavior was exploited before by Monkey, but if the player gathers health, sets off a bomb, gains stat points, or defeats a monster, parts of the screen appear visible in interesting patterns.

Creepy behavior, right?
08-18-2009 at 02:58 AM
View Profile Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5141
Registered: 02-04-2003
IP: Logged
icon Re: Setting player HP < 0 (0)  
Bumping this to keep it top of mind. Would be nice to fix at some point. Not sure how best to address it, though. There are multiple ways this situation could be arrived at (level entrance, scripted warp), and they'd need to be handled properly...whatever that means.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
03-14-2016 at 06:41 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3765
Registered: 12-28-2004
IP: Logged
icon Re: Setting player HP < 0 (0)  
Completely uninformed idea which I just came up with which seems to be the most logical way to handle it for me: make it that setting player's HP to 0 or anything below:
1. Stops the script execution until the next turn
2. Sets it to 1 instead
3. Is silently ignored

I personally like option #1 best :)

____________________________
My website
03-14-2016 at 02:24 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Keiya
Level: Delver
Rank Points: 73
Registered: 03-25-2012
IP: Logged
icon Re: Setting player HP < 0 (0)  
The correct behavior is probably to do what would happen on any turn other than 0 - that is, kill the player. Though that does create a death loop that you have to restore to get out of, any other behavior is theoretically exploitable (for instance, a moving source of scripted damage being moved to hit you turn zero)

____________________________
636th Trapdoor Replacer

Official Hold Progress:
Click here to view the secret text


[Last edited by Keiya at 03-14-2016 05:42 PM]
03-14-2016 at 05:41 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2850
Registered: 07-11-2014
IP: Logged
icon Re: Setting player HP < 0 (+1)  
Actually I think making the players HP hit 0 on turn 0 halting the execution until the next turn makes sense and is a good solution. For most sensible moving sources of damage (like a moving entity) they are not allowed to move on turn 0 due to the move command being a blocking command and blocking commands not executing anyway on turn 0.

The most likely thing I could think of that could result in an exploitable way to avoid damage if this were implemented would be something scripted that moves the player on turn 0 or 1, but that seems obvious that something that changes the character position could result in allowing you to avoid damage.

I might not be thinking hard enough, but I think it's a good solution for most practical purposes.

[Last edited by kieranmillar at 03-14-2016 05:57 PM]
03-14-2016 at 05:56 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3765
Registered: 12-28-2004
IP: Logged
icon Re: Setting player HP < 0 (+1)  
Keiya wrote:
The correct behavior is probably to do what would happen on any turn other than 0 - that is, kill the player. Though that does create a death loop that you have to restore to get out of, any other behavior is theoretically exploitable (for instance, a moving source of scripted damage being moved to hit you turn zero)
Which is exactly the reason why it's a bad solution and why we you can't kill player on Turn 0 in regular DROD (though you can force the player to restore by placing them on a mimic/clone/decoy potion without a place to put it).

@kiernamillar - the good thing about delaying the execution of this command is that it does not radically change the outcome of the script, it just delays it by one turn which should make it harder to accidentally script incorrectly.

____________________________
My website
03-14-2016 at 07:49 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5141
Registered: 02-04-2003
IP: Logged
icon Re: Setting player HP < 0 (0)  
kieranmillar wrote:
I think making the players HP hit 0 on turn 0 halting the execution until the next turn makes sense and is a good solution.
I've made this change for 1.2.8.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
09-25-2020 at 02:20 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2850
Registered: 07-11-2014
IP: Logged
icon Re: Setting player HP < 0 (0)  
Can confirm this works in 1.2.8.alpha.202-09-26. Any script that tries to set damage to 0 or below or deal enough damage that the player would die, on turn 0 of entering a room, has that damage delayed until the next turn.

I also checked other methods of killing the player on turn 0, such as monsters that attack adjacent, hot tiles and aumtlich beams when you have 1 hp and turns out none of these fired on turn 0 anyway.

But there is one exception. Turns out you can build an explosion on turn 0, and this can kill the player. Doing so results in the following being output into drodrpg.err:

Assertion error in line 6848 of C:\Users\mrime\git\drod\drodrpg\DRODLib\CurrentGame.cpp: "!CueEvents.HasAnyOccurred(IDCOUNT(CIDA_PlayerDied),CIDA_PlayerDied)"
Assertion error in line 6848 of C:\Users\mrime\git\drod\drodrpg\DRODLib\CurrentGame.cpp: "!CueEvents.HasAnyOccurred(IDCOUNT(CIDA_PlayerDied),CIDA_PlayerDied)"


And to answer a question in another thread, your filepath to your git repo never use to show up in these error logs, only the current alphas are doing this.
09-27-2020 at 12:07 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5141
Registered: 02-04-2003
IP: Logged
icon Re: Setting player HP < 0 (0)  
Thank you for verifying all these fixes!
kieranmillar wrote:
But there is one exception. Turns out you can build an explosion on turn 0, and this can kill the player. Doing so results in the following being output into drodrpg.err:
...
Thank you. Good catch! How to best address? Same way, i.e., if an explosion would kill a player, pause the script execution until next turn?
And to answer a question in another thread, your filepath to your git repo never use to show up in these error logs, only the current alphas are doing this.
Ah, thanks. I'll look into cleaning up the path messages.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
09-27-2020 at 04:51 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2850
Registered: 07-11-2014
IP: Logged
icon Re: Setting player HP < 0 (0)  
mrimer wrote:
Thank you. Good catch! How to best address? Same way, i.e., if an explosion would kill a player, pause the script execution until next turn?
I'm not sure, this seems like it might be tricky to deal with, because there's another edge case you need to watch out for: building an explosion on top of a bomb, which would cause the bomb to explode and kill the player.

Maybe preventing building explosions on turn 0 is the only effective option, unless you specifically want to check if such a build action would result in the player or a bomb being exploded and then only block execution in those two cases?
09-27-2020 at 10:00 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5141
Registered: 02-04-2003
IP: Logged
icon Re: Setting player HP < 0 (0)  
Ah, yeah...this does seem messier than I was thinking.
kieranmillar wrote:
Maybe preventing building explosions on turn 0 is the only effective option, unless you specifically want to check if such a build action would result in the player or a bomb being exploded and then only block execution in those two cases?
I'm not sure I have a strong preference here. Hmm...

I'm going to go with blocking exploding the player or a bomb on turn 0. Gives more narrative options.

Edit: PR

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 09-28-2020 11:31 PM]
09-28-2020 at 11:14 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2850
Registered: 07-11-2014
IP: Logged
icon Re: Setting player HP < 0 (+1)  
Can confirm that building an explosion is delayed by a turn if it is built on a bomb or the player in 1.2.8.alpha.2020-09-28.
10-01-2020 at 08:48 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : Setting player HP < 0
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.