[Request] Code support for having alternate restrictions on Outfits and Ships
#120 opened on Nov 1, 2024
Repository metrics
- Stars
- (18 stars)
- PR merge metrics
- (PR metrics pending)
Description
Problem Description
Right now, if an outfit needs a license to purchase, it needs that license to purchase it everywhere. Likewise, if it costs X to buy it in one place, it will cost X to buy it everywhere else too.
The problem is, this isn't how the economy works, nor is it how restricted goods work. Depending on context, prices can vary a lot from region to region; and something that requires licenses or military approval to buy in one place may be available no-questions-asked-so-long-as-you-have-cash in another. Currently, the only way to do this is to create an entirely new outfit for the other place, which doubles up on a lot of stuff and is quite inefficient.
Doubling up on things also causes a variety of problems:
- If the item is updated, now it needs to be updated in several places.
- If a mission tests for the presence of the thing, now it needs to check for several things.
- Can't be used for trade, since the cheaper one will always be cheaper no matter where it is, and the more expensive one will always be more expensive no matter where it is.
Related Issue Links
https://github.com/endless-sky/endless-sky/pull/6404 (this one handles the price/cost aspect of the above request, at least for outfits) https://github.com/endless-sky/endless-sky/pull/6474 https://github.com/endless-sky/endless-sky/issues/6314 (tangental, related to legality of things) https://github.com/endless-sky/endless-sky/issues/3579 (An issue by Tadrix requesting variable prices many years ago)
Desired Solution
Have a way to specify that a specific outfit, ship, outfitter, or shipyard has modifiers or replacements for the item's normal requirements.
Two routes come to mind: One is adding data to the sales file
shipyard "Lionheart Advanced"
modifier
clear license
cost 1.25
license "Warship License"
"Aerie"
"Corvette"
"Bactrian"
cost 0.5
This would remove all license requires, and then give them all the requirement to have the "Warship License" and multiply their price by 1.25. Further down, the Bactrian has "cost 0.5" which would then modify the cost by half.
Alternative Approaches
The second route would be adding this to the ship file, where a ship could be given multiple prices and/or license requirements, with conditions attached. Anywhere the conditions apply, the alternate values are used.
Personally, I prefer the sales route, since the whole purpose of the sales file is to control where and how things are sold. Having some of that offloaded into the ships file forces someone adding a ship to methodically list every circumstance that it might be for sale under, and what things to change (if any). Also, the sales file is already typically modified by events, whereas the ship files generally aren't. So better integration with current systems.
Additional Context
This system would be extremely useful in both building the lore of the game, setting up the environment the player operates in, and allowing greater degrees of change between areas. Right off the bat, two major improvements would be in demonstrating changes between the Republic and Free Worlds; as well as between the Republic and Pirates.