Just double-posting to say that I've finally gotten around to figuring out (with the help of the Dosbox Debugger) that it gets them from the "VERSION" section of COMMON.DAT – suddenly all the groundwork I've done to make a distributable EXE-patcher feels like a bit of a shaggy dog story.Edit: I just had another look in the Designer exe and while I found where it sets the same max memory values it seems it's a lot more complicated this time around. They are no longer just constant values, instead it gets them from somewhere - not sure where yet :/.
I found one such function, which seems to be called "AnalyseFichierVersion", that can read a text-file equivalent of the "VERSION" section mentioned above, containing the memory sizes written out in kiB as numbers, and seemingly separated by spaces.Edit 2: Unrelated, but you might find it interesting: the RayKit exe actually has a ton of unreferenced functions leftover from when Ubisoft developed Rayman 1. There are functions to compile all sorts of files, like the .wld files etc. as well as some graphics editors or converters. Not sure how to enable any of it, but it's cool it's all still there! Also, in the list of power-ups it mentions Super-Seed, which is unused and crashes the game if used.
TailleMainMemTmp: 133120 bytes
TailleMainMemFix: 286720 bytes
TailleMainMemWorld: 829440 bytes
TailleMainMemLevel: 2560000 bytes
TailleMainMemSprite: 730112 bytes
TailleMainMemSamplesTable: 394240 bytes
TailleMainMemEdit: 2560000 bytes
TailleMainMemSaveEvent: 524288 bytes
That sounds really promising! When I first got Rayman Designer, I imagined being able to place my own levels on a world map, and was disappointed when it turned out to be much more limited than that. (Well, in actual fact, the tools are so counter-intuitive that it took me years to figure out how to make anything playable, when I found instructions online!)Oh also btw, something you might be interested in: I recently parsed the wldmap file in SPECIAL.DAT which contains data for every level in the worldmap, how maps are chained together, loading screens etc. You can see this by logging the archive files with the logging enabled. So in theory this could be used to create all new games :p Sadly in R1 this is hard-coded in the exe, but for edu and the kit games it isn't (also for Kit it has more evidence there was a fifth level for every world).
Here's what I'm thinking: maybe the spreadsheet could include made-up DES names for events that are only in EDU and/or R1, and at runtime Ray1Map would only show up events with DESs that actually exist. Then there could be a button to import DESs from EDU and/or R1 (if the user has them installed), using the corresponding numbers in the spreadsheet to figure out what's what, and setting the limit appropriately when it's finished. Not sure how much UI programming that would take… Copying them between worlds sounds cool too – it could probably be implemented similarly, and then the DesKit and EtaKit columns could each have only one name instead of six! Then the MLT could be exported from Ray1Map based on what's in the spreadsheet? Of course, it might indeed be too big…Edit: I've gone ahead and names it in ray1map now. This is how it looks for KIT now:
Code:TailleMainMemTmp: 133120 bytes TailleMainMemFix: 286720 bytes TailleMainMemWorld: 829440 bytes TailleMainMemLevel: 2560000 bytes TailleMainMemSprite: 730112 bytes TailleMainMemSamplesTable: 394240 bytes TailleMainMemEdit: 2560000 bytes TailleMainMemSaveEvent: 524288 bytes
Then it hard-codes 0x100000 for the .mlt files.
It would be kind of fun to use this to have every .wld file contain DES and ETA from every worldOf course the palettes would sometimes be wrong, but in theory it should work. Would be a pain adding them all to the .mlt files though... Maybe that could be done using some script (the comments in the .mlt files would be filtered out then though). But since the .mlt mem block is hard-coded it might not work...
I just actually tried it in Ray1Map last night, and it only then hit me that the values are repeated for each language, even though they're obviously the same in all cases!Code:TailleMainMemTmp: 133120 bytes TailleMainMemFix: 286720 bytes TailleMainMemWorld: 829440 bytes TailleMainMemLevel: 2560000 bytes TailleMainMemSprite: 730112 bytes TailleMainMemSamplesTable: 394240 bytes TailleMainMemEdit: 2560000 bytes TailleMainMemSaveEvent: 524288 bytes
Then it hard-codes 0x100000 for the .mlt files.
Ah, of course, that makes sense.The reason they're duplicated is because in the edu game they wanted each volume to be configurable separately from the rest as they had their own .wld files and such, which could be of varying sizes (although they rarely were...).
I went ahead and put something together, which you can see here. I used a button on the Settings form, rather than having it happen automatically, and it's just as well because it's extremely slow! I think there are probably efficiencies to be gained, but I'm happy enough that I got it working. I don't think there's a way to modify the contents of archive files at the moment, so the game's memory allocation isn't actually being changed by this right now. Are you planning on adding write functions for archive files after the refactoring? (Or did I just not find what's there?Regarding the automatic transfer, sureI'll look into getting saving support working again the next few days as I haven't reimplemented all functions yet after the refactoring we did.
I had noticed that about the hitboxes, including the Bzzit one! Well, it's good to know that they did learn from their mistakes here!Btw, something else interesting is we have hitboxes displayed now.
Unity_2020-09-24_08-38-43.png
Sadly it's not perfect. A lot of hitboxes are missing (like the Hunter's detection zone) and some are wrong (like Bzzit always shows the collision for the fruit he carries in the chase level, even in other levels like the boss). There's nothing we can really do about these are the game hard-codes the majority of this. It's actually a complete mess the way the game handles it
On the other hand they seemed to have learned from their mistakes, cause R2 uses a unified system which means we can show collision for every object, including gendoors (shown in blue)!
I went ahead and put something together, which you can see here. I used a button on the Settings form, rather than having it happen automatically, and it's just as well because it's extremely slow! I think there are probably efficiencies to be gained, but I'm happy enough that I got it working. I don't think there's a way to modify the contents of archive files at the moment, so the game's memory allocation isn't actually being changed by this right now. Are you planning on adding write functions for archive files after the refactoring? (Or did I just not find what's there?)