Can NPC fuel-use be improved on?

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Can NPC fuel-use be improved on?

Post by Arexack_Heretic »

From 1.70 improved features:
Legacy script methods awardFuel: and setFuelLeak: now work on the current script target, not always the player.
Great Ahruman, that solves several problems. :D

Did you also alter the way 'fuel' is used by NPCs?
IIRC they currently refer to their shipdata-inherited-values only for determining how often they use injectors.

Do they even run out of fuel? e.g. Is the ship-object-atribute 'fuel' a variable or still a fixed value?



Could you incorporate a check for NPCs so that they cannot witchjump if out-of-fuel?
Also, on
stationLaunch: "set MaxFuel: 7.0"
when jumping: check if destination system is still in fuel-range. else: cancel jump after countdown and re-apply for a jump system. (no system available in range: set AI to goto sun(scoop?) or station(bounty<50?) for fuel.)
finally when entering-system: reduce ship-fuel in relation to travel distance.
(ships being generated at WP: ship-fuel acc. to possible jump-origins minus small random value.
ships followed through wormhole: carryover of previous ship-fuel-level minus jump distance)

Another thought: it may be prudent to bind injector usage to similar checks. It may be preferable to have this fuel-usage a factor seperate from actual fuel levels and to be alterable by script, as some AI's will have different fuel-priorities than others. (eg. save fuel to jump to profitable destination/ stay local goto station to trade/ use fuel solely for injectors/etc.) this fuel-economy-factor would then determine how much value the fuel has to the ship-entity.




I think the improved fuel-methods may produce strange NPC behaviour without these checks.
edit: but I'm just a fool... :P
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

NPCs do burn fuel when afterburning. Four times as fast as the player, in fact. I didn’t make this change, so it’s been there since at least 1.67 and probably was in 1.65. They don’t seem to use fuel to witchjump, though.
Post Reply