Author Topic: bug in refueling code?  (Read 1499 times)

0 Members and 1 Guest are viewing this topic.

Offline Commodore_Areyar (OP)

  • Warrant Officer, Class 1
  • *****
  • Posts: 97
  • I will format your cruiser!
bug in refueling code?
« on: February 17, 2010, 08:20:02 PM »
I have a suspicion I have found a bug that leads to unending refueling (at the cost of canceling orders)

I got two taskgroups consisting of (amongst things) several corvettes and a tanker, they have conditional orders to refuel at 30% at nearest tanker.
The corvettes run out of fuel in several days and trigger the refuel order.
The group then reports completing orders.
Now, when I go to the taskforce screen to set the orders again, fuel is 100% for all ships, including the tankers. (Also in the individual ship screen: 1million litres)

Areyar
images of planets etc
 

Offline Micro102

  • Warrant Officer, Class 1
  • *****
  • M
  • Posts: 89
  • Thanked: 1 times
Re: bug in refueling code?
« Reply #1 on: February 17, 2010, 09:10:39 PM »
Yeah it's because of the "cycle orders" check box, just set a "refuel at (insert colony here)" order in between your orders so that problem doesn't happen anymore,
 

Offline Commodore_Areyar (OP)

  • Warrant Officer, Class 1
  • *****
  • Posts: 97
  • I will format your cruiser!
Re: bug in refueling code?
« Reply #2 on: February 17, 2010, 10:16:44 PM »
no it isn't.

these are just single "move to X" orders, the problem is in the conditional refuel from tanker order.
images of planets etc
 

Offline Micro102

  • Warrant Officer, Class 1
  • *****
  • M
  • Posts: 89
  • Thanked: 1 times
Re: bug in refueling code?
« Reply #3 on: February 18, 2010, 12:23:32 AM »
Hmmm...you say unending refueling, but it looks like unending fuel. If you meant unending fuel for the tanker, then maybe they took such little fuel that it rounded back up to 100%? (I'm picky with vocab)
 

Offline Commodore_Areyar (OP)

  • Warrant Officer, Class 1
  • *****
  • Posts: 97
  • I will format your cruiser!
Re: bug in refueling code?
« Reply #4 on: February 18, 2010, 09:51:51 AM »
I don't think I wrote that. (edit: okay, so I did, meaning the fuel is unending)

I've considered that the amount of fuel burned could be too little, but semi-dismissed it and decided to post the bug report in Academy just in case.

I've had fuelers following a bigger corvette group on training and refueling took several % per refueling.
Tanker 1,000 kiloLitres, corvettes (10 kL*9) 90 KL : <1% fuel, but repeated about ten times onroute to the precursor infestation. Also the tanker is using fuel as well, so I'd not have expexted all of them to have them arrived at destination at 100% fuel.

edit2:
tested it explicitly with 1 tanker (98%of 1ML) and 14 corvettes (100%of 10kL): I get a orders complete message, the fleet is someplace halfway to its target, orders are cancelled and ALL ships in TG now have 100% fuel.
images of planets etc
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11673
  • Thanked: 20457 times
Re: bug in refueling code?
« Reply #5 on: February 20, 2010, 09:49:56 AM »
Quote from: "Commodore_Areyar"
I have a suspicion I have found a bug that leads to unending refueling (at the cost of canceling orders)

I got two taskgroups consisting of (amongst things) several corvettes and a tanker, they have conditional orders to refuel at 30% at nearest tanker.
The corvettes run out of fuel in several days and trigger the refuel order.
The group then reports completing orders.
Now, when I go to the taskforce screen to set the orders again, fuel is 100% for all ships, including the tankers. (Also in the individual ship screen: 1million litres)

Areyar
I have set up a task group and run a normal "refuel from own tankers" order. That seems to be working OK, although it might be something to do with the conditional order. I'll look into it and get back to you.

Steve
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11673
  • Thanked: 20457 times
Re: bug in refueling code?
« Reply #6 on: February 20, 2010, 09:57:09 AM »
Quote from: "Steve Walmsley"
Quote from: "Commodore_Areyar"
I have a suspicion I have found a bug that leads to unending refueling (at the cost of canceling orders)

I got two taskgroups consisting of (amongst things) several corvettes and a tanker, they have conditional orders to refuel at 30% at nearest tanker.
The corvettes run out of fuel in several days and trigger the refuel order.
The group then reports completing orders.
Now, when I go to the taskforce screen to set the orders again, fuel is 100% for all ships, including the tankers. (Also in the individual ship screen: 1million litres)

Areyar
I have set up a task group and run a normal "refuel from own tankers" order. That seems to be working OK, although it might be something to do with the conditional order. I'll look into it and get back to you.

Steve
Found it! It's a logic problem. The normal "refuel from own fleet" order has a flag that ensures tankers don't refuel themselves. The "refuel other fleet" and "refuel from other fleet" orders don't set that flag. If a fleet with tankers gets the conditional order for "Refuel at nearest tanker" it doesn't allow for the fact the nearest fleet with tankers could be itself. The don't refuel rankers flag isn't set and that results in the fleet completely refuelling itself out of thin air :)

I have added a check to the refuel code so that if the refuelling fleet and tanker fleet are the same object, the "tankers don't refuel" flag is set, regardless of from where the function is called.

Steve
 

Offline sloanjh

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
Re: bug in refueling code?
« Reply #7 on: February 20, 2010, 10:05:36 AM »
Quote from: "Steve Walmsley"
Found it! It's a logic problem. The normal "refuel from own fleet" order has a flag that ensures tankers don't refuel themselves. The "refuel other fleet" and "refuel from other fleet" orders don't set that flag. If a fleet with tankers gets the conditional order for "Refuel at nearest tanker" it doesn't allow for the fact the nearest fleet with tankers could be itself. The don't refuel rankers flag isn't set and that results in the fleet completely refuelling itself out of thin air :)

I have added a check to the refuel code so that if the refuelling fleet and tanker fleet are the same object, the "tankers don't refuel" flag is set, regardless of from where the function is called.

Do you want to (or have you) set it up so that, in addition, the "nearest TG" code doesn't include the TG itself?  I can invisage a situation where you might have a single super-tanker in a system, with subordinate tankers spread out in detached TG.  If you don't filter "self" out of "refuel from nearest", then any TG with a subordinate tanker won't be able to refuel from the supertanker.  Not sure how this plays out with the conditionals, though, since I don't use them....

John
 

Offline Commodore_Areyar (OP)

  • Warrant Officer, Class 1
  • *****
  • Posts: 97
  • I will format your cruiser!
Re: bug in refueling code?
« Reply #8 on: March 04, 2010, 07:13:32 AM »
This effect does not occur if the tanker is reduced to 10% during refueling of the TG, before the tanker itself comes up for being refueled.
So for abusing this to create fuel from thin air, having an accompanying ship with small fueltanks to trigger the effect is best.
Not sure whether the tanker needs to have enough fuel onboard to refuel itself (>50%), but it would be logical. Will investigate. :)

edit: yeah. tanker needs to be able to refuel all ships in TF before running out (10%), this includes itself.
So minimum fuel for a 100% instant refuel is 56% (disregarding drain from other ships).
images of planets etc