SMGCommunity / Whitehole-Neo

A Modern editor for Super Mario Galaxy 1 & 2
12 stars 3 forks source link

Pad stage archives to allow for testing and editing without reloading the game #51

Open AwesomeTMC opened 1 month ago

AwesomeTMC commented 1 month ago

Editing a stage and then saving while the game is open usually causes the "Disc Not Read" error, but if the new file is the same size as the old one, it works and lets you test the changes made.

So to allow for placing a coin (for example) without the game giving the aforementioned error, we could add padding to .arcs so they remain the same size. (I should also mention that shibbo suggested this, but I only found that out after coming up with the idea)

I tested this with hex editing on my own .arcs and yes, it does actually work.

Let's go through the full details.

When editing a stage, there will be an option called "Cardboard Box settings". You click on that and it brings up a small form, with a slider that ranges from 0 to the max recommended amount of padding, and an input (which is synced with the slider) that lets you put any amount wanted. Something like this (but with actual proper alignment): image

Upon setting the amount greater than 0, a .cb file will be created for each map in the current stage (or this zone's map) containing the desired size.

When saving, Whitehole will look for a .cb file. If one is found, it adds the padding needed to get the file to the size specified in the .cb file. If the file gets larger than the padding, it warns the user that "The cardboard box is full". Right there, put the cardboard box settings form so the modder can adjust it easily.

Maybe there could also be a default "cardboard box size" setting so the modder doesn't have to set it up every time.

Feel free to give your thoughts here or in the Discord.

Also, my reasoning for using cardboard box terminology: A cardboard box will remain the same size regardless of the item inside it, and becomes pretty much useless if the item inside is bigger than it. Giving the arc padding is similar to that and helps visualize.