mailto: blog -at- heyrick -dot- eu

Navi: Previous entry Display calendar Next entry
Switch to desktop version

FYI! Last read at 11:57 on 2024/05/01.

Advent 2021 day 12

It's a Sunday, so I thought I'd do a 4K/2160p video again. Since I know my phone can compress a gigabyte and a quarter down to around 650MB...which only took about two and a half hours (*) to upload.

* - estimation, I was cleaning up in and around the kitchen, so I set it up, made tea, and let it get on with the upload while I got on with things.

 

Mamie Fletcher's House 12

Fun with the development builds

Prior to the Release Candidate versions of Mamie (circa version 0.20), the game was built with some extra features added to aid in testing.

 

Extra key presses to do various things

Pressing the help key (F1) would show a different help screen than usual, listing the various additional keypresses available, and drawing Lucy in all her states... just because.
Development options
The extra development options.

These extras were:

 

In case you've not tried pressing random keys whilst playing Mamie, I'll let you know that F8 and PrintScreen are supported.
F8, in particular, can be useful if there's a level you are stuck on, to go practice it without having to play all the way to it. But don't bother trying to finish the game by pressing this key repeatedly. You'll get chewed out for cheating. ☺

And PrintScreen? Useful for recording your moments of epicness.

 

Tile information

Lots of nice juicy detail. Useful for correlating with the debug log. Having said that, all those extra rectangles and text output (which are added on top) really slay the redraw speed.
Tile information
Tile information.

 

Debug log

Various debug options could be selectively switched on. These were for debugging movements, debugging the floor position checking, and debugging jumping/falling activity.

To give an example, here is a snippet of the debug log. All that is happening here is that I pressed the 'Up' key to make Lucy jump.

     lucy_can_move()
       floorlevel = 0, tilebase = 0
       tile at 69,0 is type 12
       horizontal offset in tile is 3
     lucy_move_up
       jumping
     Trajectory left = 0, right = 0
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 5, motion = 65
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 10, motion = 60
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 15, motion = 55
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 20, motion = 50
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 25, motion = 45
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 30, motion = 40
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 35, motion = 35
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 40, motion = 30
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 45, motion = 25
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 50, motion = 20
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 55, motion = 15
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 60, motion = 10
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 65, motion = 5
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       jump - Y = 70, motion = 0
       jump: finished
       jump: falling back down after jump up
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 65, motion = 65
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 60, motion = 60
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 55, motion = 55
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 50, motion = 50
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 45, motion = 45
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 40, motion = 40
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 35, motion = 35
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 30, motion = 30
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 25, motion = 25
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 20, motion = 20
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 15, motion = 15
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 10, motion = 10
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 5, motion = 5
     lucy_calculate_floor()
       checking: tile 69,0 is type 12
       calculated floor position is 0
       fall: Y = 0, motion = 0
       fall: finished
     lucy_can_move()
       floorlevel = 0, tilebase = 0
       tile at 69,0 is type 12
       horizontal offset in tile is 3

Sometimes, diagnosing a movement and/or tile problem meant reproducing it (to ensure I could reliably cause it to happen), and then doing it again with debugging, and then working my way through what was happening line by line.

In the above snippet, you can see that 'Y' is Lucy's vertical offset, and 'motion' is a counter specifying how much movement is required. There is a variable (not mentioned here) that is called state which holds a value representing what Lucy is currently doing (jumping, falling, taking a photo...). This together with motion tell the game how to move Lucy when there's some sort of activity that happens independently of player input (such as animating a jump).

If you wonder why the game repeatedly calculates where the floor is, that's because this is how it knows if Lucy is going to fall... off the edge, down a hole, or down to a step on the level below. It could perhaps be optimised to only bother checking if Lucy moves, but it's a pretty quick routine - it just looks up the properties of the current tile along with Lucy's position within the tile, and if the floor is "below" (as in, she'd fall), then look at the tile below, or below that if necessary, until a 'floor' position can be determined.
The usual code path for the majority of the game amounts to "this tile is a floor, she's standing on it".

 

Tomorrow, a little bit about how the game was written.

 

 

Your comments:

No comments yet...

Add a comment (v0.11) [help?]
Your name:

 
Your email (optional):

 
Validation:
Please type 38556 backwards.

 
Your comment:

 

Navi: Previous entry Display calendar Next entry
Switch to desktop version

Search:

See the rest of HeyRick :-)