byvar / raymap

Map viewer/editor for OpenSpace games (e.g. Rayman 2, 3, Arena, Tonic Trouble)
81 stars 11 forks source link

Hacky SNA writer + checksum calculation. #2

Closed Zax37 closed 4 years ago

Zax37 commented 4 years ago

Hey, how are you? :)

I recently got hit by nostalgia which got me to watch videos about Hype: The Time Quest, where I found out about your project. I wanted to play around a bit and make some minor change, for a proof of concept, but it seemed like save buttons are not working, so I started looking into the code and found out the SNA writer indeed says it is not implemented.

I don't really understand the whole structure - I don't have much experience in C# or Unity, so I just hacked my way into saving to check if I could implement it, just by mirroring the read function.

The game yelled at me for writing bad checksum though, so I had to reverse engineer this part of Hype's engine, which luckily went pretty smoothly.

The code now successfully reads the compressed Hype levels and overwrites them with uncompressed SNAs that can be ran by the game (they even load noticeably faster ;))... but sadly no map changes are there... I'm guessing the whole SNAMemoryBlocks are used just as a read-only, intermediate structure, and you don't ever write changes from Unity there?

I hope you can make some use of this PR and I'll be waiting for any progress on the editor - it's good to find out I'm not the only one doing such things. Hit me up if you need anything.

Good luck!

byvar commented 4 years ago

Hey Zax37 - That's super cool! Especially that checksum algorithm, very impressive. Thank you! We've been wanting to create a SNA writer for a while... I'll merge this and see if I can make it write back to the SNA blocks. Unfortunately I don't have Hype installed at the moment so testing will be difficult. Do you have Discord? It'll be easier to contact you that way. :)

Zax37 commented 4 years ago

Sure I have discord! :) My nickname there is same as here, full id is Zax37#3446. If you have any server dedicated to Raymap you can invite me there. Or just DM me. I'm excited to see your changes, will be testing this today! :)