aliens

Author Topic: Rearming/Refuelling issue  (Read 2841 times)

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Rearming/Refuelling issue
« on: March 06, 2021, 01:24:46 pm »
When your craft finishes rearming and refuelling, the refuelling stage is still marked as "rearming", at least for the first hour of it.

https://i.imgur.com/8Ewpw1O.jpg

And yes, this is a "refuelling" stage, since at the end of the hour fuel goes from 93% to 100%, and the Avenger is "ready".

What's additionally bogus is that if no refuelling needs to be done, this rearming-but-actually-refuelling phase still happens, and consumes a unit of Elerium. To see that, just disarm the craft and then put weapons on it again.

Without having looked at the code myself, the whole thing has a suspicious stench...
« Last Edit: March 06, 2021, 01:39:51 pm by Markus Ramikin »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Rearming/Refuelling issue
« Reply #1 on: March 06, 2021, 01:56:25 pm »
The craft is still rearming on this screenshot.

Rearming one ammo takes one hour.

At the beginning of that hour, the game takes the ammo from stores and puts it into the craft weapon, instantly.
During that hour, it shows how much time remains.
At the end of the hour/at the beginning of the next hour, it loads the next ammo or starts refueling.

While loading the last ammo, the game would show that 0 hours remains (because it can't display e.g. 34 minutes remains), and instead of that the game just shows nothing.

Example:

- new game starts at 12:00
- you change weapon on the interceptor to avalanche at 12:01... the game will say 3 hours remain (but actually 3 hours and 59 minutes remain)
- at 13:00 the game reloads the first clip... says that 2 hours remain (but 2 hours 59 minutes and 59 seconds actually remain)
- at 14:00 the same reloads the second clip... says 1 hour remains (actually 1:59:59 remains)
- at 15:00 the game reloads the third clip... doesn't say anything (actually 0:59:59 remains)
- at 16:00 reloading officially finishes and refuelling starts

total time spent to reload 3 ammo = 3 hours and 59 minutes (from 12:01 to 16:00) ... time between 12:01 and 13:00 is "wasted time" where nothing happens

Or in other words... regardless if you start rearming at 12:01 or 12:30 or 12:59, the rearming will finish at 16:00.
(because the actual rearming physically starts at 13:00)

And yes, this is a "refuelling" stage, since at the end of the hour fuel goes from 93% to 100%, and the Avenger is "ready".

that's the misunderstanding here, things don't happen "at the end of the hour" but "at the beginning of the next full hour"
« Last Edit: March 06, 2021, 02:21:08 pm by Meridian »

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: Rearming/Refuelling issue
« Reply #2 on: March 06, 2021, 03:20:50 pm »
If that final hour is "rearming" and not "refuelling", are you able to tell me why I lose that final unit of Elerium, even in situations where fuel was 100% to begin with and all I did was switch a weapon?

Aside from that, I understand what you said.

But suppose for a moment that I lift off at the time of this screenshot. What then? Even though I didn't wait for the "rearming" phase to finish, I still have 4 out of 4 perfectly usable missiles in each launcher. Then the craft is rearmed, objectively. "Rearming" is not done, but that is only a label the game happened to slap on an hour of nothing happening.

Aside from making things more intuitive, rewriting this would make things consistent between playing with and without Forced Craft Launch. Here's one simple way:

First phase, during the incomplete hour, is "Maintenance Prep".
Each subsequent hour:
- Work the current phase, e.g. if "Rearming" then reload a clip. ("Prep" has nothing here.)
- if nothing left to do in current phase, switch to next phase.
- display hours rounded up.

The result would be exactly the same as right now, except hitpoints/weapons/fuel would update at the end of the hour, not at the start, which means 1. phases logically label processes that have not yet reached completion, 2. the whole procedure takes just as long with Forced Launch as without:

12:01 - Craft with 1 Avalanche laucher returns with 99% health. 99% fuel and no ammo.
Phase: "Prep"
Display hours left: "1" (59m rounded up)

13:00 Do nothing
Switch to "Repairing"
Display hours left: "1"

14:00 Repair health
Switch to "Rearming"
Display hours left: "3"

15:00 Load an Avalanche
Display hours left: "2"

16:00 Load an Avalanche
Display hours left: "1"

17:00 Load an Avalanche
Switch to "Refuelling"
Display hours left: "1"

18:00 Reload missing fuel
Switch to "Ready".

I hope that makes sense.
« Last Edit: March 06, 2021, 04:35:27 pm by Markus Ramikin »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Rearming/Refuelling issue
« Reply #3 on: March 06, 2021, 04:12:41 pm »
If that final hour is "rearming" and not "refuelling", are you able to tell me why I lose that final unit of Elerium, even in situations where fuel was 100% to begin with and all I did was switch a weapon?

That's indeed a bug and should be fixed.

I recommend opening an issue here: https://github.com/OpenXcom/OpenXcom/issues

I hope that makes sense.

Yes, it makes 100% sense.
A number of people have raised same/similar concerns in the past.

We haven't changed it, because it works the same way as in the original.
I don't know if OXC devs are interested in changing this.

I, an OXCE dev, don't have any strong opinion whether it should be changed or not. As a player, it doesn't bother me.
I just want to keep it the same as in OXC, I don't want to change it only in OXCE... (for OXC/OXCE incompatibility, I need a very good reason).

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: Rearming/Refuelling issue
« Reply #4 on: March 06, 2021, 04:32:56 pm »
I'll do that.

Thanks for the replies.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Rearming/Refuelling issue
« Reply #5 on: March 12, 2021, 10:30:11 am »
fixed