As I continue to test every level and make sure that the lighting is correct on every level I discovered a performance issue with the later levels. Because these levels are so large the number of wall collision pieces is pretty high and this is causing a lot of overhead when the shadow casters are set up.
At the moment when the leve starts a function scans the wall tiles and creates a suitable shadowcaster (invisible) element for the lighting engine to use. This means that there is one shadowcaster for each and every 128×128 tile of the walls.
I’m now in the process of rewriting the this function so that it can scan across the tiles and create shadowcaster objects that span across all the straight edges. On a manual test level (level 4.22) the number of shadow casters went down from 606 (automatically created) to just 46. So that’s my target.
Also over the last week there has been a number of fixes and improvements:
The laser fencing that fades out allowed the missile to pass through it when it had only just started to power off. To make things more realistic the fence will require the power to be below 30% before the missile can safely pass.
The detection arcs for the gun turrets was misbehaving allowign it to see through walls to their left.
A static glow effect has been added to the floor sockets to help them show up better in darker areas. The glow changes coloured depending on the state of the socket (yellow, red or green).