Monday, June 3, 2013

Physics are hard.

There hasn't been a really juicy update lately because I've been stumped on designing a flight system that only uses the physics system to power it. It turns out that its pretty easy to throw down a rapid prototype but it is obscenely difficult to control it and create a feedback loop for it to manage power controls and auto balancing features so that you can actually fly the thing instead of just spiraling out of control when you press the wrong button.

I have learned a lot about PID controllers and it's helped me get some basic principles down but its still quite hard to build a good flight system. There are a ton of floats changing all of the time and math bouncing off all kinds of other variables. Surprisingly this isn't as difficult in code but PlayMaker does not have an equation action to rapidly do an equation and store the result, you have to multiply, subtract, add, divide all as separate actions and floats and that is quite cumbersome when you have a lot of math going on and need a bunch of calcs done on every frame. Notably, this is only the second time i've been disappointed in any way with PlayMaker since I got it in 2011 but it is mortal after all.

But I did seem to be able to keep it pretty modular, almost everything is based off of the mass of the ship and there are a few principle floats that control the bulk of the background calcs related to power control and magnitude of player input so I'm pretty happy about that, I just hope as I continue that I can carry that ease of use into the autobalancing system and other features that will be in the kit.

Eventually, the prototype for the flight system will be posted on the PlayMaker forums for other PM users to delve into and use for themselves.