I've had a quick look at the way adding passenger berths works, and it's not pretty. Berths are handled as a very special case, and there's no provision in the existing code for a more generic way of handling required_cargo_space. And, well, there are other factors, apart from figuring out a way of coding in the extra flexibility: indeed, it looks to me that the whole subject is pretty much a minefield!
I'll expand on that thought!
So far, required_cargo_space was just used to see if the extension was offered or not, but adding/removing berths was hard coded to 5 tons anyway.
As an experiment, I've made passenger berths actually respect the required_cargo_space set in equipment.plist. It's in trunk now, so you can do some experiments too using the nightly build.
Changing required_cargo_space in equipment.plist to - say - 7 instead of 5 does modify the total available cargo space as expected.
However, and that's the problem, it does that retroactively too. There's simply no space for 5 tons berths in a 7 ton berths universe.
I created a few example savegames with a standard cobra3, to see what would happen.
Before: cobby with cargo bay expansion, 2 passenger berths, and 25 tons of cargo. After:2 passenger berths, and 25 tons used out of 21 available. However, we'll have to remove the extra 4 tons of cargo somehow. This would cause 'a few' problems to contracts: making the savegame consistent with the new ooniverse parameters will potentially make some already taken contracts impossible to fulfil.
And a cargo bay expanded cobby with 7 full passenger berths will load as having 5 passenger berths. Mercifully, instead of killing 2 passengers at random, it will spare the lives of all surplus passengers. Of course, this state of affairs cannot be allowed to continue, so in future any supernumerary passenger will be kindly escorted to the nearest airlock when loading a savegame. Intriguingly, after noticing that we can't have more than 5 berths to fill the 35 tons, the available cargo calculation gets 'slightly' broken, and we magically get 35 tons of available cargo space once again, to do whatever we like with it!
'Unfortunately' it's not quite recursive, so no matter what I do I can't seem to get more than 10 7 tons berths... Again, that can't be allowed to continue!
Fun fact: upping the number of berths from 7 to 8 inside the savegame shows the same extra cargo space bug in 1.76! A fix for trunk & maintenance is coming asap!
In any case we now know that the answer to:
Thargoid wrote:The required_cargo_space could perhaps be used to "buy" the equipment space I mentioned, plus it would be fairly backward compatible as I presume there's already code in place to catch having more cargo than space for it?
Is "nope, there isn't." There's a number of checks in place to try and avoid getting more cargo than available cargo space. As a consequence - and thanks to us humans being so wonderfully complacent at times - no-one seems to have anticipated the need to add such a check when loading games. Not too much of a biggie in and of itself, that check is in the TODO list for 1.77/1.78 now.
However, at the moment, I get the feeling that my experiment with 'flexible berth space' is indeed going to stay just that, an experiment.
We're just talking about 1 piece of equipment with this capability, and it already looks like presenting us with a very non-trivial problem:
Enabling all equipment to potentially disrupt savegames retroactively doesn't 'quite' seem right. It's all too likely that a player might not notice their cargo 'slimming down' after adding oxp 'X', and to overwrite their savegame with reduced cargo as a consequence. Adding notices & readmes might not really be an effective solution, as per the amount of RT(F)Ms abundantly peppering forums everywhere.
At the same time, allowing older savegames to load a ship with cargo space altering equipment that doesn't
actually alter cargo space doesn't seem right either. I believe we're at an impasse, as it where.
As A_C already pointed out, this is pretty much a Frontier-like feature. Without Frontier to 'show us the way' I doubt we'd even think in terms of cargo-taking equipment. After all, adding a CD player to a van requires finding space on the dashboard, not shrinking the cargo compartment....
Anyway, if we can figure out a solution to this impasse, I'm more than happy to investigate the possibilites!