Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : "Corrupted" demo
New Topic New Poll Post Reply
Poster Message
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged
icon "Corrupted" demo (0)  
Having made over 1200 moves in The Wrong Way: The Architect's Folly, I thought "I'd better record a demo before I restart, so I can remember how I got here." I pressed "F4", named the demo, and then pressed "F6". The description of the demo says:

"Beethro spends some time here without accomplishing much. (This demo is corrupted or from another version of DROD with different gameplay behavior.)"

Setting aside the slanderous accusation that my 1200 moves didn't accomplish much: why would the game think that the demo is corrupted?
12-09-2006 at 08:27 PM
View Profile Send Private Message 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: "Corrupted" demo (0)  
Does replaying the demo do anything weird like result in Beethro's death or bumping against a wall a bunch of times? Either way, if the same version of DROD recorded the demo and printed the error, it's definitely a bug of some sort.
12-09-2006 at 09:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2460
Registered: 09-10-2004
IP: Logged
icon Re: "Corrupted" demo (0)  
Did you just play the room now, or had you played quite some time ago and are now coming back to it? It's possible that a version change to DROD has had a small effect on how the room plays. (I'm pretty sure I know which one.)

But yeah, I'd replay the demo and see what happens. You'll probably end up stuck near the start or with a snake not quite dead or something.
12-10-2006 at 03:28 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
No, the basic timeline was:

Thursday - discovered & first entered the room.
Friday - played about 1200 moves, said "ok, need a break"
Saturday - said "want to start over, let me hit 'F4' to record what I did yesterday"

So there was no change at all to DROD, or to the room, between my playing the room and my hitting F4. (There was a time delay.)

The demo itself seems to play normally--it ends abruptly, but that's because my playing of the room stopped at that point. Otherwise there's nothing especially remarkable about it. So it's definitely some bug in the program causing it to assess the demo as corrupted, even though it's not.

I did rename the demo from 'TWW: The Architect's Folly: The Entrance' (the default, of course) to 'how did i get here'; I have no idea whether that's relevant. (It shouldn't be, but, hey, it's a bug, so who knows what caused it.)
12-10-2006 at 04:07 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
Can you post the demo here?
12-10-2006 at 04:13 AM
View Profile Show all user's posts Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2460
Registered: 09-10-2004
IP: Logged
icon Re: "Corrupted" demo (0)  
ooh.. new way of doing the room!
12-10-2006 at 04:50 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged

File: how did i get here.demo (3.4 KB)
Downloaded 42 times.
License: Public Domain
icon Re: "Corrupted" demo (0)  
Here you go--knock yourselves out.
12-10-2006 at 05:55 AM
View Profile Send Private Message 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: "Corrupted" demo (0)  
I can't seem to find that level. Maybe I'll have to play this hold myself later. But for the bughunt, are there any interesting messages in drod.err?
12-10-2006 at 06:11 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
Is there anything in drod.err?
12-10-2006 at 07:26 PM
View Profile Show all user's posts Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
Other than a "character script is in an infinite loop" from 12/5 (I wonder what that was), just a series of Internet Warnings (6 and 7) for the past week. Other incomprehensible things from longer ago, but nothing else in the past week.

(PM if you want help finding the room. It's not a "secret" room, of course; but the staircase that leads you there is.)
12-10-2006 at 08:51 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
Okay. Looking at the source, only two things could cause it to say it was corrupted without causing an error. #1 is there not being any commands, which seems unlikely since you can play it back, and that command data is plenty populated when I look at the demo. The other is an invalid checksum, which is more likely. Do you know whether the demo ends where you did the recording?
12-11-2006 at 12:30 AM
View Profile Show all user's posts Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
I think it ends where I did the recording. It looked about right, anyway; if it's a move or two off, I wouldn't necessarily remember.

It seems that one of two things happened, then: either the game incorrectly judged the demo to be corrupted; or the game corrupted the demo when it saved it. Either way, there's a bug. :-)
12-11-2006 at 02:32 AM
View Profile Send Private Message 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: "Corrupted" demo (0)  
More specifically, the checksum depends on:
Beethro's ending position and orientation; number of monsters alive in the room; turn number; number of conquered rooms (not including the current, if it claims or seems to be a victory demo); and number of explored rooms. All those numbers are combined in a semi-arbitrary way in CurrentGame.cpp CCurrentGame::GetChecksum().

Inspection of the demo file shows that its checksum is 1379598753, or 0x523b01a1. Also, it's at a point with 20 explored rooms and 17 conquered rooms. So if we knew the position and monster count at the end of the demo, we could figure out whether the checksum is right the hard way. (The checksum's higher bits which I can already compute seem right so far.) I've also been trying again to get DRODLib compiled standalone, and if that works I might be able to look at the checksum comparison the easy way.

12-11-2006 at 04:33 AM
View Profile Send Private Message to User Send Email 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: "Corrupted" demo (+1)  
:frankie Bwa-ha-ha, I now have the power of DRODLib and gdb combined. I'll show them. I'll show them all!!

Ahem. Anyway, it turns out the checksum failure is on the number of explored rooms. The demo file specifies 20 explored rooms, and in CCurrentGame::GetChecksum(), (this->ExploredRooms.size()) is returning 21. Also, the room being played in the demo is NOT among the list of explored rooms given in the demo file.

This is a little confusing, but it looks like for a first-time visit, the current room is not listed among explored rooms for some save-games, like checkpoint saves. But the 2.0.14 code looks as though the current room should always be listed for a demo's save-game. At least I didn't spot any way it might not be. What version of DROD was it?


[Last edited by schep at 12-16-2006 10:09 PM]
12-16-2006 at 10:08 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
schep wrote:
This is a little confusing, but it looks like for a first-time visit, the current room is not listed among explored rooms for some save-games, like checkpoint saves. But the 2.0.14 code looks as though the current room should always be listed for a demo's save-game. At least I didn't spot any way it might not be. What version of DROD was it?
IIRC there's a bug in the current revision of 2.0.15 where the entrance room of a level isn't marked as visited on first entry, which just might be causing this.

So in order to make such demos still work, both this bug would need to be fixed and the room the demo takes place in needs to be marked visited prior to calculating the checksum...

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
12-17-2006 at 09:36 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: "Corrupted" demo (0)  
Briareos wrote:
IIRC there's a bug in the current revision of 2.0.15 where the entrance room of a level isn't marked as visited on first entry, which just might be causing this.
Yes, that explains exactly what I saw.
So in order to make such demos still work, both this bug would need to be fixed and the room the demo takes place in needs to be marked visited prior to calculating the checksum...
The thing is, DROD does mark the room visited when computing the checksum to verify a demo. But since it wasn't considered visited when the demo was created, the original checksum stored in the file is wrong. Since the demo still plays back correctly and the only problem is that tag on its description in the F6 screen, it doesn't seem worth the trouble of changing DROD to recognize this mistake made by a particular beta version's bug.
12-17-2006 at 02:35 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: 5056
Registered: 02-04-2003
IP: Logged
icon Re: "Corrupted" demo (0)  
schep wrote:
The thing is, DROD does mark the room visited when computing the checksum to verify a demo. But since it wasn't considered visited when the demo was created, the original checksum stored in the file is wrong. Since the demo still plays back correctly and the only problem is that tag on its description in the F6 screen, it doesn't seem worth the trouble of changing DROD to recognize this mistake made by a particular beta version's bug.
Good sleuthing. Yeah, just yesterday I realized how much of a pain this is to deal with. Unless someone else has a better (i.e. cleaner) solution, I'm just going to not consider the explored room count in the checksums when determining whether a demo is valid in 2.0.15 rev14, 3.0, and onward. Regrettable for academic reasons, but then again, this information doesn't really affect whether a demo will continue to be valid for future iterations of the DROD back end or not.

____________________________
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.
01-09-2007 at 10:20 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 : "Corrupted" demo
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.