Air/Vacuum Simulation

All content discussion will take place here. Any topic that is based upon a phase 2 section must have a link back to that topic.
User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-
Re: Air/Vacuum Simulation

Post by Iv121 » Sun Jan 19, 2014 11:32 am

The difference is not in how you store them but how you access them. In liquid simulation method you basically say the following:

I am level 5 air block , All the blocks near me in all directions but the one I come from get air, repeat for new air blocks.

I am level 4 air block, all the blocks near me in all directions but the one I come from get air, repeat for new air blocks.
.
.
.

I am level 0 air block, I am not air block, function end. / I am a wall, I am not air block, function end.

That is basically meaning that we have 5 code sections for each new air block: 5*5*5*5*5 ... n times (5^n) in worst case scenario (we didn’t run into any walls), it is true that in real environment we will run much less code as we meet walls and make the function much more clever, but even after all of that you will still get a really high runtime function which means your CPU commits suicide.
They're watching ... Image

"I am forbidden tag" -CvN

Error
Moderator
Posts:4205
Joined:Thu Dec 06, 2012 11:49 am
Affiliation:CNI
IGN:FC_Rangefinder
Location:Sol IIIa, School of Hard Knocks

Re: Air/Vacuum Simulation

Post by Error » Sun Jan 19, 2014 12:39 pm

So, Iv, you mean that we figure out how much air is in a ship/metaworld, and every time a change occurs to the metaworld, recalculate the air volume, and from the air volume, determine the effects on players?

Call me derp, but I'm not codesavvy enough to see how this is more CPU efficient than the liquid method.
Image

User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-

Re: Air/Vacuum Simulation

Post by Iv121 » Sun Jan 19, 2014 1:33 pm

No, recalculation is what you do, I do PRE-Calculation, just to let you know the algorithm I wrote there is similar to what you will end up if you calculate air like flowing water. Also it seems like in one way or another RE-calculation of the air volume will be required to determine if an area is sealed or not which is why I try to figure out the best way to do it.
They're watching ... Image

"I am forbidden tag" -CvN

 ҉ 
Commodore
Commodore
Posts:1574
Joined:Thu Dec 06, 2012 6:50 am
Affiliation:Kzinti Empire
Location:Kzinhome

Re: Air/Vacuum Simulation

Post by  ҉  » Sun Jan 19, 2014 1:43 pm

Instead of making stuff actually flow, can we just make it so any air block touching a vacuum block is destroyed and replaced by vacuum after, say, a tenth of a second? That'll mean that if there's a hole in the hull, the air in that room will be destroyed very quickly, but it'll stop at airlocks or whatever.
;.'.;'::.;:".":;",,;':",;

(Kzinti script, as best as can be displayed in Human characters, translated roughly as "For the Patriarchy!")

User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-

Re: Air/Vacuum Simulation

Post by Iv121 » Sun Jan 19, 2014 1:59 pm

The problem is not with draining the air but actually filling it back as I said, to check if an area is sealed.
They're watching ... Image

"I am forbidden tag" -CvN

Error
Moderator
Posts:4205
Joined:Thu Dec 06, 2012 11:49 am
Affiliation:CNI
IGN:FC_Rangefinder
Location:Sol IIIa, School of Hard Knocks

Re: Air/Vacuum Simulation

Post by Error » Sun Jan 19, 2014 2:04 pm

Kdapt-Preacher wrote:Instead of making stuff actually flow, can we just make it so any air block touching a vacuum block is destroyed and replaced by vacuum after, say, a tenth of a second? That'll mean that if there's a hole in the hull, the air in that room will be destroyed very quickly, but it'll stop at airlocks or whatever.
That actually sounds good. Like how MC lava sets fire to flammables, which vanish after x time?

So any player in a zone with no air starts taking damage? Or do we have the underwater style air bubbles thing?
Image

 ҉ 
Commodore
Commodore
Posts:1574
Joined:Thu Dec 06, 2012 6:50 am
Affiliation:Kzinti Empire
Location:Kzinhome

Re: Air/Vacuum Simulation

Post by  ҉  » Sun Jan 19, 2014 2:06 pm

Commander Error wrote:
Kdapt-Preacher wrote:Instead of making stuff actually flow, can we just make it so any air block touching a vacuum block is destroyed and replaced by vacuum after, say, a tenth of a second? That'll mean that if there's a hole in the hull, the air in that room will be destroyed very quickly, but it'll stop at airlocks or whatever.
That actually sounds good. Like how MC lava sets fire to flammables, which vanish after x time?

So any player in a zone with no air starts taking damage? Or do we have the underwater style air bubbles thing?
If they're in hard vacuum, give them maybe a second before they start dying, and another two or three to actually die. If you end up in vacuum without a pressure suit you should be pretty screwed.
;.'.;'::.;:".":;",,;':",;

(Kzinti script, as best as can be displayed in Human characters, translated roughly as "For the Patriarchy!")

User avatar
Keon
Developer
Posts:662
Joined:Thu Dec 06, 2012 7:09 pm
Affiliation:Inactive
IGN:ducky215

Re: Air/Vacuum Simulation

Post by Keon » Sun Jan 19, 2014 2:06 pm

I think I have a solution. I'll test it in 2d later today.
- I can be reached as ducky215 on minecraft forums -

User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-

Re: Air/Vacuum Simulation

Post by Iv121 » Sun Jan 19, 2014 2:15 pm

Oh someone is actually going to bring something new to the table here !

BTW as for air draining all you need to do is to detect once a block is removed that on one side of it there is vacuum and on the other side there is air, then set the direction of all entities in the enclosure from the direction of the air cube to the direction of the vacuum cube, draining a set amount of air from the enclosure as whole.
They're watching ... Image

"I am forbidden tag" -CvN

Error
Moderator
Posts:4205
Joined:Thu Dec 06, 2012 11:49 am
Affiliation:CNI
IGN:FC_Rangefinder
Location:Sol IIIa, School of Hard Knocks

Re: Air/Vacuum Simulation

Post by Error » Sun Jan 19, 2014 3:09 pm

I feel Kdapt's solution is PROBABLY best, but I don't know sufficient java to say so for sure.
Image

User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-

Re: Air/Vacuum Simulation

Post by Iv121 » Sun Jan 19, 2014 3:44 pm

Its a solution, but not for the problem at hand. We talk about defining enclosure and if an area is sealed, not if it is depressurised.
They're watching ... Image

"I am forbidden tag" -CvN

cats
Rear Admiral
Rear Admiral
Posts:1853
Joined:Wed Dec 05, 2012 10:03 pm

Re: Air/Vacuum Simulation

Post by cats » Mon Jan 20, 2014 2:57 am

Can we have pressure levels? Can that be a thing?
"Any sufficiently advanced technology is indistinguishable from a completely ad-hoc plot device"
— David Langford
Spoiler:
cannonfodder wrote:it's funny because sonic's face looks like a * and faces aren't supposed to look like a *

User avatar
Iv121
Vice Admiral
Vice Admiral
Posts:2414
Joined:Fri Dec 07, 2012 3:40 pm
Affiliation:UTN
Location:-> HERE <-

Re: Air/Vacuum Simulation

Post by Iv121 » Mon Jan 20, 2014 3:05 am

What do you mean by that, and more importantly why do you want that ?
They're watching ... Image

"I am forbidden tag" -CvN

User avatar
Keon
Developer
Posts:662
Joined:Thu Dec 06, 2012 7:09 pm
Affiliation:Inactive
IGN:ducky215

Re: Air/Vacuum Simulation

Post by Keon » Mon Jan 20, 2014 9:18 am

If we do it on a block-by-block basis I'd prefer air-vacuum but if we precalculate it, it could work.
- I can be reached as ducky215 on minecraft forums -

Ivan2006
Fleet Admiral
Fleet Admiral
Posts:3021
Joined:Fri Dec 07, 2012 12:10 pm
Affiliation:[redacted]
IGN:Ivan2006
Location:In a universe.
Contact:

Re: Air/Vacuum Simulation

Post by Ivan2006 » Mon Jan 20, 2014 12:52 pm

Iv121 wrote:What do you mean by that, and more importantly why do you want that ?
He means that the system could differentiate between different air pressures.
May not only be important for spaceships, but also for upper atmosphere stuff.
Quotes:
Spoiler:
CMA wrote:IT'S MY HOT BODY AND I DO WHAT I WANT WITH IT.
Tiel wrote:hey now no need to be rough
Daynel wrote: you can talk gay and furry to me any time
CMA wrote:And I can't fuck myself, my ass is currently occupied

Post Reply