Hey there. I’d like to know how one would go about creating some sort of “atmosphere” or oxygen. You know, like in space, so if you for example were on a spaceship and would blow a hole in the wall the oxygen would leave the spaceship (or the vacuum enter it).
I would be really grateful for some pointers on how to go about that as I have no idea where to even start.
I know Doom 3 had a similar feature, where you could declare certain places as “out of air” and when you connected other places to that place (by shooting a window or opening a door) it would become vacuum too.
I tried looking that issue up at various sources, but either I’m very bad at searching or no one ever attempted this before (or it’s so easy that nobody ever bothered asking)
It’s more of theoretical than a “give me a code example!” question. Just a paper or something on this kinda concept in games would help to start me off already.
I think the answer to this sort of question is probably ‘whatever works’, more or less. I don’t think there’s any generally accepted solution(s) for this sort of problem.
I’m not familiar with the specific Doom feature you mention, but the Id engines have traditionally used a spatial partitioning system that identifies convex subspaces and their interconnections. I’m not sure what system is used in Doom 3, but if it’s anything like that, handling atmospheric effects of the type you mention would probably be fairly straightforward due to the enclosed nature of the environment and the connectivity information that the engine has available.
Obviously you’re not going to be simulating pressure differentials and moving molecules (at least I assume you won’t be), so any solution is going to be ad hoc, more or less. What solution will work best will really depend on the context and on how your environment is represented (again, ‘whatever works’).