Basic Ships Data (Physics vs. Cargo capacity)

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

Hi,

just wrote a php script to get some data out of the extracted xml related to cargo capacity and ships physics for further use. My purpose was to have a data basis to make some calculations and decisions to optimize my Mining/Trading-Fleet.
The advantage to make use of the game ships physics (Mass and Drag) properties instead of many different Engine configurations is obvious: "Just compare the potentials instead of many different configs."


SHEET (Import from CSV Data Script Output)
https://docs.google.com/spreadsheets/d/ ... sp=sharing




4 the coding folks among us pls take the the following Sauce:
The whole thing would be faaar more interesting with additional aspects like fuel consumptions and upholding costs etc... but x4 don't have such things.... Anyway...
Pls. don't critique my coding :) Don't had the plan to make it beautiful for a showing around, but how ever, here it is and free for use:

PHP Script (Runned with XAMPP Local Environment. Change the path (Line:3) to Your local (extracted) x4 dir)

https://pastebin.com/EdGWuEGV
Last edited by nonnex on Sun, 6. Jan 19, 01:07, edited 36 times in total.
StormLightning
Posts: 21
Joined: Tue, 25. Dec 18, 12:26

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by StormLightning »

Very informative! Thank you!

Clears up some things I was wondering about and, hopefully, will help me with my mod.

Regards,
SL
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

Glad to hear it has some worth.

Remember:
Accel/Decel = Thrust_Engine * Num_Engines / Ship_Mass
Max. Speed = Thrust_Engine * Num_Engines / Ship_Drag

If we substitute Thrust_Engine with a fictional Value (like 1000, just for human readable results) we will get an indicator. If we further use those values in conjunction with the cargo capacity then we will get an idea of efficiency regardless what type of engine we choose.

A) To be more accurate we could include the Ship-Mass acceleration/deceleration as a multipicator too. I would be in favor with a factor of 1/2 (0.5), because of time of decel = accel? (Conservation of energy). The perfectionist would take the inertias into account as well.

B) The "Travel speed" potential of an engine should also be related to the physics Drag (Not checked yet). So, within this theory this should be covered by this approach, too.

Wish you good progress and all the best with your mod.
Last edited by nonnex on Sat, 5. Jan 19, 21:58, edited 4 times in total.
User avatar
thomassanford
Posts: 77
Joined: Tue, 17. Sep 13, 01:43
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by thomassanford »

This is a very cool overview of the available ships. Thank you! I will say that as far as optimizing a fleet right now movement is free as far as resources are concerned. So, we are only talking about time in these physics calculations not energy. We have to take into account the AI's navigation ability\habits (Don't laugh they WILL learn to fly eventually). The points is with my own fleets around stations and each, other particularly if you are in system, it seems the drag on all axis may actually effect the overall performance due to just take off and landing operations. I hate to abstract concrete information, however it may be worth while to create an average 'agility' rank based on the drags.
Thanks again!
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

Well, in this case the AI does not matter, because it behaves like it behaves no matter what ship it is used. Ok, maybe some would say the larger the ship, the nastier the AI does act. But in the end it is a factor that can be saftely crossed out of the formula from my point of view, because it effects all of them in the same way (more or less).

On the other hand the energy aspect that you have mentioned has come to my mind too.
It would alter the trading and fleet management to another level. Plus, I would add upholding costs for the crew (and other things) to give the whole thing a more spicier taste.

For basic agility just use the mass as a factor not drag. Moment of intertia and so on...

for detailed agility data I or you could add the inertia data in the script for every ship too. Data is there in the xml.

For example:
ship_arg_l_trans_container_01 | Inertia : pitch="175.799" yaw="175.799" roll="140.64"
Last edited by nonnex on Sat, 5. Jan 19, 20:39, edited 1 time in total.
User avatar
thomassanford
Posts: 77
Joined: Tue, 17. Sep 13, 01:43
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by thomassanford »

:wink: I had been looking into this if you can not tell. I think it would be an interesting mechanic. You did get the point the AI gets really stupid in the L and XL ships and improved directional control will increase there overall performance given no energy cost. It was just my observation no offense intended as I do see the logic as sound. It just seems if you are calculating Wares\Time you need to know where your time is going. The code also contains the thruster information.

Code: Select all

<drag forward="5.443" reverse="21.773" horizontal="13.85" vertical="13.85" pitch="9.897" yaw="9.897" roll="9.897" />

The questions I have for someone who has seem more /aiscipt or observed more than me is how the AI navigates. Do the tend to strafe or turn? that kind of thing it is very interesting stuff to watch.
Last edited by thomassanford on Sat, 5. Jan 19, 20:49, edited 1 time in total.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

Indeed, I have observed the same thing and asked myself. What would be better. 10 Magpies or one slow and big L ship for the "same trade".
In the end my conclusion was that 1 Large is easier to manage, but has its Ai flaws. On the other hand 10 magpies trying to land and deliver the same amount on the same station hav their flaws too. :)
In total its nearly the same time consumption.

therfore I decided to cross the Ai out. Not just because we have no constants to take into account for the Ai behavior.

PS: I'll add the inertia data to te script now. More data cant hurt.
User avatar
thomassanford
Posts: 77
Joined: Tue, 17. Sep 13, 01:43
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by thomassanford »

:lol: We are on the same page .. I went the 10 medium route due to speed however. Keep up the great work.


Edit - this was a stupid comment given the subject I mean 'apparent speed' of course just from observation in my own game. More Data is always more Better :)
Last edited by thomassanford on Sat, 5. Jan 19, 21:46, edited 2 times in total.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

ok, done the changes.

Now all Drag directions and Mass Inertias are included.

See the updated sheet, results and script in the original post links.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Basic Ships Data (Physics vs. Cargo capacity)

Post by nonnex »

Update
- Added Mass Inertias and additional Drag factors.
- Added Hull Information.

See Links in the Original Post.

Return to “X4: Foundations - Scripts and Modding”