move.nohighway.html question

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

move.nohighway.html question

Post by Browser_ice » Mon, 9. Oct 17, 19:06

Hi, in trying to figure out the mining issues I had, I was tracing back all the actions one of my ships did and I found a lost of time in the log between boosting time and boost stopping. That ship was just one zone next to the destination but it took almost one hour just traveling around until it reached its destination.

I found the code below from move.nohighway.html and I am wondering why the loop was coded for 60 min delay ($booststart +1h) and why an additional 500s after. Looking at my log, it whent throught that loop without interrupting causing it to take at least 60 min to go from one zone to the next one. Why choosing those awful long times ?

Code: Select all

        <!-- fire up the boosters and go to the zone arrival position -->
        <set_value name="$booststart" exact="player.age" />
        <set_value name="$boostdistance" exact="this.ship.distanceto.[$targetzone, $targetpos]" />
        <debug_text text="'[Ship=%1, Moving] BOOOOOOOOOOOST! (Boost start=%2, Boost distance=%3)'.[this.ship.knownname, $booststart, $boostdistance]" chance="$debugchance" />
        <do_if value="player.ship == this.ship">
          <speak actor="this" line="1032" comment="Confirmed. Moving out."/>
        </do_if>
        <do_while value="player.age lt ($booststart + 1h)">
          <set_value name="$interrupted" exact="false"/>
          <move_to object="this.ship" destination="$targetzone" usehighways="false" finishonapproach="false" forceposition="false" boost="true">
            <position value="$targetpos" />
            <interrupt>
              <conditions>
                <event_boost_stopped object="this.ship" />
                <check_value value="player.age" min="$booststart + 500s" comment="only after the boost duration is over" />
              </conditions>
              <actions>
                <!-- interrupt the move_to because our boost stopped -->
                <set_value name="$interrupted" exact="true"/>
                <debug_text text="'boosting move_to interrupted! started at %1, stopped at %2. Remaining distance %3m (originally %4m)'.[$booststart, player.age, this.ship.distanceto.[$targetzone, $targetpos], $boostdistance]" chance="$debugchance"/>
              </actions>
            </interrupt>
          </move_to>
          <do_if value="@$interrupted">
            <!-- wait for the recharge, then restart it -->
            <remove_value name="$interrupted"/>
            <wait min="2s" max="5s" sinceversion="3" />
          </do_if>
          <do_else>
            <break />
          </do_else>
        </do_while>
        <stop_moving object="this.ship" />
        <set_value name="$boostend" exact="player.age" />
        <debug_text text="player.age + ' STOOOOOP!'" chance="$debugchance" />
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 9. Oct 17, 19:59

i wonder where you see a delay there.... there is no wait or other blocking Action which contains "$booststart +1h", only the do_while has this which repeats actions in its node while the conditions meet - and the only blocking action inside there it the <move_to/>. So basially the Ship REstarts the boost for one hour if the boost gets interrupted..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice » Tue, 10. Oct 17, 01:06

the delay is within the do_while : <do_while value="player.age lt ($booststart + 1h)">

This is everywhere i see in my log where one of my ship does a boost:
Line 51728: [Scripts] 24397.56 *** aicontext<move.nohighway,0x119c9>: [Ship=Miner-Large-Vrak, Moving] BOOOOOOOOOOOST! (Boost start=24397.556, Boost distance=141152)
Line 56450: [Scripts] 24502.73 *** aicontext<move.nohighway,0x119c9>: 24502.733 STOOOOOP!

Line 3335: [Scripts] 23291.25 *** aicontext<move.nohighway,0x11c51>: [Ship=Miner-XL-Gaz, Moving] BOOOOOOOOOOOST! (Boost start=23291.25, Boost distance=128832)
Line 10614: [Scripts] 23447.42 *** aicontext<move.nohighway,0x11c51>: 23447.419 STOOOOOP!

Line 12959: [Scripts] 23496.34 *** aicontext<move.nohighway,0x11c51>: [Ship=Miner-XL-Gaz, Moving] BOOOOOOOOOOOST! (Boost start=23496.34, Boost distance=159424)
Line 25995: [Scripts] 23817.20 *** aicontext<move.nohighway,0x11c51>: 23817.201 STOOOOOP!

Line 213227: [Scripts] 27920.23 *** aicontext<move.nohighway,0x11c51>: [Ship=Miner-XL-Gaz, Moving] BOOOOOOOOOOOST! (Boost start=27920.229, Boost distance=181664)
Line 225127: [Scripts] 28171.11 *** aicontext<move.nohighway,0x11c51>: 28171.108 STOOOOOP!

Line 231294: [Scripts] 28309.03 *** aicontext<move.nohighway,0x11c51>: [Ship=Miner-XL-Gaz, Moving] BOOOOOOOOOOOST! (Boost start=28309.032, Boost distance=165792)
Line 246473: [Scripts] 28636.19 *** aicontext<move.nohighway,0x11c51>: 28636.189 STOOOOOP!

Line 69929: [Scripts] 24799.65 *** aicontext<move.nohighway,0x11d3a>: [Ship=Miner-XL-Vrak, Moving] BOOOOOOOOOOOST! (Boost start=24799.646, Boost distance=134144)
Line 76749: [Scripts] 24948.62 *** aicontext<move.nohighway,0x11d3a>: 24948.62 STOOOOOP!
I am just going throught the logs to see why it too soooo long for some of my minng ships to do anything. I see a time spent between these 2 log events and trying to find out if it is normal for such time spent.

If you take the player.age value of both lines (boost and stop), how much does it corresponds in real time ?
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 10. Oct 17, 17:06

Default dimensions for time (player.age) and distance are seconds and meters, respectively.

Hence it seems that (looking at the last 2 lines of your output) the time passed between boost start and stop is about 149 seconds and the ship had to travel roughly 134 Km which means it's speed was slightly less than 1 km/s (that is consistent with booster speed).

Not sure this helps; maybe I've missed your point.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice » Wed, 11. Oct 17, 03:29

It was in a adjacent zone when it boosted. So all it had to do was go to the next zone. However, it took like 30-60 min to actually reach home base. That is a hell of a long time for just crossing one zone to the next.

This is one of the issues I have with my warehouse managing mining ships I assigned it too. Either they are just stuck in free mining for a long time, or it says it is looking for ressources for a long time or simply not going back to the warehouse at all to unload cargo.

I want to use the warehouse coupled with mining but there are these issues that get in the way and ruin my game (almost to the poing of quitting this game). I thought I could trace it down with a better log and comparing with the code, but after a few days of doing this, I am only finding issues with how long it took to move around from place to place.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Wed, 11. Oct 17, 04:12

Browser_ice wrote:It was in a adjacent zone when it boosted. So all it had to do was go to the next zone. However, it took like 30-60 min to actually reach home base. That is a hell of a long time for just crossing one zone to the next....
Hmm....are you sure (again looking at the last two lines as previously) the ship did reach the destination after the stop boost? (only explanation for the 30-60 mins is that it did not in the first attempt).
Browser_ice wrote: This is one of the issues I have with my warehouse managing mining ships I assigned it too. Either they are just stuck in free mining for a long time, or it says it is looking for ressources for a long time or simply not going back to the warehouse at all to unload cargo.....
In my experience during the coding of the AutoTrader there are several problems:
  • 1# Assigning a miner to any station (manager) reduces it's potential because the manager will only pass a mining order to the ship if a corresponding resource is in demand and not yet ordered at another miner. Even then the amount ordered it is just the amount needed to refill the stock which is most of the time way less than the full carry capacity of the ship.

    2# Free Mining is a substitute for Idle and issued to a miner if (see 1#) no current mining operation is required (in the "opinion" of the station manager).

    3# Even if a miner is in the resource area the mining process has several limitations (see the corresponding vanilla scripts). There are wait states between resource transportation to the ship's cargo hold and also limitations on the amount. Also the miner might change locations either within the resource area or even move to another one although the current location is not fully "harvested".

    4# There is (or was, not sure since I never used vanilla miners again) also an issue with the drones (scooper/surface). IIrc then sometimes the miner ship never released them all and/or very slowly.

    5# Boosting an NPC ship never really worked for me reliably, neither IZ nor OOZ (avoiding collision detection problems). I've spent many hours to figure out why but then got fed up wasting time on this and just coded my AutoTrader (including the miners) to jump.
The above issues was the reason why I've coded the AutoMiner (as part of the AutoTrader) scripts myself avoiding those time consuming problems. But please be aware that all this happened after the first release and some of the above mentioned problems may have been resolved now.


Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice » Thu, 12. Oct 17, 00:43

I am not using any MODs or extensions at all, excep the Egosoft 2 DLC and mine which is just doing more meaningfull debug_text to investigate those issues.

For the adjacent zone, I am in Cold Star (my translation because my game is in french). My zone is between zone-2 and 3, but north of it It is very close to the both of them. It is a non populated free zone. The kind you light up on the map as you travel the map. I put my warehouse there because it is near the asteroids in zone-3 and 2.

I did a thread about this where I am talking about the bug of warehouses using mining ships. I always use the same savegame file where my ware house has no mining ships. As soon as I load my savedgame, I assigned all mining ships to my warehouse (all kinds of ships) and then just let it go for a while. I then take the log and check what happened. The easiest visual clues are on ship travelling from zone-2 to mine in at least 30 min. The second visual clue is ships that are either full or empty and not doing anything, not even returning to homebase. Those symptoms lasts for 15-60 min, depending on the ship.

Here are a bit more log info from the long traveling case. Notice the distance it is sayng before travelling from one sector to another one next to it: 1123.5m away
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: this.ship.knownname=Miner-Large-Vrak
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: this.ship.cargo.capacity=290000
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: this.ship.commander.exists=1
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: homebase=0x120be
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: this.ship.commander=0x120be
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: warebasket=[ware.crystals,ware.ice,ware.nividium,ware.ore,ware.silicon]
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: warebasket.count=5
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: this.ship.cargo.free=16704
[Scripts] 23234.63 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] returning to Warehouse EF in My Testing Sector...
[Scripts] 23234.63 *** aicontext<move.generic,0x119c9>: Long distance trip. Using engine booster...
[Scripts] 23234.63 *** aicontext<move.nohighway,0x119c9>: this.zone = Reprise de l'Extraction, $target = Warehouse EF, $targetzone = My Testing Sector
[Scripts] 23234.63 *** aicontext<move.nohighway,0x119c9>: current position in zone: position.[-35914.246094m, -4127.008789m, 36205.902344m]
[Scripts] 23234.63 *** aicontext<move.nohighway,0x119c9>: moving to zone exit pos: position.[-34967.457031m, -3961.002441m, 36787.765625m], 1123.5m away
[Scripts] 23256.36 *** aicontext<move.nohighway,0x119c9>: 23256.363 boost from position.[-35916.433594m, -4127.155273m, 36209.964844m] in Reprise de l'Extraction to position.[17011.656250m, 342.930634m, -386.853333m] in My Testing Sector which is 16732m away
[Scripts] 23256.36 *** aicontext<move.nohighway,0x119c9>: 23256.363 BOOOOOOOOOOOST!
[Scripts] 23643.70 *** aicontext<move.nohighway,0x119c9>: 23643.703 STOOOOOP!
[Scripts] 23643.70 *** aicontext<move.nohighway,0x119c9>: 23643.703 now in zone My Testing Sector at position.[17010.765625m, 342.928711m, -388.274231m]
[Scripts] 23643.70 *** aicontext<move.generic,0x119c9>: boost complete. Moving into final position.
[Scripts] 23643.70 *** aicontext<move.generic,0x119c9>: Short distance trip to position.[25000.000000m, -2161.943359m, 0.000000m] in My Testing Sector. D=8380, using highways: 0
[=ERROR=] 26854.31 aicontext<move.generic,0x119c9>: Not successfuly reached the position in targetzone My Testing Sector(0x12033)! Miner-Large-Vrak(0x119c0) is currently in Bout de la Ligne(0x111a7), 72304m from the target destination (actual distance 72128).
[Scripts] 26856.55 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] Homebase is Warehouse EF in My Testing Sector(La Carrière), we are at position.[35814.101563m, 481.064148m, -11691.822266m] in Bout de la Ligne(La Carrière), distance to homebase is 72192
[Scripts] 26856.55 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] moving to park at homebase Warehouse EF
[Scripts] 28934.49 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] now parked at homebase Warehouse EF
[Scripts] 28934.49 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] reserved 14672 Silicium for unloading at homebase Warehouse EF(0x120be) (have 14672, homebase has room for 265664)
Here something else that did not happen in the previous game sessions. It looks like it did not go through the same scripts as above so I have no clues what it did between the 2 lines. I would need to investigate deeper. This log was created last weekend.
Line 99: [Scripts] 23228.14 *** Context:md.Orders.SectionHandler_Broadcast<inst:26b1e>: attempt to set 0x120be Warehouse EF as commander of 0x119c0 Miner-Large-Vrak old commander null
Line 8501: [=ERROR=] 26854.31 aicontext<move.generic,0x119c9>: Not successfuly reached the position in targetzone My Testing Sector(0x12033)! Miner-Large-Vrak(0x119c0) is currently in Bout de la Ligne(0x111a7), 72304m from the target destination (actual distance 72128).
Line 16476: [Scripts] 29269.24 *** aicontext<mining.ship.station,0x119c9>: [Ship=Miner-Large-Vrak, Mining] updating warebasket on Miner-Large-Vrak(0x119c0) to collect [ware.crystals,ware.ice,ware.nividium,ware.ore,ware.silicon]
Line 21768: [Scripts] 30568.70 *** aicontext<move.collect.drone,0x101b988>: 30568.7 returning to homebase Miner-Large-Vrak[0x119c0] in Reprise de l'Extraction (dronelaunchpad)
Line 21774: [Scripts] 30569.31 *** aicontext<move.collect.drone,0x10287de>: 30569.31 returning to homebase Miner-Large-Vrak[0x119c0] in Reprise de l'Extraction (dronelaunchpad)
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 12. Oct 17, 13:58

Browser_ice wrote:I am not using any MODs or extensions at all ...
Misunderstanding I guess: I was not asking you nor claiming that you use mods. I've just pointed out my experience with some issues related to your problem while coding my mod (the AutoTrader).

It may be that your problems are related to the warehouse. Have you tried to assign the miner ships to another station (not the warehouse) manager?

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice » Fri, 13. Oct 17, 01:10

Good point !

I had thought about it but forgot. I was too eager to find what the root cause is.

I will try and use a refinery instead.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice » Sat, 17. Feb 18, 15:11

I am back after 3 months. I do not recall if I tested this with the refinery station. But has anything came out of my log files I sent you guys ?

Is it being investigated or it is waiting in line while other higher priorities are being done ?

Using warehouses was my biggest objective in this game because you can make so much profit with it but these issues and others I mentioned in seperate threads pissed me off enough to simply stop playing it. I though after 3 months you guys would have come up with something.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

Post Reply

Return to “X Rebirth - Scripts and Modding”