The Armageddon App

Here is where to post about the latest Commander Keen fangame or modification you've finished, a new website you've made, or another Keen-related creation.
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: The Armageddon App

Post by 55Aavenue »

So this is interesting...

I can duplicate the elevator bug every time now if I complete the levels in a certain order, and the glitch always starts happening after I complete level 21 (Research & Development Sphere). So I have been trying to figure out what is different about that level. Seemingly nothing, so out of desperation just trying to rule out every variable I could think of, I tried swapping its level name and entry text with another level (I inserted the pointers for Main Engineering). I have a saved game file I've been using for testing where I enter Research & Development Sphere and then F10-E to complete it and then I backtrack to the elevators, and consistently every time the elevator bug would happen when I tried to enter the 1st elevator to back track back to the first floor. But after doing this pointer swap, the bug did not happen! Then, if I change the level entry/name pointers back, the bug happens again!

So what's weird about the pointers for this level? Well, at about this point in the game, because I added so many extra levels over the regular keen 5, I was running out of text space for level names and entrances. So, to save room, I started combining them. The level entrance texts always contain the name of the level anyway, so I patched in the entrance text as normal, and then decided for the level name, I would have the pointer just point to the start of the name, within the entry text.

So here would be the entrance text, patched into the level entry section as normal:

Code: Select all

%patch $20471 "Keen slithers through" $0A "the Research &" $0A "Development Sphere" $00
My level entry text pointer was $20000471RL nothing unusual with that.

My level name pointer was $2000048BRL so it points to where the word Research starts within the level entry text.

I thought this was a clever way to save space, I was able to get the entrance text and name I wanted using only one text string. I guess the game doesn't like this. I'm a noob at patching, just trying to figure things out and learning as I go so I don't really understand why this is a problem, but maybe someone can enlighten me. Or if this explanation makes no sense then please correct me, but I do think this is the cause of the bug, I can switch the pointers for this level to other level texts (where the name and entrance string are separate as normal) and then bug will not happen. Switch it back and the bug happens again on the same save file.

So, if this is my problem, then I guess I now have the task ahead of me of redoing a portion of my level names and entrance texts to try and make it all fit without combining them (I used this trick on several of the later levels, which again seems to explain why the elevator bug only starts happening late in the game). I believe I will have to shorten some of names and/or entrances texts because they won't all fit otherwise.

K1n9_Duk3 and or other experienced patchers, please let me know your thoughts on this, if what I've said makes any sense or not. I'd hate to go and redo all my level name and entrance string for nothing :bloody
User avatar
Nisaba
Janitress
Posts: 1597
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Re: The Armageddon App

Post by Nisaba »

nice track down!
I'm curious what K1n9_Duk3 or Levellass have to say about it. to me this seems to be a hot lead.

you might already know that you can free up some text space by limiting game error texts. also by overwriting some in the same general area you should find plenty of free text space. It is easily possible to compress the game's dozens of errors into just a few lines, freeing up massive amounts of 'text space'. this might help to generate some free space for your level names and entrance texts.
out now (link) : Image
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: The Armageddon App

Post by K1n9_Duk3 »

Okay, I'll investigate this.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: The Armageddon App

Post by K1n9_Duk3 »

Found it. :evil
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: The Armageddon App

Post by K1n9_Duk3 »

This was the culprit:

Code: Select all

%patch $60B3 $10 $74 #BWB level is level 16
The comment for this patch is misleading. What you're actually manipulating here is the check for the largest valid level entrance number that cannot be re-entered (i.e. it removes the entrace, spawns a flag and maybe clears a barrier on the world map when the level is completed). This should be something like "if (levelnumber >= 1 && levelnumber <= 17)" in Keen 5 by default, but your patch changes this to "if (levelnumber >= 1 && levelnumber != 16)", meaning that almost anything can possibly be treated as a level number, including the coordinates on the elevators.

The "level number" part of the elevator coordinate in question is 0x51 (or 81 in decimal). When the code checks to see if that "level" is done and the level number must be removed from the world map, it adds 2*81 to the base address of the "leveldone" array and lands in the middle of the string buffer that the game uses for various things. One of the places where that string buffer is used is for the loading messages. The messages themselves are stored in "far" memory, and the game has to copy the string into the buffer, which is in "near" memory, in order to draw the message text.

In this case, if the level message string was longer than 53 characters or anything else that was ever copied into that string buffer was longer than 53 characters, the game will always erase the coordinates for that elevator shaft.

This bug could affect the other elevator coordinates as well. The ones at the top and bottom use coordinate 0x35, which would also get mapped to a string buffer (but that buffer is rarely ever used and never filled enough to trigger this). The elevator leading to the top uses uses coordinate 0x1F, which gets mapped to the keycard variable. If you leave a level with a keycard in the inventory, the elevator to the top will not work. Just in case anybody stumbled upon that situation and was wondering about that.

So the solution to this problem is this:

Code: Select all

%patch $60B3 $18 $77 #highest level number is 24
There is absolutely nothing wrong with re-using parts of the level message string as the level name string. Some compilers will do that automatically to save space.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
Syllypryde
Vorticon Elite
Posts: 1025
Joined: Tue Jan 20, 2009 18:33
Location: Michigan
Contact:

Re: The Armageddon App

Post by Syllypryde »

K1n9_Duk3 wrote: Thu May 14, 2020 21:49 ......So the solution to this problem is this:

Code: Select all

%patch $60B3 $18 $77 #highest level number is 24
There is absolutely nothing wrong with re-using parts of the level message string as the level name string. Some compilers will do that automatically to save space.
Will this also solve the issue with Keen dying immediately as he goes through the keycard door in the final level? The updated patch file did not work to fix this issue.
.niarb ym fo
snoitulovnoc eht tuaba
selbbarcs ssensuoicsnoc
rehgih a ekil smees
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: The Armageddon App

Post by 55Aavenue »

Yay! I don't have to redo my level texts! Thanks a lot for your help with this K1n9_Duk3, it is very appreciated!!

I'll be back shortly with an update that should fix the elevators, as well as the other issues that have been reported.
Syllypryde wrote: Thu May 14, 2020 22:34 Will this also solve the issue with Keen dying immediately as he goes through the keycard door in the final level? The updated patch file did not work to fix this issue.
Is it the same save game file that keeps doing this? As in, you were already saved in the last level when you copied over the new patch file? Maybe the error was already in that save game.
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: The Armageddon App

Post by 55Aavenue »

Armageddon App version 1.1 is here! Now much less broken!

Thanks to everyone who has commented and helped me improve this.

Here's whats fixed:

-Likes reset at 10 instead of 0 after a 100 likes 1up

-Intro credits now scroll normally and don't glitch

-Fixed some conveyor belt tiles that didn't animate in Refinery Sphere

-Removed unnecessary tiles from map level to reduce unique tile count and save memory

-Various patch file corrections suggested by K1n9_Duk3

-Fixed several levels where Keen could ledge grab out of boundaries on phasers (unintentionally completing the level)

-Best of all, no more glitching elevators! Keen can now safely travel around the Omegamatic going in and out of elevators as he pleases without worrying that he might end up getting trapped forever in an endless loop at coordinates 0,0

Download link in the first post is updated.

Save game files should transfer just fine. I'd recommend saving on the main map when transferring to the updated version.
Last edited by 55Aavenue on Sun May 17, 2020 0:30, edited 2 times in total.
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: The Armageddon App

Post by K1n9_Duk3 »

Syllypryde wrote: Thu May 14, 2020 22:34
K1n9_Duk3 wrote: Thu May 14, 2020 21:49 ......So the solution to this problem is this:

Code: Select all

%patch $60B3 $18 $77 #highest level number is 24
There is absolutely nothing wrong with re-using parts of the level message string as the level name string. Some compilers will do that automatically to save space.
Will this also solve the issue with Keen dying immediately as he goes through the keycard door in the final level? The updated patch file did not work to fix this issue.
No, this particular patch will only affect the world map.

I can try to investigate this keycard door issue as well, but I'm gonna have to ask you for some savegames. I'd prefer it if you could save your game once you've reached that door but haven't opened it yet. In addition to that, I would like a savegame that was saved while Keen is walking into the fully opened security door. Please also include the patch file you were using. "updated patch file" is too vague, I need to know which patch commands are in it and which ones aren't.

And when you upload these files, please make sure that others can actually access the files. This dropbox link you posted earlier might have worked for you, but I can't access that file:
Syllypryde wrote: Thu May 14, 2020 0:25 It is still happening...
https://www.dropbox.com/preview/PCKF%20 ... e=personal

@55Avenue:
I have examined every single patch instruction (of the original 1.0 patch file, not the one from version 1.1) and I did notice a few minor issues I wanted to point out. None of them will cause issues in DOSBox, but perhaps you can fix those minor issues as well to minimize the chances of somebody taking problematic patches from your mod and using them in his/her own mod in the future.

- The patch to play music during the terminator intro overwrites part of a "set palette" instruction, but not all of it. The code to move $1002 into register AX and then run interrupt $10 is still there. I think it's better to turn those intructions into NOPs (i.e. add "$90" 5 more times at the end of the patch instruction for a total of 6 NOPs). The interrupt call expects to find palette data at ES:DX and we don't know what values the registers ES and DX have at this point, so I think it's better not to use that interrupt call.

- The "keen jumps and pogos same height in easy as in normal and hard" patch only affects pogo jumps, not the regular jumps. The same patch instruction also appears in the conveyor belts section. I guess you could remove it from the conveyor section to avoid confusion.

- The patch for the "Unending FG anim" text uses the wrong offset. It should be "%patch $17B63 $3951W". Your current patch uses the "Whoops you hit an air generator" string for that error.

- The new QED collision code uses 286 instructions ("push 3", "push 1" and "push 32"). Those instructions are handy for patching (because they're only 3 bytes each instead of 4 bytes), but they will not work on 8086 or 8088 CPUs. The code will still work fine in DOSBox since DOSBox doesn't emulate different CPU types and their instruction sets, but you should at least be aware that these instructions will cause some CPUs (real or emulated) to lock up when trying to execute that code. Just adding a comment in the patch file saying that this patch uses 286 instructions should suffice.

There might still be some other issues in your patch file that I just haven't noticed yet, like the deadly door problem that Syllypryde encountered.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: The Armageddon App

Post by 55Aavenue »

K1n9_Duk3 wrote: Fri May 15, 2020 21:25 I have examined every single patch instruction (of the original 1.0 patch file, not the one from version 1.1) and I did notice a few minor issues I wanted to point out. None of them will cause issues in DOSBox, but perhaps you can fix those minor issues as well to minimize the chances of somebody taking problematic patches from your mod and using them in his/her own mod in the future.
Corrections made. Links updated.
User avatar
Syllypryde
Vorticon Elite
Posts: 1025
Joined: Tue Jan 20, 2009 18:33
Location: Michigan
Contact:

Re: The Armageddon App

Post by Syllypryde »

55Aavenue wrote: Fri May 15, 2020 0:31
Syllypryde wrote: Thu May 14, 2020 22:34 Will this also solve the issue with Keen dying immediately as he goes through the keycard door in the final level? The updated patch file did not work to fix this issue.
Is it the same save game file that keeps doing this? As in, you were already saved in the last level when you copied over the new patch file? Maybe the error was already in that save game.
55A was right. I was using the same save file I had before when the updated patch file was copied into my Armageddon App folder. As you seen in the screenshot I posted earlier in the thread I completed normal with a perfect score. I started my hard run a few days ago with 6 levels complete as of today. So I obviously overwrote that previous save game with a new save game from hard. To create another save game file for K1n9_Duk3, I recopied my normal save files from the last 5 levels I had completed, then replayed the final level. The keypad door worked! I did not die. I replayed it 9 times and the glitch never happened again.

Now you guys might be asking yourselves, if he was instantly dying when he went through the keypad door, how was he able to complete the game with a perfect score? Answer? The glitch didn't happen all the time. As I said earlier in the thread, I completed the game on easy twice, on normal 3 times trying to get the perfect score before playing on hard. After I was confident I knew where all the points were, I played normal a fourth time and when I went through the final keypad door.... presto.... instant death! I replayed The Bridge 6 times and the same thing, instant death. That is when I reported the glitch with a .gif as proof. After that I replayed the level two more times and finally on the 8th try total, it worked and I completed the game. That is when I posted my screenshot. Just for shyts and giggles I replayed the level 3 more times, the glitch happened again the first 2 times then the keypad door worked the third time.

But now that I created a new save game with the updated patch file, I cannot get the glitch to happen anymore. So I guess the update patch file fixed this glitch after all.
.niarb ym fo
snoitulovnoc eht tuaba
selbbarcs ssensuoicsnoc
rehgih a ekil smees
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: The Armageddon App

Post by K1n9_Duk3 »

Alright then, if that bug can't be reproduced in the current version, then I guess my job is almost done.

I do have to make one more addition, though:

Code: Select all

%patch $60AE $10 $74 #level 16 can be re-entered
I totally forgot that this mod had a BWB level that the player was supposed to be able to enter multiple times. My fix for the elevator bug made it so that you could only enter that level once.

This goes to show that you shouldn't just trust anything I post. It's always a good idea to double-check before uploading a new version. And if you have any reason to supect that a patch/fix is breaking other parts of your mod, you should let me know so that we can discuss this and perhaps find an alternative solution for the problem.

The only side effect of the new patch above is that "level 0" will now recieve the same treatment as levels 1-24 (except level 16 obviously) on the world map. That means any coordinate with a Y value of 0 will be removed from the info layer. That shouldn't be a problem in your mod, but I wanted to mention it anyway.


Another thing I noticed when I was starting to actually play this mod today is that some of your tile attributes are a little bugged. Look at this (GalaxyView screenshot showing level 1 of your mod with collision info):
Image
The tile circled in black has a solid right side. That solid right side will push Keen back when you start a jump while touching that tile. Sometimes this will cancel the jump altogether and make Keen walk into the deadly pit if you don't manage to release the direction key quickly enough.

This happened in the very first level and I stopped playing after this, so I don't know how many tiles in your tileset have this problem.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: The Armageddon App

Post by 55Aavenue »

K1n9_Duk3 wrote: Sat May 16, 2020 20:44 I do have to make one more addition, though:

Code: Select all

%patch $60AE $10 $74 #level 16 can be re-entered
I totally forgot that this mod had a BWB level that the player was supposed to be able to enter multiple times. My fix for the elevator bug made it so that you could only enter that level once.

This goes to show that you shouldn't just trust anything I post. It's always a good idea to double-check before uploading a new version. And if you have any reason to supect that a patch/fix is breaking other parts of your mod, you should let me know so that we can discuss this and perhaps find an alternative solution for the problem.
Oof. I actually did go through and play every level again but I forgot to try re-entering the BWB a 2nd time.
K1n9_Duk3 wrote: Sat May 16, 2020 20:44 The tile circled in black has a solid right side. That solid right side will push Keen back when you start a jump while touching that tile. Sometimes this will cancel the jump altogether and make Keen walk into the deadly pit if you don't manage to release the direction key quickly enough.

This happened in the very first level and I stopped playing after this, so I don't know how many tiles in your tileset have this problem.
I went through and recheck my tiles and found this issue on the steep hills in the Korath and the green Omegamatic tile sets. I had noticed Keen's jump act a little weird sometimes on those but I didn't know that was why.

Both issues fixed now.
User avatar
Roobar
Vorticon Elite
Posts: 3267
Joined: Tue Jan 08, 2008 16:12
Contact:

Re: The Armageddon App

Post by Roobar »

You can get stuck here: https://i.postimg.cc/ht93S7Xp/ck5patch-006.png

btw that Hydro Sphere level is really confusing, even more than my Golden Beach outpost level. It wouldn't be that bad, if there weren't any of those electric eyes. But, no, to make things worse, you've added a bunch of them. At least make sure there's enough ammo, if you want to torture players. Or/and make the stunning time longer. Least fun level so far.
User avatar
Syllypryde
Vorticon Elite
Posts: 1025
Joined: Tue Jan 20, 2009 18:33
Location: Michigan
Contact:

Re: The Armageddon App

Post by Syllypryde »

Roobar wrote: Sun May 17, 2020 10:11 You can get stuck here: https://i.postimg.cc/ht93S7Xp/ck5patch-006.png

btw that Hydro Sphere level is really confusing, even more than my Golden Beach outpost level. It wouldn't be that bad, if there weren't any of those electric eyes. But, no, to make things worse, you've added a bunch of them. At least make sure there's enough ammo, if you want to torture players. Or/and make the stunning time longer. Least fun level so far.
Here is a hint that will help you with the Volte-faces,

Spoiler... When you get to the 4 switches, 3 of those switches free the other Volte-faces, the 4th switch activates a goplat to get a gem and points. If you leave the other 3 switches alone, you will only have 1 Volte-face (2 on hard) to dodge during the level and most of the time you can avoid him or duck under him and can avoid having to repeatedly stun him.

As confusing as the level seems at first, if you explore and locate were all the gems and switches are, you can cut down the confusion considerably.
.niarb ym fo
snoitulovnoc eht tuaba
selbbarcs ssensuoicsnoc
rehgih a ekil smees
Post Reply