Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : VerboseDemo Utility
New Topic New Poll Post Reply
Poster Message
Stefan
Level: Smitemaster
Avatar
Rank Points: 2118
Registered: 05-25-2004
IP: Logged

File: VerboseDemo.zip (12.9 KB)
Downloaded 77 times.
License: Other
From: Unspecified
icon VerboseDemo Utility (+3)  
Here's a small command-line utility for printing demos verbosely. I'm still improving it and adding features, so if you find any errors or strange behaviour (error handling is still very primitive), or if you have any suggestions, please reply to this thread.

I'll release the source code later (when it isn't as messy as it is now).

Unzip the archive to any folder and type
java VerboseDemo
for a quick help on how to use it. You need Java 1.4.2 or higher (it may work with earlier versions as well).

Here's an example output:
$ java VerboseDemo "KDD Tenth Level 1N1W Victory.demo"
Demo: 'KDD: Tenth Level: 1N1W: Victory!' by Stefan
Start at column 38, row 12. Sword orientation: NE
Moves: W W W NW SE CC CC CC CC NW CC CC W CC W W W W S SW SW SW SW E NW SE SE E 
W W CC W CC W W SW W SE W W SW SW S SW W W W SW S S S SW SW S S S S S
Enjoy!

____________________________
0.099
01-12-2005 at 11:39 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2462
Registered: 02-04-2003
IP: Logged
icon Re: VerboseDemo Utility (0)  
Hey, cool! Just curious: did you end up porting code from DRODLib over to Java, or was it more like you figured out the file format and wrote from scratch code?

-Erik

____________________________
Godkiller Gamedev streams (live sessions where I make a new puzzle game. NSFW, mature content)
youtube (archive of live streams, and some animated videos I made. Again, contains mature content.)
01-12-2005 at 07:03 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Stefan
Level: Smitemaster
Avatar
Rank Points: 2118
Registered: 05-25-2004
IP: Logged
icon Re: VerboseDemo Utility (+1)  
Everything except the FlippedInputStream and Base64 classes are written from scratch. I did take a look at some files in DRODLib, but I mostly used the source of the DemoCount-tool to figure out how to get the moves (the rest of the file format is quite self-explanatory). However, my app processes the information a bit differently than DemoCount, so I basically wrote the whole thing from scratch.

By the way, DemoCount has a bug: it doesn't recognize the commands 15 (Yes) / 16 (No) (and thus it can't process some demos from level 25).

____________________________
0.099
01-12-2005 at 08:37 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
patmo98
Level: Delver
Rank Points: 39
Registered: 03-14-2003
IP: Logged
icon Re: VerboseDemo Utility (0)  
quote:
Stefan wrote:
By the way, DemoCount has a bug: it doesn't recognize the commands 15 (Yes) / 16 (No) (and thus it can't process some demos from level 25).


Will it ignore them, hang, or crash? If it hits 15 or 16?
01-13-2005 at 02:48 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Stefan
Level: Smitemaster
Avatar
Rank Points: 2118
Registered: 05-25-2004
IP: Logged
icon Re: VerboseDemo Utility (0)  
quote:
patmo98 wrote:
quote:
Stefan wrote:
By the way, DemoCount has a bug: it doesn't recognize the commands 15 (Yes) / 16 (No) (and thus it can't process some demos from level 25).
Will it ignore them, hang, or crash? If it hits 15 or 16?
From the Level Demos thread:
quote:
Hix wrote:
I did Level 25, and I think it's an improvement. DemoCount loads fine for me, but when I click "Count time & moves" I get "Annoying pop-up box!" telling me "org.xml.SAXParseException: 16"
This happens whether I've selected my own demo, or one I downloaded. Uh... I don't know anything about error messages, but if there's something simple I can do to possibly get it working, I'll try it.
In other words, it won't crash, but it can't parse the file correctly.

____________________________
0.099
01-13-2005 at 03:08 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
disoriented
Level: Smitemaster
Rank Points: 1739
Registered: 08-07-2007
IP: Logged
icon Re: VerboseDemo Utility (+3)  
This is a pretty nifty little utility, although it's unfortunate that Stefan never posted the source code. Luckily there are tools like Java decompilers that can help.

Using one such tool, I've got a copy of source for the VerboseDemo class, and I'm working on adding a few more cases so the program "understands" modern demos. Feel free to request a copy if this would help you out.

____________________________
34th Skywatcher

[Last edited by disoriented at 09-02-2019 06:15 AM]
09-02-2019 at 04:29 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
Dying Flutchman
Level: Smiter
Avatar
Rank Points: 397
Registered: 01-27-2017
IP: Logged
icon Re: VerboseDemo Utility (+1)  
I'd love to have this on forum.carvelgames.com/demo_examiner.php or something like that :rolleyes

____________________________
Autocorrect is not my friend. Apologies for the typos.
09-02-2019 at 11:12 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
disoriented
Level: Smitemaster
Rank Points: 1739
Registered: 08-07-2007
IP: Logged
icon Re: VerboseDemo Utility (+2)  
So a .demo file is basically a compressed (gzipped) stream of bytes, indicating the moves that the player made.

I've got two Java classes in my Eclipse project: VerboseDemo and FlippedInputStream. The VerboseDemo class contains the main() method.

I've tested it on many .demo files, and it works pretty well for simple demos, outputting the move sequence to the console. But the .demo file format stores some things in a way I'm not sure how to parse. For example, taking potions and placing doubles.

Here are the byte values I know:

Byte   Player Input
---    ------------
 1       N
 2       NE
 3       W
 5       E
 6       SW
 7       S
 8       SE
 9       clockwise rotation
10       counterclockwise rotation
11       NW
12      (wait)
15      'Yes' option (in a dialog)
16      'No' option (in a dialog)



The value -1 seems to be used for time clones, and I've seen various values used for placing a double (17, 27, 30, 36, others?) Byte value 21 might be for drinking a potion and 23 might be Special Command.

Does anyone familiar with the DROD source care to help fill in the gaps? It would be nice if I could put together a utility for the community that properly parses all demo files into human readable form.


____________________________
34th Skywatcher

[Last edited by disoriented at 01-06-2020 02:49 AM]
01-06-2020 at 02:37 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
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2194
Registered: 09-10-2004
IP: Logged
icon Re: VerboseDemo Utility (+2)  
01-06-2020 at 03:19 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2194
Registered: 09-10-2004
IP: Logged
icon Re: VerboseDemo Utility (+2)  
For placing doubles, I think what it actually does is do the "placing double" command, then the coordinates of where it actually goes - at least since 2.0 (in AE demos it records the keystrokes to get to the placement)
I think selecting a clone might be similar if you click instead of tab.

I'm guessing CMD_ANSWER does the same thing for multiple choice questions - the CMD, then a number signifying which choice.
01-06-2020 at 03:24 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2194
Registered: 09-10-2004
IP: Logged

File: DemoCommands.pl (1.3 KB)
Downloaded 7 times.
License: Public Domain
icon Re: VerboseDemo Utility (+4)  
Here's a perl script that converts a demo to a list of commands.

Re my last post, Tabbing to change clones is treated in the command list the same as clicking on the next clone.
Tabbing to finish a temporal recording is treated as selecting a clone at (255,255) so if DROD rooms get really big in the future that'll have to change. :)


[Last edited by Rabscuttle at 01-14-2020 04:55 AM]
01-13-2020 at 11:59 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2194
Registered: 09-10-2004
IP: Logged

File: democommandexamples.PNG (32.1 KB)
Downloaded 155 times.
License: Public Domain
icon Re: VerboseDemo Utility (+2)  


Here's sample output.
First room starts with a cutscene and Beethro answers (or asks) a question.

Second Room is a ray gun room with special commands.

Third room is Chronocide from Arky's Revenge. Couple of potions, Couple of timeclones, couple of normal clones.

I haven't checked the script on any pre 5.0 demos, so maybe it'll fail on those.

[Last edited by Rabscuttle at 01-14-2020 04:54 AM]
01-14-2020 at 12:04 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
disoriented
Level: Smitemaster
Rank Points: 1739
Registered: 08-07-2007
IP: Logged
icon Re: VerboseDemo Utility (+2)  
Ah thanks this helped. I was parsing the X/Y coordinates incorrectly.

____________________________
34th Skywatcher
01-14-2020 at 06:53 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
disoriented
Level: Smitemaster
Rank Points: 1739
Registered: 08-07-2007
IP: Logged
icon Re: VerboseDemo Utility (0)  
quote:
Rabscuttle wrote:
I haven't checked the script on any pre 5.0 demos, so maybe it'll fail on those.


Here's one where it fails: King Dugan's Dungeon 2.0, Sixth Level, 2N. Look at what the script outputs for michthro's #1 demo. At move 160 when he picks up the mimic potion, it outputs a series of 14 "west" commands and then a Z (wait) instead of understanding the action as a place double action (byte 21). Not sure why.

____________________________
34th Skywatcher
03-10-2020 at 06:23 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
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2194
Registered: 09-10-2004
IP: Logged
icon Re: VerboseDemo Utility (+2)  
In 1.6 and 2.0, you couldn't place [mimics] by clicking, so it recorded the placement moves instead - the mimic in that case is placed 14 squares west of Beethro.

Later versions interpret the demo properly - when you watch it it'll skip ahead automatically. Although I think if you look at the demo on the demo select screen it'll show the placement moves.

[Last edited by mrimer at 05-20-2020 10:48 PM]
03-10-2020 at 09:09 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 : Caravel Boards : Development : VerboseDemo Utility
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.