The Machine Gun Hack

Mar 16, 2019 at 10:19 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Mar 14, 2019
Location:
Posts: 8
My first mod. The origin of this mod, is that I wanted to do a challenge run where you complete the good ending while wearing the Mimiga Mask, using only Machine Gun powered flight to do acrobatics in Last-Cave-Hidden and Hell that were meant to be done with the Booster 2.0.

However, that was not possible, since entering last cave with the Mimiga Mask apparently locks you out of the good ending. Even if you remove that requirement, the "black wind" means you can't reasonably do these segments with the Booster unequipped, as the machine gun only flies at Lv. 3.

I originally envisioned this as more of a quick-and-dirty hack to make that possible, but I ended up doing a lot more than I initially expected.

In addition to making it so that you never collect anything that isn't a Machine Gun, and dealing with the "black wind" and certain event flags that were blocking my intended run, I ended up making a few other miscellaneous changes wherever I felt like it, though I don't think most of these of these are too obtrusive, e.g. making the first 3 Kazuma cutscenes at the start skippable, etc.

At least, they're not obtrusive if you're going for the good ending. Some of my changes can be very obtrusive otherwise... I started out trying to just streamline the process of getting the good ending, but I ended up just completely locking out the other endings. I encourage you to test the boundaries of this if you like, but I'm pretty sure I pretty sure I made it impossible to lock yourself out of the good ending with Curly or Booster being dead, etc.

I think if you did somehow manage to kill Curly, it would pretty much break the game at this point :p

At the beginning, you will be prompted on whether or not you want "easy mode". If you say yes, you get a machine gun with infinite ammo. Otherwise, you steal one from the Gunsmith with very limited ammo, which can upgraded in the same manner that the Missiles are in the vanilla game.

While the intended way to play this mod is all the way through from the beginning, the biggest part of the focus is on the endgame, so I prepared some saves that are right before Last Cave and some that are right before Hell. Only the ones that say "normal", however, are legit saves from my test playthrough. The "Easy", "Hard", and "SuperHard" versions are edited saves, though I don't think there should be any overly significant discrepancies compared with a real save.

And that's all I want to say before you play it. Only shameless spoiler hounds need read on:

  • Curly Brace's Super Awesome Hell Gun
    • I hacked Curly's Nemesis to be an awesome machine gun instead.
    • This is the most noticeable hack of the EXE file in this mod, and the only one custom made by me. I never expected to do this at the start, but seeing Curly wielding a Nemesis instead of a Machine Gun seemed to defeat the whole purpose. Special thanks to Cucky and Clownacy for their Cave Story Engine 2 decompilation project, without which I never would have figured out where the code for Curly's Nemesis was stored and how I could patch it. I have contributed the hack back upstream, some of you may have already seen it if you updated to the latest Booster's Lab.
  • Mimiga mask credits illustrations. No, I didn't steal them from Cave Story+. Some of them are re-used from Isage's redrawn versions from Nxengine-Evo, some are custom made by myself.
  • "Secret Glitch Room". I was hinting at this when I said killing curly would break the game. To see this abomination for yourself, try carrying Curly through the Waterway without visiting the shack to drain the water from her. Instead of just preventing it like the other usual methods of locking out the good ending, I made it do this. And yes, I did make a dumb Stryder7x reference :p
  • The "Booster 1.9". By an existing hack in Booster's Lab, I was able to reduce the Booster's fuel so it's less useful. This is for the brief period of time you even have it; Momorin doesn't give it back after using it to build the rocket.
  • I think I gave a few bosses a little more health. Or, a lot more in the case of Ballos' final form, though Curly's gun compensates for that quite a bit.
  • This list isn't exhaustive, but I think those were the things worth listing.

EDIT: Reuploaded with all Thumbs.db and Thumbs.db:encryptable files removed. They were automatically inserted by Windows XP at some point during development, and I forgot to delete them when I deleted all the other unecessary files. Apparently they were causing problems for some people.
 

Attachments

Last edited:
Mar 16, 2019 at 3:16 PM
Senior Member
Org Discord Admin
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jun 18, 2017
Location:
Posts: 91
Age: 23
Pronouns: he/him
Hello, just played through this mod.
zxin has said quite a lot on how the general game goes, I'll just add from here.
The game becomes very easy at the start, even without Easy Mode. Actually, I think it becomes very easy throughout the entire playthrough (bar the Last Cave and Hell, which I'll mention later). It's good at least that you took care of all possible exploits.
There is some strange tendency for the game to absolutely rail you into the best ending. All findings and secrets end with anticlimactic "Got your Machine Gun back"!/"Why did you do that for?"/"Santa's Apology Letter!" You appparently get all the items necessary to get there even if you didn't bother much. It feels exactly like a challenge run. I guess that's the intent?
There are a couple of script errors, but otherwise the edits were good. I unfortunately did not list all the errors, but they'll float up. Eventually.

Now, onto the late-game.
Last Cave has not been changed much outside of perhaps some EXP capsules (?), which means it's highly risky to take any kind of damage.
You will need to keep both Machine Guns at Level 3. I say both, because for some reason the second one has to exist (and not, say, be used as an ammo upgrade). Well, I guess they have some benefits, like switching to Level 3 when your other is down.
You will also need to have the Arms Barrier, otherwise it'll be almost impossible to pass if you get hit once.
You will need to bait the Presses at the very last section. That's because that section has not been changed, at all. It's supposed to be done with Booster 2.0. But you have none, so instead you'll need to kill the Presses separatedly.

Hell has also not been changed. Again, it's very risky to take damage.
Curly's new Super Machine Gun is okay, good when you're also holding the attack button. I guess the intent is that you'll need to focus more on platforming, since Curly takes care of all enemies.
What's an third, infinite ammo Machine Gun doing there? It has no practical purpose, it can't propel you or do more damage than Curly can. I guess it serves the same role as the Missile Launcher with 100-something ammo. Or it's just a joke item, I don't know.
The rest of Hell went as expected.

Very small nitpick, but this mod doesn't do much for people who can mash faster than Machine Gun fires. There was not a hack used to properly reduce Machine Gun's recharge rate (there is a hack by EnlightenedOne in the CS Modding Community server, you probably should check that out). So, I could mash away at almost no drawbacks, especially when Level 3 has 6 damage. Enemies have never been cheesed harder than this.

It's, uh, a first mod. A polished one, for sure! Some significant changes should be done to the last 2 areas (and perhaps the rest of the game), but otherwise there's not much to complain about.
 
Mar 16, 2019 at 8:39 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: Nov 3, 2015
Location: Westminster, Colorado, U.S.A
Posts: 128
Pronouns: he/him
When I try to extract it, there is a file preventing me from doing so called "Thumbs.db:encryptable". I did a small bit of research, and apparently this is for thumbnails in files. If you added any such thumbnails to any file or files within this folder, would you mind telling me what you did? I was able to get past it, and it might even be a bug on my part, but I still find it odd that this happened. What did you do?

Also yes, I will post my review of the mod soon.
 
Mar 16, 2019 at 10:46 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Mar 14, 2019
Location:
Posts: 8
When I try to extract it, there is a file preventing me from doing so called "Thumbs.db:encryptable".

Crappity crap, I think Windows XP might have inserted that automatically at some point. I did most of my editing and playtesting on Linux Mint (using WINE to run the game), but I loaded my WinXP Virtualbox VM a few times as a sanity test to make sure it was running correctly on actual Windows. I'm not familiar enough with Windows to know when it inserts these files or how to prevent it.

I will delete all "thumbs.db" related files and reupload, though. They weren't supposed to be there anyway, but I'm kinda surprised it caused such issues.
___________________________________
I'm putting the following in a spoiler box just because it's too long, not because of actual spoilers:
HOLD ON this is Last Cave (Hidden)! WTF? X(
You realise this becomes kinda bullshit the moment I take any damage, right...? Like I literally can't progress if I take too much damage, and I HAVE to take damage to get back after that, too.

That was kind of the point. Not being able to access that version of Last Cave with the Mimiga Mask and no Booster was a big part of what precipitated me to start this. Yeah, it is hard. Yeah, you lose your flight and are screwed if you take too much damage. It is kinda the point.

Maybe you shouldn't have re-hacked it to run at 80fps? I left it at the default 50 because I wanted it to play like the normal game, and changing it might have made Last Cave more frustrating.

Here's a video of what a run of this level should look like.

Do note however that it was beta footage from an earlier version of the mod where easy mode was the only mode (i.e. the machine gun always had infinite ammo). I didn't record any video of my test run of the finished/released version. Also, the extra machine gun wasn't available at that point, though I did have the Arms Barrier on. Perhaps I should include the Arms Barrier in the "Normal" save, as well as just the "Easy"...

In case you're wondering why I slowed down and acted inappropriately cautious before right before the Red Demon fight... honestly, I misremembered there being a Press in that gap because I'd been playing too much Jenka's Nightmare :p

Wait why do I have 42HP--OW
[...]
HEY! HOW COME I DON'T HAVE A LIFE POT! D:

Honestly, those were just incompetence on my part while I was doing the test playthrough the saves were derived from. The Life Pot is not available in the Hell saves because I wasted it on the Undead Core fight like a chump, and, and the 42/47 HP instead of 45/50 is because I missed a life capsule somewhere. I guess I could save edit them, but I wanted to make sure at least one of the save variants for each point was "legit". If I release an update, I should probably make sure that at least the "Easy" save has a life pot, though.

Jenka. I already know this, okay? Just shh. Shhh.
[...]
However, unfortunately every 'not-Cave Story' mod I've ever played still have the same issues:
-Not enough fundamental changes to the gameplay to make me really want to play Cave Story again that much.
-The changes are too drawn out between things like the vanilla dialogue, and unmodified gameplay.
-Tend to lump the major changes towards either the end or the start of the game, leaving most of the gameplay completely unchanged.

I sorta see what you mean, and that's what led me to create the "Skip to the good part saves" for people who would find a complete run boring because they've already replayed cave story too many times. Outside of making that option available, I don't intend much further serious changes to the middle part of the game, but if I do ever release another revision pass of this, then in addition to fixing the various instances of janky message boxes I may also add some more cutscene skips, or at least liberally apply <SAT commands to make long dialogues faster.

All she does is ask if I wanna trade guns??? XD
If you're using an AMJ, you should use a flag instead so that she says literally anything else but "Wanna trade guns?" ... and since they're both identical, she might as well say "Wanna lose all your weapon energy?"

I don't think I used an AMJ or an FLJ for this, that's just unconditionally what she says now.

I agree it's stupid, but it's sort of supposed to be. It was just sort of a (possibly failed?) attempt at humor, replacing the old scene for trading the polar star with a pointless machine gun swap. I guess I could have just removed the trade altogether so no one gets tricked into seeing what happens and losing their XP. Or maybe just remove the actual TAM command and keep the rest of it the same, IDK.

I did the same thing with the Little Man, too, so that you trade the Machine Gun for the Machine Gun, though in that case it pretty much dooms you to fall to your death >:) I didn't feel too bad about screwing over the player like that since it's not too far from a save point.

Also, trying to get the Bubbler just sort of calls you out for quenching a fireplace for no real reason, as there's nothing behind it :)

And of course, you already saw the Fireball being replaced with Curly's Panties.

Huh, you weren't kidding! That's a pretty cool assembly edit. Reminds me of Four Hours.

The interesting thing is, it's not even technically a real ASM patch. It only changed a few immediate values (some 8-bit integers and one 32-bit memory address) passed along with the instructions, the instructions themselves are all exactly the same and the basic program logic has not changed at all.

It's built more like the simple hacks that overwrite a few isolated numbers, than the "heavy" asm patches that wipe out and reimplement an entire function. But you wouldn't know that by looking at it, because changing that memory address so that it checks a different variable (one that only indicates if the key is held down, not that it was pressed and then released) makes an extremely dramatic difference.

2 Machine Guns?

Yeah, if you play all the way through, there's a spare MG in the chest Balrog leaves in Boulder Chamber, replacing the Super Missiles. I figured out you could add a weapon you already have by adding one you don't and then immediately trading: <AM+0002:0000<TAM0002:0004:0025
There was not a hack used to properly reduce Machine Gun's recharge rate (there is a hack by EnlightenedOne in the CS Modding Community server, you probably should check that out). So, I could mash away at almost no drawbacks, especially when Level 3 has 6 damage. Enemies have never been cheesed harder than this.

I may look into that if I ever do a new revision. I did use a bundled hack in Booster's lab to subtly lower the recharge rate, but it doesn't mitigate mashing properly, the first bullet regained is still too soon.

But maybe not, since mashing abuse being possible may be somewhat necessary for the mandatory flight sequences, especially when not collecting enough ammo upgrades.

Last Cave has not been changed much outside of perhaps some EXP capsules (?)

Hell has also not been changed. Again, it's very risky to take damage.

This is fully intentional. The reason I started making this mod was because I wanted it to be possible to do those segments without trading the mimiga mask for the Booster. Their level design being exactly the same is considered a feature, not a bug.

And I didn't change the EXP capsules, as my changes to Last Cave were limited to the segment of the script controlling the "black wind" sequence; no entity or tile edits were made there unless I'm remembering incorrectly.

You will need to bait the Presses at the very last section. That's because that section has not been changed, at all. It's supposed to be done with Booster 2.0. But you have none, so instead you'll need to kill the Presses separatedly.

That's true. The intent is that finding a way to do with the MG, things that were only meant to be done with the Booster, is supposed to be part of the appeal.

There is some strange tendency for the game to absolutely rail you into the best ending. All findings and secrets end with anticlimactic "Got your Machine Gun back"!/"Why did you do that for?"/"Santa's Apology Letter!" You appparently get all the items necessary to get there even if you didn't bother much. It feels exactly like a challenge run. I guess that's the intent?

My response to that, is as follows:

Yes. Definitely yes.

If you had any doubt that's intentional, try drowning Curly in the waterway by not visiting the shack, see what happens ;-)

What's an third, infinite ammo Machine Gun doing there? It has no practical purpose, it can't propel you or do more damage than Curly can. I guess it serves the same role as the Missile Launcher with 100-something ammo. Or it's just a joke item, I don't know.

It's actually pretty useful if you level it up in the statue room. Though this may be a tad luck-based that they all need to drop XP instead of health. And of course, you can only get to the statue room if at least one of the other two guns is still at Lv. 3 after the Giant Press fight.
Thanks for all the replies. I appreciate the response.
 
Last edited:
Mar 18, 2019 at 7:29 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Mar 14, 2019
Location:
Posts: 8
Also my name is zxin.

Okay, I went back and uncapitalized it.

Then just have everything instantly kill you. There's no point leaving the player alive but in this "you're fucked" state. That's even more frustrating than being instantly killed. (as long as I can respawn quickly > .>)

The problem there is that depending on the arms barrier and the state of the spare gun, not everything necessarily instantly ruins you. Not to mention, I'm not actually sure how to set the damage of small spikes for one level only without changing it for the whole game.

While playtesting, my workaround for getting stuck with otherwise high health was to hit Esc+F2 to reset the game.

At this point I'd say you have the skills to go and create a mod that's more inspired...

I certainly won't rule out the possibility of doing something more ambitious in the future. Though if I get too ambitious, I may dispense with making it as a "proper" mod and re-base to NxEngine-Evo.

For the type of mod I did here, using the original CS was beneficial because it offered me assurance that anything I didn't change would behave exactly the same as the original, without any discrepancies at all, which was what I wanted. But if I wanted to change an absolute ton of stuff, then Nx is certainly "close enough" for a starting point, and even though I'm not a wizard at C++, editing it certainly seems more manageable than writing ASM patches for every change or addition.

Yeah but I'm the kind of person who would simply not have saved there. That's one situation where I think removing the <TAM would be necessary.

Point taken. I may do that if I do a revision. ...Or else something crazy like autosave before the trade, so after you die, it reloads in the Little House without having traded.

Oh right yeah - that's actually a clever idea. <TAM must be missing the checks that <AM+ is.

Here's my understanding of what happens there:<AM+ receives a weapon id and an ammo count. The command iterates over the weapon list one at a time to see if it can find a weapon with that id. If it does, it adds the specified ammo amount to the existing weapon and exits (becoming effectively a no-op if the ammo count was zero). If it gets to the end of the list without finding the specified weapon, it creates a new entry at the end of the list with the specified id and ammo.

<TAM, on the other hand, also iterates over the list, but it's only checking for the weapon to be traded away rather than the one to be received. If it finds it, it replaces it with the specified weapon at the specified ammo count, and there's no option for simply adding more ammo, though selecting zero ammo does have the special behavior of keeping the ammo the same (this is used when switching Missiles for Super Missiles in the original).

I actually didn't test what it does if you don't have the specified weapon-to-trade-away, but I assume it just gives up and exits without doing anything. In any case, it seems clear to me that the logic for <TAM is completely agnostic of whether you already have the weapon you're supposed to be getting.

Again, I appreciate the feedback.
 
Last edited:
Jul 24, 2019 at 2:15 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Oct 7, 2018
Location:
Posts: 4
Hey! Nice mod. One bug that I've found:
Balrog's Super Missile chest gives the player endless machine guns. You don't even need to leave the room and come back to get a new gun.
 
Back
Top