CSE2 - The Cave Story decompilation project

May 31, 2019 at 9:31 PM
Deliverer of Sweets
Bobomb says: "I need a hug!"
Join Date: Jul 20, 2015
Location: Under sea level or something
Posts: 784
Age: 25
I don't think the mentions of limitations aren't in the asm area but more in the area of how some of us are enjoying pushing TSC to it's limits.
 
Jun 2, 2019 at 4:35 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
TL;DR Nice try kid, but you gotta get up to our level if you wanna play with the big boys, not change the rules to drag us down.

Nice meme.
 
Jun 4, 2019 at 3:06 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Nov 13, 2018
Location: Russia, in long range century...
Posts: 77
Age: 21
zxin said:
At the point where you're changing the source code you're not modding anymore... you're just an actual programmer.

Say this to Minecraft's modders. xD
 
Jun 5, 2019 at 2:09 PM
Serri Online
War criminal
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location: Phoenix
Posts: 2738
Age: 29
Ask me, ask Xin, ask anyone who knows anything about x86asm. BLink is not a very good programmer, he's just very experienced.
As someone who knows anything about x86 and who's not a very good programmer in x86 but also quite experienced, BLink is definitely better than I am.

Also this kind of drama is dumb, BLink literally parroted me and said nobody will enforce CSE2 as the only version people should make mods with. People are just gonna be people and read it all wrong just because it's BLink and everything he says is apparently condescending so let's be even more condescending to him.
 
Last edited:
Jun 13, 2019 at 7:29 AM
Indie game enthusiast
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1786
Some simple editing notes while looking at CSE2e v1.2...:
Stage.cpp - Has music filename info

ExtraSoundFormats.cpp - Has volume for the other sound formats:
Mixer_SetSoundVolume(song.instance, 1.0f); I'm setting this to 100% volume instead of the current 0.75f to match org volume (tested with flac)

GenericLoad.cpp - Has sfx filename info

CommonDefines.h - Adjust the displayed game size/resolution, not magnification
Adjusting it high works as long as your resolution meets your desktop resolution (tested with fullscreen)
Adjusting it low works at 321 w x 64 h (321 x 181 for same min aspect ratio as CSE2e)
default cs2e : 426x240

Draw.cpp -
static SDL_Rect RectToSDLRectScaled(RECT *rect) - section seems to be part of what is needed for interpreting different sized graphics? i.e. 2x etc.

Having trouble figuring out how to use graphics at different scales though. Like 2x. or 10x...
 
Jun 13, 2019 at 8:57 AM
Senior Member
CSE Discord Admin
"Fly, Fly, Fly!"
Join Date: Jan 13, 2016
Location:
Posts: 132
Mixer_SetSoundVolume(song.instance, 1.0f); I'm setting this to 100% volume instead of the current 0.75f to match org volume (tested with flac)
Heh, yeah I've been meaning to set it back to 100%. It looks like the CS+ soundtracks are just really loud.

Having trouble figuring out how to use graphics at different scales though. Like 2x. or 10x...
That requires dividing the 'magnification' variable by 2 or 10 in a couple of places. But right now this causes a problem where the game crashes if you play at a resolution smaller than the internal resolution (e.g. 2x 640x480 graphics in a 320x240 window). IIRC there's also an issue when using a larger resolution that isn't a multiple of the internal one, like 2x sprites in a 3x window.
 
Jun 27, 2019 at 8:53 PM
Senior Member
CSE Discord Admin
"Fly, Fly, Fly!"
Join Date: Jan 13, 2016
Location:
Posts: 132
This was actually finished last month, but I didn't like how messy the code was, so I remade it.

Here's a web port of CSE2 - it needs a fairly beefy computer to run at full speed. This was done by compiling the game with Emscripten, which compiles C++ to WebAssembly/JavaScript instead of machine code. This means it technically runs on desktops and smartphones... but good luck controlling it with no touch controls.
 
Last edited:
Jun 27, 2019 at 11:25 PM
Indie game enthusiast
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1786
Tested it on my i7-3770 and it worked the best with Firefox. Averaging 48 fps with perfect sound reproduction. Chrome played at 50 fps, but sound was terrible. Edge played slower and sounded horrible. And IE threw some kind of exception. Lastly, tried it on a new iphone and it ran about 1-3 fps on the intro and 45 at the menu and no sound. Couldn't get the keyboard to appear to continue...

Not sure if it's the same for others, but looks like Firefox is the way to play. I could try to load Cave Story with minimal footprint anywhere :muscledoc:
 
Jun 27, 2019 at 11:38 PM
Deliverer of Sweets
Bobomb says: "I need a hug!"
Join Date: Jul 20, 2015
Location: Under sea level or something
Posts: 784
Age: 25
Im surprised my phone seems to be able to run this at 40-50 (often near 50) fps although I wouldn't know for sure since I obviously can't get past the title screen unless i maybe get my controller working somehow (though that's more trouble than it's worth right now).
Oddly enough however the site tells me I'm IP banned unless I'm in my browser's private mode but I guess that's more a problem on my end.
 
Jun 28, 2019 at 2:39 PM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2847
Age: 33
My 5+ year old comp is managing in the high 40's in Firefox aside from dipping a bit during fade transitions. The text scrolling sound is a bit off but everything else seems right.
 
Jun 28, 2019 at 7:49 PM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 22, 2012
Location: Hell
Posts: 544
GTX 1050, i5, 8g single channel ram.

Getting a constant 47 FPS on average with Firefox, and the text scrolling sound is off thanks to it not being a perfect 50 / 60.
Why not just speed all the code in the game up and make it run at 30fps instead? 4head
 
Jul 16, 2019 at 1:11 AM
Indie game enthusiast
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1786
That requires dividing the 'magnification' variable by 2 or 10 in a couple of places. But right now this causes a problem where the game crashes if you play at a resolution smaller than the internal resolution (e.g. 2x 640x480 graphics in a 320x240 window). IIRC there's also an issue when using a larger resolution that isn't a multiple of the internal one, like 2x sprites in a 3x window.
Sadly, I don't think I'll figure this out myself. Seemed like I was onto something when I multiplied instead of divided
Code:
static SDL_Rect RectToSDLRectScaled(RECT *rect)
{
    SDL_Rect SDLRect = RectToSDLRect(rect);
    SDLRect.x *= magnification;
    SDLRect.y *= magnification;
    SDLRect.w *= magnification * 10;
    SDLRect.h *= magnification * 10;
    return SDLRect;
Except I still need to resize the image elsewhere back to normal magnification... that's probably wrong though, since without a simpler starting point, I'm struggling.
 
Jul 17, 2019 at 5:53 AM
Indie game enthusiast
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1786
Jul 20, 2019 at 12:42 AM
Senior Member
"Fly, Fly, Fly!"
Join Date: Nov 3, 2015
Location: Westminster, Colorado, U.S.A
Posts: 128
About the Emscripten port, I have a Phenom II x4 975 at 3.6ghz, GT 740 and 730 (Not in SLI but to control multiple monitors with VGA since either GPU only has 1 port), 4GB of single-channel RAM, and was averaging 30-35 fps
 
Sep 13, 2019 at 12:16 PM
Senior Member
CSE Discord Admin
"Fly, Fly, Fly!"
Join Date: Jan 13, 2016
Location:
Posts: 132
I doubt it could be that. Just two days ago, I ran the enhanced branch on a device with only 1GB of RAM.
 
Top