Dead in the Desert - Cactus Forest Unbeatable

All discussion about the Commander Genius project (a Keen interpreter + more).
Post Reply
LaughingMan008
Grunt
Posts: 3
Joined: Tue Jun 01, 2021 16:30

Dead in the Desert - Cactus Forest Unbeatable

Post by LaughingMan008 »

Ive been using Commander Genius to replay the whole series this past couple weeks, and Ive now moved on to playing the much beloved unofficial Universe is Toast trilogy. Been enjoying them alot, but Ive run into a game ending bug or something. Basically, The Cactus Forest is unbeatable, because half the level is gone.

https://ibb.co/T0hvcgJ

See the thick black line? NOTHING below that line exists, so to speak. If you stand right above and look down, nothing happens. The game treats it as if you're already at the bottom of the level and you can't look down. If you try to go down into that part past the black line, the screen will stay where it was and you'll die the second you get offscreen.
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: Dead in the Desert - Cactus Forest Unbeatable

Post by K1n9_Duk3 »

I remember that level causing trouble in early versions of my Keen:Galaxy level viewer. I just dug up the old version and opened the DITD levels with it. There are a bunch of errors in the decompressed info plane and one of these errors is a scroll blocker placed around the same position as shown in your image. If CG loaded the level the same way my level viewer did and then spawned a scroll blocker at that position, that would explain why you can't make the camera scroll down any further.

IIRC, this means there is a bug in the level loading code (more specifically: the decompression code) that prevents the program from loading the level correctly. Unfortunately, I don't have any backups of my old source code, so I can't say what change would be necessary to fix this bug. I'm not even sure which part of the decompression code (RLEW or Carmack) I had to fix.

The original Keen 6 code as well as the more recent versions of my level viewer can load that same level perfectly fine, so this is definitely a bug in Commander Genius and not a broken level file.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
Multimania
Vortininja
Posts: 84
Joined: Sat Nov 10, 2007 8:10
Location: Hiding in a small, cramped corner of the BwB megarocket.
Contact:

Re: Dead in the Desert - Cactus Forest Unbeatable

Post by Multimania »

Omnispeak's decompression code also handles this level fine.

I'd double check your Carmack decompression code's handling of escaped tags: Cactus Forest has an $A81C value in it, which would be encoded as $00 $A8 $1C. (Or $A8 $00 $1C in big-endian.)

The Commander Genius code works pretty differently to the Omnispeak code, using bytes rather than words though several places, but I don't see why there's a " && src.at(OFFSET_MSB)==0x00" in the escape handling case — it seems wrong to me. You should just need to check the count is zero. Also, it looks like you're skipping a byte after this case: the "inc = WORDSIZE+2" should probably be inside the else block — this is probably actually the thing that's breaking decompression here.
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Re: Dead in the Desert - Cactus Forest Unbeatable

Post by gerstrong »

Hey, what an interesting undiscovered bug! Very cool.

Just fixed up that decompression routine and the level loads perfectly now. Thanks for discovering it!

If you want to check out a CG with this fixed, pick one artifact suitable for your system: https://gitlab.com/Dringgstein/Commande ... /323572680

Next release will have it fixed obviously :-)
Having fun developing stuff...
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Re: Dead in the Desert - Cactus Forest Unbeatable

Post by gerstrong »

Alright, just pushed another update and included that fix as well.

The level fully loads and also the entrance teleportations are working correctly this time.

viewtopic.php?f=9&t=11177
Having fun developing stuff...
Post Reply