If anyone wants to help me out (even just to bounce ideas off of) cause I'm honestly stuck, page me for skype info. :)
I think the way you're shifting O2 means that you'll likely never achieve constant states. It's just a characteristic of the dispersing method you use.

I also think the only reason why it doesn't disperse properly into a room with vacuum is that there's not enough of it.

Think about real life. Gas expands to fill available space but it's also made up of millions of atoms. You don't have this luxury and so it tends to collect in certain places. Only if you had an infinitely divisible gas could it fill infinitely. It's really the level of divisibility that limits spread.
At the moment I no longer use this code, I wrote a rough draft that identifies chambers instead, but now the behaviours are giving me trouble.

It's like I go so far on one side and so far on the other an can't get to the center. :(

I've been rewriting the pressure portions and revisiting the chambers code often.
Why are you trying so hard to simulate reality? A gas system that the user will recognize as gas isn't hard. Seems like you're trying to simulate and not mimic. Which is a lot harder.
I just want the system to behave as one would expect.
In response to Jittai
Then why not just make an object that attempts to spread duplicates onto floors, doesn't spread to space, also transfers it's amount to other objects of the same type?

You could use amounts like var/O2 = 1000 so you get really smooth quantities. In rooms that you want to have air pressure add an object called a vent that creates 1 new air object every ventDelay seconds or add amounts to the air around it if there is already air outside it.

Also, when an air object touches space it should lose all amount to the space and when it's floor gets deleted it should also be deleted.

That's how I'd do it and I'd keep the delays quite high.
That's sort of how the first draft worked, except the venting to space part didn't work. This actually gives me an idea.
You should definitely look into Cellular Automata for handling fluid dispersion in a game. I've found that its much easier to represent this way than to handle a bunch of individual gas objects. Take a look at any one of these articles to read up on it.

Gamasutra article and Cellular Automata for Physical Modelling.

Once you get over the initial hump of figuring out what the hell is going on with the stuff, it becomes second nature.
I used it for my Water Sim, and have even added to it to measure flow direction in tiles as well as just the volume alone.
Again I feel the need to point out that c ellular automata is a wasteful and needless implementation here.

You need a lumpier algorithm. It works better. It behaves better. Take a look at my prior posts here. Zec is leading you in the wrong direction. Per-tile calculations really aren't necessary. You need to treat gases as objects based on contiguity. Not based on locality.
I think my second draft does what you are recommending more or less?
In response to Ter13
Not trying to lead anyone in the wrong direction. I just gave one way of doing it, which I actually coded myself in one night and it works pretty well.
I'm not really going for extreme realism, I just want something that has gas dispersing into a room evenly- and if there's a breach made for the air to vent towards the breach (If there's a difference of pressure) taking any near by items with it while the air is equalizing.

Draft 1 focused more on dispersing from single tiles, which I didn't really like.

Draft 2 focused on establishing "rooms" and doing everything using "chamber" (room) datums.
I don't care for realism if it sacrifices performance, my only goal is that it behaves like I want it.
I got a working version, I'll be doing tests of it. Thanks everyone.
Page: 1 2