[Mod] vacuum [git] [0.1] [vacuum]

Post Reply
User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

[Mod] vacuum [git] [0.1] [vacuum]

by BuckarooBanzay » Post

Vacuum mod for minetest
Releases

Version 1.0: Version 0.1:
Goes along great with the jumpdrive mod:
viewtopic.php?f=9&t=20073

Or the spacesuit:
https://git.rudin.io/minetest/spacesuit

Operation

The space/vacuum starts at 1000 blocks in the y axis (configurable)

The mod defines an airlike vacuum:vacuum block which suffocates the player (with drowning=1). An airtank or spacesuit (https://git.rudin.io/minetest/spacesuit) would help to survive in space: https://github.com/minetest-mods/airtanks

Air can be pumped in to any closed structure with an airpump (vacuum:airpump).
The airpump uses filled and empty bottles depending on which height it is placed:
on earth it fills empty steel-bottles with air and in space it empties them and creates an air-bubble around itself.

Configuration in minetest.conf
  • vacuum.space_height defines at which height the vacuum starts, default: 1000
  • vacuum.air_pump_range defines the range (radius) of the air pump, default: 5

Vacuum propagation

The vacuum sucks air out of every structure if there are leaky nodes (doors, wool, wood, etc; defined in abm.lua)

A vacuum node in a pressurized area can suck out the whole structure.

Other nodes in space

Vacuum exposure on nodes:
  • Dirt converts to gravel
  • All plants convert to dry shrubs
  • Leaves disappear
  • Water evaporates
  • Torches and ladders drop (to prevent air bubbles/cheating)
Compatibility

Optional dependencies:
  • Mesecon interaction (execute pump on signal)
Mesecon Protip: Use mesecon-detector to detect vacuum and auto-close areas with sticky pistons (airlock)
Or use a scifi-door from the scifi-nodes mod: viewtopic.php?t=11751

License

Code: LGPL 2.1
Textures: CC0

Screenshots

Airpump:

Image


Hole in the structure:

Image


Hole from outside:

Image
Last edited by BuckarooBanzay on Tue Oct 02, 2018 09:32, edited 4 times in total.

User avatar
false_chicken
Member
Posts: 52
Joined: Wed Feb 04, 2015 23:41
GitHub: falsechicken
In-game: false_chicken
Location: Florida, USA

Re: [Mod] vacuum [git] [vacuum]

by false_chicken » Post

This works really well. I built an airlock using mesecons with sticky pistons and it worked exactly as I expected.
DISCLAIMER: I am probably wrong.

User avatar
paramat
Developer
Posts: 3691
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] vacuum [git] [vacuum]

by paramat » Post

Nice, i did something similar in my moonrealm mod https://github.com/paramat/moonrealm

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] vacuum [git] [vacuum]

by BuckarooBanzay » Post

Yes, i did my research :)
I also looked into the code from mars-survive but the solutions were pretty integrated.

This aims to be a modular, standalone solution for vacuum/space based survival

Did you have time to test it, i'm open for feedback...
paramat wrote:Nice, i did something similar in my moonrealm mod https://github.com/paramat/moonrealm

User avatar
paramat
Developer
Posts: 3691
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] vacuum [git] [vacuum]

by paramat » Post

Not yet, i can see how it works and in some ways it is better than my approach and i can learn from it.

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] vacuum [git] [0.1] [vacuum]

by BuckarooBanzay » Post

Version 0.1:

Festus1965
Member
Posts: 1404
Joined: Sun Jan 03, 2016 11:58
In-game: bye bye

Re: [Mod] vacuum [git] [0.1] [vacuum]

by Festus1965 » Post

I am interested ... as a solution for the space area.

I think about make all area over 25000 nodes to vacuum items, even without the pump, but would need the other direction to get my spaceship with air to breath ... could even build a real air lock gate to get in or out ... here with hazemat or get a problem.

yes I could use WorldEdit then and set, as using the mod and activate the vacuum item, all areas over 25000 in vacuum.

Yes nice, I like that Idea from the base,
even maybe build safety rooms on the surface, where no one should go in and keep it airfree (vacuum).

What is happening when i open then a normal door between vacuum and air ?
(yes nothing yet ... i guess both items stand on there position)

But maybe some further ideas.

Go on, you get a plus already ! i check it out next.
Minetest has no future

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] vacuum [git] [0.1] [vacuum]

by BuckarooBanzay » Post

Update 1.0
  • Airpump creates an air bubble now (as long as there are enough air-bottles)
  • Optimized Vacuum-propagation and mapgen
This mod is in "productive" deployment on the pandorabox space server: viewtopic.php?f=10&t=20311

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] vacuum [git] [0.1] [vacuum]

by BuckarooBanzay » Post

I just found out this mod is on youtube: https://www.reddit.com/r/Minetest/comme ... ew_vacuum/
Thanks and keep up the good work Nathan Salapat :)

Red_King_Cyclops
Member
Posts: 315
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] vacuum [git] [0.1] [vacuum]

by Red_King_Cyclops » Post

I'm making a space mod that uses vacuum as a dependency. This mod adds in space dimensions similar to your planet_moon and planet_mars mods. I plan to make habitable exoplanet dimensions, and I am wondering if it is possible to cause the vacuum to stop at a certain y-height.
My best mods: space_travel, time_travel, and rocket.

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] vacuum [git] [0.1] [vacuum]

by BuckarooBanzay » Post

Red_King_Cyclops wrote:I'm making a space mod that uses vacuum as a dependency. This mod adds in space dimensions similar to your planet_moon and planet_mars mods. I plan to make habitable exoplanet dimensions, and I am wondering if it is possible to cause the vacuum to stop at a certain y-height.
You could overwrite the vacuum.is_pos_in_space(pos) function with your own logic, like i did in the planet_mars mod:

https://github.com/pandorabox-io/planet ... vacuum.lua

Code: Select all

local has_vacuum_mod = minetest.get_modpath("vacuum")

local y_start = planet_mars.y_start
local y_height = planet_mars.y_height


if has_vacuum_mod then

	local old_is_pos_in_space = vacuum.is_pos_in_space
	vacuum.is_pos_in_space = function(pos)

		if pos.y < y_start or pos.y > (y_start + (y_height * 0.95)) then
			-- not on mars
			return old_is_pos_in_space(pos)
		end

		-- atmosphere in mars caves
		return false
	end


end
This allows the mars-caves to be filled with air in my case.

Or the air-shell around the planetoids:
https://github.com/pandorabox-io/planet ... vacuum.lua

Just a heads-up: the function is rate-limited but will be called 1000 times per second in the worst case:
https://github.com/thomasrudin-mt/vacuu ... cs.lua#L58

(i need to document that mod a bit more in the future... :/ )

Red_King_Cyclops
Member
Posts: 315
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] vacuum [git] [0.1] [vacuum]

by Red_King_Cyclops » Post

BuckarooBanzay wrote:
Red_King_Cyclops wrote:I'm making a space mod that uses vacuum as a dependency. This mod adds in space dimensions similar to your planet_moon and planet_mars mods. I plan to make habitable exoplanet dimensions, and I am wondering if it is possible to cause the vacuum to stop at a certain y-height.
You could overwrite the vacuum.is_pos_in_space(pos) function with your own logic, like i did in the planet_mars mod:

https://github.com/pandorabox-io/planet ... vacuum.lua

Code: Select all

local has_vacuum_mod = minetest.get_modpath("vacuum")

local y_start = planet_mars.y_start
local y_height = planet_mars.y_height


if has_vacuum_mod then

	local old_is_pos_in_space = vacuum.is_pos_in_space
	vacuum.is_pos_in_space = function(pos)

		if pos.y < y_start or pos.y > (y_start + (y_height * 0.95)) then
			-- not on mars
			return old_is_pos_in_space(pos)
		end

		-- atmosphere in mars caves
		return false
	end


end
This allows the mars-caves to be filled with air in my case.

Or the air-shell around the planetoids:
https://github.com/pandorabox-io/planet ... vacuum.lua

Just a heads-up: the function is rate-limited but will be called 1000 times per second in the worst case:
https://github.com/thomasrudin-mt/vacuu ... cs.lua#L58

(i need to document that mod a bit more in the future... :/ )
Thanks, that looks like it should work.

Edit: I modified your code and tested it in my mod. For some reason, from 23500 to 24500, there is no atmosphere. The code looks like it should function, but nothing happens for some reason. Have I made any mistakes?

Code: Select all

--vacuum code

local old_is_pos_in_space = vacuum.is_pos_in_space
vacuum.is_pos_in_space = function(pos)

	if pos.y < 23500 or pos.y > 24500 then
		-- not in the atmosphere of a habitable planet
		return old_is_pos_in_space(pos)
	end

	-- atmosphere on habitable worlds
	return false
end
Second edit: I figured out that the example you provided stopped the vacuum but did not replace it with air. After creating an on_generated function that accompanied the override of is_pos_in_space, my alien planet now has an atmosphere.
My best mods: space_travel, time_travel, and rocket.

Post Reply

Who is online

Users browsing this forum: duckgo, KCoombes and 4 guests