Discussion in 'Engineering & Reverse Engineering' started by Starman, Feb 18, 2021.
Beta Windy Valley in Sonic Jam 2021 Challenge, let’s go.
/s or is it
There is more coming from Starman's discovers! I'm planning to make some tools to extract assets from Sonic Jam, so far I was able to put my hands on the models.
Oho! Another historical moment for this community may be close at hand.
Hacking the Saturn Sonic games seems to have been a tough endeavor thus far...
Patiently awaiting nice news as soon as possible ^^"
Cool! What tool did you use to get your hands on the models from extracting assets from Sonic Jam?
I've been wanting this for time. Please update us! <3
Actually curious, are there any rolling or spin dash leftovers hidden in Sonic Jam's engine? Or any early Adventure stuff? Or was most of it stripped away?
If not I wonder if Sonic 3D Blast's special stage roll could be ported over to Jam assuming they use the same engine?
I am watching eagerly for developments on this. A future where the models and their animations get exported is all I can dream about.
I haven't done a lot of digging into the actual engine code yet. I'm still trying to figure out the assets, specifically helping MarmitoTH write his tools to export the models, and trying to wrap my mind around the music sequencer. I do know that the curling/uncurling animations from 3D Blast are present in the game though, despite being unused. Assuming there isn't anything already, I'd bet we could port the roll over, though depending on how it was done in 3D Blast it may need some retooling to work in a fully 3D environment, as opposed to the linear special stages.
Not sure if this may be the best place to bring it up...
Models Resource seems to have the 3D Blast special stage models.
If anyone's still interesting in making good use of them, this may finally be that chance.
It might not be a bad idea to start up another thread for more general Sonic Jam/Saturn Sonic datamining/hacking stuff. I haven't really worked on this specific project for a good while, though I am still working on mapping out the game's data/formatting.
I've been digging into Sonic Jam for many years, on and off. I'll share what I've got so far in case it's of use to someone. Bare in mind that most of my notes weren't written for other people, but I'm putting it out thre because it's *very* slow going for me (I haven't had time for it in the last 6 months) and the info might help someone else.
My obsidian notebook: https://bitbucket.org/mark_mcs/sonicjamnotes/src/master/
Contains mostly brain dump-style notes on structures & formats used in the engine.
Annotated Ghidra export & tools: https://bitbucket.org/mark_mcs/sonicjamreversing/src/master/
This is an *extremely* rough split disassembly, generated by running my ghidra export through the "tools/format_raw_dump.awk" script. Some of the annotations & comments get clipped off but it may be useful to someone. **It does not build yet**. I don't know of a way of sharing the actual Ghidra repository.
I suspect the contents of the tools directory will be of most interest. There are some python scripts, and associated driver shell scripts, in there for extracting various resources from the data files. For example, "extract_all.sh" will use "extract_model.py" to dump all of the model data to C structures, ready for recompiling.
All of the addresses & data locations are for the PAL version of the game.
I think I might just make this thread the general Sonic Jam Hacking thread going forward. I'm not really actively working on the Tails model-swap at the moment, I'm not seeing another general Sonic Jam Hacking thread anywhere, and this thread seems to be heading in a more general direction anyway. I didn't see any rule against it, but if it's a problem, I'll delete this, change the title back, and make a new thread. Sorry, I'm not all that well-versed in proper forum etiquette!
Anyway, to further push the thread towards general Sonic Jam hacking discussion, look what I found!
I haven't done any in-depth digging into how it's programmed, but it seems like Sonic World has a palette-based lighting system, similar to Sonic Adventure. Furthermore, in addition to the 3 palettes that are seen in-game, I found 5 that seemingly go unused; doing a search for those palette's addresses in RAM came back with nothing.
Lighting on the Saturn is done using gouraud shading tables. That's controlled on a polygon-by-polygon basis by way of the polygon attributes structure. And here's the data for Sonic's head model. The lighting calculation routine fills in the buffer, associated with that object in RAM, then that gets DMAed to VRAM. I'm still focusing my time on the rendering code so I haven't throughly documented the lighting code yet and my notes are a bit sparse.
Very interesting find! Something I noticed that may be of interest is that Unused Palette 3 seems to bear a slight resemblance to the one used during the beginning of Sonic's Twinkle Park:
(Ignore the fact that he's in a car, can't be bothered to boot the game myself at the moment so I sourced some YouTube footage)
Separate names with a comma.