[Design] Equipment, cargo, mass and volume

jpab
Posts: 77
Joined: Thu Jul 18, 2013 12:30 pm
Location: UK

[Design] Equipment, cargo, mass and volume

Post by jpab »

The current system
Currently, ships have limits on different equipment "slots". These limits are specified in terms of the maximum number of items. For example, a ship might have a cargo bay that can accept up to 10 cargo items, and missiles racks that can take up to 4 missiles. For most equipment slots, the limit is set to 0 (to prevent that piece of equipment being installed on the ship), or 1 (to allow it). For most equipment it does not make sense to install more than one item in a slot.

Each item of equipment or cargo also has a mass (currently specified in tonnes), and the total mass carried by the ship is tracked. There is currently also a limit on the total mass carried by the ship, which applies in combination with the individual limits on item counts in different equipment slots. This means that if you install a lot of equipment on a ship, then you may not be able to use all the space in its cargo bay, because you will hit the mass limit before you hit the cargo slot item count limit, or, if you have a full cargo hold, you might not be able to install a piece of equipment even though your ship does have an attachment point for it.

Design discussion
Several people have expressed dissatisfaction with the current design. There are various changes that could be made, including:
  • Tracking equipment and cargo mass in kilograms instead of tonnes.
  • Removing the total ship mass limit. This limit doesn't make any real physical sense, although it can act as as safety limit.
  • Tracking cargo volume as well as mass, to allow different cargo to have different densities.
  • Tracking volume of all equipment (not just cargo).
(I'm sure there are many other possibilities that I haven't thought of, or haven't included in the above list).

The first two items in that list (tracking mass in kilograms and removing the total mass limit) should be reasonably easy to implement, and I have no objection to them.

Tracking volume is possible, but leads to design questions: Should only cargo volume be tracked, or does it make sense to track item volume too? What limits need to be applied? When and where are they applied? Should it be possible to manipulate arbitrary fractions of an item (e.g., when refuelling from hydrogen in the cargo hold, does the refuelling system transfer an arbitrary portion of your hydrogen, or does it always transfer an integer number of hydrogen cargo units)?

One option for consideration is to give the equipment/cargo item slots a volume limit instead of an item count limit, specify a volume for each item, but still only manipulate whole items. This provides most functionality. Manipulating arbitrary fractions of an item only makes sense for a few items, and it can be simulated with reasonable behaviour by dealing with those items (e.g., hydrogen) as a large number of low-volume items. I'll note that the current implementation of EquipSet will have bad performance characteristics when dealing with large item counts, but that should be fairly easy to fix.

Any comments?

John B

This design discussion is being transferred from issue #2308.
Last edited by jpab on Tue Jul 15, 2014 10:19 pm, edited 1 time in total.
Reason: Formatting
impaktor
Posts: 992
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: [Design] Equipment, cargo, mass and volume

Post by impaktor »

Tracking equipment and cargo mass in kilograms instead of tonnes.
Are you just talking about the internals of the code? We would still display everything in tonnes to the player? If buying in units of kg we would need to have a better interface in commodity market, so that we don't have to click 1000 times to buy 1t.
Removing the total ship mass limit. This limit doesn't make any real physical sense, although it can act as as safety limit.
If acceleration and being too heavy to lift off, or being pulled into a gravity well would be taken into account, then I see no problem with this.
Tracking cargo volume as well as mass, to allow different cargo to have different densities.
So we could buy cargo in units of m^3 and then the physics engine would use the mass for how the ship handles. The player would need to know how much mass he/she is adding to the ship when buying 1 m^3 of Gold or Hydrogen of course.
Tracking volume of all equipment (not just cargo).
You should not be able to fit an engine bigger than your ship, but should filling your ship with a smaller engine allow you to fit ECM, radar mapper, scanner, ... or do they go on the outside of the ship? I.e. would engine compete with the same volume as all other equipment?

I think some of the slots do make sense. Like missile. For engine and scoops it's just a way to make sure no one tries to buy more than one to see if the game will crash (we've seen issues of that kind on the bug tracker).
Tracking volume is possible, but leads to design questions: Should only cargo volume be tracked, or does it make sense to track item volume too?
I say keep things simple. All equipment have negligible volume except engine and passenger cabin, and maybe shield generator. The cargo hold has a fixed volume into which one puts cargo, and passenger cabin. Does cargo bay life support go into the cargo hold, or outside?
nozmajner
Posts: 1079
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: [Design] Equipment, cargo, mass and volume

Post by nozmajner »

I think buying cargo by m3 makes sense. You need to be on a lookout for it's mass to avoid overloading the ship, but the UI should provide that information. Something like this could work for example:
Image
Mass per unit is visible on the Market side, and the total mass of each cargo on the Cargo hold side.
The TWR (thrust to weight ratio - you don't go to space today if it's under 1) display on the bottom calculated against the gravity of the body where you are landed, and against 1G for orbitals (for easier comparison). And I included a red text version in this mockup to indicate if you are overloaded. I think there shouldn't be a limit here, so you have to watch out. But there should be some kind of other warning, like a message from your computer about ship overloaded, when you want to take off. Or don't allow blastoff at all if overloaded.
But this also veers into the question of tailsitters since it doesn't makes sense that you can't use your most powerful thrusters for liftoff. This could be alleviated with a mechanic thing that rotates the ship up upon liftof if needed. (Would need to add those to the station models also)

I agree with impaktor about equipment slots. It just makes sense for things like hyperdrive or weapons, and some other things.

Also there's a potential issue with Autopilot if you are able to overload your ship. It uses your retro thrusters for landing, which are much weaker then belly or main ones for most ships.

Also there was some discussion about changing the way propellant handled, but could be related to this. Like adding the ability to transfer propellant from tanks to cargo hold/sell back to the station, which makes sense since you might want to remove some of it, so you are able to take off with some much valuable cargo.
Also currently tanks are measured with 1m3 = 1t in mind (It was easy when it was water), but Liquid hydrogen is less dense then hydrogen, about 70kg/m3, which would reduce deltaV-s quite a lot I guess. I was unable to find much data on compressed Hydrogen density, but it doesn't seem to be much better.
Or like only having 1t of that on all ships to act as a buffer. I think the current model of separate tank is reasonable for one reason: A propellant tank is already in the ship, but you need some kind of container for any propellant in your cargo hold, so 1m3 of hydrogen could mean less than 1m3 of hydrogen if you refuel. Might be not that much impact, I can't really tell how much a 1m3 liquid hydrogen tank weighs.
I imagine it a hassle with plumbing and such too (refueling could also take some time). And having a dedicated tank helps differentiate ships too. Also there are things like wings on some crafts which are a nice place for propellant storage, but you can't really store Industrial machinery or a passenger cabin there.
Something like this could be useful for that:
Image
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: [Design] Equipment, cargo, mass and volume

Post by DraQ »

I think we need both volume and mass, for both equipment and cargo.

I'd probably keep volume coarsely grained as it's only needed for managing free internal space and stuff to occupy it with - cubic meters or whatever we consider the volume of our standarized container will do.

Maximum allowed mass is not needed, on the surface inability to lift-off makes safety limit redundant unless we want to make player's overloaded ship collapse into a crumpled heap of scrap for its own sake, in space the only thing stressing the construction is ship's own thrust, and it can be presumed capable of handling that.

Some liftoff acceleration and surface gravity meters would be useful displayed in both the commodity market and shipyard, so that the player could know what they can and cannot afford to do.

Tracking volume along with mass (which we need for jump ranges and physics) has a few things going for it:
  • It makes sense. You can fit limited volume, not mass into a spaceship's hull and different things have different densities.
  • It allows for more interesting cargo management and more conditions affecting how valuable given cargo seems to the player.
  • It allows balancing space taken by equipment and hindrance caused by it separately from each other. For example equipment meant for fighters or couriers could be relatively low mass allowing ship to be filled leaving little cargo space, but retaining most of their agility, OTOH other kinds of equipment could hinder ship physically without affecting capacity much.
  • It allows variable mass equipment and equipment that should reserve space like all sorts of tanks, ammo-based weapons, ship and drone docking bays and so on.
impaktor wrote:You should not be able to fit an engine bigger than your ship, but should filling your ship with a smaller engine allow you to fit ECM, radar mapper, scanner, ... or do they go on the outside of the ship? I.e. would engine compete with the same volume as all other equipment?
(...)
I say keep things simple. All equipment have negligible volume except engine and passenger cabin, and maybe shield generator.
I strongly disagree.
You shouldn't be able to fit many things bigger than your ship - guns, shields, and so on.
And since we cannot predict what kinds of equipment could be added further down the road that we might want to forbid fitting on a too small ship and to track volume of selectively, we should track all the volumes.

Of course, some compartmentalization with separate cargo, engineering, forward and backwards weapon bays and so on, could be called for and be used to diversify ships by different models allocating different capacities to different compartments, but that's rather antithetical to keeping things simple so maybe it should be added further down the line if ever. ;)

As for the missiles I'd get rid of the pylons (since they never really worked well in Frontier) and have missiles carried in cargo bay and jettisoned on launch and separate type of missiles fired from launchers with considerable initial velocity - the launchers themselves would be considered guns and excess ammo packs (of fixed amount of rounds) could be carried as cargo. Pylons could replaced 1-to-1 with additional generic hardpoints since we're going to need more of them if we are to have more weapon diversity, but that's material for whole other thread regarding combat.
nozmajner wrote:But this also veers into the question of tailsitters since it doesn't makes sense that you can't use your most powerful thrusters for liftoff. This could be alleviated with a mechanic thing that rotates the ship up upon liftof if needed.
That doesn't really help if you can't use your most powerful thrusters for landing safely. :P
I'm all for tailsitters, although high thrust, very low ISP belly thrusters for liftoff/landing (cold thrust, if you will, to not vaporize the pad) could be enabled when deploying landing gear as an alternative.
Also there's a potential issue with Autopilot if you are able to overload your ship. It uses your retro thrusters for landing, which are much weaker then belly or main ones for most ships.
That's the problem with autopilot, though. It should be fixed anyway since its bad mechanically AND it looks wrong.
Or like only having 1t of that on all ships to act as a buffer. I think the current model of separate tank is reasonable for one reason: A propellant tank is already in the ship, but you need some kind of container for any propellant in your cargo hold, so 1m3 of hydrogen could mean less than 1m3 of hydrogen if you refuel. Might be not that much impact, I can't really tell how much a 1m3 liquid hydrogen tank weighs.
I imagine it a hassle with plumbing and such too (refueling could also take some time). And having a dedicated tank helps differentiate ships too. Also there are things like wings on some crafts which are a nice place for propellant storage, but you can't really store Industrial machinery or a passenger cabin there.
True, though 1t buffer has the advantage of least logic needed for the desired effect - with autorefueler and delta-v counting the cargo bay propellant which are needed anyway to take advantage of extra propellant and reduce tedium - it would not require any new functionality to let player dump or sell excess propellant.

Cargo bay propellant cannot have containers, since that would mean extra containers being magically summoned when, for example, scooping fuel, and mass discrepancies when converting between tank and cargo bay. Let's not go there.
We can consider all harvestable gases/liquids to be stored in variable volume bladders that extend into cargo space (contractile bladders or pistons would be nice when getting the contents out of the tanks).

Alternatively, we can keep large, ship-dependent tanks, but prohibit carrying scoopables in cargo bay - additional tanks could be installed as optional equipment. This would require dedicated means of dumping the contents, and some way to reserve fuel (with unit buffer it could be as simple as converting fuel to and from additional cargo type representing reserved fuel).
impaktor
Posts: 992
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: [Design] Equipment, cargo, mass and volume

Post by impaktor »

DraQ wrote: [... everything before this is just a reiteration of jpab's post...]
impaktor wrote:You should not be able to fit an engine bigger than your ship, but should filling your ship with a smaller engine allow you to fit ECM, radar mapper, scanner, ... or do they go on the outside of the ship? I.e. would engine compete with the same volume as all other equipment?
(...)
I say keep things simple. All equipment have negligible volume except engine and passenger cabin, and maybe shield generator.
I strongly disagree.
You shouldn't be able to fit many things bigger than your ship - guns, shields, and so on.
And since we cannot predict what kinds of equipment could be added further down the road that we might want to forbid fitting on a too small ship and to track volume of selectively, we should track all the volumes.
Having things bigger then the ship makes no sens at all. Please refer to the wiki on ship designs. What you're suggesting (as I understand it) is that every ship is just an engine and then add tings to that. It kind of makes ship design and modelling pointless, unless there's negative volume on the ship, or the things you add to the ship are invisible and have no collision box, which is not the game we are making.
DraQ wrote:As for the missiles I'd get rid of the pylons (since they never really worked well in Frontier) and have missiles carried in cargo bay

Pioneer is not Frontier, and I think they do work quite well. What you're suggesting would make a cargo ship the same as a battle ship, if cargo space is equivalent to missile mounts. It would also reduce the characteristics of the ships. We do have ships like AC33 that is a combat version of its cargo sibling. We do want the distinction between trader and fighter and missile mounts is part of how that is achieved.
DraQ wrote:Cargo bay propellant cannot have containers, since that would mean extra containers being magically summoned when, for example, scooping fuel, and mass discrepancies when converting between tank and cargo bay.
Keep it simple. The "magic" is the inflatable bladder you suggested. All containers are 1m3 in volume, they compress what they hold to the density of its liquid/solid state, and the containers have negligible mass and volume when empty. Solved.

Please don't over think everything. This isn't dwarf fortress. We don't want to buy toilet paper and tooth paste every time we land at a station.
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: [Design] Equipment, cargo, mass and volume

Post by DraQ »

impaktor wrote:
DraQ wrote:You shouldn't be able to fit many things bigger than your ship - guns, shields, and so on.
And since we cannot predict what kinds of equipment could be added further down the road that we might want to forbid fitting on a too small ship and to track volume of selectively, we should track all the volumes.
Having things bigger then the ship makes no sens at all.
Which ship is *the* ship again?
Because even today you wouldn't be able to fit something like GAU8 on every aircraft and Pioneer's spaceships have far larger size range than today's aircraft have.

It's perfectly reasonable for something the size of Malabar or Venture Star to be able to mount a weapon system larger than entire Varada and there is nothing we can reasonably do about it. And because we don't want to be able to fit a gun bigger than the ship its mounted on, we need to monitor the volume it takes.
What you're suggesting (as I understand it) is that every ship is just an engine and then add tings to that.
No, I suggest the ship to be a mostly empty hull with conventional drive and essential equipment like cockpit, basic avionics, life support, landing gear, plumbing, actuators and so on. This is what gives (well, will) ships it atmospheric characteristics and thrust values in various directions.
This is what ships currently are and so the available hull volume should dictate what could be fitted inside.

Pioneer is not Frontier, and I think they do work quite well. What you're suggesting would make a cargo ship the same as a battle ship, if cargo space is equivalent to missile mounts. It would also reduce the characteristics of the ships. We do have ships like AC33 that is a combat version of its cargo sibling. We do want the distinction between trader and fighter and missile mounts is part of how that is achieved.
Ok, that's a fair point, though if you're just shoving missile out before it activates its engine and starts pursuing the target there is little you can realistically do to stop anyone from turning a freighter into a missile bus.
Maybe add requirement for a guidance system occupying a weapon slot and make the heavy missiles expensive (we're talking missiles the size of cargo container or bigger) making it uneconomical and impractical for freighters with few weapon mounts.

Anyway, the problem with pylons is that they have way to limited capacity for missiles to be practical and the missiles themselves are too bulky (the missiles launched from cargo bay would only work for stuff at least the size of container, so heavy, expensive and probably not exactly anti-fighter ordnance). We need missiles of various sizes that could be mounted in clusters depending on their size, either on pylons or fired from reloadable launchers reloaded from ammo packs the size of standard container. This is especially important for unguided rockets that just can't be expected to hit anything unless they are launched in large salvoes.
DraQ wrote:Cargo bay propellant cannot have containers, since that would mean extra containers being magically summoned when, for example, scooping fuel, and mass discrepancies when converting between tank and cargo bay.
Keep it simple. The "magic" is the inflatable bladder you suggested. All containers are 1m3 in volume, they compress what they hold to the density of its liquid/solid state, and the containers have negligible mass and volume when empty. Solved.
Then how about forgoing "magic" bladders and making ship's hydrogen tank a normal one, forgoing fixed capacity fuel tank? We can assume all the hydrogen in the bay is in the bladder and treat it as containers otherwise except destroying it on jettisoning, spawning some vent effect instead of container?
impaktor
Posts: 992
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: [Design] Equipment, cargo, mass and volume

Post by impaktor »

DraQ wrote:Which ship is *the* ship again?
The ship you want to fit said piece of equipment to. I suggest you re-read my first post, since I now suspect we are misunderstanding each other.

My reply was to:
DraQ wrote:
impaktor wrote:You should not be able to fit an engine bigger than your ship...
[....]
I strongly disagree.
I interpreted this to mean you wanted a ship to be able to carry an engine bigger than the ship. ("the ship"= the ship you want to fit the engine to)

So, never mind. At least we've given jpab some thoughts he can choose from (if he now is the one who feels up to implementing this?) and pointed out some potential issues.
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: [Design] Equipment, cargo, mass and volume

Post by DraQ »

impaktor wrote:
DraQ wrote:Which ship is *the* ship again?
The ship you want to fit said piece of equipment to. I suggest you re-read my first post, since I now suspect we are misunderstanding each other.

My reply was to:
DraQ wrote:
impaktor wrote:You should not be able to fit an engine bigger than your ship...
[....]
I strongly disagree.
I interpreted this to mean you wanted a ship to be able to carry an engine bigger than the ship. ("the ship"= the ship you want to fit the engine to)
I was objecting to the idea of not tracking volume of most equipment, as I have indicated in my post:
DraQ wrote:
impaktor wrote:You should not be able to fit an engine bigger than your ship, but should filling your ship with a smaller engine allow you to fit ECM, radar mapper, scanner, ... or do they go on the outside of the ship? I.e. would engine compete with the same volume as all other equipment?
(...)
I say keep things simple. All equipment have negligible volume except engine and passenger cabin, and maybe shield generator.
I strongly disagree.
You shouldn't be able to fit many things bigger than your ship - guns, shields, and so on.
And since we cannot predict what kinds of equipment could be added further down the road that we might want to forbid fitting on a too small ship and to track volume of selectively, we should track all the volumes.
(relevant parts in bold)
So, never mind. At least we've given jpab some thoughts he can choose from (if he now is the one who feels up to implementing this?) and pointed out some potential issues.
True.
laarmen
Posts: 34
Joined: Fri Jul 05, 2013 8:49 am

Re: [Design] Equipment, cargo, mass and volume

Post by laarmen »

I wish people would at least read the current implementation to be able to have a sense of how difficult some things are compared to others. Or offer to code (which, I can testify, is

First off, we don't care about container size. Let's assume we have an automagic force field to hold the stuff, and voilà.

Each equipment set has (poorly named) slots such as "cargo", "laser_front", etc, each with a size. Originally, an equipment would take up a size of 1 no matter what, which means that pretty much all slot sizes are of one, except for cargo. My proposal is to put a real volume unit to this size, and to give each equipment piece a volume. And to further simplify, let's say that the unit is 1 m^3. And that you keep it all in integer realm, which means you buy at least 1m^3 of cargo, when you refuel your tank you use at least 1m^3 of hydrogen, etc.

Here. That's it. We don't care about missiles or stuff, we'd "just" need a bit more code in EquipSet.lua, and to update all the equipment to include a volume in cubic meter and to specify a mass in kg instead of tons, and to update the slot sizes in all the ships. And we'll have a fairly good basis to go on from, without breaking much stuff.

Once that is done, and *works*, we can start putting realistic values for the cargo, dropping the hard mass limit for the ships (unless it was needed in a step before that, which is possible, I haven't thought all of it through). And then, finally, we can start nitpicking about allowing equipment bigger than the ships, and how unpractical the current missile system is, and all that.

Does anyone disagree with this proposal ? :-)
impaktor
Posts: 992
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: [Design] Equipment, cargo, mass and volume

Post by impaktor »

Sounds good laarmen.

When the weight is implemented, one would like to, when loading a ship, see what the maximum G-force planets one would be able to take off from with the current weight. Some bar/value in the footer perhaps.

Tradeship and NPCs would also need to not be heavier than max takeoff weight.

I can imagine getting to a system with full cargo from a small world, realizing there's no orbital port in the system, so you have to jettison some cargo to be able to land on a heavy world. A bit interesting game play I think.
Post Reply