Friday, September 6, 2013

Brain Reactivate, Fix Stupid Bug

Camera guidance - check
Multiple nav points - check
Ship operates in parent object's space - check
Ship weapons fire emits in correct frame of reference - check
AABB limiter works in correct frame of reference (keep ship on screen) - check

Considering I really only had half a work day, today has somehow been relatively productive. 

Mostly it came down to fixing the one bug where the physics was not syncing correctly when the parent game object to the ship's game object was moving, rather than the ship itself.  Ultimately the biggest problem was that the Update event was happening in the ModelComponent before the NavComponent, causing the world space transform of the object to be inconsistent before and after the physics update.

Or, for the non-technical reader:  Did bad stupid thing.  Fixed bad stupid thing.  Is good.  Have post in queue for Weekend Edition.  You read, all make sense.

Best moment of the day:
Ship turns and accelerates towards the first nav point.  Velocity vector aligns with the target direction, all is good.  Approaching the model at the target point, we hit the first nav point and... yes, proximity check works, we're headed to the second nav point!  Ship turns, velocity vector aligns, here comes the enemy ship I put at the next nav point and....

My ship explodes.  Oh, right, apparently this one has a collision object attached to it.  :)   The camera didn't care though, it was all just, "OK, next nav point, let's go..."

Well, it was funny when it happened.

No comments:

Post a Comment