[Ship Design] Acceleration Formula?

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: elliotg, Icemania

Post Reply
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

[Ship Design] Acceleration Formula?

Post by Pymous »

Hi everyone,

I am looking to mod the game but I can't find the formula used to obtain the "acceleration" value of ships.

After many tests I found that this value seems only function of:
- Engine Thrust power (only the max thrust)
- Mass
- Reactor Energy Output
- Engine Energy usage

Can someone help on this subject? I need the formula in order to determine if it is possible to mod the game to design ships with low acceleration value (<10) but with a high max or cruise speed (around 2000 for example).

In fact I would like to simulate a max speed corresponding to more or less a "speed of light" value but with limited ship acceleration so it takes for exemple few seconds or minutes to reach this "speed limit".

By the way is there some kind of agreement about the "default" Light speed value in vanilla game?

Thank you!
Hopefully someone found this formula or even Erik can help directly?

EDIT:
Here is the Formula!
Thanks to Eliott Himself!
quote:

The basic acceleration formula is as follows:

accelerationRate = ((topSpeed / 8) + 0.5) * accelerationFactor


This defines the rate of acceleration in units per second.

The accelerationFactor value above relates to the ratio of total reactor power output (less static energy requirements) to total engine power draw at full speed. The formula for accelerationFactor is as follows:

accelerationFactor = ((reactorPowerOutput - staticEnergyConsumption) / engineEnergyDrawAtFullPower)


There's a further condition when spare reactor power is greater than engine power draw (which is usually how ships are designed):

if (accelerationFactor > 1)
{

accelerationFactor = min(2, sqrt(sqrt(accelerationFactor)))

}



In summary, I don't think you can easily do what you're after here. We've deliberately made it hard for players to stuff up acceleration in their ship designs (i.e. by having ships with very slow acceleration).

You could however play around with having high energy draw for engines, and/or with low power output from reactors.

Sorry about that.

Elliot
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
User avatar
Osito
Posts: 878
Joined: Thu May 09, 2013 8:55 am

RE: [Ship Design] Acceleration Formula?

Post by Osito »

You can find some earlier discussions on these issues here:

tm.asp?m=3494716&mpage=1&key=cruise%2Cspeed&#65533; - see the final post, in particular.

tm.asp?m=3615456&mpage=1&key=&#65533;

I never had the patience to try to work out the formula for acceleration, especially as it doesn't seem to be based on Newtonian (or 'Einsteinian') physics.

I don't think it's possible to have satisfactory scaling between sub-light engines and warp engines, at least not without having a very small 'galaxy' size. However, you can certainly have very high speed sub-light engines, as you may have discovered. It's quite amusing because at very high speeds, the AI ends up spiraling around its destination as it tries to slow down.

Osito
Osito
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: [Ship Design] Acceleration Formula?

Post by Pymous »

Thanks for your response Osito,

Indead I have read all your posts on such related topic (I agree with your modding experience and ideas toward more "realism" :) ) and spend time searching any response to this question. Unfortunately it looks like nobody managed or tried to find this formula.
I also experienced the "infinite looping ships" when the speed is too high.:)

Hopefully someone will manage to find the formula for acceleration or Erik will give it to us.




[Mod]Shadow Stratagems Artpack for Shadow Empire game.
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: [Ship Design] Acceleration Formula?

Post by Pymous »

Ok, looks like I made some progress :
If you have enough energy output from the reactor (haven't checked for now how to calculate it), the formula for acceleration is something really close to:
Acceleration = (0.5)*(mass)*speed^2)/(max energy usage)/ 100000

To the result you add more or less +1 (still dont know why)

I am still working on it, haven't checked on a complex (real) ship and don't know what the "100000" corresponds to.

Image

EDIT: The formula still works with a "real" ship from my "modded components test-game" but If I switch to a normal game, the formula don't work. So I suspect I need to find what the 100000 corresponds to in my simplified modded test-game and find also to what correspond the small +1 difference I observe on final values.
In fact if I decrease the engine Thrust value (from 50000 to 3000 for example), my formula broke too.

Any help is welcome!
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: [Ship Design] Acceleration Formula?

Post by Pymous »

I think I made some progress again.
I probably got one part of the equation:

If the reactor has a very high power output, the formula is:

Code: Select all

((max speed)^2) / (Max thrust * (4/total mass))+1
It works most of the time with any design as long as you have a design with a high energy output (excess energy output)

But still haven't found how to inject this reactor output value in the equation.
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
Aeson
Posts: 786
Joined: Fri Aug 30, 2013 7:36 pm

RE: [Ship Design] Acceleration Formula?

Post by Aeson »

I would point out that the formula for maximum speed is [total maximum thrust] / [total size], and so your formula simplifies to ([total maximum thrust] / (4 * [total size])) + 1, or alternatively that your formula is ([speed] / 4) + 1. While I cannot be certain, I rather doubt that the formula you gave is the one used.
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: [Ship Design] Acceleration Formula?

Post by Pymous »

Hi guys,

I contacted Eliott and he gave me a nice detailled response! Thanks to our great DW creator!
I copy-paste the response below:
The basic acceleration formula is as follows:

accelerationRate = ((topSpeed / 8) + 0.5) * accelerationFactor


This defines the rate of acceleration in units per second.

The accelerationFactor value above relates to the ratio of total reactor power output (less static energy requirements) to total engine power draw at full speed. The formula for accelerationFactor is as follows:

accelerationFactor = ((reactorPowerOutput - staticEnergyConsumption) / engineEnergyDrawAtFullPower)


There's a further condition when spare reactor power is greater than engine power draw (which is usually how ships are designed):

if (accelerationFactor > 1)
{

accelerationFactor = min(2, sqrt(sqrt(accelerationFactor)))

}


In summary, I don't think you can easily do what you're after here. We've deliberately made it hard for players to stuff up acceleration in their ship designs (i.e. by having ships with very slow acceleration).

You could however play around with having high energy draw for engines, and/or with low power output from reactors.

Sorry about that.

Elliot
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
User avatar
Osito
Posts: 878
Joined: Thu May 09, 2013 8:55 am

RE: [Ship Design] Acceleration Formula?

Post by Osito »

Hey, that's really nice. You should ask Icemania to link this post in the 'Guide to Guides'.

Osito
Osito
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: [Ship Design] Acceleration Formula?

Post by Pymous »

Unfortunately like Eliott explained, speed and acceleration rate are intimely linked. I tried to play with the formula, but in fact the max time to reach full speed from 0 to any speed limit you would fix yourself tend to 8sec at maximum (because if you don't have enough energy output, you decrease also the max speed limit). We can't decorelate max speed from acceleration, theses two properties are linked...

So I can unfortunately forget the mod I was planning to work on for DW (main objectives: fix some kind of max speed value for any ships, but allow variable and wide different accelerations rates so with some design you would need 30 or more sec to reach full speed. Maybe even fixed max ships size for any kind of ships and have new technology that would reduce components sizes) until we got some kind of modding access to base formula to main mechanisms of the game (but I doubt we will get it for DW1. Maybe for DW2?).

It's a shame due to potential DW would have as a game/mod engine.
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
Post Reply

Return to “Design and Modding”