shinyquagsire23 / SaltySD

A collection of SD redirect patches for 3DS games
74 stars 14 forks source link

Adding too many files results in some not being loaded. #13

Closed Cydget closed 8 years ago

Cydget commented 8 years ago

So, I was testing out adding additional character costumes/model swaping, and it worked partially. For mario captain falcon it works, but for the rest of the cast it doesnt work. It might have something to do with the fact that Im loading 53,474 files into the game that did not previously exist. If you would like I could send you the mods if you want to check for yourself. Im not sure if this is an amount issue or if it is just an issue where some files dont load.

Cydget commented 8 years ago

So, it turns out I was actually testing only 2,230 files at the time, witch only included files for additional mario and captain falcon costumes, but the issue there was that it was lagging the menus, and some of marios additonal css portraits/stock icons didnt load, so this is still an issue. I also tried with the 53,474 file mod that I made, and that just crashes and doesnt load the game at all. Even when I got it down to around 5000 files it still crashed.

shinyquagsire23 commented 8 years ago

You know I honestly had hoped nobody would try to do dumb things like this but I suppose I was wrong to hope for that.

Here's the thing: The base game literally only uses 48,686 files. If you're adding 53,474 additional files on top of that you're literally pushing the game to a point where I don't even know how the base game would react, I don't know how much space the game allocates total for all the RF entries or if it would be OK with that because the game needs a good portion (like a few MB) of RAM just to keep this information. You yourself said that at 2,230 files it began to lag, and that's actually pretty close to the set limits I have, chances are it's not meant to be pushed that far.

There are limits (there has to be) to how many files you can add, and I experimented with these limits already and found that it was stable at 0x800 (2048) additional files, which is actually more than a full on mod like Project M. If you want to experiment and see if this can be extended, mess with https://github.com/shinyquagsire23/SaltySD/blob/master/smash/resource_mod/source/main.c#L190-L191 and https://github.com/shinyquagsire23/SaltySD/blob/master/smash/resource_mod/incalloc.asm for that. Currently though there is a limit of 0x10000 bytes for additional paths, and 0x800 additional RF entries The RF entry limit was pretty leniant, the additional text was not. There was a certain range on added text paths where it would begin to fail loading stages.

Either way, nonissue, and intentional, idk what you're doing with that many additional files to be honest but it's definitely outside of a sane boundary.