Feature request: Teleport on out-of-fuel

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
danau
Posts: 9
Joined: Wed Apr 25, 2018 6:13 pm

Feature request: Teleport on out-of-fuel

Post by danau »

When an unit runs out of fuel, then it disappears/gets destroyed. I would like to set other out-of-fuel behaviours in a ruleset for some units, for example teleporting back to the last location where the unit was fuelled or teleporting to the nearest location with fuel available.
The last location could be static (city, airfield, last-visited-coastline (triremes), non-moved transport), or a feature that also allows returns to moved transports would be even nicer.

The game would need to track the last refuelling location (position or unit) for this feature to work.

The concrete use-case I have at the moment is that I'm working on a ruleset where I would like to reduce some micromanagement around fighters and bombers by having them automatically return to the last location where they were fueled on out-of-fuel. This would remove the need for the player to give the commands to return fighters and bombers back to a fuel-providing location. (Players would only need to give the commands for the "outgoing/attack" actions.)

Spies already seem to have some sort of return behaviour (not on out of fuel, but after completing a diplomatic action) and those spies return to their home-cities. Allowing return to the nearest friendly city (or nearest coast for triremes) on out of fuel might also be useful for some units (although last fuelling location seems more appropriate for the fighters and bombers I'm working on).
---
Danau (Peter van der Meer)
Ignatus
Elite
Posts: 624
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Feature request: Teleport on out-of-fuel

Post by Ignatus »

Out of fuel units currently try to go to closest fueling location automatically if they have movepoints for that at end of the turn. That's the idea of fuel - if you are out of it without an airstrip in reach, you crash; either you look out or get ready to an unpleasant surprize. To reduce surprizes, goto lines are red if the mission looks suicidal. If you really don't like it, you may create a copy of the unit in "unit_lost" Lua callback (teleport does not help). (AIs, as far as I know, currently always return planes with any incomplete fuel any way).

A good way to reduce the micromanagement is CivIII style aviation when the units don't move on attack, just perform ranged actions (and sometimes are intercepted/suffer damage in process). We have ranged attacks in newer Freeciv versions, just the defense still has some aspects to work around.

(offtopic) My own related idea was making an effect of probability that a unit perishes at turn change, that will work for fueled units out of fuel as well as for triremes in open seas or regular units on glaciers. We have had the latter (hardcoded) in old Freeciv versions but it was canceled due to AI's stupid usage of unsafe paths; I would suggest calculating logarithm of unit survival probability that would help in calculating the target worth. But this all is not related here.
danau
Posts: 9
Joined: Wed Apr 25, 2018 6:13 pm

Re: Feature request: Teleport on out-of-fuel

Post by danau »

Ranged actions also sounds like a good way of reducing micromanagement. Looking forward to seeing that feature in the new versions.
---
Danau (Peter van der Meer)
Post Reply