Jump to content

Recommended Posts

Do the gasses in Oxygen Not Included follow the ideal gas law? In case your physics is rusty, it's an equation that governs how the temperature, pressure and volume of a gas relate to each other: https://en.wikipedia.org/wiki/Ideal_gas_law

It doesn't appear that they do, considering I've seen cave sections around a geyser, for example, increase drastically in pressure without an accompanying increase in temperature. It's sort of a shame that this isn't implemented, because one could use it to build in-simulation refrigeration systems and such.

Link to comment
https://forums.kleientertainment.com/forums/topic/87707-ideal-gas-law/
Share on other sites

2 minutes ago, throne_of_hunger said:

Sure, but being able to alter the temperature of a gas by compressing/decompressing it would add some interesting possibilities to the game, don't you think?

It would not work with the game well. There's no pressure in pipes, for instance. A pump can scoop 10 C gas from a room that's overpressurized at 150 kg of gas per tile and dump it in vacuum room or in room with 19 kg of gas per tile - how should that released packet behave? Should it remember the pressure at which it was scooped? What if it gets mixed with another packet scooped somewhere else? It would add whole new layer of complexity into the game in exchange for confusing behavior, a few convenient effects, and a whole bunch of new exploits.

Yes, adiabatic cooling / heating is missing in ONI.

It would be a lot of fun to have it!

How about:

We have two adjacent cells (a, b) with the same gas (one can be vacuum with M=0 and T=0),
but different mass (Ma, Mb) and different temperature (Ta, Tb).

Gas will flow from higher M*T to lower M*T, say (a) has higher pressure, Ma Ta > Mb Tb

We choose some amount of gas Md that will flow from (a) to (b), perhaps Md = (Ma - Mb) / 3 if there are only two cells, but when considering 4 adjacent cells the Md should be distributed according to M*T of adjacent cells.

New masses of gas for (a) and (b):
Ma2 = Ma - Md
Mb2 = Mb + Md

The energy that goes from (a) to (b) will, depending on the gas type and temperature, not only change the pressure (towards equalization), but also temperature. For the sake of performance, a simplified calculation can be chosen.

New temperature:
Ta2 = Ta (Ma / Ma2)(1 − γ)
Tb2 = (MbTb (MbTb / (MdTa + MbTb))(1 − γ) + MdTa (Ma / (Md (1 + MbTb / MdTa)))(1 − γ) ) / Mb2

Where γ depends on the type of the gas and temperature and can be looked up from a table and approximated (see https://en.wikipedia.org/wiki/Heat_capacity_ratio)

This can probably be simplified again without loosing too much of the "feel" about gas behavior.

It is important (IMO) that mass and energy are preserved while giving as good as possible gas behavior.

2 hours ago, Saturnus said:

No. And it probably won't at any point. ONI is not a physics sim but a game.

ONI needs good physics to be an interesting game. It doesn't have to copy RL, but, better in-game physics => more fun.
Adiabatic cooling and heating would add a lot of fun.

1 hour ago, Kasuha said:

It would not work with the game well. There's no pressure in pipes, for instance. A pump can scoop 10 C gas from a room that's overpressurized at 150 kg of gas per tile and dump it in vacuum room or in room with 19 kg of gas per tile - how should that released packet behave? Should it remember the pressure at which it was scooped? What if it gets mixed with another packet scooped somewhere else? It would add whole new layer of complexity into the game in exchange for confusing behavior, a few convenient effects, and a whole bunch of new exploits.

Adding gas or taking away gas (with known mass and temperature) to/from a cell can be calculated analog to above calculations where gas flows from one cell to the other.

Warming up of gas in the pump could be added as well as part of the pumps heat output - separately and simply approximated, without taking into account the needed difference in pressure between intake and vent.

15 minutes ago, Master Miner said:

How about:

Think about the following cases:

  • A duplicant breathes out a 100 g packet of CO2 in a room full of oxygen, 100 g per tile. What temperature is that packet?
  • A duplicant breathes out a 100 g packet of CO2 in a room full of oxygen, 2 kg per tile. What temperature is that packet?
  • Two 100 g packets of CO2 in a room full of oxygen at 2 kg per tile merge and form a 200 g packet of CO2. What happens to the temperature of the CO2?
  • You have a room full of O2 at 2 kg per tile and a layer of CO2 at the bottom. A pump scoops that CO2 at 500 g per packet and puts it in a pipe. There's five valves and vents at the top of the room, each releases that scooped CO2 at 100 g/s. What happens with the temperature in the room?

 

2 minutes ago, Kasuha said:

Think about the following cases:

With pleasure :)

3 minutes ago, Kasuha said:
  • A duplicant breathes out a 100 g packet of CO2 in a room full of oxygen, 100 g per tile. What temperature is that packet?

Initially same as the body temperature of the dupe.
The displaced oxygen merges according to above calculations. For very close T*M of both (oxygen) cells the calculation can be simplified to increase performance if needed.

6 minutes ago, Kasuha said:
  • A duplicant breathes out a 100 g packet of CO2 in a room full of oxygen, 2 kg per tile. What temperature is that packet?

Same as above - as the volume does not change nothing special happens, we have different gasses at different pressures next to each other. The exchange in heat will still happen, but that's not an adiabatic process.

9 minutes ago, Kasuha said:
  • Two 100 g packets of CO2 in a room full of oxygen at 2 kg per tile merge and form a 200 g packet of CO2. What happens to the temperature of the CO2?

They merge analog to above calculations, T2 = 0.5 * (Ta + Tb) * 0.5(1 − γ) (masses are equal)

15 minutes ago, Kasuha said:
  • You have a room full of O2 at 2 kg per tile and a layer of CO2 at the bottom. A pump scoops that CO2 at 500 g per packet and puts it in a pipe. There's five valves and vents at the top of the room, each releases that scooped CO2 at 100 g/s. What happens with the temperature in the room?

Overall, the temperature will increase only because of the heat coming from the pump.
Otherwise - if there are no other external influences - the energy associated with the gas won't change.
The process will initially cause some minor temperature difference / vertical gradient (cooler bottom, warmer top) which will mostly equalize when the CO2 packets start arriving at the bottom again.

59 minutes ago, Master Miner said:

Adding gas or taking away gas (with known mass and temperature) to/from a cell can be calculated analog to above calculations where gas flows from one cell to the other.

Oh, okay, I missed this point.

It would mean, breaking up a packet into smaller ones with a valve would reduce temperature of these packets substantially. Beyond the point of breaking the pipe due to state change if the ratio is sufficient. I don't think most players would consider such behavior realistic.

You could then make a stream of super cold small packets, send them through a radiator pipe, cool down the environment, then let these packets collect again still in the same pipe and release that collected heat in another radiator. With just one valve and a pipe loop, you can get a free heat transfer from cold place to hot place.

I wouldn't consider that very good for the game balance.

51 minutes ago, Kasuha said:

It would mean, breaking up a packet into smaller ones with a valve would reduce temperature of these packets substantially. Beyond the point of breaking the pipe due to state change if the ratio is sufficient. I don't think most players would consider such behavior realistic.

There is no need for that. Pipes are special and splitting gas flow with (or without) valves does not need to change the volume of the gas and thus would not have adiabatic cooling or heating effect. Pipes transport gas packages as if pipes wouldn't have own volume, as if they would transport pieces of differently colored marzipan that can be cut in parts and/or joined together, (only same color), but without change in the volume.

You see in the pipe animation, smaller amount of gas = smaller piece of marzipan. :)

So, no compression or decompression within the pipes / valves.

Of course, you can (already) use pipes and make radiators to cool or heat rooms through advection - conduction - convection.

4 hours ago, Master Miner said:

There is no need for that. Pipes are special and splitting gas flow with (or without) valves does not need to change the volume of the gas and thus would not have adiabatic cooling or heating effect. Pipes transport gas packages as if pipes wouldn't have own volume, as if they would transport pieces of differently colored marzipan that can be cut in parts and/or joined together, (only same color), but without change in the volume.

I think you mean constant pressure rather than constant volume in pipes, no problem with that. But then you run into a problem when you release such small packet of a gas into the environment through a vent because it will suddenly gain substantial volume and cool down. That will make it condense, maybe even freeze. What will happen next?

You could use it to transmute polluted oxygen to clean. Release polluted oxygen in tiny packets into vacuum room, it will instantly liquefy, then scoop that clean liquid oxygen at the bottom with a pump and route it wherever you need it. I assume you don't plan to apply ideal gas law to liquids, or do you? And consider that we have just deleted substantial amount of heat, too.

 

18 hours ago, Kasuha said:

I think you mean constant pressure rather than constant volume in pipes

The pipes have undefined volume for transported gas, they just transport "packages" with given mass and temperature. There's no volume, no pressure and no adiabatic change. Simply, that would remain as it is now.

18 hours ago, Kasuha said:

you run into a problem when you release such small packet of a gas into the environment through a vent because it will suddenly gain substantial volume and cool down. That will make it condense, maybe even freeze.

We don't have to apply adiabatic changes to the inserted gas when inserting. P*V = c*M*T stays constant as it the gas would be ideal. We can, though, apply the adiabatic change to the gas already present that gets compressed as proposed above.

Example: vent is in the vacuum, the first packet with 1kg of oxygen at 290K arrives. As the pipe doesn't have a defined volume, we have to assign a volume (and thus pressure to that packet): 1 cell. P*V = c*M*T stays constant as if the gas would be ideal. No adiabatic changes happen at that point, so that would remain as it is now in the game.

18 hours ago, Kasuha said:

What will happen next?

When the gas starts to spread to adjacent cells, then adiabatic cooling would take place - for example it spreads to a second cell (initially vacuum) and we get 2 cells with 0.5kg oxygen in each of them. γ = 1.4 for oxygen at 290K.
T2 = 290K * 2(1 − γ) = 290K * 2(-0.4) = 220K

Ideal gas has its associated energy only in the kinetic energy (motion of the molecules), but a real gas has also internal potential energy. The energy is converted from heat into internal potential energy.

18 hours ago, Kasuha said:

You could use it to transmute polluted oxygen to clean. Release polluted oxygen in tiny packets into vacuum room, it will instantly liquefy, then scoop that clean liquid oxygen at the bottom with a pump and route it wherever you need it. I assume you don't plan to apply ideal gas law to liquids, or do you? And consider that we have just deleted substantial amount of heat, too.

BTW, it's actually not ideal gas law, it's how real gases behave.

As shown above, you can not do that with any temperature of the PO, you would need to cool it beforehand - let's see:
PO will liquefy around 87 K. What is the (approximate) max temperature of an incoming packet to allow (almost) immediate liquefying, on the very first expansion to the adjacent vacuum cell?
86 K = Ti * 2(-0.4)
Ti = 113 K
PO would first need to be cooled to around -160°C.

Adiabatic changes as proposed above assume that there is no phase change.

Solution: liquefy only a part of the gas in the first step and add the heat created in the process to the remaining gas.

2 hours ago, Master Miner said:

The pipes have undefined volume for transported gas, they just transport "packages" with given mass and temperature. There's no volume, no pressure and no adiabatic change. Simply, that would remain as it is now.

 

2 hours ago, Master Miner said:

Example: vent is in the vacuum, the first packet with 1kg of oxygen at 290K arrives. As the pipe doesn't have a defined volume, we have to assign a volume (and thus pressure to that packet): 1 cell. P*V = c*M*T stays constant as if the gas would be ideal. No adiabatic changes happen at that point, so that would remain as it is now in the game.

Your ideas lack consistency. Let's step back to the example I was giving a few posts back

You have a room full of oxygen at 2 kg/tile with a layer of CO2 at 2 kg/tile at the bottom.  They are the same temperature.

You scoop that CO2 with a pump and form a 500 g packet. You route that packet to a valve and split it into ten 50 g packets. Then you route them to vents and release them back to the room.

When each of these packets is released, by the description you gave just now, they will have their initial temperature when scooped, but now instead of their initial 2 kg/tile they'll be at 50 g per tile. When you let these packets then merge, they'll gain substantial heat through adiabatic change. Repeating the process, you can heat the room up to any temperature just by pumping the gas around.

Whatever approach you try, you get unintuitive or unphysical results somewhere. Either on entry/exit, or in pipe transfer. You can't have adiabatic changes in gas in environment and at the same time pipes that don't work with volume and pressure. You can't draw reasonable physics system from that.

To have adiabatic changes in consistent manner and without easy ways to abuse the physics, you need to completely rework pipes in the first place. Which returns me to my initial statement:

On 17. 2. 2018 at 10:17 AM, Kasuha said:

It would not work with the game well.

 

2 hours ago, Kasuha said:

Your ideas lack consistency

The lack in consistency is necessary in order to simplify calculations. It would be far too complex otherwise, or wouldn't it?

So we would sometimes have ideal gas behavior and sometimes real gas behavior. What you mention are corner cases which perhaps can be abused, but let's think that through.

2 hours ago, Kasuha said:

Whatever approach you try, you get unintuitive or unphysical results somewhere

We have that already (unintuitive and unphysical), and I think it can be improved.

2 hours ago, Kasuha said:

You have a room full of oxygen at 2 kg/tile with a layer of CO2 at 2 kg/tile at the bottom.  They are the same temperature.

You scoop that CO2 with a pump and form a 500 g packet. You route that packet to a valve and split it into ten 50 g packets. Then you route them to vents and release them back to the room.

I'll assume that the room is 30 cells wide and 20 cells high with the vents evenly spaced out at the top. All 10 packets are released at the same time and the travel vertically down. They do not combine before they reach the bottom 2 rows with CO2 - this is to simplify the calculation. The initial temperature is 290K and each cell has 2kg of gas. γ = 1.4 for oxygen and 1.3 for CO2 at 290K

Scooping a packet of gas:
T2 = 290K * (1/0.75)(1 − 1.3) = 266K (first cell)
calculated for all of CO2 in the bottom 2 rows at once: T2 = 290K * (60/59.75)(1 − 1.3) = 289.64K

Inserting packets at the top: (this has to play somewhat "unnatural" because it is how the game works with 1 gas per cell ...)
10 cells are inserted with 50g CO2 each at 290K
10 cells of oxygen are displaced, gas has to go into 4 adjacent cells at each vent
each O2 merge (4 cells): T2 = 290K * (1/1.25)(1 − 1.4) = 317.08K
calculated for all of O2 at once: T2 = 290K * (530/540)(1 − 1.4) = 292.18K

Until the packets reach the bottom the temperature will equalize through conductivity (I don't know how the game simulates that, I'll use a simple calculation for the expected outcome):
Toverall = (540 * 2 kg * 1.005 * 292.18K + 119.5kg * 0.846 * 289.64K + 0.5kg * 0.846 * 290K) / (540 * 2kg * 1.005 + 60 * 2kg * 0.846) = 291.96K

Now the CO2 reaches the bottom and recombines into the bottom layer (2 cells high):
O2 above expands: T2 = 291.96K * (540/530)(1 − 1.4) = 289.79K
CO2 compresses: T2 = 291.96K * (60/60.25)(1 − 1.3) = 292.32K

Next, the temperature equalizes again through conductivity:
Tfinal = (540 * 2 kg * 1.005 * 289.79K + 60 * 2kg * 0.846 * 292.32K) / (540 * 2kg * 1.005 + 60 * 2kg * 0.846) = 290.0064K

Wow! The increase in the temperature is below the the calculation error and is rather effect of minor simplifications that I've used above. In other words, there is no heating of the room just because of pumping the gas around - other than heating from the pump itself.

So, it works, indeed, and no change in how pipes work would be needed.

2 hours ago, Master Miner said:

Wow! The increase in the temperature is below the the calculation error

You're not convincing. Actually I think you already know you're wrong and you just don't want to admit it.

The calculation is for a single packet in a room 20 to 30 cells. That's a congress hall. Of course change per packet will be small. That doesn't mean the difference isn't there. Do it with smaller room, more packets, different gases. And you'll see real difference, no more excuses to calculation errors.

Temperature balancing conserves heat content. Adiabatic changes don't. You need to put some work into compressing gas, that work is energy you got somewhere and it's now in the gas. If you could change compression ratio at will without putting in energy, you'd have perpetuum mobile in your hands. But that's exactly what you can do with the rest of ONI mechanics.

Let's consider a simpler example. A 1x1 tile room with a pump and a vent that somehow fit there, and containing 500 g of gas at some temperature. You scoop that gas into the pipe with a pump in single step, then release ten 50 g packets back to the room. Even without a lot of calculations it's clear that the temperature of the gas in the room will rise substantially because the very first packet will be at initial temperature and the next one will raise the temperature to about 120%. And there's still 8 packets in the queue.

In a similar manner, you can have cooling. Have a room with 1 kg of gas. Scoop it with Mini Gas Pump (50 g/s) in 20 steps, merge into single packet and release back to the room.

And that's not even considering abuse of mechanicsl airlocks for completely power free gas cooling or heating.

I maintain that ONI is better without it.

30 minutes ago, Kasuha said:

You're not convincing. Actually I think you already know you're wrong and you just don't want to admit it.

You can just skip that kind of "thinking" and point to the error if you see one.

31 minutes ago, Kasuha said:

The calculation is for a single packet in a room 20 to 30 cells. That's a congress hall. Of course change per packet will be small.

Please look again at the calculation above - the change is not small, it is significant - but it gets evened out when the  CO2 merges with the bottom layer again - then the  O2 above decompresses again and returns to the previous temperature. You did choose 10 vents to make it significant. Calculate it yourself for a smaller room and show the calculation. Let's see where the heating you mention would come from.

You seem to hang on pressure change while pumping or pressure change between pump and the vent. But we don't have that in ONI. Gas pipes just transport packets, there is no compression nor decompression, just transport of mass and associated heat - and this wouldn't need to change.

I'm proposing a model for temperature changes due to compression and decompression of gas to make it behave more like real gas and add new possibilities and fun to the game. You argue that "it wouldn't work well" but you didn't provide a sound argument yet.

 

42 minutes ago, Kasuha said:

[...] perpetuum mobile in your hands. But that's exactly what you can do with the rest of ONI mechanics.

So then, where's the argument against introduction of adiabatic cooling and heating?

About other infinite energy and matter sources in ONI - that can be adjusted / changed to balance gameplay and make it interesting.
If the spectrum of possibilities in the game is reduced, if the "degrees of freedom" in the game are small then it will soon get dull. What you mention for gas is also true for the game in double sense - without work there's no heat.

56 minutes ago, Kasuha said:

Let's consider a simpler example. A 1x1 tile room with a pump and a vent that somehow fit there,

That's actually a border case that exploits the granularity of the simulation. The simulation uses cells as atomic (not dividable) units, and it is a priori clear that it will behave oddly if you have just a single cell.

This would be like request "draw me a picture, but use only one pixel".

If such border cases have significance at all, then they would need to be taken care of separately.

I think people use exploits when they actually, for whatever reason, don't want to play the game. Sometimes they say "I play my way" or "I don't like this or that aspect of the game so I use exploits, but I do play the other parts without exploits", but that means more that they play with the game instead of playing the game.

Thermodynamics is one of the key aspects of ONI - isn't it? - so i think that adding to it perfectly makes sense.

The simulation isn't perfect - you're right that the cooling when removing gas with the pump will not be exactly the same as the heating due to it being inserted, but, does it need to be perfect?

And what if packets transported by pipes would remember the volume?
That would be just one additional parameter and would allow to apply changes when inserting.

I think a few improvements could be made for sure to the current physics.

We have half of the way things work but why does everything need to be pure cells?

I can have a pile of objects (100s of kgs) in a cell but only one gas or liquid? 

We need mixtures to make a more realistic and allow for simplifications of the simulation for each cell.

If I was going to do it from scratch each "cell" volume would be our constant, and can contain solid, liquid, or gases. For simplicity we can keep them as purely fractional, so you could halve a half slime / half algee tile, or a half water, half chlorine gas tile, or a gaseous mixture that we'll call "Air" for convenience.

The individual tile would contain enough information to provide a density for the liquid/gas mixtures and allow for convection and self separation/stratification. Iterating through the tiles with a kernel filter or some similar method would provide a method for that, but I'm an engineer not a programmer so I could be wrong. I just think you could do a bulk smoothing once per tick and that would be enough.

I think "Air" would add a lot to the game. You could still have "breathable",  "unbreathable", "toxic", or "infectious" designations but you'd be more concerned about scrubbing the chlorine out of your "Air" system since "toxic" air would cause a work debuff and under most circumstances CO2 is able to just fall out of your base as it is now. A new station could even help with this, "Life support" could debuff the electrical cost of the valves or itself act as a "smart" filter.

This would also incentivize placing airlocks and keeping your base separate from the rest of the asteroid, I don't think a Dupe should be able to live in a pure Chlorine gas environment, or a complete vacuum without proper protection. Again adding to the game without really increasing complexity for the player.

Currently you just punch into any open space without concern, adding mixtures and pressures would force you to consider expansion/exploration more carefully. Digging into a high pressure differential could hurt or kill your Dupe, death by "explosive decompression" should definitely be a part of this game! 

Also allowing mixtures would provide a method for other "types" of tiles, mostly liquid with some solids could be a "slurry" or "muck" if it's the opposite, easily add a lot of variation to the game. So you'd need to dry out slurry or process it to get the solids back, adding to the game mechanics too.

At the same time pipes and vents should be overhauled so that they work just like reality, as pressure differentials. As we are able to deal with a mixture now each section of pipe/vent can only contain one mixture. Each run of pipe/vent would only need to store its volume, current pressure, and mixture of gases or liquids. All outlets are the same pressure, and if we wanted to get really fancy (if its a less resource intensive system than the current "packet" implementation) we could even add in our restrictions (bends, tees, filters, etc.) just by treating them as the start of a new run.

Each pump should have a maximum pressure differential it can produce, this would keep things working somewhat like we're used to but provide for future tech too. Higher Pressure Pumps, Ultra High Pressure Pumps, Vacuum Pumps, Slurry Pumps, etc.

I know that it may be far too late for this to happen but I'm hoping that as development progresses we may get lucky.

I just hope by the time of release I can combine Chlorine gas and Water to make "chlorinated" Water, with Water that I can produce by combining Oxygen and Hydrogen, inside of a base which I'm able to temperature control because the "heat" rises to the top and I can circulate that air through a heat exchanger, and then vent a pile of superheated CO2 out into the void so my Dupes don't get too sweaty.

Now that this thread has been brought up the list, I'll add my few cents.

I'm not about to run through the calculations at this moment, but I'm concerned about the ideal gas law-ish implementation and the lack of uniform gas behavior.  There is no gas mixing, so gases aren't treated as non interacting ideal gases...  So when we have these weird floating small packets of CO2 (100g) heating and cooling among a large room of O2 (2 kg) my (probably wrong) intuition tells me they will be super heated and super cooled by disruptions in the room.  In Master Miner's example there are temperature swings from 266 (freezing water) - 317 (hot for teacher) from a room at 290K (chilly 17 C).  What happens when this is a small packet in a room filled with a high pressure valve 20 kg O2 cells with small packets of 100g moving around?  Will these packets start freezing out, flash boiling liquids, or melting duplicant's faces?

The next problem of expansion into a vacuum, the phase changes now need to become more realistically modeled so they don't instantly expand to fill a room and freeze or liquefy into droplets and stay frozen/liquid with the vacuum maintained, hoping the small floor contact eventually warms and vaporizes it again (Only to cool as it expands into the vacuum again).  I personally would love to see vapor pressure included and phase changes following pressure and temperature but it's probably too much.  Need more RAM to store lookup tables for all elements' phase diagrams in the game...

Lastly this,

On 2/17/2018 at 6:04 AM, Master Miner said:

For the sake of performance, a simplified calculation can be chosen.

New temperature:
Ta2 = Ta (Ma / Ma2)(1 − γ)
Tb2 = (MbTb (MbTb / (MdTa + MbTb))(1 − γ) + MdTa (Ma / (Md (1 + MbTb / MdTa)))(1 − γ) ) / Mb2

Looks terribly painful for performance.  On oh so many tiles throughout our asteroid every few milliseconds (I think I saw 4 times per second for the temperature calculations in a post?).

I feel like I need to attempt to make a striped down simulation of cell based thermodynamics with everything but the duplicants...  To see for myself how many more years we need to wait for enough poor gamers to have the computer power.  Simulations as is with a cell for each gas vs gas mixing...

10 hours ago, Dopey said:

how many more years we need to wait for enough poor gamers to have the computer power

An average budget CPU can make over 30,000,000,000 floating point calculations per second per core, a better CPU over 60x109 operations.
If the calculation needs 30 additional operations (that includes some overhead) to add adiabatic temperature changes, then if we would have a full 512x512 map filled with gas it would take some 0.26 milliseconds per iteration on an average CPU. For 4 iterations per second that would take 1 ms per second or some 0.1% of a single CPU core (or one CPU's FP unit).
If the game engine would be optimized.

On 2/28/2018 at 9:46 AM, Master Miner said:

An average budget CPU can make over 30,000,000,000 floating point calculations per second per core, a better CPU over 60x109 operations.

Is that one too many zeroes?  I have a 6 core AMD (FX-6300) and I see values of 8 GFLOPS 8,000,000,000.

Even so that's just a quarter, 1 ms per update by your calculations (If we use all cores simultaneous).

The bigger problem these days I see mentioned are cache hits.  So I don't expect this perfect performance.

The CPU has to share its cache space with graphics data pointers, structures for the dupe and animal path finding, whatever madness is going on behind the scenes for pipe and vent pathing, mass flow/pressure calculations along side these thermodynamics ones.

Maybe simultaneous updating of mass and temperature will get you closer to 2 ms per update for this part.  But the shared threading with freeze this work and may give audio sampling some time to run possibly emptying the cache, path finding needs its chances to run (probably not as long as some think after initial caching of paths but I haven't gotten this far myself in game programming...), and the rendering passes.

I've mentioned FLOPS just as a side note, just to underline that the in-game physics isn't broken because of performance restrictions and that average budget hardware is capable of much more.

1 hour ago, Dopey said:

2 ms per update

That would be the order of magnitude.

1 hour ago, Dopey said:

The CPU has to share its cache space

To make the calculations / the simulation, the data has to be "visited" on every update no matter what we do with it. The fact that the memory link speed is the bottleneck means we have surplus CPU processing power. We can do more with the data without an impact on performance.

2 hours ago, Master Miner said:

The fact that the memory link speed is the bottleneck means we have surplus CPU processing power. We can do more with the data without an impact on performance.

This is pretty good support for trying out more complicated equations like presented above.  Won't know until it's tried...

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