Jump to content

Gas doesn't clump, guys!


Recommended Posts

I love your games, you know I love them, so I'm going to get straight to the point.  I can't stand this:

image.thumb.png.1f77a9b6ce5666325cd95d7abf2fbc3e.png

There is absolutely no way this would happen, nor would gases a meter apart from each other have a constant fluctuation of half a kilogram of mass!  Gases mix, and flow from high pressure areas to low pressure areas almost immediately.  Hell, the 'oxygen' we breathe is like 80% nitrogen; if it was 100% oxygen we would be dead by now.  I appreciate the detail where CO² sinks below oxygen, but it doesn't because it's too busy pushing and being pushed by oxygen, and it's just this really ugly dance of an unbreathable pocket of air.  It also makes air filters sort of hit-and-miss because sure, there's a huge chunk of CO² in my basement but it can't reach the vent through the impassable wall of oxygen.

Please overhaul the gas system to allow combination of gases, where air becomes unbreathable when the oxygen content in a tile is too low.  If some chlorine gets in there, it'll mix in with the rest of the air and you'll need to filter it out.  And additionally, please make the air pressure act a little less like molasses - there's no reason for one half of my room to be so low pressure that it's unbreathable and plants can't grow while the other half of the same room is "very breathable".

Possibly liquids should do the same, but I could take it or leave it.

Link to comment
Share on other sites

I absolutely agree. The physics of gas in the game about the physics of gases is somehow far from realism. I understand that making a mix of gases and liquids means changing the mechanics drastically, but it's worth it. Have you seen what is going on with water when it is mixed with polluted water? The water that flows out of the pipe turns into an infernal dancing monster.

And yes, the appearance in the game of mixes of gases and liquids will not create an extra large cpu intense.

But even if you can not make the mixes, the physics of gases and liquids are really need improvement! It is enough to just move faster!

Link to comment
Share on other sites

14 hours ago, vovik said:

Uhh, tile logic is cornerstone of oni physics... also implementing gas mix is very cpu intense....

If it's a cornerstone, then it's a pretty poor cornerstone to have.  I would rather see the meta change and all the established little exploits and gimmicks thrown out than have to deal with gas that behaves like maple syrup.

Also, your second statement is 100% false - there's nothing cpu intense about implementing a gas mix mechanic with the current number of gases in the game.  The mixed gases don't react or otherwise interact with each other, so it would simply be a matter of replacing 'oxygen tiles' and 'carbon tiles' with generic gas tiles that have an oxygen component and a carbon component ( and the other kinds of gases in-game, obviously ).

Link to comment
Share on other sites

Just as food for thought: would it help if the current tile system was to be split into quarters for liquids and gases?

Pumps would only be able to extract one element at a time from such a tile, but the interexchange of the different liquids/gases would possibly be more fluent.

It would also prevent liquid seals and the like.

Link to comment
Share on other sites

4 minutes ago, blash365 said:

Just as food for thought: would it help if the current tile system was to be split into quarters for liquids and gases?

 

A step in the right direction functionally, but that would probably be more complicated and costly than just having gas tiles store information about the volume of different gases.  If I'm not mistaken Klei uses an ECS for their games, and that's sort of what they're designed to do - have a single entity contain a handful of component parts that are run by a component system.

Short topic detour on your 'liquid seal' note; my roommate brought up an interesting point about how liquids tend to unrealistically stick to surfaces and mostly ignore gravity.  If duplicants were VERY small, like the size of fleas or so, the surface tension of water would be high enough that it would realistically exhibit that kind of behaviour.  The reason why this isn't a viable theory, however, is because if the surface tension was that high then water would certainly be a death sentence for them ( since they would not be able to break the surface of the water on the way out ).

Link to comment
Share on other sites

3 hours ago, Fokson said:

Also, your second statement is 100% false - there's nothing cpu intense about implementing a gas mix mechanic with the current number of gases in the game.  The mixed gases don't react or otherwise interact with each other, so it would simply be a matter of replacing 'oxygen tiles' and 'carbon tiles' with generic gas tiles that have an oxygen component and a carbon component ( and the other kinds of gases in-game, obviously ).

Currently there are seven (?) gasses available in game, with 19 listed in the Wiki as having values in code. If you wanted to make each tile a possible mix of gasses, you went from storing a a gas type and mass to storing, at minimum, 7 masses. Likely that the gas type is stored as single byte (256 values) and mass as a four byte number (I've seen values from a few milligrams of gas to many kilograms. That means either a 2 byte number and another byte as unit of measure (Kg, Mg, g) or just a 4 byte number). So worst case, right now that means 5 bytes per tile. Bumping up to 7 gas types means 28 bytes per type since you can store them as an array where 0 is always Hydrogen, 1 is always O2, etc and thus you don't need to store the type. The map is currently 256x384 tiles in size for a total of 98304 tiles. That means 491,520 bytes in memory just to store gasses in tiles. That would change to 2,752,512 bytes if mixes were allowed.

Now that's not a lot of memory, but it's only the first performance hit. Currently the physics only has to look at each tile's gas type and density, compare it to its surrounding 4 tiles and do some pseudophysics to see if it gains or loses mass (if surrounding tiles are the same gas) or switches places if not. Let's assume that only 24576 (25%) of the tiles actually have gas, the others are solid and can be ignored. So each tile therefore requires four neighbor calculations to see how it acts (still gotta check solids because you can't move there). That means we're back to 98,304 calculations every time the gas physics runs. However if we have every type of gas possible on every tile it becomes more complicated. First you have to sum the masses of every gas type on every tile to determine total density of the tile (this can be done once per cycle and saved and means extra memory, but it still has to be done). Next, we have to take each gas type and see if it wants/can spread into neighboring tiles, but you have to do that 7 times per tile. That means 688,128 calculations per gas cycle

None of that even gets into temperature. Right now it's pretty easy to compare the contents of a tile and see if it should get emit or absorb heat from its surroundings. However if 250 grams of Hydrogen at 20C mixes into a tile with 750g of Chlorine, 100g of Oxygen, and 50g of Natural Gas at 21C, what is the new temperature? The math's not hard, but it has to be done every cycle for every tile. Plus it involves lots division and computers hate division.

 

So it's very accurate to say that it would be very CPU intensive to add mixed gasses. I would love to see that kind of detail, but I don't think it's going to happen any time soon. Maybe ONI2.

Link to comment
Share on other sites

The gas interaction as it already is (in conjunction with heat, liquid, etc simulations running simultaneously) is already pretty demanding.

Changes to it have to be very carefully considered.

Besides, it seems like changes to these systems are unlikely at this point anyway, since they claimed with their roadmap update in August that "Additionally, while we agree that a new system was not the most requested feature in the game, we felt strongly that we needed to bite the bullet and work on building out the base systems before digging deeper into those systems."

This, to me, reads as though they're satisfied with the basic core systems that this game relies on for its gameplay. That they're now focused more on adding content to those systems than they are in overhauling the way that they work.

At the end of the day, it's a video game. They're not trying to create an accurate representation of reality. There are creatures in this game that eat dirt and poop coal. There are plants that cool gasses that they breathe. There's a giant 3d printer that duplicates people. They're trying to build something that's fun and challenging to play. Not some kind of ultra-realistic gas simulator. The way that the game is currently built doesn't facilitate the mixing of gasses.

Link to comment
Share on other sites

I strongly disagree with most of your last paragraph, Kevin.  There's a pretty stark difference between the creatures and the printer being unrealistic and the gases being unrealistic.  The former complements the game's flow, and are - as Vovik would say - "A cornerstone of the game".  Janky gas physics are both unrealistic and make managing airflow a burden to the gameplay.  You spend less time and effort making a workable system to manage your colony's air supply and instead develop strange and unintuitive meta-cheeses that take advantage of the said janky physics.  This is ultimately what kills the fun in games for me - when the 'winning move' as you could call it is abusing a quirk in the system.  Nevertheless, though, I respect your opinion and appreciate your perspective!

Wedge, thanks for your very in-depth post!  I understand the calculations you've made, but I believe you're overthinking the issue a little.  You're going on the assumption that, to achieve this change, you'd need to run the same gas calculation for every individual gas every cycle, which isn't necessarily true.  A gas tile could have one value, which represents the overall pressure in the tile, and then one byte for each gas that represents what percentage of that pressure compared to the other gases it occupies. If the pressure is greater than its surrounding tiles, it will average the two, and then accordingly adjust the different gases.  If no pressure change occurs - which there shouldn't be in areas that aren't being acted upon by the player - then no calculation beyond that initial check needs to take place.  I hope that makes sense!

Link to comment
Share on other sites

I'd also like to take a moment to clarify, in case it wasn't apparent, that this suggestion isn't solely about mixing gases.  It's about gas movement and transmission in general.  If you look at this base here,

image.thumb.png.59cde59895554fd45b054618b51e47cd.png

there is a pressure gradient of over a kilogram across this tiny area, which should be impossible.  If that's not enough for you, please explain to me what on earth ( or this asteroid ) is going on here:

image.thumb.png.320f1d431f8be287c24a9f8ab5fd9254.png

That is literally a kilogram of difference exactly one tile away!  This isn't just a weird thing that was there for a moment, either; that's been being like that for the whole cycle.  Why isn't this equalizing?

Quick side note too, because this confuses me about as much.  The above deoxidizer is pumping with an ambient pressure of about 1.5kg, but this other one...

image.thumb.png.d0f79202117957825a921c43893b5435.png

Vents will do this sometimes too - refuse to pump because of a high ambient pressure when the room is barely breathable. A vent should theoretically never have this problem if the room isn't airtight, since the air is being removed from one location and pumped to another.  It's not supposed to be so much a transportation of the gas, but a circulation - you pump oxygen from a high area down to a carbon filled room, which pushes some of the carbon up and distributes the oxygen ( more of less ) evenly.

All of this silliness would be solved with more responsive air pressure, and mixing gases would prevent a random pocket of 4kg of carbon floating by and exploding Lindsay's ear drums.  I have no idea how the code is handling it currently, but - and I risk sounding like a broken record at this point - the air behaves more like pea soup than air.  It's a wonder my poor Duplicants haven't just suffocated already, breathing must be really hard for them D=

Link to comment
Share on other sites

8 hours ago, Fokson said:

image.thumb.png.d0f79202117957825a921c43893b5435.png

Vents will do this sometimes too - refuse to pump because of a high ambient pressure when the room is barely breathable. A vent should theoretically never have this problem if the room isn't airtight, since the air is being removed from one location and pumped to another.  It's not supposed to be so much a transportation of the gas, but a circulation - you pump oxygen from a high area down to a carbon filled room, which pushes some of the carbon up and distributes the oxygen ( more of less ) evenly.

All of this silliness would be solved with more responsive air pressure, and mixing gases would prevent a random pocket of 4kg of carbon floating by and exploding Lindsay's ear drums.  I have no idea how the code is handling it currently, but - and I risk sounding like a broken record at this point - the air behaves more like pea soup than air.  It's a wonder my poor Duplicants haven't just suffocated already, breathing must be really hard for them D=

this is a bug with deoxidizer - it should read gas pressure properly, also, seems this is a preview branch with glitches(i may be wrong) - deoxidizer never shown same to me

Link to comment
Share on other sites

Archived

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...