23386 Posts in 3989 Topics - by 8545 Members - Latest Member: Loki98

Author Topic: AI trade haulers are utterly broken  (Read 216 times)

Cyka

  • Newbie
  • *
  • Posts: 38
    • View Profile
AI trade haulers are utterly broken
« on: January 06, 2018, 08:07:00 AM »
They just get stuck no matter what, whether i build my dock long or shot, make my station bigger or smaller, nudge the hauler, exit the sector then come back, none of this works, the hauler only moves if i delete my dock then rebuild it, but even then the next hauler comes and immediately gets stuck.

Hellatze

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #1 on: January 07, 2018, 10:40:18 AM »
this need fix.

dangerboybb

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #2 on: January 07, 2018, 11:07:09 AM »
Yes, absolutely, extremely frustrating.  Station builds, I request items, and they work at first, but it ultimately stops, I think once it hits the max items in the station, everything just stops period just like you said, and there seems to be no way to get them rolling again.  Even the mines have problems, they only mine until ONE of the items reaches max, and then it just stops, even if the other item might be zero.  All of this needs to be fixed!  I realize resources to fix the game are limited, so waiting very patiently!  Ok maybe not so patiently.  ;-p

Hellatze

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #3 on: January 07, 2018, 07:10:03 PM »
use this for temporary problem

download that attached file then : /flushtraders

Cyka

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #4 on: January 08, 2018, 03:09:12 AM »
I play multiplayers exclusively, so until the trade haulers are finally fixed, im just gonna brood over all the stuck cargo haulers in my sectors and dead trade zones everywhere on the map.

DRAGNET

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #5 on: January 09, 2018, 06:14:50 PM »
I managed to fix stuck traders by using a force turret to pull them to the dock of the station, they stay for a while then get pushed away from the station and continue to fly away.

Looks like they stop too far away of the dock's hauling range and wait there forever, this is also blocking the station from calling for other traders.

Cyka

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #6 on: January 10, 2018, 08:19:35 AM »
I managed to fix stuck traders by using a force turret to pull them to the dock of the station, they stay for a while then get pushed away from the station and continue to fly away.

Looks like they stop too far away of the dock's hauling range and wait there forever, this is also blocking the station from calling for other traders.

Is not just that, it seems they are just outright broken in way too many aspects:

Stuck at dock, cant dock for whatever reason.
Stuck moving at midway to dock, like you reported.
Stuck firing traction beam, the one they use to enter/leave the dock, i've seen a traction beam ACROSS HALF OF THE ENTIRE SECTOR.
Stuck at asteriods, destroying asteriods does nothing.
Stuck and just outright broken AI, removing docks and re-enabling them does nothing, only way to make next trader comes is to destroy the dead AI trader.

DoorsMonster

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #7 on: January 11, 2018, 08:05:36 PM »
Hello,

Ugh, this bug is really annoying. I'm having the same issue. I want to drag attention from devs since I think this is a big problem, so I'll post a couple links.

When I first encountered it I wrongly named my post, yet I found the source of the problem here:
http://www.avorion.net/forum/index.php/topic,4318.msg22832.html#msg22832

Also there's another guy having the same problem, here:
http://www.avorion.net/forum/index.php/topic,4212.msg22853.html#msg22853

I think I found a 'solution' which is more a way to 'avoid' the problem. This issue occurs because the DockAI.lua script has a bug on the 71th line. Those lines says that:

  • Trading ship spawns
  • Said ship flys to station
  • IF YOU LEAVE THE SECTOR IN THIS STEP THE BUG IS TRIGGERED
  • Ship get stuck because 71th line can't be executed (ship's can't check docking when player is out of the sector)

The trick to avoid the problem is:

  • Unstuck the ship by any means OP just said before (I suggest just deleting ALL docks from the station, that works, me and 2 friends tested it)
  • Let the trade finish and wait for the yellow undocking tractor beam to finish the movement
  • LEAVE THE SECTOR RIGHT AFTER THE YELLOW BEAM PUSHED THE SHIP OFF THE STATION (Time this carefully, otherwise it won't work)
  • Once you are out of the sector the station will notify you about the profits

This works because, according to trade.lua script, server has 2 ways of trading: actually spawning a trading ship and simulating trading. Simulation is only triggered if there's no pending trades for a given station. This happens for each station, so it's okay if there's traders stuck near NPC's stations. Only focus on your factory. In the server I am currently playing on, I have 7 stations running just fine.

If you reenter the sector, you'll have to repeat the steps.

Cyka

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #8 on: January 12, 2018, 12:53:50 AM »
Hello,

Ugh, this bug is really annoying. I'm having the same issue. I want to drag attention from devs since I think this is a big problem, so I'll post a couple links.

When I first encountered it I wrongly named my post, yet I found the source of the problem here:
http://www.avorion.net/forum/index.php/topic,4318.msg22832.html#msg22832

Also there's another guy having the same problem, here:
http://www.avorion.net/forum/index.php/topic,4212.msg22853.html#msg22853

I think I found a 'solution' which is more a way to 'avoid' the problem. This issue occurs because the DockAI.lua script has a bug on the 71th line. Those lines says that:

  • Trading ship spawns
  • Said ship flys to station
  • IF YOU LEAVE THE SECTOR IN THIS STEP THE BUG IS TRIGGERED
  • Ship get stuck because 71th line can't be executed (ship's can't check docking when player is out of the sector)

The trick to avoid the problem is:

  • Unstuck the ship by any means OP just said before (I suggest just deleting ALL docks from the station, that works, me and 2 friends tested it)
  • Let the trade finish and wait for the yellow undocking tractor beam to finish the movement
  • LEAVE THE SECTOR RIGHT AFTER THE YELLOW BEAM PUSHED THE SHIP OFF THE STATION (Time this carefully, otherwise it won't work)
  • Once you are out of the sector the station will notify you about the profits

This works because, according to trade.lua script, server has 2 ways of trading: actually spawning a trading ship and simulating trading. Simulation is only triggered if there's no pending trades for a given station. This happens for each station, so it's okay if there's traders stuck near NPC's stations. Only focus on your factory. In the server I am currently playing on, I have 7 stations running just fine.

If you reenter the sector, you'll have to repeat the steps.

My good god how are you doing it for all the 20 factories in a sector simultaneously, some will get stuck no matter what.

DoorsMonster

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #9 on: January 12, 2018, 06:49:59 AM »
I had to put no more than 2 stations  per sector.
Exactly as you say, if you put too many stations in a single sector it would become too hard to jump Just in time.
 Yep, not a fully satisfying solution, I fear. But I hope it helps you keep running stations.

Shrooblord

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Re: AI trade haulers are utterly broken
« Reply #10 on: January 15, 2018, 07:21:42 PM »
This works because, according to trade.lua script, server has 2 ways of trading: actually spawning a trading ship and simulating trading. Simulation is only triggered if there's no pending trades for a given station. This happens for each station, so it's okay if there's traders stuck near NPC's stations. Only focus on your factory. In the server I am currently playing on, I have 7 stations running just fine.
I knew it! I've figured most of this out without looking at a single line of code by analysing the game's behaviour in different situations. Thank you very much for confirming that this is also indeed what happens in-code.

I wonder if we can implement a fix to this ourselves or if it's something in the core code that needs changing. I feel like the simulating trading thing shouldn't be too hard to "turn on"; i.e. delete / change the conditions under which the simulation says it can't execute if a trade is already in-progress. After all, we're OoS, so why should we care that "actually" there's a trader still "using" the Station while we're gone (seeing as the Sector is frozen in time until our return). If we simulated trading during our time away, we wouldn't suddenly go "Ha! See? I knew it! Simulation, not reality! That trader wasn't done trading yet; all of this is fake!!" - more likely, we'd think "oh hey that trader did the trade and now another one's come in, cool", if we even stop to think about it at all.

I also wonder if there's a way to "jump back into" line 71 after re-entering the Sector. In basic and DOS, there's such a thing as GOTO labels. In other programming languages, I'd abstract those away into separate functions.
Maybe the functionality post-71 can be put into a separate function that gets executed when the player returns to the Sector?

Although I think we need a better system to handle players jumping OoS in general. They could jump at any time, inside the execution loop of any function. Functions shouldn't break whenever a player jumps away. At the very least, they should finish their current execution loop, or simulate it to some degree, and then store the Sector's state and time-freeze it. Preferably, of course, we never time freeze any Sector, but I understand that's a little too radical a change to the game's core processes. :P

Basically, we need a "safe close state" function for Sectors when we jump away.
  • We jumped. OK. What does that mean?
  • Close down actively running functions, completing them to a safe place to halt and resume later.
  • Store the data for this Sector.
  • Suspend everything.
  • Start Sector simulation rather than actively keeping the Sector alive.
  • When we jump back, load all Sector data, restore functions from their "paused" state, using any data we need to resume running.
  • Proceed as per normal.
« Last Edit: January 15, 2018, 07:25:14 PM by Shrooblord »
Shrooblord