One of the final things on the To Do list is a collision detection glitch that Nathan encountered at the end of August - P-Type on the left was hit, but not destroyed:
but I hadn't encountered it myself until last night while play testing the new Epsilon Quadrant. I saw it on hardware, so no screen shot of that.
I reviewed the routines this morning and suspect I know what's going on. There's a array gSpriteState[#] that uses bits to keep track of info about each sprite. The routines check for specific SP
- MissileCollisions() tests for SPS_DEADLY_TO_PLAYER
- MoveEnemyShips() tests for SPS_ENEMYSHIP
- MoveFormation() tests for SPS_DEADLY_TO_PLAYER
- MoveSpyShip() tests for SPS_DEADLY_TO_PLAYER
When an enemy ship (the I-Type and P-Type missiles) are created the state is set to this:
gSpriteState[index] = SPS_DEADLY_TO_PLAYER | SPS_ENEMYSHIP | dir;
is the direction the ship is traveling. I think that somehow SPS_DEADLY_TO_PLAYER is getting cleared (as that would disable collision detection) while SPS_ENEMYSHIP stays set(which means the ships would move like normal). To test this theory I've added this bit of code at the end of MoveEnemyShips()
if ((gSpriteState[i] & SPS_DEADLY_TO_PLAYER) == 0)
gSpriteColor[i] = gObjectColors[COLOR_SHIP];
What that will do is change the color of the enemy ship to white if SPS_DEADLY_TO_PLAYER was cleared.
I've played a few rounds since making the change, but haven't seen any white ships yet. Not surprising though as it's taken about a month since Nathan reported the issue for me to encounter it. As such, I need lots of people to test this
and see if they spot any white ships! The lots of people is why this technical update is in the homebrew topic instead of my blog.
Additionally, this build has the test of the Epsilon Quadrant which generates random station layouts for each sector. I still need to put in the final sound effects but am hopefully this will also make it to the final build.
For Harmony or Stella (requires Stella 5.0.0 or newer)