From The Depths – Fundamental Guide + LUA Protocol

From The Depths – Fundamental Guide + LUA Protocol 1 - steamlists.com
From The Depths – Fundamental Guide + LUA Protocol 1 - steamlists.com

A comprehensive guide about how to make sure your vehicle doesn’t behave like a rock.
 
 
For beginners and experts.
 
 

Introduction

There are 3 types of objects in the game:
 
– structures, that don’t move, so we don’t care about them in this guide
 
– fortresses
 
– vehicles
 
 
Let’s get rid of fortresses in the intro: their only “propulsion” block is the fortress turbine. You use either an AI with the fortress maneuver or a fortress controller. You don’t need to set up anything. Fortress turbines use engine power. The further the fortress is from sea level, the more power they require. The more mass, the more power is required. The more fortress turbines, the more efficient they are. If your fortress turbines run out of power, the fortress starts to take damage.
 
 
So keep your fortress at sea level and scale the engine power and the number of fortress turbines with the mass of your fortress. That’s all for fortresses, thanks for coming to my TED talk.
 
 
The rest of the guide is about vehicles.
 
 
 

Fundamentals

Center of mass.
 
 
The center of mass is the where the mass of your vehicle is located in average (it’s a barycenter). You can easily find it in build mode, it’s the blue mass with “Center of mass” written on it.
 
 
From then on, you can abstract your vehicle as a sphere with the center of mass at its center.
 
 
There are 6 possible movements: 3 rotation axes, and 3 thrust axes.
 
– forward/backwards (thrust axis), when your vehicle moves forward and backwards. It’s generated by a thrust aligned with the center of mass behind or in front of it.
 
– strafe right and left (thrust axis), when your vehicle moves right and left. It’s generated by a thrust aligned with the center of mass to the right of left of it.
 
– hover up and down (thrust axis), when your vehicle moves up and down. It’s generated by a thrust aligned with the center of mass below or above it.
 
– yaw right and left (rotation axis), when your vehicle turns right and left. It’s generated by a thrust perpendicular with the center of mass in the horizontal plane.
 
– pitch up and down (rotation axis), when your vehicle looks up and down. It’s generated by a thrust perpendicular with the center of mass in the vertical plane (the one that divides the vehicle into left and right).
 
– roll right and left (rotation axis), when your vehicle leans right and left. It’s generated by a thrust perpendicular with the center of mass in the vertical plane (the one that divides the vehicle into front and back).
 
 
The entire point of propulsion is to control those 6 axes, decide what you want to do with them and how.
 
 
Thrust:
 
 
Thrust is a force. When applied to a vehicle, it creates acceleration. Acceleration = Thrust/Mass. A vehicle twice heavier will require twice the thrust to have the same acceleration. So here is already a lesson on how to build a vehicle: reducing the mass of a vehicle makes it more nimble.
 
 
Gravity: in FtD, gravity is a downwards force. It stops at around 1200m of altitude and reappears at 1800m.
 
 
Buoyancy: buoyancy is an upwards force applied to every underwater block. It’s the difference between the weight of a block and the weight of the same volume in water. It also works with the helium pump but with air.
 
 
Drag: this is the first thing a bit subtle so far, so keep attention. The speed of your vehicle is separated into 3 components: a forward/backward component, a strafe component and a hover component.
 
 
Drag is a force applied to each of this component individually and here is how it works: it’s a force proportional to the velocity of this axis AND proportional to the frontal drag factor of that component. The drag factor is how aero/hydrodynamic the shape of your vehicle is, and is determined block by block. Some blocks require clearance to apply their drag factor or they will apply full drag. I call frontal drag the face of your vehicle that goes directly into the drag. But here is the subtle thing: there is also a side drag which is strictly proportional to the cross section of the sides.
 
 
What this means: a very narrow but very long plane is going to experience a lot of side drag when moving forwards, which means your vehicle must also be relatively short. So you have to keep a balance between cross section of your vehicle and its length in order to reduce its drag as much as possible.
 
 
Maximum speed:
 
Since drag is proportional to speed, that means maximum speed is reached when thrust is no longer stronger than drag. So maximum speed is when Thrust = Drag. So to increase maximum speed, you have either to increase thrust, or reduce drag, and both of them will find a new balance at a higher speed.
 
 
Top speed: Most propulsion blocks have a top speed value. Top speed is the speed after which the propulsion block suffers a reduction in thrust. So it’s possible to go higher than this top speed but the block will become less and less powerful. Beware: this applies to every propulsion blocks, so if you go really fast and control the rotational axes with propulsion blocks, you can lose control of those axis (because the blocks become too weak).
 
 
 

Propulsion blocks

In this section we will take a look at all the different blocks
 
 
All propulsion blocks have listening axis in their menu. Do not forget about setting them, we will talk more about them in the AI section.
 
 
Dediblades/Heliblades:
 
 
If you put down a spinblock (set in continuous mode) and put heliblades on it, it’s called a rotor. Dediblades are the blocks dedicated to easily do rotors, but they partly work in the same way. The longer the blade, the more efficient it is. Dediblades/heliblades do not require engine power to work, but you can give them some engine power to make them stronger. There is a setting so that the force applied is always upwards regardless of the pitch/roll of the vehicle.
 
 
Sails:
 
 
Wind is constant and only depends on the world you have loaded in. Square sails need to be perpendicular to the wind while triangle sails have to be parallel. The more aligned with wind the sail is, the stronger the sail is. Sails only generate thrust in the direction they are looking. You can control the sail surface by putting a winch block at an extremity of the sail.
 
 
Steam jets:
 
 
Steam jets take steam from their steam system and turn them into thrust. Very inefficient. They have a pitch/yaw settings to adjust them.
 
 
Steam propellers:
 
 
Steam propellers take kinetic energy from the shaft they are connected to. You can use transmission blocks to increase efficiency from a piston-powered shaft, or use crank shaft to use engine power to power the steam propeller. Only works in water.
 
 
Custom Jet Engines (CJEs):
 
 
CJEs and small CJEs work the same. They use fuel and turn it into thrust. The design of the CJE changes its efficiency and its thrust density. Require the exhaust to be above water.
 
 
Air, helium pumps and balloons:
 
 
Yes, pumps can be seen as propulsion blocks. The more contained free volume around them, the stronger they are. However they only apply their force upwards through buoyancy (so only works in water and air). They don’t require any power. Balloons are essentially the same but outside.
 
 
Wings:
 
 
Wings generate upwards force proportional to the speed they are moving at. They have a setting to lower their force factor.
 
 
Paddles:
 
 
They paddle. I don’t know much about how they exactly work, but they can be used to either move a ship 19th century style or to make underwater “reaction” wheels.
 
 
Standard propellers, jet engines and ion thrusters:
 
 
They all take engine power to work. Propellers only works in water, jet engines in air and ion thrusters everywhere. They have a pitch/yaw settings to adjust them.
 
Those propulsion blocks have an additional feature: their scale factor goes up to x4 instead of x1. At x1, the power required is scaled by x1. But at x4, the power required is scaled at x6 (which means less power efficient). The default value is x4.
 
 
 

Control surfaces

Those blocks can’t generate thrust but can make your vehicle rotate.
 
 
Standard rudders:
 
 
Insert “You underestimate my power” meme here. Most blocks are well mannered. They either have a ceiling, scale linearly with volume dedicated to them, or scale with the speed of the vehicle. None of that with standard rudders. They scale up linearly with the mass of the vehicle they are attached to. Yup. And as explained earlier, acceleration is divided by mass. That means 3 rudders on a 25 millions material ship will have the same effect than 3 standard rudders on your canoe. Standard rudders are messed up. I would advise to keep your children away from them if you want your children to become upstanding citizens.
 
 
Custom rudders:
 
 
Custom rudders are passive blocks. You need to put them on a spin block (rotate to angle setting) and control that spinblock with a listening axis. They aren’t that efficient but look better than standard rudders.
 
 
Standard air control surfaces (ailerons):
 
 
You put them, their effect scale with speed. Don’t forget to properly set their listening axis and test them.
 
 
Custom air control surfaces:
 
 
Only 1 pivot is used per control surface, then all the passive blocks clip to the pivot
 
 
Reaction wheels:
 
 
Every object that applies a force on something has the opposite force applied to it. That works with rotation forces. So a spinblock that accelerates left will make a vehicle accelerates right. In FtD, reaction wheel are simplified: they apply a rotational force proportional to their rotation speed and mass (not their acceleration as it should be IRL). So you can control roll/pitch/yaw with a spinblocks with lead on it. Since they are spinblocks, you can dedicate engine powers to it.
 
 
The massive upside is that reaction wheels don’t require your vehicle to move to work.
 
 
Earlier I talked about paddles on a reaction wheel: if your paddle reaction wheel is axis-symetrical and fully underwater, then it won’t generate thrust but rotational acceleration.
 
 
 

Control and AI

Player control:
 
 
Chairs allow you to teleport to a vehicle so use them.
 
 
Then you need a vehicle controller. As far as propulsion is concerned, the other controllers are obsolete.
 
 
Vehicle controllers either have a ship mode or an airplane mode, but it’s just for convenience sake and doesn’t matter mechanically speaking.
 
 
The controller allows you to control listening axis:
 
– primary drive
 
– secondary drive (if additional drives setting is on)
 
– third drive (if additional drives setting is on)
 
– misc axes A, B, C, D and E (if misc axes setting is on)
 
– roll, yaw and pitch axes
 
– strafe and hover axes
 
 
The controller doesn’t allow you to control forward/backwards axis !
 
 
The 3 drives are values that you can control between -1 (-100%) and 1 (100%) and stay at that level.
 
 
However, when you press a key this sends either a -1 or +1 to the listening axis. So when player control is involved, it’s either -1, 0 or +1.
 
 
– hover up and down: down is -1 and up is +1
 
– strafe right and left: left is -1 and right is +1
 
– roll right and left: left is -1 and right is +1
 
– pitch up and down: down is -1 and up is +1
 
– yaw right and left: left is -1 and right is +1
 
 
Additionnaly, forward is +1 and backwards -1 on the forward/backwards listening axis.
 
 
Then you can set up your thruster/control surfaces to answer to those listening axis. A thruster/control surface can answer to as many listening axes as you want, but beware of being coherent. For example, an upwards thruster at the front-left of your vehicle can answer both roll, pitch and hover. And I actually advise you do to that. Refer to “Fundamentals” section to understand how the position of your thruster tells you what it does.
 
 
Control PIDs:
 
 
Finally, to help you control your ship, you can use Control PIDs. PIDs are mathematical tools that take an input value, compares it to a desired value and then outputs a value, and they do this overtime. That means that they can output any value they want between -1 and 1, giving them much more control and stability.
 
 
For example, you can tell a control PID to check the altitude above sea level, tell it you want that value to be 100 meters, and give it control of the hover listening axis. It will start to control the system.
 
 
You will most probably face oscillations: cycles in movements. To fix them, you have 3 settings: gain (how strong you want the reaction of the PID to be), derivative error (how much you want the PID to anticipate) and integral time (how stupid you want your system to be). Always put integral time to 250 (“Off”), the derivative time close to the time-length of the oscillation and finally reduce gain until there is no longer an oscillation (ideally between 0.01 and 0.1).
 
 
Why I feel so strongly against integral time: integral time integers all the error since the moment your vehicle is spawned. It makes sense in an industrial machine that does the same thing 24/7. It doesn’t mean anything in a vehicle which is engaged in a fight, and can take very different actions at different times.
 
 
Control PIDs act independently from anything and can only be turned off manually or with ACBs.
 
 
AI:
 
 
There are 2 important AIs within the AI: behaviour (what your vehicle tactic is) and maneuver (how your vehicle moves). What’s important here is maneuver AI:
 
 
– tank/ships: only controls forward/backwards and yaw axis, may control pitch if you tell it to do it in the settings
 
– airplane: controls forward/backwards, yaw, pitch and roll. The difference between the 2 AIs is that one uses roll to turn like IRL planes while the other only uses the yaw listening axis.
 
– fortress: already covered
 
– hover: controls all 6 default axis
 
– 6-axis: also controls all 6 default axes but I have never seen it being better than hover, so use hover instead (unless you know more than I do).
 
 
Those AI don’t tell you what to do, and you should see them as mechanics, not vehicle “identity”. For example, you will probably want to use ships/tank AI on an airship, and let a Control PID handle “Hover”. This will allow you to take manual control of the airship without crashing the airship in the water.
 
 
Submarines either use an airplane or an hover maneuver AI.
 
 
AI have a weakness: they can only output -1 and +1 like controllers. To fix that, you can give them AI PIDs. Don’t forget to activate them and adjust them.
 
 
Now with everything I have explained here, you should be able to make move anything you want the way you want. In the last section we will look at more advanced propulsion systems.
 
 
 

Spin blocks, breadboard and LUA

Spinblocks:
 
 
If you want, you can put thrusters on spinblocks. Players either call them “azipods” for propellers (like in the thumbnail) or “tilt-rotors” for dediblades. That means you can control the direction they are facing (or even their location in the vehicle if you are insane like me). To control those spin blocks, you can use listening axes. Or better, you can use breadboards. Or even better you can use LUA.
 
 
Breadboards:
 
 
Breadboards can do a lot of things and could have their own guide and probably have some, but here we will only look at them for propulsion and do a basic guide.
 
 
In the Inputs, you can choose the propulsion box. This box gives you the choice between the 6 basic listening axes, the 3 drives and the 5 misc axes. Put Inputs to the left of the breadboard screen.
 
 
Then in the middle you can put operators. The 2 most important in my eyes are the PID operator and the mathematical operator (the one that allows you type in any formula, you can do anything you want with it basically).
 
 
Then on the left you can put Outputs, Propulsion in our case. Beware, the Input and Output Propulsion boxes aren’t the same, so use the correct one.
 
 
Then connect all the boxes together as necessary.
 
 
With that, you can design your own AIs. You can control Spinblocks using the propulsion listening axes.
 
 
LUA:
 
 
The LUA box is a block that allows to type LUA code. LUA is a simple programming language, so look on the internet on how to code with it. There is a library of FtD-related functions that goes with it. Many are obsolete due to updates.
 
 
However, with a few tricks, it’s possible to control propulsion and spinblocks with the LUA box, and that allows pretty insane stuff. LUA can pick up the names of individual blocks, which means LUA can do anything you want with spin blocks and propulsion blocks with no limit in numbers.
 
 
LUA that automatically sets up all your thrusters (not by me): https://steamcommunity.com/sharedfiles/filedetails/?id=2429730986 – [steamcommunity.com] 
 
 
My propulsion systems mod (full 3D reaction wheels, 4 thruster drone-like system and 2-thruster unique system): https://steamcommunity.com/sharedfiles/filedetails/?id=2499162748 – [steamcommunity.com] 
 
 

Written by Julen

 
 
This is all about From The Depths – Fundamental Guide + LUA Protocol; I hope you enjoy reading the Guide! If you feel like we should add more information or we forget/mistake, please let us know via commenting below, and thanks! See you soon!
 
 


Be the first to comment

Leave a Reply

Your email address will not be published.


*