A real-time strategy game where you design airships and then fight with them. The aim is to have pretty chaotic explodey fights and interesting ship design choices.

Post news Report RSS Landships Dev Blog 1: Sproing!

Having covered the kind of stompy war machines I want to make in the last blog post, let's get into how to implement them.

Posted by on

Having covered the kind of stompy war machines I want to make in the last blog post, let's get into how to implement them.

Mostly, landships and airships can be treated the same. Buildings are technically a kind of immobile airship, so landships aren't much of a stretch. The difference is that a landship is held up and propelled by tracks or legs, rather than through Suspendium and propellers.

The question is how the ship navigates changing terrain. What happens when there's an upwards step? A real vehicle tilts when it drives up or down a slope, but the game engine can't support rotation of ships without massive complication.

On a slope, I want to keep the body of the ship level, but raise it up gradually so it can adjust to the new terrain height. To do this, I add a suspension, a set of springs that raises the landship off the ground. The ship won't bump against minor changes in terrain, and its vertical position gets smoothly adjusted. The springs aren't real physical objects, so they won't bump against the side of a hill. The tracks or legs the ship uses will get drawn on top.

This is what happens when the ship encounters a step upwards: As the springs move across the ground, the first one encounters the new height. It becomes more compressed and the additional force starts shifting the body of the landship upwards. As more springs move over the new area, the ship keeps on rising. Of course, if the hill is too steep, or the ship too heavy for the springs to push it up much, it will get stuck. But that's fine, that's realistic.

It also works when going down, though again the ship can get stuck if it doesn't have enough clearance.

So let's start implementing these springs, which will be attached to new tracks/legs modules. I start by creating a Spring class and putting in code so it can find the closest bit of ground. That gives me the length of the spring, and from that the upwards force the spring exerts, which can be easily plugged into the physics engine. Create a test module and put it on a building - and it sproings up!


Great! The next step is to actually introduce landships as a type of construction, beyond ships and buildings. Turns out that lots of things key off "is it a ship or a building", which is too specific. What matters is "can it move" and "does it fly", which nicely separates airships, landships and buildings in how they need to be treated.

Next time: Creating some basic landship modules that are able to both hold up and propel the ships.

Post comment Comments
***Geroj***
***Geroj*** - - 2,161 comments

Yeah but that "foot" or wheel will be huge weakpoint for any landship, like few hits and you immobilized something that rely on mobility (if I compare it to today tanks) to survive on battlefield

Reply Good karma Bad karma+1 vote
TL_ARMY
TL_ARMY - - 61 comments

Actually no. There are few solutions to prevent that for example. Hideous or well armored spot. Cannongs might not even target that area.

Reply Good karma Bad karma+1 vote
***Geroj***
***Geroj*** - - 2,161 comments

"Hideous or well armored spot" means
Armored feet or wheel is heavier -heavier is slower, slow advancing huge-*** tower is perfect target for everybody on battlefield
"Cannongs might not even target that area."
Why not? Its like number 1 on list of tank warfare -destroy tanks tracks, immobilize him and finish him from side or rear or just keep distance from his weapons

Reply Good karma Bad karma+1 vote
Slaineify
Slaineify - - 37 comments

Nice

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: