Possible solution for missing light fixtures#667
Possible solution for missing light fixtures#667joshuarwood wants to merge 2 commits intofgsfdsfgs:portfrom
Conversation
|
It would be nice to find a solution that does not require hardcoding light shifts per stage. Stages can be replaced after all. |
|
Could you point me towards an example of how to replace the stage? Does it involve swapping out a binary from the ROM? |
https://github.com/fgsfdsfgs/perfect_dark/wiki/Modding#asset-files |
|
Oh, excellent. Many thanks! |
|
I followed the g5_carpark example and put together a .zip containing a modified background geometry with fixes for the 14 lights from the Investigation level that were included in this PR: It should work with ntsc-final builds using
Does anyone want to test it out? It should also fix #665. |


This PR contains a possible solution for some of the missing lights in certain levels. The idea is to shift the position of problematic lights slightly so they pass the line-of-sight test for visibility. This is needed since the original position is very close or just behind the background geometry, which fails the line-of-sight test.
The shift is performed inside bgBuildTables, which is only called when loading background data at the beginning of the level. It should not impact performance once the player is in the level. The shifts are small enough (the minimum size of 1 allowed by the vec3s16 light position) that they should be indistinguishable from the original light position.
So far I've implemented fixes for lights in dataDyne Research: Investigation since it had the largest number of missing lights on my playthrough. I included comparison images below. I can add fixes for additional levels if you approve of this approach.
Images from PC port
Broken lights from dataDyne Research: Investigation in the current PC port
Images from this PR
Fixed lights after adjusting positions with this PR