What determines a tape's filesize?

Discussion around programming R'n'D, its source code and its tools.

Moderators: Zomis, Flumminator

Post Reply
User avatar
RAP
Posts: 280
Joined: Sat Jun 19, 2004 6:44 pm

What determines a tape's filesize?

Post by RAP » Wed Feb 14, 2018 6:58 am

What the title says, because I've been submitting proof tapes for my Emerald Mine Club levelset completion topic, and wanted to figure out how to make tapes with few bytes as possible. One thing I know that seems true is that just standing still doesn't take up that much bytes. What actions makes a tape stuffed with more bytes in it? Would holding two keys to move diagonally (like say up and right) make more input data like that?

User avatar
Holger
Site Admin
Posts: 2866
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: What determines a tape's filesize?

Post by Holger » Wed Feb 14, 2018 10:23 am

The structure of tape data in R'n'D is quite easy (and it's similar to Supaplex solution files, by the way): It's just a list of input actions stored as one byte (for each player, if playing multi-player games), which has bits set for up, down, left, right, button 1 and button 2 actions, and another byte with a counter that determines the duration (counted in number of frames) that this input actions stay unchanged.

That is, if you just wait for one second (50 game frames), there are only two bytes of tape data (one being "0" for saying "no input at all", and one being "50" for saying "that same action for the next 50 frames").

If you move into the same direction for one second, it's the same (only two bytes), but with the first byte having a value for that specific direction.
Would holding two keys to move diagonally (like say up and right) make more input data like that?
Therefore, the answer is "no"!
wanted to figure out how to make tapes with few bytes as possible
Using the single-step mode could help here, as you can change input actions while the tape is paused between actions.

User avatar
RAP
Posts: 280
Joined: Sat Jun 19, 2004 6:44 pm

Re: What determines a tape's filesize?

Post by RAP » Wed Feb 14, 2018 10:52 am

Ah, I'm aware there's a single-step mode, but I would try to make my play-through of the as authentic as possible, even if it means having a sub-optimal run at points. In regards to this feature, and thinking on the two-buttons thing, does it know that that the player would go diagonal, because if not, that would imply that by using the single-step mode feature, it would creature byte instructions for moving one of the two directions separately, like 1 left, then 1 up, and 1 left, and then 1 up, and so on, instead of one byte instruction of a diagonal movement.

User avatar
Holger
Site Admin
Posts: 2866
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: What determines a tape's filesize?

Post by Holger » Wed Feb 14, 2018 12:03 pm

I'm aware there's a single-step mode, but I would try to make my play-through of the as authentic as possible
Yes, I also would consider using single-step mode as cheating. ;-)

And it could indeed result in tapes that replay the game in a non-authentic way (with the player moving in a very "unnatural", too perfect way)...
does it know that that the player would go diagonal, because if not, that would imply that by using the single-step mode feature, it would creature byte instructions for moving one of the two directions separately, like 1 left, then 1 up, and 1 left, and then 1 up, and so on, instead of one byte instruction of a diagonal movement.
That's indeed a perfect example of single-step mode *not* creating shorter, but much longer tapes! Because it is practically impossible to press the two direction keys for diagonal movement at exactly the same time for each move, while you would just keep both keys pressed down without single-step mode!

Post Reply