Devlog #16 - Juice

A big, big thank you for all the feedback. I've taken it all on board and I think the vast majority have made it either into the next big release or the ideas backlog. I've started with the most important thing: it's a bastard to drive. While it's a bastard to drive then everything else: fighting, exploring and collecting Flotsam is a pain in the arse. Get it right or go home.

Physics changes

Originally, each Boiler Chimney would only provide force and mass. The top speed of the cloudship would be set as whatever the Unity engine would make it go. What this meant was that if you set the forces to give a reasonable top speed then it would accelerate REALLY SLOWLY. If you set the forces to make the acceleration feel better then it would end up doing warp 9 across the map. Funny but no easier to stop because at warp 9, you still have the same forces slowing you down. There is "drag" in Unity but it's a constant: if you stop putting force into an object then it will eventually come to rest. We do need that but we need something more...

So I introduced a new factor of top speed, which increases with each boiler with a diminishing return (IIRC the 6th Boiler you add only half of what the first boiler gives you). If you try and set a maximum speed in a physics engine, it goes mad. So what I did was add a force in the opposite direction that was proportional to the top speed. The faster you are going, the more this force is until the force holding you back is the same as driving you forward. Now I can set the force for acceleration as high as I like, knowing that as it reaches top speed, the force in the opposite direction will be the same.

I tried making a video to demonstrate this but it was difficult to see, it's more of a feeling thing. It handles very, very differently. Better, I hope.

Juice

Juice is the term that game devs give flounce that helps the player connect with the game. It might be little user experience bounces, flashes, trails, lights, etc. Lots of things count as juice and I've come to discover that it's really, REALLY important. I've been learning about juice recently, mostly via example as there are no hard and fast rules. Perhaps my physics changes above were juice? Juice tends to be subtle and the change I've made to flying physics isn't.

The rest of this post are juice things. Stuff you guys all instinctively know about and suggested in feedback but juice nonetheless.

Smoke, Steam and Wobble

Smoke now pours from the stacks relative to your throttle and steam from the vents on turning and moving. It's not perfect but it's something so far. Adding the smoke makes it easier to see how you're skidding through the sky. The cloudship also rocks under throttle, you tip up when you accelerate and dip forward if you decelerate.

I've not got a good video of it happening, instead I decided to take one of other stuff...

Cannon range

Bear with me on this one. At the furthest range, cannonballs take 8 seconds to reach their target. By the time they get there, the target has moved. When two Cloudships were closing (RAMMING SPEED!) head on then both would shoot over the top of the other. When running away, they would undershoot. Even if I make elevation controlled by the player (which is easy, I might still do that), the enemy still needs to range find automatically.

So what I needed was a way to say was

Set the elevation so that if I fire a cannonball right now then it will land at the place the enemy will be by the time it gets there.

I'm rather proud of the solution. Cannonballs are fired with a constant force (for now) so I can make a lookup table of range, time in the air and elevation. Before the cannonball fires, I find the range of the target as it is now. From that range, I can find the time of flight. I then take the position and velocity of the target and make a new predicted location:

predicted location = current location + (velocity x time of flight)

I can then use that predicted location to give me an elevation to shoot the cannonball at (using the same table). Now, if the enemy turns then so be it. That's for the player to anticipate. It's not very precise but it's good enough. The targets are large and this only really matters at range. The game is more about putting as many cannons on as you dare and then blasting the hell out of the enemy.

Let's look at it in action. There's rather a lot going on this video, which is the debug camera in the scene window, not the running game. Firstly, the enemy's cannon elevation is not working (fixed since) and because the enemy turned at the start, my cannonballs are sailing past. I've switched off wind and I'm not moving, that's why there's idling smoke coming from my Cloudship while the Enemy is at full throttle (it always is right now).

The green ball hovering in front of the enemy is the predicted location and the big green circle is the range that I get from it. You can see how the green ball does a reasonable job of being where the enemy is going to be. The red lines that blink are the rays checking that the cannon isn't behind super structure and the black line out of the enemy is the top speed limitting force that I mentioned earlier.

Another thing I need to fix is the cannon elevation needs to be relative to the world and not the cloudship. You can see the enemy tilt right over and when it does that the elevation goes wrong! That's easy to fix.

I need to test with some gunship configurations but I think this works a treat.

Puffs and Bangs

These past couple of days I've been experimenting with particle systems. Again. Still. I've managed to get the cannonballs to have a bit more to them. They now puff in the sand:

They look dark in the video because they are lit, needlessly. I'm still toying with that. They also explode when they hit something. This effect I do like:

They need sound before they are properly satisfying and I am tempted to get them to give the Cloudship a little bit of torque force to make it rock. As I build and experiment more with Particles, I'm not yet going back to change other ones (even though I don't like them). I'll wait until my skills are honed and then redo the lot; there's a huge propensity for fiddling with the different settings and I want to leave that until later. Juice first.

Next up

Unity want me to make a minimal project to demonstrate the problem I was having. So that's next. Then some claw enhancements. At that point, I might make another release for anyone who's interested.

Comments

I tested with a gunship this morning. I managed to keep the enemy at a distance while I collected and built. Managed 7 cannons on the front (because I had a bug to repro), turned, unleashed and the little chappie went down like a sack of potatoes.

There's some side-effects to my design, though...

If you line up the chimneys in a straight line (rather than Big-R's edge idea) and point the cannons straight forward then lining up a shot is tough because of all the smoke! Something to think about.

I also turned off the random "variable power" of the cannonballs, so they look a bit weird all flying together. Easy to fix.

The enemy is woefully under thrust and over torque. Either I broken it when I was messing with the physics (possible) or it's that the chimney on the enemy is actually its own separate instance of a chimney because of how Unity deals with prefabrication (they're changing it in the next release). Don't think that's a disaster, though.

If you put 5 chimneys on it and a few cannons, it goes like a sodding rocket. I tried putting on broadside cannons and - if you're faster than the enemy - you can do laps round it. Haw haw. You do take hits because it has cannons facing all directions but I don't mind that.

When near-stationary and guiding in over Flotsam, it would be handy to have a wind indicator. The smoke isn't bad but I think something on the compass would be easier.

brainwipe's picture

Oh and I sent off the minimal project to Unity.

brainwipe's picture

Cheeky!!!

Zoom in!

brainwipe's picture

The thought of getting back into Cloudship after a two week illness-enduced break was hard. Fortunately, the tasks on the board looked like fun. The first, kinda-important-but-not-really was to make enemies "drop" flotsam when they die. Right now, it just spawns them in an ugly way. I'm trying not to do too much graphics-ness until I decide to take the next step into putting work into the models. The dropped flotsam has twice the value of normal flotsam.

There's a few other bits I've done too: mousewheel camera zoom (you can see that in the video above if you look carefully), made the claw longer (still takes skill but you can go faster while collecting), enemies run away downwind (surprisingly effective if you don't give chase sharpish). Along with a bunch of bugs I caused too.

There's only two things left and, in reality, the second one can be bounced as I'm waiting on Unity. It can look odd when the smoke jitters but I don't think it's a disaster.

brainwipe's picture