Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Adders on hot tiles (They just keep growing)
New Topic New Poll Post Reply
Poster Message
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1306
Registered: 06-14-2005
IP: Logged

File: Adder Glitch.rar (779.9 KB)
Downloaded 54 times.
License: Public Domain
icon Adders on hot tiles (0)  
I have included pictures of the error in the rar file included with this post. What happened was I was testing a room, and the Adder moved over to the side. A second adder followed and then the first adder's tail dissapeared. Then the first adder kept moving, not shortening because there was no tail to shorten. Oddly, the adder acted as if it was eating monsters (you can see blood in picture 3). Also, when stabbed it died completely. It also died completely when it got trapped on itself. Drod.err did log the error, however (also in the .rar):

Assertion error in line 137 of .\GreenSerpent.cpp: "CGreenSerpent:: Process: incorrectly died from shortening"
Assertion error in line 153 of .\Serpent.cpp: "pMonster"
Assertion error in line 155 of .\Serpent.cpp: "pBackPiece"

I does happen in other copies of DROD.

[Last edited by Someone Else at 05-05-2007 03:37 AM]
05-04-2007 at 12:52 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
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Adders on hot tiles (0)  
Someone Else wrote:
I does happen in other copies of DROD.
Then can you describe exactly how the rest of us can make it happen? Maybe post a hold and demo or instructions to be repeated. This is generally much more useful than describing what happened to you, when possible.
05-04-2007 at 01:01 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1306
Registered: 06-14-2005
IP: Logged

File: Elemental Showcase Someone Elses Clones.hold (1.4 KB)
Downloaded 46 times.
License: Public Domain
icon Re: Adders on hot tiles (+1)  
Here is a hold. Just move around until it happens.
05-04-2007 at 01:03 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
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1306
Registered: 06-14-2005
IP: Logged

File: Drod Glitch 5.GIF (194.2 KB)
Downloaded 74 times.
License: Public Domain
icon Re: Adders on hot tiles (0)  
Also, another picture.
05-04-2007 at 01:04 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
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Adders on hot tiles (0)  
Yup, looks buggy. Also, a word of caution: if an adder's head loops back to the square where this sort of bug started, DROD pegs the CPU and hangs and needs to be killed.
05-04-2007 at 01:18 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1306
Registered: 06-14-2005
IP: Logged
icon Re: Adders on hot tiles (0)  
I didn't notice that's when it happened, but I did notice that it did happen, and so I had to stop testing.

Also, sometimes one square disappears and the adder goes right through again.
05-04-2007 at 01:21 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
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged

File: hot_adder_fix.patch (495 bytes)
Downloaded 37 times.
License: Public Domain
icon Re: Adders on hot tiles (+2)  
First off, if you watch the adders in this hold carefully, you can see that they shorten by two units per turn when stuck. Once for being blocked by another adder, and once for the head staying still on a hot tile. I think this is flawlessly consistent (a sword strike + hotplate has the same effect), but it's debatable.

The bug here is that the hot tile is attempting to shorten an adder which just died on its own turn. In DRODLib/CurrentGame.cpp ProcessMonsters() line 3423, I added
	//Process monster.
	pMonster->Process(nLastCommand, CueEvents);

	//Check for damage inflicted from something in the room.
	if (pMonster->bAlive && pMonster->CheckForDamage(CueEvents))

Running the same demo that I made to hunt the bug, I get no more drod.err messages, and no adders failing to pull their tails along.
05-06-2007 at 05:59 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
silver
Level: Smitemaster
Rank Points: 915
Registered: 01-18-2005
IP: Logged
icon Re: Adders on hot tiles (+1)  
schep wrote:

	//Process monster.
	pMonster->Process(nLastCommand, CueEvents);

	//Check for damage inflicted from something in the room.
	if (pMonster->bAlive && pMonster->CheckForDamage(CueEvents))

Running the same demo that I made to hunt the bug, I get no more drod.err messages, and no adders failing to pull their tails along.

which works as long as that's the only place CheckForDamage is called or ever will be called.

suggested patch to patch: CheckForDamage begins with (a properly formatted for C++ and matching the local preferred indent and brace rules):

if (! pMonster->bAlive ) { return 0; }


____________________________
:yinyang
05-06-2007 at 06:12 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Adders on hot tiles (+1)  
silver wrote:
if (! pMonster->bAlive ) { return 0 false; }
Hm, I'm ambivalent about that change. On one hand, sure, why not. On the other, there are lots of functions in DRODLib that should only ever be called on an "alive" monster, and this bug is essentially something that failed to check that between steps. Also, that really is the only place CheckForDamage is called, and I can't see reasons to add calls elsewhere in the future.

Another idea perhaps more similar to the code's existing style would be to add ASSERT(pMonster->bAlive); to the top of both CMonster::CheckForDamage() and CSerpent::ShortenTail(). (But what about CGreenSerpent::OnStabbed(), also called in the chain? Other OnStabbed methods?) It's all a style decision, though, so might as well let Mike or whoever puts in the fix choose what else to do about this.
05-06-2007 at 02:51 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5064
Registered: 02-04-2003
IP: Logged
icon Re: Adders on hot tiles (0)  
I've patched this bug as schep posted above, and since CheckForDamage is currently only queried in this one place, I've added an "ASSERT(this->bAlive);" to the base method. Thanks for your guys' help!

____________________________
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.
07-28-2007 at 05:55 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
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Adders on hot tiles (They just keep growing)
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.