Author Topic: Fuel Percentage  (Read 9586 times)

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Fuel Percentage
« on: June 08, 2014, 09:07:55 pm »
Just watching MetalCanyon's LP
https://youtu.be/fNEh7dGAkBw?t=4m57s

and at 4m57s, he picks AceTheBrave and it says "Low Fuel", but it says below "Fuel : 97%". This doesn't make sense. Should the number be inverted? (100 less % shown)

Offline Qpoter

  • Colonel
  • ****
  • Posts: 114
    • View Profile
Re: Fuel Percentage
« Reply #1 on: June 08, 2014, 11:25:06 pm »
Happens a lot with the Skyranger for me, where it returns to base due to low fuel even though it's at 90-something %.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: Fuel Percentage
« Reply #2 on: June 09, 2014, 06:20:16 pm »
Transporters are hardcoded to Low Fuel when returning from a mission (this is basically a game-logic-way of forcing them to have to go back to base, so the post-mission-procedures still make sense).

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Fuel Percentage
« Reply #3 on: June 09, 2014, 08:26:35 pm »
Several players have been surprised by the "low fuel" status. It may be better to use the standard STR_RETURNING_TO_BASE rather than STR_LOW_FUEL_RETURNING_TO_BASE on mission completed.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Fuel Percentage
« Reply #4 on: June 09, 2014, 08:34:04 pm »
STR_RETURNING_TO_BASE allows to redirect the craft to the next ufo
if the devs want the crafts to return for briefing one has to create a new STR_BRIEFING_RETURNING_TO_BASE  state and include that in the code

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Fuel Percentage
« Reply #5 on: June 09, 2014, 09:08:07 pm »
I'm only referring to the message that the player sees : When there's a forced "return to base" which is not motivated by damage or low fuel, I think the generic message "RETURN TO BASE" would be less confusing than "LOW FUEL - RETURNING TO BASE".

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Fuel Percentage
« Reply #6 on: June 09, 2014, 09:32:42 pm »
you would need to add some new variable to determine the correct status of a craft
SpoilerClick if you want to see source code:
Code: [Select]
if (_waypoint != 0)
{
status = tr("STR_INTERCEPTING_UFO").arg(_waypoint->getId());
}
else if (_craft->getLowFuel())
{
status = tr("STR_LOW_FUEL_RETURNING_TO_BASE");
}
else if (_craft->getDestination() == 0)
{
status = tr("STR_PATROLLING");
}
else if (_craft->getDestination() == (Target*)_craft->getBase())
{
status = tr("STR_RETURNING_TO_BASE");
}
like that
SpoilerClick if you want to see the changed source code:
Code: [Select]
if (_waypoint != 0)
{
status = tr("STR_INTERCEPTING_UFO").arg(_waypoint->getId());
}
else if (_craft->NEW_WAS_ALREADY_ON_A_MISSION())
{
status = tr("STR_BRIEFING_RETURNING_TO_BASE");
}
else if (_craft->getLowFuel())
{
status = tr("STR_LOW_FUEL_RETURNING_TO_BASE");
}
else if (_craft->getDestination() == 0)
{
status = tr("STR_PATROLLING");
}
else if (_craft->getDestination() == (Target*)_craft->getBase())
{
status = tr("STR_RETURNING_TO_BASE");
}

Edit: trying the new spoiler tag :)thanks @SupSuper
« Last Edit: June 09, 2014, 09:44:35 pm by Falko »

Offline Qpoter

  • Colonel
  • ****
  • Posts: 114
    • View Profile
Re: Fuel Percentage
« Reply #7 on: June 10, 2014, 02:52:55 am »
This makes a whole lot more sense now. Falko's code should be implemented to avoid any more confusion.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Fuel Percentage
« Reply #8 on: June 10, 2014, 10:55:47 am »
there is a bit more to it than just using the code above
you have to define the variable/method NEW_WAS_ALREADY_ON_A_MISSION
what happens with that value while starting,landing,crashing,intercepting,ending,beginning a mission...
then of course you want to have a option similar to the "always start" options that allows the skyranger to make multiple missions in one flight,...

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: Fuel Percentage
« Reply #9 on: June 10, 2014, 02:25:54 pm »
...and that's how a suggestion quickly becomes a hassle. :P

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Fuel Percentage
« Reply #10 on: June 10, 2014, 03:19:48 pm »
I don't see why you'd need anything more than STR_RETURNING_TO_BASE - as this is already in for when you've been patrolling.

This keeps vanilla behaviour of it flying home after the mission, but giving you a clear message that it's fine to carry on.

What "post mission procedures" are there? Regarding the immediate transport of recovered items to the base, I never assumed they went in the craft anyway (instead some local government clean-up crew shipped it across to your base)

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Fuel Percentage
« Reply #11 on: June 10, 2014, 05:12:12 pm »
The string exists (and is translated! It's a big plus), but the game code doesn't keep track of "why" the ship is going home. At the moment, it uses the same boolean (_lowFuel or something), in both cases :
- mandatory back to base because of lack of fuel
- mandatory back to base because mission completed.

Post-mission includes some tasks which are instantaneous, they don't wait for the ship to go back home :
- transport of live aliens to detention
- wounded soldiers start "healing"
- loot items (including large "tile" items like UFO power source) into home base stores
- reload spent items, drawing from base stores (clips, but also anything destroyed in explosions) Inform player of missing items.

It's a simplification which is consistent with the fact that the game doesn't expect the ship to do a second mission before coming home.
Having a ship "chain" missions would require a big rethinking, to get the behavior a player could "expect". For example, you don't expect human-made ammo to be magically transferred from base stores to the ship. But at the same time you'll want expended plasma to be replaceable with what you find on the aliens. And also, even if you do multiple missions with less and less ammo, on final return you probably expect the game to re-equip the ship back to its original loadout: What the ship contained when it left the base, not what it had when the last mission started. Even the individual soldiers equipment may need to be restored back to its "ideal" load, rather than the last mission's.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Fuel Percentage
« Reply #12 on: June 10, 2014, 05:51:25 pm »
Post-mission includes some tasks which are instantaneous, they don't wait for the ship to go back home :
- transport of live aliens to detention
- loot items (including large "tile" items like UFO power source) into home base stores
These I, personally, don't think matters - you don't see the freighters that transport your goods from base to base, but it still happens, could just make it lore that you have freighter picking up the mess and delivering it to your base

- wounded soldiers start "healing"
This is the only one that I wouldn't be too sure about - Do the battlescape stats remain in the game data even in geo? If so, you could apply a clock that every 30 mins your soliders with injuries get worse. Alternatively, you could say the craft have non-portable medikits that will prevent further injury but does not restore any health.

- reload spent items, drawing from base stores (clips, but also anything destroyed in explosions) Inform player of missing items.
Yeah, but I don't see why you shouldn't be able to go from one mission to another with whatever you have left.

I guess most of this depends on how much data is persisted in the geoscape

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Fuel Percentage
« Reply #13 on: June 10, 2014, 07:07:18 pm »
I don't see why you shouldn't be able to go from one mission to another with whatever you have left.
I can imagine many in-universe reasons some times, but not every time (plane damaged, getting help for the wounded, having 6 live chryssalids prisoners, towing an intact UFO that's 4x larger than the transport).
But even if you some times feel the constraint is unrealistic, note that it is simple and player-friendly on every single mission! Immediate post-mission procedures allow you to sell loot, buy missing ammo and start research new things immediately.

I think the only reason this topic comes up is that people think there's a bug when they see "Low fuel" contradicted by a high fuel %. It's completely different from "feeling a need for ships to do multiple land missions in a row".

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: Fuel Percentage
« Reply #14 on: June 10, 2014, 08:19:29 pm »
What happens in the Battlescape, stays in the Battlescape. :P You cannot have crafts go on multiple missions unless you really like breaking the game abstraction that post-mission procedures are instantaneous, nothing ever leaves bases and crafts are purely an abstract point on the globe. Plus then it becomes XCOM 2012 and there's no point in having multiple crafts.

We can look into adding a new flag for "craft returning from mission" if the "low fuel" string really drives you nuts.