Tuesday, October 29, 2013

Ammunition, Weights, Names and Sounds

We haz ammunition!

I got a basic ammunition system put in today. Each Hull and Wing has a max capacity for ammo and this is combined to give you a max ammo capacity when you finish building the ship and go to fly it.



Now the trick is setting up good scales for figuring the weight of the parts in conjunction with ammo capacities. I figured out some basic numbers but they need to change, I think.

(Base item weight) + (Ammo capacity) = (total weight of part)...... Or.. (Ammo capacity * 2) as currently the i'm assuming you need more mass/volume to support storing more ammunition and I just made them equal to keep things simple for now.

You can also run out of ammo and make the guns upset at you so they quit firing. Thats no bueno dude.

We haz weight!

It was pretty much just as easy as I had hoped, too. I gave all of the parts a weight float and grab that at the build time for the ship. It takes that total weight, divides it down (*0.05) to a magical number near what I want the mass to be and changes the Mass property of the ship's rigidbody component.


What I haven't done is have it update the ship's Mass every frame so you lose mass when consuming ammunition. That would be kinda neato, eh? Slug on over to the baddies, drag your direction into firing vector, unload gratuitous ordinance and feel the weight of a thousand suns lift from your figurative space shoulders while your top speed suddenly grows to 5x its previous amount.

Or, alternatively while trying to dogfight someone it is continuously screwing up your aim by changing the mass and directly affecting your control responsiveness.. Not so cool in that sense...

Names and other stuff

I laid down the basic variables for naming parts and all of the data I think I'll need to take the hangar GUI to the next level but I'm not sure if I want to do it for the free package since I want to use RageSpline for it and the regular GUI wouldn't improve much. I'll probably just leave it alone for now.

It should be gravy when I get it going though... Just mirror the variables into a hover box when you are building the ship or something. Who knows what it'll end up looking like.

There were a bunch of graphical changes on this build, new rocket models, effects, testing some things to see how they look, adjusting point lights on weapon effects, changing material/texture appearances etc...

Sounds... Oh those evil sounds...

Trying to get sounds to cooperate is not fun. Props to anyone making sound games or making games on a physical scale that is not normal. Anyone with tips/links on getting sound customization under control and making it do what you want with falloff, distance, parenting, etc.. please feel free to message me.

You can check out the WebPlayer Link if you want to see the changes.

Monday, October 28, 2013

Coherent design is melting my brain

It starts pretty basic most of the time, you get an idea, start working on it, fix a few hurdles and adjust some ideas, make some great progress and then hits some evil wall that you never even saw coming and will need to start reworking systems or designing things totally differently.

In my case its these model constraints on the ships. I've been deliberately making the shapes weird to try and identify where I would have problems (I secretly love being angry and frustrated all the time) and go figure I'm running into issues with size and placement of models on the hardpoints when they're mix-matched. For instance making a long hull and putting the mounts for the wings near the back of it, then realizing they clash with the engine if you use the wider, larger engine but everything is peachy on the short hull with the mounts in the middle. Is that a problem with the mount location? The wing length? Hull length? Engine width? Theres so many factors it can get really difficult to choose which one to clamp down on to get good design constraints.

I look back to Black Prophecy (2010 -2011 space action game with a ship customizer much like this) and wonder how any of those guys managed to stay sane while doing this. They had the same diversity in their model combinations but I suppose they just made tighter constraints for sizes of things to keep it all in order. I'm still just amazed that they could have so much ship diversity and fluid design without clashing parts all the time. Too bad it flopped.

I hope I don't have to keep redesigning the ships. It seems that I'll need to sit down and define maximum sizes for a lot of mounted items to prevent overlapping and clashing.

On the up side I did make some new models for Oomph and get them loaded into the webplayer. There are some more functional camera controls in the pipe that will allow you to view the ship better so you can get a good look at the new weapons, hulls and engines. You can also now change your thruster color values thanks to Jean for some cool new HSV Color Actions. I had been messing around with adjusting those colors with GUI sliders last week but it wasn't working out. His actions made it much easier so check out the color slider to change the thruster colors! =)

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.