Thursday, November 28, 2013

Pushing

So many things going on all at once... not sure which of them might be interesting.  :)

The last couple of days have been spent jumping around all over the place:
  • Reviewing concept character art - I now know what my lead characters look like (!)
  • Writing character dialog
  • Working on the "hyperspace" level design, resurrecting some old test code
  • Arranging music
  • Adding "cylinder" primitive drawing to the render library
  • Putting local variables into the script system
  • Music sync and object spawn sync
  • Dealing with physics issues
The physics issues were perhaps the biggest problem.  Currently, Blender doesn't let you set the mass of anything to more than 10000 units (say, kg) and not less than something like 0.01.  This was causing some problems with low-mass bullets pushing high-mass objects around in unpleasing ways simply because they move fast enough to carry a lot of energy.

I tried a few different methods for dealing with this, but none of them were working very well.  Disabling collision response kind of works, but isn't selective enough and actually lets some objects pass through each other that I do want to respond.

I tried making the object Kinematic, which means it exists in the collision system but doesn't have it's motion affected by collisions.  Unfortunately, in Bullet, it doesn't actually have any built-in motion of any sort, it requires game-side key-frame animation, where I just wanted to set a velocity and have it go.

So, I ended up just making it a regular dynamic rigid body with a really, really large mass.  This may cause weird numerical instability, but my immediate tests seem to work just fine - it doesn't get pushed around by bullets, and nudges the player ship out of the way during collisions.

Then, I was trying to get a constraint to work in the physics system, but it was all going horribly wrong... until I finally figured out that some code forcing the ship orientation was causing the constraint to be violated.  Removing that and just letting physics "do its thing" fixed everything nicely.


I would say there has been some real progress on getting the level done.  Getting music, spawning and rendering all in sync still needs some work, but the pieces are really falling into place now.

No comments:

Post a Comment