Rayman 1 Level Editor/Viewer (Ray1Map)

Discuss tools to aid in the modification and running of Rayman games.

Moderators: English moderators, Modding and utilities team

RayCarrot
Uglette
Posts: 2112
Joined: Sat Jan 11, 2014 5:46 pm
Contact:
Tings: 29019

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by RayCarrot »

I've merged your pull request now, seems to work just fine on Windows :)
Image

PluMGMK
Dora Dodemer
Posts: 32011
Joined: Fri Jul 31, 2009 9:00 pm
Location: An tír ina labhraítear (beagán ar fad) an teanga ina bhfuil sé seo scríofa
Contact:
Tings: 5435

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by PluMGMK »

Thanks! Good to know it works! :D I'll probably take a break from this now, at least until after Record Day, but after that I might come back and see if I can do anything about other emulators (BizHawk or otherwise).

EDIT (18 August): Btw I got the re-compressor working! :D It turns out that what I thought was an off-by-one was actually an off-by-4096 (or off-by-8192, etc.) because the C code I was copying from was written with the underlying assumption of a 4-kB buffer, whereas I was using arbitrary-sized buffers. Therefore I was silently chopping off the MSBs of some string offsets. :oops2:

PluMGMK
Dora Dodemer
Posts: 32011
Joined: Fri Jul 31, 2009 9:00 pm
Location: An tír ina labhraítear (beagán ar fad) an teanga ina bhfuil sé seo scríofa
Contact:
Tings: 5435

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by PluMGMK »

RayCarrot wrote:
Mon Jul 27, 2020 12:53 pm
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 :/.
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. :oops2: Worth noting that the size values are in kiB rather than bytes this time…
RayCarrot wrote:
Mon Jul 27, 2020 12:53 pm
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.
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.

RayCarrot
Uglette
Posts: 2112
Joined: Sat Jan 11, 2014 5:46 pm
Contact:
Tings: 29019

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by RayCarrot »

Oh, that explains a lot! Each version has an array of 32-bit integer values I never knew what they were... Setting one to 0 causes the game to say it can't allocate 0 bytes, but for some reason I never made the connection it was for this data. Nice! :)
Let me know if you need help patching it. I should also mention that I did some major refactoring for the editor code (in order to better support R3 GBA and for the web version), and I haven't yet re-implemented everything, so saving level changes might not fully work yet.
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).

Edit: I've gone ahead and names it in ray1map now. This is how it looks for KIT now:

Code: Select all

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 world :P Of 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...
Image

PluMGMK
Dora Dodemer
Posts: 32011
Joined: Fri Jul 31, 2009 9:00 pm
Location: An tír ina labhraítear (beagán ar fad) an teanga ina bhfuil sé seo scríofa
Contact:
Tings: 5435

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by PluMGMK »

RayCarrot wrote:
Tue Sep 15, 2020 9:40 pm
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).
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!)
RayCarrot wrote:
Tue Sep 15, 2020 9:40 pm
Edit: I've gone ahead and names it in ray1map now. This is how it looks for KIT now:

Code: Select all

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 world :P Of 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...
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…

RayCarrot
Uglette
Posts: 2112
Joined: Sat Jan 11, 2014 5:46 pm
Contact:
Tings: 29019

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by RayCarrot »

That would be really nice yeah. There's a lot I would ideally want to do with ray1map in terms of allowing for modifications. Something like an animation editor/creator would be really neat where you can drag around sprites and such for each frame. But yeah, then it's the problem with the UI. There also aren't as many people interested in Rayman 1 modding nowadays I feel, especially with Rayman Redemption soon getting its own editor. It's at least nice to finally understand how everything works in Rayman 1 :) I find these sort of things very interesting.
Image

PluMGMK
Dora Dodemer
Posts: 32011
Joined: Fri Jul 31, 2009 9:00 pm
Location: An tír ina labhraítear (beagán ar fad) an teanga ina bhfuil sé seo scríofa
Contact:
Tings: 5435

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by PluMGMK »

RayCarrot wrote:
Tue Sep 15, 2020 9:40 pm

Code: Select all

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.
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! :P Wonder what they were thinking there. Also, the devs misspelled "DEUTSCH" in the header. :fou: I also decided to investigate that byte referred to as "Unk1", and it turns out that it's a padding byte that gets overwritten at runtime with the index of the user's language choice, so that's a (very minor) mystery solved.

As for automating the transfer of ETAs/DESs from game to game, maybe it's something that could happen at startup, with a checkbox in the general options to enable/disable it, so it wouldn't necessarily require a lot of UI work. I might see if I can get something going along those lines…

RayCarrot
Uglette
Posts: 2112
Joined: Sat Jan 11, 2014 5:46 pm
Contact:
Tings: 29019

Re: Rayman 1 Level Editor/Viewer (Ray1Map)

Post by RayCarrot »

Ah nice! I named the property now :)

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...).

Regarding the automatic transfer, sure :) I'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.

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 :P

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)!
Image
Image

Post Reply