Jump to content

In depth example attempt at conservation of mass in game, with minimal changes

Recommended Posts

Problem: The game is poised to be a trailblazing member of its genre by nailing a unique kind of gameplay: closed loop system sustainability. That would be more awesome, novel, and fun, historical, and the whole theme and setting points toward this. See for example of several other people supporting this concept very recently: 

Solution: Below, I've listed what I think is a comprehensive (?) or if not, good enough for a demonstration list of minimally invasive changes to make the game conserve mass. I've added as little complexity as possible--the list is long but most of it is changes to existing recipes, not new features, which is not a net increase in complexity. And I've sought to maintain the same buildings, critters, general tasks and features, etc. as now. The basic change is only to break everything that can be converted down into elemental formulae, then track the elements 1:1 as any conversion takes place, then make recipes work accordingly. Note that the player doesn't have to worry about this, the code takes care of it for you, and early/basic gameplay remains similar, but now sustainability and a much more novel game is possible.

Glossary term: “CH2O” used below a lot. This is a generic simplified chemical abbreviation of "sugars and other biomass." It does not need to actually appear in game anywhere, just on the back end. Plant and animal material is all just chemically made out of this (and water sometimes), but maintains existing names and item types, etc. Meal lice are still meal lice, for example, and cannot be converted to algae, but both are, for chemical mass conservation purposes in the suggested code, both made out of CH2O.

Glossary term: “Units” These are not all equal to each other across the whole document. Just a way to denote LOCAL generic ratios per unit time, as with molar ratios. So within any one recipe below, 1 unit = 1 unit by moles, but between recipes, 1 unit in one recipe might not = 1 unit in the other recipe. Just multiply all units in any one recipe by whatever mass is convenient for economy and game balance.

Recipes are organized somewhat narratively for built-on understanding:



Mush bars and Lice loaf:
Take in
1 unit by weight dirt or lice (CH2O), 9 unit H2O
Output 10 units corresponding wet food
Store Same ratio by weight but now as the food item.

Other food: (not made with water added, like raw lice)
Store only chemically made of CH2O in weight


Take in
5 units H2O (includes that gained from eating wet foods. Otherwise with dry foods, remaining amount of bottled water must be drank directly) + 5 units CH2O (from food) + 4 units O2
Output 10 units contaminated water as urine/waste (CH2O + 9(H2O)) + 4 units CO2 + clean excess H2O if consumed too much
Store 90% H2O 10% CH2O equal to their weight while alive.
Require to print 90% H2O 10% CH2O equal to their weight to print (bottled water needed and necessary ratio of mush bars or algae etc. depending)

Note that although the by-moles units of water above look super high compared to the gases, one must remember that gases at max pressure are 1.5kg per tile, while water is 1,000kg/tile, so they're exchanging WAY more tiles of gas per unit time than tiles of solid resources, since “units” are by moles. Just like now in gameplay (and similar to real life).


Take in
1 unit H2O (absorb vapor and/or delivered by dupes), 1 unit CO2, optionally x amount of light
Output 1 unit O2
Store +1 unit CH2O grown from above input added toward increased mass of plant or toward harvestable food output per unit time. So for example, for every 1 mole of meal lice grown by a mature meal plant, it would need to have taken in 1 mole of water, 1 mole of CO2, and would also have outputted 1 mole of O2 in the meantime. Algae terrariums can output this mass as algae items instead of edible food, etc.

speaking of which:
Algae Terrarium:
Some initial algae
Take in (per unit time) same as above for any other plant.
Output same as above.
Store same as above gains + initial.

So they CREATE algae, not destroy. As a reason to build them, they might for example, convert resources into plant matter much faster than other plants, at the cost of not being edible (less flexibility). Remember: units =/= units between recipes, so these could all be multiplied by a higher number than for some other plant, creating a faster conversion.

And this multiplying algae isn't imbalancing, because 1) mass is conserved, it's not infinite, and 2):
Algae Deoxidizer
[Removed entirely from game.]

Note that pressure gameplay is still very relevant and entertaining, though, due to the issues caused by digging out the base causing lower pressure. And more gas pressure can also be created or manipulated by burning plant matter (depending on water vapor implementation), or by pumping out pockets found and purifying them, adding them to base ecosystem, etc. Burning plants:


Bio Generator:
[Added building]
Take in 1 unit dry CH2O materials (such as algae or meal lice or biofuel, see below) + 1 unit O2
Output 1 unit CO2 + 1 unit H2O + x amount of power, power can be chosen to be wasted if you only care about the gas pressure it provides.

Bio Distiller:
[Slightly expanded application]
Take in 1 unit of any wet bio solid ITEMS (not contaminated water). Still includes slime (see below) but also now includes things like corpses, mush bars, etc. Anything from the many items in this document listed as being made of 90% H2O 10% CH2O.
Output 1 unit “biofuel” (made of dry CH2O) + 9 units H2O

(also conveniently makes more sense that distiller now gives distilled water, not dirty water, as per what a distiller actually is. Though not the primary reason for this or any change here. It just happens that when conserving mass, lots of other things by accident / for free end up more realistic!)


Contaminated Water
Composed of 90% H2O, 10% CH2O by moles, in all contexts.

Contaminated Air
Composed of 90% O2, 10% CH2O by moles, in all contexts.


Rotting dry food or plant matter (pure CH2O):
Take in
nothing if not in contact with clean water or clean O2. If in contact with one or both of those, though, then it uses up 9 units of clean O2 or H2O
Output again nothing if not in contact with above. Otherwise, outputs 10 units of contaminated versions of input (9 clean material + 1 CH2O), and loses 1 molar unit itself (eventually rotting away completely)

Rotting bodies OR wet food (mush bars, lice loaf):
contaminated water, and directly decreases weight of remains 1:1 as contaminated water is generated over time. Eventually therefore rots away completely.
Optional: Also could have it, when O2 available, have some of the rot be contaminated air, then output some portion of clean water to balance that.


Slime (composed of “wet” bio i.e. 90% H2O 10% CH2O):
Does three different things:

Two of them:
Take in 9 units of O2 or H2O when available
Output 10 units of contaminated versions of either
Loses its weight in 1 unit of CH2O

Then also, if slime is less than max weight for its tile, and there is CO2 and clean H2O vapor or liquid near it, it can partially grow more slime back in (in order to form a closed ecosystem with pufts), according to the formula:

Take in 925 units CO2 + 7,850 units H2O
Output 100 units contam. air + 773 units contam. water
Store +50 units CH2O in own slime weight for the tile

(remember, units are just for internal ratios, they could for this recipe be milligrams, for instance, so 7.85 grams water, 9.25 grams CO2, etc. The big numbers was just because 773 is prime)


Take in
10 units of contaminated air + 10 units contaminated water
Output 7 units O2 + 11 units H2O + 2 unit CO2
Store 90% H2O + 10% CH2O equal to their own weight

This should form a symbiotic ecosystem with slime and pools of water

Take in
minerals / stuff, up to maximum storage equal to a storage compactor building
Output nothing, until killed when it spills everything back out.
Store the same stuff it's eaten + (90% H2O + 10% CH2O equal to original empty weight)

Take in
8 units O2, 1 unit CO2, 1 unit H2O (vapor or liquid) when all available
Output 1 unit contaminated air (9(O2) + CH2O)
Store its weight in 90% H2O, 10% CH2O
Takes to create: 1:1 moles of material is removed from a duplicant corpse to spawn one.


Chemically treat as C10H2O or similar for high carbon content

Coal Generator:
Take in
1 unit coal (C10H2O) + 10 units O2
Output 10 units CO2 + 1 unit H2O vapor + x amount of power


Take in
2 units H2O + x amount of power
Output 2 units H2 + 1 unit O2

Hydrogen Generator:
Take in
2 units H2 + 1 unit O2
Output 2 units H2O + x amount of power

Note this is still temporarily useful as long as you stash the hydrogen somewhere, like pumping it into a pressurized chamber. Or possibly, for example:


Hydride Production [in a “fuel cell” building -- added complexity, but only to make hydrogen assets still cool]:
Take in 1 unit any [metal] + 1 unit H2 + x amount of power
Output 3 units [metal] hydride

DeHydriding [in fuel cell building]:
Take in 3 units [metal] hydride
Output 1 unit [metal] hydride + 1 unit H2 + x amount of power


CO2 Scrubber:
Take in
1 unit CO2 + 10 units H2O + x amount of power
Output 10 units contaminated water (9(H2O) + CH2O as always) + 1 unit O2

Water purifier:
Take in
10 units contaminated water (9(H2O) + CH2O) + 5 units sand + x amount of power
Output 9 units H2O + 6 units “tar sand” (5 units sand + 1 unit CH2O as one mixed material)

Tar Sand Generator:
Take in
6 units tar sand (5 units sand + 1 unit CH2O) + 10 units H2O (pipe) + 1 unit O2
Output 5 units sand + 11 units warmer H2O (pipe) + 1 unit CO2 + x amount of power
where x is some amount of power noticeably smaller than needed for the equivalent purifier step.


Take in:
1 unit some liquid on floor
Output: 1 unit bottled version of that liquid made on ground nearby, instead of destroying

New job button available: “Empty bottled liquid”
Take in
1 unit bottled liquid
Output 1 unit of free flowing liquid at reachable, designated tile once delivered


TILE BUILDING etc. on top of liquids or gases:
If available adjacent space for fluid to push into: have it push there and be displaced, not destroyed.
If no available adjacent space, but tile is only liquid: bottle it and drop bottle item somewhere nearby.
If no available adjacent space (or all at max pressure), and includes gas: give a red box error similar to the ones when plants don't have the right growing conditions, and don't let the building be built yet until space is available adjacent for the gas to go. If this is even possible? It probably is somehow, but would be very rare.


Edit: Duh, forgot the whole bathroom processing thing. But am tired now, hopefully it should be fairly obvious how that would fit in similarly to the pattern above.

Link to comment
Share on other sites

I really like the amount of thought that has got into this post, nicely done!

The only problem with an entirely closed loop system is that once set up, it can run indefinitely without any further input from the player, unless you model energy loss / heat generation when transforming inputs to outputs.

Without the need for new materials, I believe the gameplay will stagnate

Link to comment
Share on other sites

3 hours ago, chromiumboy said:

I really like the amount of thought that has got into this post, nicely done!

The only problem with an entirely closed loop system is that once set up, it can run indefinitely without any further input from the player, unless you model energy loss / heat generation when transforming inputs to outputs.

Without the need for new materials, I believe the gameplay will stagnate

If you simply withhold some of the reactions needed for the full closed loops until maximum tech, and possibly clever piping, etc. worked in there as being necessary, and/or complex and exotic ingredients to build the necessary processors, then you could definitely make this unachievable until you've put many hours into a base, even if you know what you're doing.

That would make it good enough to not stagnate for tens of hours of gameplay. And then anybody still sticking around after that is probably loyal enough to the game that they'd play more afterward just to play with fun contraptions and concepts. By comparison, note that in Dwarf Fortress, you can become self sufficient in about 5 minutes, yet people stick around and build crazy traps and machines and architecture anyway. Same in minecraft. Rimworld you can become self sustaining entirely (as long as you win raids without deaths). Planet coaster you can be self sufficient in 5 minutes too. Several similar successful games don't seem to have a problem with people leaving due to that.

It would require lots of fun machines to play with in late game, but it seems guaranteed they have such things planned already, looking at the material lists, for example ("steel, mercury, ..." and the fact that research only goes up to "intermediate" so far, and so on, clearly lots and lots of complexity planned)

Link to comment
Share on other sites


I like everything about this post, @Crimeo. Good job. Hope the devs see and agree.


On 3/9/2017 at 8:25 AM, chromiumboy said:

The only problem with an entirely closed loop system is that once set up, it can run indefinitely without any further input from the player, unless you model energy loss / heat generation when transforming inputs to outputs.

Without the need for new materials, I believe the gameplay will stagnate

H E A T  D E A T H  O F  T H E   U N I V E R S E

Ahem. Waste heat is the most common method of losing energy, but there's a ton of sources you can have as potential losses. Light, Sound, Motion, they all use up energy of the Dupes, which is your lynch pin. You don't reaaaally need to model them however, since a lot of those do get 'wasted' in a sense. Radiated heat would leave the asteroid at some point anyway. I like the idea of your Energy reserves being a nice measure of how much you have stored up for your colony; electricity, food, Dupes stored energy, biomass, etc. Could create fun gameplay where you know you have a ton of biomass, but you need electricity or food and need to research a method of conversion. That also creates more replay value as you try various different environments and limitations (no spawned water, no spawned coal, plants can't grow, etc), meaning you have to resort to different strategies to leverage what resources you have to survive. Don't Starve had that methodology running through it; use what you have, not what you want.

I'm pretty sure that Gases are at standard 'pressure' at 1kg, or at least Oxygen is; its almost exactly equal to standard atmos pressure if tiles are 1.5 m3. All gases in the game spawn at 1kg as well. Oxylite only equalizes with outside Oxygen at roughly 1.8kg.

Link to comment
Share on other sites

Air is 1.225 kg/cubic meter (which seems vaguely what a tile is), so yeah the pressure is reasonably calibrated.

Everything about pressure and gas does really probably need to be redone anyway though to open up all the possibilities needed. Lots of things inherently would require partial pressure being a thing to really be able to do many other things well (such as any process requiring more than one gas ingredients, which I avoided a lot above but didn't want to have to), and having any reasonable way of modeling things like humidity without ridiculous outcomes like "humidity suffocates you because water vapor uses its own entire tile" etc.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...