Jump to content

Thoughts on partial pressure?


Recommended Posts

Any thoughts on doing partial pressure in game?  It looks strange to see a whole square devoted to 10mg of CO2 next to 1000g of O2.  A more natural thing would be to hover over a square and see (in the tooltip) a mixture of gases.  The visuals would probably still reflect the dominant gas.

On a related note, has anyone tested to see if "grams of gas" is being used as a proxy for pressure?  i.e. if I put 1kg of hydrogen and 1kg of CO2 together in a 10-square room, do they each get 5 squares, or does the hydrogen take nine squares and CO2 just one?

 

Link to comment
Share on other sites

I'm afraid it would be not technically possible. Have you played Victoria 2 ? Think every square in ONI is a nation in VIC2 and every type of gas is a culture. In the end game there would be all types of gas in each square. ONI would be more laggy than VIC2.

Link to comment
Share on other sites

1 hour ago, FluxFaraday said:

Any thoughts on doing partial pressure in game?  It looks strange to see a whole square devoted to 10mg of CO2 next to 1000g of O2.  A more natural thing would be to hover over a square and see (in the tooltip) a mixture of gases.  The visuals would probably still reflect the dominant gas.

 

This seems to be just a side effect of the devs decision to not have gases mix, otherwise after a few cycles you should just have a rather homogenesis mass of gas throughout your base (with a bit more oxygen near oxgyenators and more CO2 near things like coal generators), unless you have pressure doors and gas pumps everywhere.

 

1 hour ago, FluxFaraday said:

On a related note, has anyone tested to see if "grams of gas" is being used as a proxy for pressure?  i.e. if I put 1kg of hydrogen and 1kg of CO2 together in a 10-square room, do they each get 5 squares, or does the hydrogen take nine squares and CO2 just one?

 

I haven't tested it, but it seems to me that hydrogen is less dense and takes up more room than other gases.

 

Link to comment
Share on other sites

4 hours ago, FluxFaraday said:

On a related note, has anyone tested to see if "grams of gas" is being used as a proxy for pressure?  i.e. if I put 1kg of hydrogen and 1kg of CO2 together in a 10-square room, do they each get 5 squares, or does the hydrogen take nine squares and CO2 just one?

 

I have tested it, and you're right; gases try to equalize density rather than pressure.  http://forums.kleientertainment.com/klei-bug-tracker/oni-alpha/gases-dont-diffuse-properly-r3014/

Link to comment
Share on other sites

Simulating partial pressure for the gasses wouldn't be that much more expensive than the current approach: one bitmap of 1MB (for a simulation size of 512*512 tiles) for each gas layer, one for available volume per tile (to model blocks only partly available - like tiles partly occupied by liquids, buildings or even duplicants - disturbing the athmosphere by moving around). If you feel like it add another for temperature to also model heat convections.

That's what we have multicore CPUs for, put it on another core to let it run in parallel with the rest of the game, or code it as a shader and let the GPU do the work, it should be suited fine for this task...

Link to comment
Share on other sites

Would require a complete rewrite of the whole system. Every tile in the grid has an element and a mass.
Everything checks for vacuums and replaces elements with vacuums. The save file would also inflate massively.
 

Link to comment
Share on other sites

The save file already tracks a pressure field, in addition to mass and temperature, although I don't know what the value is used for.

 

At any rate, what Flux seems to be proposing is keeping the current system, but having the ui show a bit of gas from nearby tiles as well as the current one.

This could also be used for gameplay.  For example, pulling gas for a pump would scan the surrounding tiles for their mass, compare it to the mass of the target tile, and choose to pump one one of them based on the ratio of masses.

The CPU hit for this wouldn't be too terrible, and certainly less than trying to go the gas-mixing route by support an arbitrary number of gasses per tile.  This would fix the bug where a tiny bit of water creates a vacuum tile from a gas standpoint, for example, as it would find gas above the file.

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