michael-fadely / sadx-dc-lighting

Sonic Adventure 1 palette lighting for SADX PC.
MIT License
39 stars 3 forks source link

Palette selection for Sky Chase models #28

Closed PiKeyAr closed 7 years ago

PiKeyAr commented 7 years ago

At the moment the character palette pair (base/specular 2, zero-based) is used for the Tornado, Sonic and Tails in Sky Chase 1. The character section is blank in the PL file, which causes the Tornado to have no lighting, while on the Dreamcast it clearly has lighting. The problem goes away if you copy the object palettes to the character section in the PL file (PL1A0B.BIN). What I think happens is that SA1 sets a different light type for the Tornado, which makes it use object lighting instead, while in SADX it forces the player light type. If this is hard to fix, it may help to just include a modified PL file in the distribution. Note that this is applicable only for Sky Chase 1. Sky Chase 2 has the character palettes filled in, and they are used by the Tornado, oddly enough.

Another issue is that the Egg Carrier appears to have incorrect lighting in Sky Chase 2. Its lighting is much more prominent than in SA1, though admittedly it looks pretty good. I think the Egg Carrier model in that stage has some subtle lighting in SA1, perhaps defined by the SL file?

PiKeyAr commented 7 years ago

I have confirmed that Tornado 2 in Sky Chase 2 (including the transformed model and the model used in the transformation cutscene) uses the first pair of palettes. I don't know what the character section in this stage is for. It's reasonable to assume that Tornado 1 is also using the first pair.

PiKeyAr commented 7 years ago

When the Tornado gets hit at the end of Sky Chase 1, it switches to the first pair of palettes, which is actually correct. This pair should be used on all Tornado models.

Here's a list of NJS_OBJECTs (memory addresses) that may help with implementing this: 0x028B1DA0 //Tornado model 1 0x02920F8C //Tornado model 1 hit cutscene 0x027EB198 //Tornado model 2 0x0280C158 //Tornado model 2 transformed 0x2863DEC //Tornado 2 transformation cutscene

PiKeyAr commented 7 years ago

Reference screenshot for Sky Chase 1 ref Reference screenshot for Sky Chase 2 ref2

PiKeyAr commented 7 years ago

I found out that simply patching one byte to force a different light type on the Tornado model does the trick: WriteData((char)0x0062751B, 0x00, 1); //Normal WriteData((char)0x0062AC1F, 0x00, 1); //Transformation cutscene There are still some differences, like some parts of the model don't ignore specular in the Dreamcast version, but that should probably stay outside of the main mod. Or I could provide patches for SADX models if you want. Anyway since palette selection is no longer a problem I'm closing this.