[Mod] Moon realm [0.9.2] [moonrealm]

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

[Mod] Moon realm [0.9.2] [moonrealm]

by paramat » Fri Jun 21, 2013 07:09

Image


Image


Image


For Minetest 0.4.12 or later
Depends default
Licenses: Code LGPL 2.1. Media CC BY-SA

Download v0.9.2 and rename folder to 'moonrealm'
https://github.com/paramat/moonrealm/archive/e1764cf63599e24d0caa1db84c5185ddf617b59d.zip

Browse v0.9.2 code
https://github.com/paramat/moonrealm/tree/e1764cf63599e24d0caa1db84c5185ddf617b59d

Note i am now working on an unstable development version 0.10.0, the links above are to the previous stable version.
v0.10.0 will break existing worlds and only works with Minetest 0.4.14 or later.
Download v0.10.0 and rename folder to 'moonrealm'
https://github.com/paramat/moonrealm/archive/master.zip

Browse latest dev code
https://github.com/paramat/moonrealm

The mod will automatically select singlenode mapgen.
Uses the custom skybox, altered gravity and 'override_day_night_ratio': the brightness of the terrain stays constant and is independant of server time.
You will spawn inside an egg on the bright side of the moon, with the sun and the crescent of the normal realm overhead.
You will be provided with a spacesuit and initial equipment. Break your way out of the egg and use the lights inside as your initial supply of lights.
Mine moon stone and build a well-sealed base (edge- or corner-connected nodes will still leak air), the airlock nodes can be walked through but will not let life support air pass.
Place the airgen node in the centre of the base and wait for the air to spread.
Place hydroponic liquid in at least 2 nodes depth of moon dirt and wait for it to saturate and turn the moon dirt into orange moon 'soil', then plant a sapling, this will only grow in 2 nodes depth of moon soil under a 5x5x6 node volume of air.
The appletree provides apples and leaves for crafting more hydroponic liquid.

Crafting
----------

Spacesuit.
To avoid drowning in the vacuum nodes put a spacesuit in your inventory.

Mesetint helmet.
-C-
-G-
-S-
C = default mese crystal (mese tint)
G = default glass
S = default steel ingot

Lifesupport backpack.
SSS
S-S
SMS
S = default steel ingot
M = default mese block (power source)

Spacesuit.
WHW
-L-
W-W
W = wool white (fabric)
H = moonrealm helmet
L = moonrealm lifesupport


Moonrealm sapling.
-C-
-S-
C = default mese crystal
S = sapling

Moon stone brick x 4.
MM
MM
M = moon stone

Moon stone stair x 4.
M
MM
M = moon stone

Moon stone slab x 4.
MM
M = moon stone

Default furnace.
You can cook moon dust to moonrealm glass, use mese crystal as fuel.
MMM
M-M
MMM
M = moon stone

Airgen.
Place in the centre of a sealed habitat.
Moonrealm air will spread to a distance of roughly 16 nodes.
SIS
IMI
SIS
S = default steel ingot
I = moonrealm waterice
M = default mese block (power source)

Airlock with light source.
Walk through it, life support air cannot pass through.
S-S
SMS
S-S
S = default steel ingot
M = default mese block (power source)

Light x 8
GGG
GMG
GGG
G = moonrealm glass
M = default mese block (power source)

Default water source.
Ice spawns in dust at mid to low altitudes.
I
I = moonrealm waterice

Hydroponic liquid source.
Hydroponic liquid will saturate the 5x5 node area of dust around it, to a depth of 5 nodes,
changing it to moonrealm soil.
A depth of 2 soil nodes with 5x5x6 nodes of moonrealm air above is needed for a moonrealm sapling to grow.
LLL
LIL
LLL
L = moonrealm leaves
I = moonrealm waterice
Last edited by paramat on Tue Mar 14, 2017 01:22, edited 41 times in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Fri Jun 21, 2013 07:57

Your mods are amazing, as always... A problem with the tint is the transition between the different levels of tint, and the fact that the sky will change whenever we are above/below ground. Moreover, you should add a function that places tint again when a node is dug.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Fri Jun 21, 2013 08:03

Nore wrote:Moreover, you should add a function that places tint again when a node is dug.

Aha yes good idea.
And yeah the tint transition should be smoother, next version.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Fri Jun 21, 2013 15:06

How about some alien ruins for this alien world? They could be made out of some kind of metal that is found in the fissures and have glass domes that are made out of the sand.

Will there be meseors here?
Last edited by Inocudom on Fri Jun 21, 2013 15:07, edited 1 time in total.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Sat Jun 22, 2013 06:45

Yeah meseors.
Alien ruins is a good idea i'm interested in architecture generation.

The tinted atmosphere was a crazy experiment but problematic, i have now removed that and doubled the scale of the surface to 2 chunks. A few other things i want to do before the next version.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sat Jun 22, 2013 06:57

You should also modify the replace code, or add lua code that checks if every node has been replaced, because there are still lots of air bubbles in the stone (perhaps register_ore 16 times instead of 8 will be enough)
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sat Jun 22, 2013 14:42

paramat, you should try to use the new functions to set multiple nodes that were added today: it is now insanely fast (less than a few seconds for a full chunck). I am doing a mod that creates multiple realms at y=20000, and it went at least 100 times faster with the new version. Here is the code: (it is WTFPL, and if there are unused variabled, it is because it is base on your code ;) )
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local ONGEN = true -- (true / false) -- Enable / disable moonrealm generation.
local YMIN = 19000 -- Approx bottom.
local YMAX = 20000 -- Approx top.
local GRAD = 40 -- 40 -- Surface generating noise gradient. Controls height of hills.
local STOTHR = 0.15 -- 0.15 -- Stone noise threshold. Controls maximum depth of dust.

local DUSDIS = 40 -- 40 -- Dust thinning distance in nodes.
local DUSAVY = 20 -- 20 -- Average y where dust starts to thin, relative to minp.y.
local DUSAMP = 20 -- 20 -- Amplitude of that thinning level.
local DUSRAN = 2 -- 2 -- +- Randomness of that thinning level.

local CAVOFF = 0.015 -- 0.015 -- Cave offset. Size of underground caves.
local CAVDIS = 56 -- 56 -- Cave thinning distance in nodes.

local ATMALP = 32 -- 32 -- Alpha of above ground atmosphere
local ATMTHR3 = 0.1 -- 0.1 -- Atmosphere noise thresholds. Controls smooth transition from orange tinted air to normal air underground -- .
local ATMTHR4 = 0.2 -- 0.2 --
local ATMTHR5 = 0.3 -- 0.3 --

local DEBUG = true

-- Perlin noise for terrain.
local SEEDDIFF1 = 46894686546
local OCTAVES1 = 6 -- 6 -- Add 1 to this if you increase scale, add another 1 each time scale has doubled.
local PERSISTENCE1 = 0.55 -- 0.55 --
local SCALE1 = 256 -- 256 -- Largest scale of noise pattern.

-- Perlin noise for caves.
local SEEDDIFF2 = 9294207
local OCTAVES2 = 6 -- 6 -- Add 1 to this if you increase scale, add another 1 each time scale has doubled.
local PERSISTENCE2 = 0.5 -- 0.5 --
local SCALE2 = 256 -- 256 -- Largest scale of noise pattern.

-- Perlin noise for dust thinning line.
local SEEDDIFF3 = 93561
local OCTAVES3 = 4 -- 4 -- Add 1 to this if you increase scale, add another 1 each time scale has doubled.
local PERSISTENCE3 = 0.5 -- 0.5 --
local SCALE3 = 256 -- 256 -- Largest scale of noise pattern.

local yminq = (80 * math.floor((YMIN + 32) / 80)) - 32
local ymaxq = (80 * math.floor((YMAX + 32) / 80)) + 47

minetest.register_node("realms:barrier", {
    drawtype = "normal",
    tiles = {"realms_barrier"},
    paramtype = "light",
    sunlight_propagates = true,
    pointable = false,
    diggable = false,
})

local function replace(old, new)
    for i=1,16 do
        minetest.register_ore({
            ore_type       = "scatter",
            ore            = new,
            wherein        = old,
            clust_scarcity = 1,
            clust_num_ores = 1,
            clust_size     = 1,
            height_min     = yminq,
            height_max     = ymaxq - 80,
        })
    end
end

if ONGEN then
    replace("air", "default:stone")
end

-- On generated function.

function ces()
    local s={}
    for i=1,80 do
        s[i]={}
        for j=1,80 do
            s[i][j]={}
            for k=1,80 do
                s[i][j][k]={name="air"}
            end
        end
    end
    return s   
end

function flatten(scm)
    local s2={}
    local s2i=1
    for _,a in ipairs(scm) do
    for __,b in ipairs(a) do
    for ___,c in ipairs(b) do
        s2[s2i]=c
        s2i=s2i+1
    end
    end
    end
    return s2
end

function add_to_scm(scm, pos, s)
    for p, node in pairs(s) do
        if p.x+pos.x>=1 and p.x+pos.x<=80 and p.y+pos.y>=1 and p.y+pos.y<=80 and p.z+pos.z>=1 and p.z+pos.z<=80 then
            scm[p.z+pos.z][p.y+pos.y][p.x+pos.x]=node
        end
    end
end

treeschm = {[{x=0,y=0,z=0}]={name="default:tree"},
        [{x=0,y=1,z=0}]={name="default:tree"},
        [{x=0,y=2,z=0}]={name="default:tree"},
        [{x=0,y=3,z=0}]={name="default:tree"},
        [{x=0,y=4,z=0}]={name="default:tree"},
        [{x=1,y=5,z=0}]={name="default:leaves"},
        [{x=-1,y=5,z=0}]={name="default:leaves"},
        [{x=1,y=5,z=1}]={name="default:leaves"},
        [{x=1,y=5,z=-1}]={name="default:leaves"},
        [{x=-1,y=5,z=1}]={name="default:leaves"},
        [{x=-1,y=5,z=-1}]={name="default:leaves"},
        [{x=0,y=5,z=0}]={name="default:leaves"},
        [{x=0,y=5,z=1}]={name="default:leaves"},
        [{x=0,y=5,z=-1}]={name="default:leaves"},
        [{x=1,y=6,z=0}]={name="default:leaves"},
        [{x=-1,y=6,z=0}]={name="default:leaves"},
        [{x=0,y=6,z=1}]={name="default:leaves"},
        [{x=0,y=6,z=-1}]={name="default:leaves"},
        [{x=0,y=6,z=0}]={name="default:leaves"},
        }

for y=2,4 do
for x=-2,2 do
for z=-2,2 do
    if x~=0 or z~=0 then
        treeschm[{x=x,y=y,z=z}]={name="default:leaves"}
    end
end
end
end

if ONGEN then
    minetest.register_on_generated(function(minp, maxp, seed)
        minetest.place_schematic(minp, {size={x=1,y=1,z=1},data={{name="default:mese"}}})
        local env = minetest.env
        local scm = ces()
        if maxp.y == ymaxq then
            math.randomseed(seed)
            --local pr=PseudoRandom(seed)
            local perlin1 = env:get_perlin(SEEDDIFF1, OCTAVES1, PERSISTENCE1, SCALE1)
            local perlin2 = env:get_perlin(SEEDDIFF2, OCTAVES2, PERSISTENCE2, SCALE2)
            --local perlin3 = env:get_perlin(pr:next(1,1000), pr:next(2,6), pr:next(1,1000)/500, pr:next(50,1000))
            local water_level = math.random(20,60)
            local sea,treeproba
            if math.random()<=0.05 then
                sea="default:lava_source"
                treeproba=0
            else
                sea="default:water_source"
                treeproba = (math.exp(2*math.random())-1)/50
            end
            for x=1,79 do
            print(x)
            for z=1,79 do
                local surf=math.floor(40+25*perlin1:get2d({x=minp.x+x,y=minp.z+z}))
                local top=math.floor(3+2*perlin2:get2d({x=minp.x+x,y=minp.z+z}))
                if top>=surf then top=surf-1 end
                if surf>80 then surf=80 end
                for y=1, surf-top do
                    --minetest.set_node({x=x,y=y,z=z},{name="default:stone"})
                    scm[z][y][x]={name="default:stone"}
                end
                for y=surf-top, surf-1 do
                    --minetest.set_node({x=x,y=y,z=z},{name="default:dirt"})
                    scm[z][y][x]={name="default:dirt"}
                end
                --minetest.set_node({x=x,y=surf,z=z},{name="default:dirt_with_grass"})
                scm[z][surf][x]={name="default:dirt_with_grass"}
                if surf<water_level then
                    for yw=surf+1,water_level do
                        --minetest.set_node({x=x,y=yw,z=z},{name=sea})
                        scm[z][yw][x]={name=sea}
                    end
                else
                    if math.random()<=treeproba then
                        add_to_scm(scm, {x=x,y=surf+1,z=z}, treeschm)
                    end
                end
            end
            end
           
            for y=1,80 do
                for x=1,80 do
                    --minetest.set_node({x=x,y=y,z=minp.z},{name="realms:barrier"})
                    --minetest.set_node({x=x,y=y,z=maxp.z},{name="realms:barrier"})
                    scm[1][y][x]={name="realms:barrier"}
                    scm[80][y][x]={name="realms:barrier"}
                end
                for z=2,79 do
                    --minetest.set_node({x=minp.x,y=y,z=z},{name="realms:barrier"})
                    --minetest.set_node({x=maxp.x,y=y,z=z},{name="realms:barrier"})
                    scm[z][y][1]={name="realms:barrier"}
                    scm[z][y][80]={name="realms:barrier"}
                end
            end
            minetest.place_schematic(minp, {size={x=80,y=80,z=80},data=flatten(scm)})

        elseif minp.y>=yminq and maxp.y<ymaxq then
            for y=minp.y,maxp.y do
                for x=minp.x,maxp.x do
                    minetest.set_node({x=x,y=y,z=minp.z},{name="realms:barrier"})
                    minetest.set_node({x=x,y=y,z=maxp.z},{name="realms:barrier"})
                end
                for z=minp.z+1,maxp.z-1 do
                    minetest.set_node({x=minp.x,y=y,z=z},{name="realms:barrier"})
                    minetest.set_node({x=maxp.x,y=y,z=z},{name="realms:barrier"})
                end
            end
        end
    end)
end
Last edited by Nore on Thu Jun 27, 2013 09:26, edited 1 time in total.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Sat Jun 22, 2013 16:28

Keep up the good work, you're one of the rare (imaginative) ones.

I played around with it, pretty cool. Though the atmosphere nodes were preventing me from placing doors (since they look for air). I also found that w/o atmosphere, the realm generates 2-3x faster on my (newest/average) rig. I was also slightly confused why Mars would be called moonrealm :P but i hacked around and added a moon layer.

Tweaked moonrealm : moon @ y= 10K, mars @ y= 20K

I think the next step might be to add realm-specific ores/resources to give the players a reason to reach the other realms.

ex. moon realm with little base:
Image
Last edited by mauvebic on Sat Jun 22, 2013 22:11, edited 1 time in total.
"Fuck the hat." - Paulie Gualtieri
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat Jun 22, 2013 17:03

Nore wrote:paramat, you should try to use the new functions to set multiple nodes that were added today: it is now insanely fast (less than a few seconds for a full chunck). I am doing a mod that creates multiple realms at y=20000, and it went at least 100 times faster with the new version. Here is the code: (it is WTFPL, and if there are unused variabled, it is because it is base on your code ;


Were these new functions added to Minetest itself recently? It is a great day for this game if they were.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Sun Jun 23, 2013 02:56

Nore ...
Yeah i noticed the air bubbles and discovered they are due to the number of 'register ore's. Trying to get a balance between speed and lack of bubbles i decided Pilzadam's value of 8 is reasonable, the bubbles are only a problem if they make fissure walls excessively pitted.
Thanks for posting the code with the new functions, this is exciting news and i look forward to using them in 0.4.8 (yeah i only use stable releases so i'lll have to wait).

mauvebic, thanks :) Yeah one of the many reasons i removed the atmosphere nodes was generation speed.
EDIT I like that moonbase.
Last edited by paramat on Sun Jun 23, 2013 05:40, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sun Jun 23, 2013 03:29

mauvebic wrote:Keep up the good work, you're one of the rare (imaginative) ones.

I played around with it, pretty cool. Though the atmosphere nodes were preventing me from placing doors (since they look for air). I also found that w/o atmosphere, the realm generates 2-3x faster on my (newest/average) rig. I was also slightly confused why Mars would be called moonrealm :P but i hacked around and added a moon layer.

Tweaked moonrealm : moon @ y= 10K, mars @ y= 20K

I think the next step might be to add realm-specific ores/resources to give the players a reason to reach the other realms.

ex. moon realm with little base:
Image


Making use of your mods and nodes again, Mauvebic? I once asked Starseed to do a review of your MM6 modpack, but he hasn't been doing any videos lately.
 

User avatar
prof-turbo
Member
 
Posts: 518
Joined: Mon May 07, 2012 17:02

by prof-turbo » Sun Jun 23, 2013 10:48

AMAZING!
You should take a look at http://www.xorhub.com
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Mon Jun 24, 2013 03:49

Version 0.2.0, first post rewritten, new screenshots.
I think this mod was initially partially inspired by the photograph of the surface of Titan, a moon of Saturn.
Image
Last edited by paramat on Thu Jun 27, 2013 01:58, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Mon Jun 24, 2013 04:30

The mod below is a good basis for creating alien ruins above ground and below ground.
http://forum.minetest.net/viewtopic.php?id=5524
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jun 24, 2013 18:07

Inocudom wrote:Making use of your mods and nodes again, Mauvebic? I once asked Starseed to do a review of your MM6 modpack, but he hasn't been doing any videos lately.


The irony is i don't remember building that base (national holiday, 3 day weekend ;), it's even got a beer brewery in the basement lol

But yes, i still use my stuff, i just don't publish, so your friend would be better off reviewing something else :p

Paramat: how easy would it be to convert all the air nodes of these realm(s) into something else like vacuum? Would be cool if oxygen farming was a necessity for survival :-)
"Fuck the hat." - Paulie Gualtieri
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Mon Jun 24, 2013 18:13

It would be quite easy... (2 lines code, very fast to execute with minetest.register_ore) The hard part is to add air physics after that.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jun 24, 2013 18:25

Nore wrote:It would be quite easy... (2 lines code, very fast to execute with minetest.register_ore) The hard part is to add air physics after that.

I guess you are using the same register_ore() hack I use in my nether mod?
Last edited by PilzAdam on Mon Jun 24, 2013 18:25, edited 1 time in total.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jun 24, 2013 18:25

Im not familiar with on_generated at all - how would one use register_ore to fill air with vacuum?
"Fuck the hat." - Paulie Gualtieri
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jun 24, 2013 18:40

mauvebic wrote:Im not familiar with on_generated at all - how would one use register_ore to fill air with vacuum?

I already said that its originally used in my nether mod. You can look it up there.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jun 24, 2013 18:47

PilzAdam wrote:
mauvebic wrote:Im not familiar with on_generated at all - how would one use register_ore to fill air with vacuum?

I already said that its originally used in my nether mod. You can look it up there.


I was asking Nore. I thought LKjoel wrote the nether mod?
Last edited by mauvebic on Mon Jun 24, 2013 18:50, edited 1 time in total.
"Fuck the hat." - Paulie Gualtieri
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jun 24, 2013 18:50

mauvebic wrote:
PilzAdam wrote:
mauvebic wrote:Im not familiar with on_generated at all - how would one use register_ore to fill air with vacuum?

I already said that its originally used in my nether mod. You can look it up there.


I was asking Nore. I thought LKjoel wrote the nether mod?

You can use PM to ask people personal questions, otherwise you have to expect anwers from others.

I wrote a nether mod myself that completly differs from the other nether mod.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jun 24, 2013 18:55

PilzAdam wrote:
mauvebic wrote:
PilzAdam wrote:I already said that its originally used in my nether mod. You can look it up there.


I was asking Nore. I thought LKjoel wrote the nether mod?

You can use PM to ask people personal questions, otherwise you have to expect anwers from others.

I wrote a nether mod myself that completly differs from the other nether mod.


Well when you have a clear answer let me know (hint, RTFM and such answers wont do).
"Fuck the hat." - Paulie Gualtieri
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Mon Jun 24, 2013 19:08

This code will replace all air between heights ymin and ymax with void. Notes:
- Not perfect, still little holes. You can register 2 times more ores, and they will disappear.
- You need to add it *after* the code of paramat, and *not* in an on_generated function. Else, his replacing of air with stone will not work since it will have already been replaced with void
- You need to change the fissure creating code so it places void instead of doing remove_node.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
for i=1,8 do
    minetest.register_ore({
        ore_type       = "scatter",
        ore            = "void",
        wherein        = "air",
        clust_scarcity = 1,
        clust_num_ores = 1,
        clust_size     = 1,
        height_min     = ymin,
        height_max     = ymax,
    })
end
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jun 24, 2013 19:20

Thank you Nore :-)
"Fuck the hat." - Paulie Gualtieri
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Jun 25, 2013 01:41

mauvebic wrote:Paramat: how easy would it be to convert all the air nodes of these realm(s) into something else like vacuum? Would be cool if oxygen farming was a necessity for survival :-)

Well version 0.1.0 replaced all air nodes with tinted atmosphere nodes so yo could work from that, however as you know that slows generation a lot so ...
Use the register ore hack to replace air with void between 'ymaxq' and 'ymaxq - 159', edit the code so the 'register ores' section looks like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Register ores. The air is very rich in stone.
if ONGEN then
    minetest.register_ore({
        ore_type       = "scatter",
        ore            = "moonrealm:luxore",
        wherein        = "air",
        clust_scarcity = LUXCHUN,
        clust_num_ores = 1,
        clust_size     = 1,
        height_min     = yminq,
        height_max     = ymaxq - 160,
    })
    for i=1,8 do
        minetest.register_ore({
            ore_type       = "scatter",
            ore            = "moonrealm:moonstone",
            wherein        = "air",
            clust_scarcity = 1,
            clust_num_ores = 1,
            clust_size     = 1,
            height_min     = yminq,
            height_max     = ymaxq - 160,
        })
    end
    for i=1, 10 do
        minetest.register_ore({
            ore_type       = "scatter",
            ore            = "void",
            wherein        = "air",
            clust_scarcity = 1,
            clust_num_ores = 1,
            clust_size     = 1,
            height_min     = ymaxq - 159,
            height_max     = ATMTOP,
        })
    end
end

And add another parameter
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local ATMTOP = 30000


Then as Nore said in the fissure code add void instead of 'remove node' (line 209 version 0.2.0).
There may be bubbles of air left over here and there but at least they'll be invisible, if they are a problem then increase 'i' for more iterations.
Nore wrote:You need to add it *after* the code of paramat, and *not* in an on_generated function. Else, his replacing of air with stone will not work since it will have already been replaced with void

Luckily not a problem since there are 2 parts to this realm: 'underground' yminq to ymaxq -160, and 'surface chunks' from ymaxq - 159 to ymaxq.
Last edited by paramat on Tue Jun 25, 2013 04:32, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Tue Jun 25, 2013 02:00

i tacked this onto the end of the latest version (020):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node(":air", {
    description = "Air",
    inventory_image = "unknown_node.png",
    wield_image = "unknown_node.png",
    drawtype = "airlike",
    paramtype = "light",
    sunlight_propagates = true,
    walkable = false,
    pointable = false,
    diggable = false,
    buildable_to = true,
    air_equivalent = true,
    drop = "",
--    groups = {not_in_creative_inventory=1},
})
minetest.register_node(":void", {
    description = "Void (you hacker you!)",
    inventory_image = "unknown_node.png",
    wield_image = "unknown_node.png",
    drawtype = "airlike",
    paramtype = "light",
    sunlight_propagates = true,
    walkable = false,
    pointable = false,
    diggable = false,
    buildable_to = true,
    air_equivalent = true,
    drop = "",
    groups = {not_in_creative_inventory=1},
    damage_per_second = 2,
    post_effect_color = {a=64, r=255, g=148, b=0},
})
for i=1,8 do
    minetest.register_ore({
        ore_type       = "scatter",
        ore            = 'void',
        wherein        = 'air',
        clust_scarcity = 1,
        clust_num_ores = 1,
        clust_size     = 1,
        height_min     = 14000,
        height_max     = 30000,
    })
end


Basically i want all air above y = 14000 to be void (airlike vacuum w/ damage). I havent written abm's for group = leaves to produce air or for air to be sucked out towards vacuum yet.
"Fuck the hat." - Paulie Gualtieri
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Jun 25, 2013 03:41

Yeah that will work but the register ore should be like this
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
for i=1,8 do
    minetest.register_ore({
        ore_type       = "scatter",
        ore            = 'void',
        wherein        = 'air',
        clust_scarcity = 1,
        clust_num_ores = 1,
        clust_size     = 1,
        height_min     = ymaxq - 159,
        height_max     = 30000,
    })
end

... because the 'underground' volume between 14000 (yminq) and ymaxq - 160 is air already turned to moonstone by 'nether mod register ore black magic'. Putting the ymaxq - 159 parameter in there makes it flexible.

The realm top and bottom parameters YMAX and YMIN are quantised to ymaxq and yminq, the chunk edges.
Last edited by paramat on Tue Jun 25, 2013 03:42, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Jun 25, 2013 04:00

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Register ores. The air is very rich in stone.
if ONGEN then
    minetest.register_ore({
        ore_type       = "scatter",
        ore            = "moonrealm:luxore",
        wherein        = "air",
        clust_scarcity = LUXCHUN,
        clust_num_ores = 1,
        clust_size     = 1,
        height_min     = yminq,
        height_max     = ymaxq - 160,
    })
    for i=1,8 do
        minetest.register_ore({
            ore_type       = "scatter",
            ore            = "moonrealm:moonstone",
            wherein        = "air",
            clust_scarcity = 1,
            clust_num_ores = 1,
            clust_size     = 1,
            height_min     = yminq,
            height_max     = ymaxq - 160,
        })
    end
    for i=1, 8 do
        minetest.register_ore({
            ore_type       = "scatter",
            ore            = "void",
            wherein        = "air",
            clust_scarcity = 1,
            clust_num_ores = 1,
            clust_size     = 1,
            height_min     = ymaxq - 159,
            height_max     = ATMTOP,
        })
    end
end

And add another parameter
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local ATMTOP = 30000


The order of the register ore statements is important i think it determines the order of execution.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Jun 25, 2013 04:08

Anyways it's good to see someone else likes the atmosphere nodes idea, i'm now inspired to write that back in but of course done instead by register ore to make it fast ... duh.
It certainly looked a bit sickly and especially bad at night or in a cave, so now i have the idea of keeping it as a low altitude surface mist that clears smoothly with altitude and as you enter the caves below.
The important thing being being able to have a good night sky at mid to high altitude ... i am actually obsessed with space and that murky orange night sky looks worse than your average city night sky.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Jun 25, 2013 04:11

Anyone using this mod may find my spacesuit mod useful as a very simple, cute and crude way to get vacuum / poisonous atmosphere damage.
http://forum.minetest.net/viewtopic.php?id=5508
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 8 guests

cron