Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Soldier with staff doesn't stun brain
New Topic New Poll Post Reply
Poster Message
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2460
Registered: 09-10-2004
IP: Logged

File: BrainToggle.hold (1.2 KB)
Downloaded 39 times.
License: Public Domain
icon Soldier with staff doesn't stun brain (0)  
Soldier with a staff hitting a brain doesn't stop brained movement.

See example hold.

Brain shows stun animation, but roach continues to path towards me.

Also tried with the soldier moving, and brain moving, but still no dice.
02-20-2023 at 12:55 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1062
Registered: 06-23-2006
IP: Logged
icon Re: Soldier with staff doesn't stun brain (+2)  
An interesting situation.

We decide if brained movement is possible on a turn after player doubles have moved. This means stuns applied to brains by monsters moving later won't stop brained movement. This is also why a brain getting killed by a Fegundo or slower won't stop brained moves from happening.

We can't delay this check, since it could break a lot of rooms. I'm not sure if there's a good solution, since the non-breaky solutions will inevitably cause Weird Edge Cases.

____________________________
[Insert witty comment here]
Qzvlkx?
02-20-2023 at 03:47 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2434
Registered: 06-21-2014
IP: Logged
icon Re: Soldier with staff doesn't stun brain (+2)  
I say, with absolute confidence, that delaying the check will break zero rooms. It may break demos, but no room should become unsolvable. Honestly, I don't think it's even going to break that many demos - in most rooms where a non-Beethro or double has a chance of killing a brain, either it's completely unnecessary for them to do so, or the room is over by the time that happens.

There's just one thing that would need to be addressed - currently, if the player is invisible and within smell range of a brain, the brain can tell guards and slayers to move. So this would still have to be checked before guard/slayer movement, but at least in theory it could be a separate check, and then another check could be done just before regular monster movement. This second check should still include the invisibility check, as the brain(s) detecting you could be killed or stunned by a guard or slayer.
02-20-2023 at 07:45 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Soldier with staff doesn't stun brain (+2)  
The main discussion about all this occurred in a past bug report. Prior to the bug fix (back in 2010), monsters would become unbrained as soon as the last brain was killed, unless there was still a Guard left in the room.

Mike didn't want monster movement order to determine whether the remaining enemies would be brained or unbrained, so the fix was built to make "brain detection" occur after a particular process sequence. And as noted, given the Slayers and Guards can still use brains to detect Beethro, it didn't make sense to have this check occur after they've moved. I chose after Player Doubles since it's also when objects can fall off platforms the first time.

(In retrospect, another method of dealing with this could've been to give Brains their own unique Processing Speed so that it's clear where they 'act' in the turn order -- they literally do nothing on their turn anyways. But changing that after all this time would be very risky now, since Fluff use monster movement order to break ties when picking targets.)


So whether this should be changed at all is certainly debatable. Also, if scripted characters ever get the ability to query or follow brained paths, then there may need to be an answer to what should occur if the character moves faster than Player Doubles (and thus before the brain would normally detect Beethro).


All this said, there *is* a current bug with the code that I can see, and that's down to a small optimization left in since JtRH that hasn't been looked at since but could now cause problems with scripting with custom Process Sequences. Namely, Brains can only be checked if at least one brain exists after Beethro moves, but the check will only happen once all Player Doubles have moved.

This means that a new Brain could be generated by a fast script (acting before Mimics) either via Generate Entity or Turn into Monster. If there were no brains in the room before that script, then the new Brain can't detect Beethro. But if there was a Brain still in the room after Beethro moved, then even if that Brain is killed by a Mimic, the new Brain would be allowed to run its check and detect Beethro on the turn it appeared.

Fixing that would be trivial: just make sure bBrainCheck starts as 'false' after Player Movement, and move the 'this->pRoom->wBrainCount > 0' optimization into the actual Brain Check code (so that the BrainSensesSwordsman() routine is only run if there's at least one Brain around during the check). bBrainCheck should be set to true afterwards in either case since we'd only want this to run once.

Technically Platform falling has a similar problem, but scripting can't create new Platforms at this time, so it's not an issue (yet).

[Last edited by TFMurphy at 02-21-2023 12:02 AM]
02-20-2023 at 11:57 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2434
Registered: 06-21-2014
IP: Logged
icon Re: Soldier with staff doesn't stun brain (0)  
TFMurphy wrote:
Mike didn't want monster movement order to determine whether the remaining enemies would be brained or unbrained, so the fix was built to make "brain detection" occur after a particular process sequence. And as noted, given the Slayers and Guards can still use brains to detect Beethro, it didn't make sense to have this check occur after they've moved. I chose after Player Doubles since it's also when objects can fall off platforms the first time.

My response to this objection is that it's not movement order that's relevant here, but processing order. Guards and slayers always move before other monsters, so it does not introduce much complexity if they can kill brains and prevent brained movement from happening.

Besides, it's already possible to change a brain pathmap in the middle of a turn in a way that's impacted by turn order - just have a monster step on a pressure plate. And the consequences of this can be much more complicated than just turning off brained behavior would be, especially if multiple monsters are hitting plates in the same turn.
02-21-2023 at 03:54 AM
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 Boards : Bugs : Soldier with staff doesn't stun brain
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.