Gamedev Diary – SpaceLife #2

Well, that was five minutes well spent!

In the last post, I mentioned moving the ship’s physics code into the BaseShipProperties class (I think it’ll better called ShipController, don’t you?), and it’s liberating! I’ve made the main input handler smaller – a good thing, because I think we’ll be adding more to it. This allows us to easily use the same ShipController as an AI bot, sending it thrust, roll, pitch instructions without replicating the movement and intertial dampner calculations. Also, I don’t care to know what the max speed is in the camera controller, that’s upto the ship, so I don’t Clamp() it here.

Improved camera controller

Whilst I was testing my scene, I thought I’d have a look at the stats tab, and wow, 30 draw calls (aka SetPass)? I narrowed this down to the OnGui() function which had all my scene buttons in it created by GUI.Button(). Removing the buttons reduced the draw calls to 9. Much better. #oneToWatch. The funny side of this is that I had noticed juddering, so I looked into the draw calls to see if something strange was happening. Then I noticed the GUIText() culprit, but even then the program was juddering. WHY?

Well, I was running another windows 10 hyper-v session in the background that I’d forgot about. This dell laptop is amazing with its NVIDIA GeForce GTX 960M, but I should give Unity a fighting chance!

As you may notice below – I’ve found some cool font to show in HUD, maybe it’s temporary, but maybe not! It’s pretty nice. http://www.fontspace.com/nimavisual/moonhouse. Let’s hope meters per second is enough. Or do you like miles per hour? I guess it depends if my ancestors have pillaged your country or not.

newfont.png

Particle article…

Oh my, particles are fiddly beasts aren’t they? My first outing with the particle system, and I think I only achieved this by copying the standard Asset for the aircraft jets, and tweaked it a little. I think I need to spend a good few hours watching tutorials and playing around to get effects combined that produce something lovely, I’ve managed this so far – next step to make the length adjust with the speed (madness in space, it makes no sense!). The question is, should I add jets for rotation, pitch and reverse thrust? Maybe overkill.

2016_05_18_20_06_06_Unity_Personal_64bit_SkyboxTestScene.unity_SpaceLife_WebGL_DX11_.png

Hmm.. The choices you have – does the jet size relate to how much you’re trying to accelerate or thrust? That would certainly be the case in the real world of space physics. But it doesn’t work so well in games. It will mean that if we are going our top speed  we will have no jet. So, maybe we’ll do a bit of both. The jet should depict how hard we are trying, and as we reach our target speed, we settle down to a size proportionate to our speed. – I’ll give that a go and see! Oh the fun!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s