Sunday, October 13, 2013

Oomph goodness

Physics, space, and science.

Oomph spawned from working on a Hover Ship system with the Brevis project, then eventually I realized that firing lots of missiles, blowing things up and flying through space at high speeds was much more fun than throwing boxes around with the force. So I switched gears and moved on to Oomph.

After throwing together the physics side of things for Oomph, testing, testing, re-testing, changing, fixing and testing that ship more and more I started to get pretty tired of looking at it. That silly ship and its pointy, low poly, projecting wings and ... stuff.. whatever those pointy things are. (you'll know if you had kept up with things on the Playmaker forums)

So I manifested a new ship and in doing so began to wonder how the next iteration of the shop was going to work. Currently you could make 3 things, [1]Hull, [2]Engine and [3]Wingset. This worked fine for testing purposes since the ship would grab the engine and wing data and figure out the horsepower that puppy was pushing and what pewpew to make it shoot.






But, this did not appease my inner nerd! Nothing mounted dynamically, everything was based on object prefab pivot points, you couldn't change the weapons from the wingset and it would not allow much diversity long term.

Then came the glorious day I overhauled the shop (like... friday).




Now the menu is way more comprehensive, you can change the left and right wing independently, weapon mounts now exist, you can mount them on any wing, the weapons know if they are supposed to be in firing group A (left click) or group B (right click) based on their mount point, every mount reads its parent object and figures out where it should be, how its rotated, builds the thrusters on the fly, and the best part is that as long as I name the hardpoints correctly in the prefab then I don't have to do anything more than add a GUI button in the shop for any new Hull, Weapon, Wing, or Engine that I create from now on.

BAM, SON.





Needless to say, I thought this was pretty cool and was pretty surprised that the beer I was able to pull it off and get things actually working as intended. I learned a lot about using temporary variables and generalizing state machines for purposes while parent states define the properties for them to execute and now my shop does my bidding. HA!



If anybody has questions about how this works feel free to post up or find the downloadable project with all the assets on the Playmaker forums.

No comments:

Post a Comment