[Mod] Moon realm [0.11.0] [moonrealm]

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

by mauvebic » Post

i tacked this onto the end of the latest version (020):

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.

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

by paramat » Post

Yeah that will work but the register ore should be like this

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.

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

by paramat » Post

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

Code: Select all

local ATMTOP = 30000
The order of the register ore statements is important i think it determines the order of execution.

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

by paramat » Post

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.

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

by paramat » Post

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

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

by Inocudom » Post

How do you intend to make it so that the sky always looks like the player is in space, even during the daytime?

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

by paramat » Post

Inocudom wrote:The mod below is a good basis for creating alien ruins above ground and below ground.
http://forum.minetest.net/viewtopic.php?id=5524
The new fast schematics functions will be excellent for structures, 0.4.6 totally blew my mind but 0.4.8 is another huge improvement. Those who left just don't understand what they're missing, distracted by cosmetic changes to minetest_game. This game is far beyond minecraft but also free and open source.
Last edited by paramat on Tue Jun 25, 2013 04:26, edited 1 time in total.

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

by paramat » Post

Inocudom wrote:How do you intend to make it so that the sky always looks like the player is in space, even during the daytime?
Oh haha i don't intend, that's why this is a large moon / small planet with a thin atmosphere (which just happens to be blue).

But then, you could make it always night and make the surface nodes glow ... ? might slow generation but sounds fun to try once. You only get night sky during day when there is no atmosphere, lots of moons have thin atmospheres.
Last edited by paramat on Tue Jun 25, 2013 04:48, edited 1 time in total.

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

We need a function to change the time for only one player, and to change his stars/moon/sun background... We could get real space...

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

by paramat » Post

Someone could run a space server with time stationary and set to night. In space the sun is actually blinding yellow-white so you could consider the 'moon' to be the sun.
Last edited by paramat on Wed Jul 16, 2014 14:15, edited 2 times in total.

User avatar
Mossmanikin
Member
Posts: 599
Joined: Sun May 19, 2013 16:26
Location: where we don't speak english.

by Mossmanikin » Post

Looks awesome

Noob 4 life!
My stuff

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Is it water at the top of the map? That looks strange on a moon...
@mauvebic: were you finally able to finish your code for an atmosphere? If so, I'd like to see it.

paramat: If you want faster generation for those who have the indev release, without affecting the generation time for the others, use that code:

Code: Select all

if minetest.place_schematic==nil then
    function minetest.place_schematic(pos, schematic)
        local x = pos.x
        local y = pos.y
        local z = pos.z
        local set_node = minetest.set_node
        local scmdata = schematic.data
        local j2, k2
        for k = 0, schematic.size.z-1 do
            k2 = k*schematic.size.x*schematic.size.y
            for j = 0, schematic.size.y-1 do
                j2 = j*schematic.size.x
                for i = 0, schematic.size.x-1 do
                    if scmdata[i+j2+k2+1].name~="ignore" then
                        set_node({x=x+i,y=y+j,z=z+k}, scmdata[i+j2+k2+1])
                    end
                end
            end
        end
    end
end
with a modfied ces function that will set "ignore" to all locations instead of air.
Last edited by Nore on Thu Jun 27, 2013 07:34, edited 1 time in total.

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

by mauvebic » Post

Nore wrote: @mauvebic: were you finally able to finish your code for an atmosphere? If so, I'd like to see it.
I did get it to work but the results were disappointing with a test dome. It simply took too long for oxygen to be produced and move (or at least, one of the two processes was slowing things down). After an evening (few hours) my test dome still didn't have a full breathable atmosphere. On the flipside, increasing the speed through the abm's made the server slower (--FPS,++cpu usage).

Another avenue might be to implement the lua drowning mod in reverse (make players suffocate above a certain Y threshold w/o the spacesuit) though that comes with it's own caveat of not knowing when a player is indoors or not (they would suffocate in bases). One solution to that might be to add atmospheric generator nodes. Register/poll the position of these gens and give them an effective radius. Then the suffocation (reverse drowning) mod could simply check if the player is within range of said generator.

Anyways, here's the code (if someone can make it work more smoothly):

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


minetest.register_abm({ 
    nodenames = { "air"}, 
    interval = 2, 
    chance = 10,
    action = function(pos, node, active_object_count, active_object_count_wider)
        if pos.y > 14000 then
            for _, cp in pairs({{x=pos.x+1,y=pos.y,z=pos.z},{x=pos.x-1,y=pos.y,z=pos.z},{x=pos.x,y=pos.y+1,z=pos.z},
            {x=pos.x,y=pos.y-1,z=pos.z},{x=pos.x,y=pos.y,z=pos.z+1},{x=pos.x,y=pos.y,z=pos.z-1},}) do
                if minetest.env:get_node(cp).name == 'void' then
                --    print('moving air')
                    minetest.env:remove_node(cp) -- air dest
                    minetest.env:add_node(pos,{name='void'}) -- air source
                    break
                end
            end
        end
    end 
})
minetest.register_abm({ 
    nodenames = { "group:leaves"}, 
    interval = 5, 
    chance = 6,
    action = function(pos, node, active_object_count, active_object_count_wider)
        if pos.y > 14000 then
            for _, cp in pairs({{x=pos.x+1,y=pos.y,z=pos.z},{x=pos.x-1,y=pos.y,z=pos.z},{x=pos.x,y=pos.y+1,z=pos.z},
            {x=pos.x,y=pos.y-1,z=pos.z},{x=pos.x,y=pos.y,z=pos.z+1},{x=pos.x,y=pos.y,z=pos.z-1},}) do
                if minetest.env:get_node(cp).name == 'void' then
                --    print('making air')
                    minetest.env:remove_node(cp) -- air dest
                end
            end
        end
    end 
})
]]--

This is my rebuilt base using paramat's 020 version:
Image

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Did you try to add a neighbors = {"void"} field to the ABM ? It will avoid unecessary operations.

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

by mauvebic » Post

I was thinking of using minetest.find_nodes_in_area(minp, maxp, 'void')

leaves could replace more voids with air (current limit: 6 nodes or radius 1). It might help speed up air movement too.

Adding neighbours field would also improve performance as the dome fills up (fewer voids).
Last edited by mauvebic on Thu Jun 27, 2013 20:57, edited 1 time in total.

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

by paramat » Post

This idea of turning vacuum / poison atmosphere nodes into air nodes is interesting and inspiring. Nice base.

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

by paramat » Post

Nore wrote:Is it water at the top of the map? That looks strange on a moon...

paramat: If you want faster generation for those who have the indev release, without affecting the generation time for the others, use that code
That's water on the normal surface below :)

Thanks but no point me using that code 0.4.8 is coming soon and i'll then be concentrating on using hmmm's voxel map manipulator, also he recommended not using schematics for large scale realm generation.

User avatar
prof-turbo
Member
Posts: 516
Joined: Mon May 07, 2012 17:02
Location: MinetestForFun or Teeworlds master server list

by prof-turbo » Post

---Idea---

When arriving to a x level of depht, you fall in space

Exemple :
| between -500 and -450, there's space :
|
|spawn
|___________________________
|moon |
|___________________________|
|blank
You should take a look at http://www.xorhub.com

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

by paramat » Post

prof-turbo, yeah that already happens in this mod, by default dig 1km down to reach realm bottom.

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

by Inocudom » Post

Have you had any luck with creating abandoned alien ruins yet? They could be made out of the same ores that could be found within the moon. Maybe mauvebic could help out with this, since he is very good at making gargantuan structures.

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

by mauvebic » Post

Well, i have ships and bases from ST and BSG, and buildings from SW, though i have no idea what the new schematics in plaintext look like, id likely have to convert my models.

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

by paramat » Post

Version 0.3.0.
Link, details, screenshots in edited first post.
Last edited by paramat on Fri Jun 28, 2013 20:28, edited 1 time in total.

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

by paramat » Post

Now on github, link in first post.

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

by mauvebic » Post

updated shots of moonbase Titan I. Residential building is up, got water, plasma & beer distrubtion running :-)

Image
Image
Image
Image

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

by Inocudom » Post

mauvebic wrote:updated shots of moonbase Titan I. Residential building is up, got water, plasma & beer distrubtion running :-)
Good to see you back with us again, Mauvebic.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests