├── depends.txt ├── mod.conf ├── screenshot.png ├── textures ├── mars_moss.png ├── sky_neg_x.png ├── sky_neg_y.png ├── sky_neg_z.png ├── sky_pos_x.png ├── sky_pos_y.png ├── sky_pos_z.png ├── mars_grass_1.png ├── mars_grass_2.png ├── mars_grass_3.png ├── mars_grass_4.png ├── mars_grass_5.png ├── mars_redweed.png ├── asteroid_atmos.png ├── asteroid_dust.png ├── mars_redgrass.png ├── asteroid_cobble.png ├── asteroid_gravel.png ├── asteroid_reddust.png ├── asteroid_redstone.png ├── asteroid_redcobble.png ├── asteroid_redgravel.png ├── crystals_ghost_crystal.png ├── crystals_red_crystal.png └── crystals_rose_quartz.png ├── description.txt ├── init.lua ├── settings.lua ├── crafting.lua ├── README.md ├── space_asteroids.lua ├── license.txt ├── crystals.lua ├── redsky_asteroids.lua ├── skybox.lua ├── mars_plants.lua ├── space_nodes.lua ├── models ├── crystal_shape02.obj └── crystal_shape01.obj └── asteroid_layer_helpers.lua /depends.txt: -------------------------------------------------------------------------------- 1 | default 2 | -------------------------------------------------------------------------------- /mod.conf: -------------------------------------------------------------------------------- 1 | name = other_worlds -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/screenshot.png -------------------------------------------------------------------------------- /textures/mars_moss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_moss.png -------------------------------------------------------------------------------- /textures/sky_neg_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_neg_x.png -------------------------------------------------------------------------------- /textures/sky_neg_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_neg_y.png -------------------------------------------------------------------------------- /textures/sky_neg_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_neg_z.png -------------------------------------------------------------------------------- /textures/sky_pos_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_pos_x.png -------------------------------------------------------------------------------- /textures/sky_pos_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_pos_y.png -------------------------------------------------------------------------------- /textures/sky_pos_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/sky_pos_z.png -------------------------------------------------------------------------------- /description.txt: -------------------------------------------------------------------------------- 1 | Adds asteroid layers and height-based skybox switches to create space environments. -------------------------------------------------------------------------------- /textures/mars_grass_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_grass_1.png -------------------------------------------------------------------------------- /textures/mars_grass_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_grass_2.png -------------------------------------------------------------------------------- /textures/mars_grass_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_grass_3.png -------------------------------------------------------------------------------- /textures/mars_grass_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_grass_4.png -------------------------------------------------------------------------------- /textures/mars_grass_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_grass_5.png -------------------------------------------------------------------------------- /textures/mars_redweed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_redweed.png -------------------------------------------------------------------------------- /textures/asteroid_atmos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_atmos.png -------------------------------------------------------------------------------- /textures/asteroid_dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_dust.png -------------------------------------------------------------------------------- /textures/mars_redgrass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/mars_redgrass.png -------------------------------------------------------------------------------- /textures/asteroid_cobble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_cobble.png -------------------------------------------------------------------------------- /textures/asteroid_gravel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_gravel.png -------------------------------------------------------------------------------- /textures/asteroid_reddust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_reddust.png -------------------------------------------------------------------------------- /textures/asteroid_redstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_redstone.png -------------------------------------------------------------------------------- /textures/asteroid_redcobble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_redcobble.png -------------------------------------------------------------------------------- /textures/asteroid_redgravel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/asteroid_redgravel.png -------------------------------------------------------------------------------- /textures/crystals_ghost_crystal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/crystals_ghost_crystal.png -------------------------------------------------------------------------------- /textures/crystals_red_crystal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/crystals_red_crystal.png -------------------------------------------------------------------------------- /textures/crystals_rose_quartz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ezhh/other_worlds/HEAD/textures/crystals_rose_quartz.png -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local modpath = minetest.get_modpath("other_worlds").. DIR_DELIM 2 | 3 | otherworlds = {} 4 | 5 | dofile(modpath .. "settings.lua") 6 | dofile(modpath .. "mars_plants.lua") 7 | dofile(modpath .. "crystals.lua") 8 | dofile(modpath .. "space_nodes.lua") 9 | dofile(modpath .. "crafting.lua") 10 | dofile(modpath .. "skybox.lua") 11 | dofile(modpath .. "asteroid_layer_helpers.lua") -- required helpers for mapgen options below 12 | dofile(modpath .. "space_asteroids.lua") 13 | dofile(modpath .. "redsky_asteroids.lua") 14 | -------------------------------------------------------------------------------- /settings.lua: -------------------------------------------------------------------------------- 1 | otherworlds.settings = {} 2 | 3 | -- general 4 | otherworlds.settings.crafting = { 5 | enable = true, --set to false to remove crafting recipes 6 | } 7 | 8 | -- space_asteroids 9 | otherworlds.settings.space_asteroids = { 10 | enable = true, -- set to false to prevent space mapgen 11 | YMIN = 5000, -- adjust to change minimum height of space layer 12 | YMAX = 6000, -- adjust to change maximum height for space layer 13 | } 14 | 15 | 16 | -- redsky_asteroids 17 | otherworlds.settings.redsky_asteroids = { 18 | enable = true, -- set to false to prevent redsky mapgen 19 | YMIN = 6000, -- adjust to change minimum height of redsky layer 20 | YMAX = 7000, -- adjust to change maximum height for redsky layer 21 | } 22 | 23 | -- gravity 24 | otherworlds.settings.gravity = { 25 | enable = false, -- set to true to enable gravity 26 | } -------------------------------------------------------------------------------- /crafting.lua: -------------------------------------------------------------------------------- 1 | if otherworlds.settings.crafting.enable then 2 | 3 | minetest.register_craft({ 4 | output = "asteroid:cobble", 5 | recipe = { 6 | {"asteroid:stone"}, 7 | }, 8 | }) 9 | 10 | minetest.register_craft({ 11 | output = "asteroid:gravel", 12 | recipe = { 13 | {"asteroid:cobble"}, 14 | }, 15 | }) 16 | 17 | minetest.register_craft({ 18 | output = "asteroid:dust", 19 | recipe = { 20 | {"asteroid:gravel"}, 21 | }, 22 | }) 23 | 24 | minetest.register_craft({ 25 | output = "asteroid:redcobble", 26 | recipe = { 27 | {"asteroid:redstone"}, 28 | }, 29 | }) 30 | 31 | minetest.register_craft({ 32 | output = "asteroid:redgravel", 33 | recipe = { 34 | {"asteroid:redcobble"}, 35 | }, 36 | }) 37 | 38 | minetest.register_craft({ 39 | output = "asteroid:reddust", 40 | recipe = { 41 | {"asteroid:redgravel"}, 42 | }, 43 | }) 44 | 45 | end 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Other Worlds 2 | === 3 | 4 | Minetest mod which adds asteroid layers. 5 | 6 | Each layer contains: 7 | 8 | 1. Asteroids composed of unique materials. 9 | 2. Decoration (or lack of) for the asteroid surfaces, including plants and glowing crystals. 10 | 3. A skybox for the layer. 11 | 12 | Default layers are Space and Red Sky, but anyone familiar with editing mods should be able to easily adjust these or create different/ additional layers. 13 | 14 | 15 | Settings 16 | -------- 17 | 18 | Settings for this mod can be adjusted by editing the settings.lua file. 19 | 20 | See the comments in this file for how to adjust: 21 | 22 | 1. The minimum and maximum height of each layer. 23 | 2. Whether map-generation is currently active for individual layers. 24 | 3. Whether player gravity changes for each layer (off by default). 25 | 4. Whether crafting recipes are enabled. 26 | 27 | Note: It is advised to turn off map-generation after you have generated the required number of asteroids. 28 | 29 | 30 | Licenses and Attribution 31 | ----------------------- 32 | 33 | Components of this mod use multiple licenses and were the work of several individuals. Please see license.txt for the full list. 34 | -------------------------------------------------------------------------------- /space_asteroids.lua: -------------------------------------------------------------------------------- 1 | if otherworlds.settings.space_asteroids.enable then 2 | 3 | -- Approximate realm limits 4 | local YMIN = otherworlds.settings.space_asteroids.YMIN or 5000 5 | local YMAX = otherworlds.settings.space_asteroids.YMAX or 6000 6 | 7 | -- Register on_generated function for this layer 8 | 9 | minetest.register_on_generated(otherworlds.asteroids.create_on_generated(YMIN, YMAX, { 10 | c_air = minetest.get_content_id("air"), 11 | c_obsidian = minetest.get_content_id("default:obsidian"), 12 | c_stone = minetest.get_content_id("asteroid:stone"), 13 | c_cobble = minetest.get_content_id("asteroid:cobble"), 14 | c_gravel = minetest.get_content_id("asteroid:gravel"), 15 | c_dust = minetest.get_content_id("asteroid:dust"), 16 | c_ironore = minetest.get_content_id("default:stone_with_iron"), 17 | c_copperore = minetest.get_content_id("default:stone_with_copper"), 18 | c_goldore = minetest.get_content_id("default:stone_with_gold"), 19 | c_diamondore = minetest.get_content_id("default:stone_with_diamond"), 20 | c_meseore = minetest.get_content_id("default:stone_with_messe"), 21 | c_waterice = minetest.get_content_id("default:ice"), 22 | c_atmos = minetest.get_content_id("asteroid:atmos"), 23 | c_snowblock = minetest.get_content_id("default:snowblock"), 24 | })) 25 | 26 | end 27 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Original asteroids code: 4 | License: MIT (https://opensource.org/licenses/MIT) 5 | By paramat (available from https://github.com/paramat/asteroid) 6 | 7 | Original asteroid_ textures: 8 | License: CC BY-SA 3.0 (https://creativecommons.org/licenses/by/3.0/) 9 | Attribution: paramat 10 | 11 | Crystal models: 12 | License: MIT (https://opensource.org/licenses/MIT) 13 | By Electra Gizen 14 | 15 | Skybox texture: 16 | License: CC BY-SA 3.0 (https://creativecommons.org/licenses/by/3.0/) 17 | Attribution: Ulukai (available from http://opengameart.org/content/ulukais-space-skyboxes) 18 | 19 | 20 | --- 21 | 22 | Recoloured textures from various mods: 23 | Grass textures based on default mod in minetest_game (WTFPL). 24 | Redgrass texture based on junglegrass texture in default mod in minetest_game (assumed to be CC BY-SA 3.0). 25 | Red versions of asteroid textures (CC BY-SA 3.0). 26 | 27 | 28 | --- 29 | 30 | Textures created for this mod: 31 | CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) 32 | Attribution: Shara RedCat 33 | 34 | All original code and edits to code for this mod: 35 | License: MIT (https://opensource.org/licenses/MIT) 36 | By Shara RedCat, tenplus1 and Mewmon 37 | 38 | --- 39 | 40 | Thanks also to DonBatman for help with the initial idea, and to the players of Red Cat Creative who gave ideas and helped in testing. -------------------------------------------------------------------------------- /crystals.lua: -------------------------------------------------------------------------------- 1 | 2 | local sbox = { 3 | type = "fixed", 4 | fixed = {-5/16, -8/16, -6/16, 5/16, -1/32, 5/16}, 5 | } 6 | 7 | local crystal_list = { 8 | {"ghost_crystal", "ghost_crystal.png",}, 9 | {"red_crystal", "red_crystal.png",}, 10 | {"rose_quartz", "rose_quartz.png",}, 11 | } 12 | 13 | for i in ipairs(crystal_list) do 14 | local name = crystal_list[i][1] 15 | local texture = crystal_list[i][2] 16 | 17 | minetest.register_node(":crystals:"..name.."_1", { 18 | description = "Glowing Crystal", 19 | drawtype = "mesh", 20 | mesh = "crystal_shape01.obj", 21 | tiles = {"crystals_"..texture,}, 22 | paramtype = "light", 23 | paramtype2 = "facedir", 24 | selection_box = sbox, 25 | walkable = false, 26 | light_source = 10, 27 | use_texture_alpha = true, 28 | visual_scale = 10, 29 | groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,}, 30 | sounds = default.node_sound_glass_defaults(), 31 | }) 32 | 33 | minetest.register_node(":crystals:"..name.."_2", { 34 | description = "Glowing Crystal", 35 | drawtype = "mesh", 36 | mesh = "crystal_shape02.obj", 37 | tiles = {"crystals_"..texture,}, 38 | paramtype = "light", 39 | paramtype2 = "facedir", 40 | selection_box = sbox, 41 | walkable = false, 42 | light_source = 10, 43 | use_texture_alpha = true, 44 | visual_scale = 10, 45 | groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,}, 46 | sounds = default.node_sound_glass_defaults(), 47 | }) 48 | end 49 | 50 | 51 | -------------------------------------------------------------------------------- /redsky_asteroids.lua: -------------------------------------------------------------------------------- 1 | if otherworlds.settings.redsky_asteroids.enable then 2 | 3 | -- Approximate realm limits 4 | local YMIN = otherworlds.settings.redsky_asteroids.YMIN or 6000 5 | local YMAX = otherworlds.settings.redsky_asteroids.YMAX or 7000 6 | 7 | -- Register on_generated function for this layer 8 | 9 | minetest.register_on_generated(otherworlds.asteroids.create_on_generated(YMIN, YMAX, { 10 | c_air = minetest.get_content_id("air"), 11 | c_obsidian = minetest.get_content_id("default:obsidian"), 12 | c_stone = minetest.get_content_id("asteroid:redstone"), 13 | c_cobble = minetest.get_content_id("air"), 14 | c_gravel = minetest.get_content_id("asteroid:redgravel"), 15 | c_dust = minetest.get_content_id("asteroid:reddust"), 16 | c_ironore = minetest.get_content_id("asteroid:ironore"), 17 | c_copperore = minetest.get_content_id("asteroid:copperore"), 18 | c_goldore = minetest.get_content_id("asteroid:goldore"), 19 | c_diamondore = minetest.get_content_id("asteroid:diamondore"), 20 | c_meseore = minetest.get_content_id("asteroid:meseore"), 21 | c_waterice = minetest.get_content_id("default:ice"), 22 | c_atmos = minetest.get_content_id("asteroid:atmos"), 23 | c_snowblock = minetest.get_content_id("default:snowblock"), 24 | })) 25 | 26 | 27 | -- Deco code for grass and crystal 28 | 29 | local TOPDECO = 500 -- how often surface decoration appears on top of asteroid cobble 30 | 31 | local grass = { 32 | "mars:grass_1", "mars:grass_2", "mars:grass_3", 33 | "mars:grass_4", "mars:grass_5" 34 | } 35 | local flower = { 36 | "mars:moss", "mars:redweed", "mars:redgrass" 37 | } 38 | local crystal = { 39 | "crystals:ghost_crystal_1", "crystals:ghost_crystal_2", 40 | "crystals:red_crystal_1", "crystals:red_crystal_2", 41 | "crystals:rose_quartz_1", "crystals:rose_quartz_2", 42 | } 43 | 44 | -- Add surface decoration 45 | minetest.register_on_generated(function(minp, maxp) 46 | 47 | if minp.y < YMIN or maxp.y > YMAX then 48 | return 49 | end 50 | 51 | local bpos, ran 52 | local coal = minetest.find_nodes_in_area_under_air(minp, maxp, 53 | {"asteroid:redgravel"}) 54 | 55 | for n = 1, #coal do 56 | 57 | bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z } 58 | 59 | ran = math.random(TOPDECO) 60 | 61 | if ran < 100 then -- grass 62 | 63 | minetest.swap_node(bpos, {name = grass[ math.random(1, #grass) ] }) 64 | 65 | elseif ran >= 180 and ran <= 200 then -- other plants 66 | 67 | minetest.swap_node(bpos, {name = flower[ math.random(1, #flower) ] }) 68 | 69 | elseif ran == TOPDECO then -- crystals 70 | 71 | minetest.swap_node(bpos, {name = crystal[ math.random(1, #crystal) ] }) 72 | end 73 | end 74 | end) 75 | 76 | end 77 | -------------------------------------------------------------------------------- /skybox.lua: -------------------------------------------------------------------------------- 1 | --Heights for skyboxes 2 | local space_low = 5000 3 | local space_high = 5999 4 | local redsky_low = 6000 5 | local redsky_high = 6999 6 | 7 | 8 | local player_list = {} -- Holds name of skybox showing for each player 9 | 10 | --Outerspace skybox 11 | local spaceskybox = { 12 | "sky_pos_z.png", 13 | "sky_neg_z.png^[transformR180", 14 | "sky_neg_y.png^[transformR270", 15 | "sky_pos_y.png^[transformR270", 16 | "sky_pos_x.png^[transformR270", 17 | "sky_neg_x.png^[transformR90", 18 | } 19 | 20 | --Redsky skybox 21 | local redskybox = { 22 | "sky_pos_z.png^[colorize:#99000050", 23 | "sky_neg_z.png^[transformR180^[colorize:#99000050", 24 | "sky_neg_y.png^[transformR270^[colorize:#99000050", 25 | "sky_pos_y.png^[transformR270^[colorize:#99000050", 26 | "sky_pos_x.png^[transformR270^[colorize:#99000050", 27 | "sky_neg_x.png^[transformR90^[colorize:#99000050", 28 | } 29 | 30 | 31 | local timer = 0 32 | 33 | minetest.register_globalstep(function(dtime) 34 | 35 | timer = timer + dtime 36 | 37 | if timer < 2 then 38 | return 39 | end 40 | 41 | timer = 0 42 | 43 | for _, player in pairs(minetest.get_connected_players()) do 44 | 45 | local name = player:get_player_name() 46 | local pos = player:getpos() 47 | local current = player_list[name] or "" 48 | 49 | -- Earth 50 | if pos.y < space_low and current ~= "earth" then 51 | player:set_sky({}, "regular", {}) 52 | player:set_clouds({density = 0.4}) 53 | player_list[name] = "earth" 54 | if otherworlds.settings.gravity.enable then 55 | player:set_physics_override({gravity = 1}) 56 | end 57 | 58 | -- Outerspace 59 | elseif pos.y > space_low and pos.y < space_high and current ~= "space" then 60 | player:set_sky({}, "skybox", spaceskybox) 61 | player:set_clouds({density = 0}) 62 | player_list[name] = "space" 63 | if otherworlds.settings.gravity.enable then 64 | player:set_physics_override({gravity = 0.4}) 65 | end 66 | 67 | -- Redsky 68 | elseif pos.y > redsky_low and pos.y < redsky_high and current ~= "redsky" then 69 | player:set_sky({}, "skybox", redskybox) 70 | player:set_clouds({density = 0}) 71 | player_list[name] = "redsky" 72 | if otherworlds.settings.gravity.enable then 73 | player:set_physics_override({gravity = 0.2}) 74 | end 75 | 76 | -- Everything else (blackness) 77 | elseif pos.y > redsky_high and current ~= "blackness" then 78 | player:set_sky(000000, "plain", {}) 79 | player:set_clouds({density = 0}) 80 | player_list[name] = "blackness" 81 | if otherworlds.settings.gravity.enable then 82 | player:set_physics_override({gravity = 0.1}) 83 | end 84 | end 85 | end 86 | end) 87 | 88 | minetest.register_on_leaveplayer(function(player) 89 | local name = player:get_player_name() 90 | player_list[name] = nil 91 | if otherworlds.settings.gravity.enable then 92 | player:set_physics_override({gravity = 1}) 93 | end 94 | end) 95 | -------------------------------------------------------------------------------- /mars_plants.lua: -------------------------------------------------------------------------------- 1 | minetest.register_node(":mars:redgrass", { 2 | description = "Red Grass", 3 | drawtype = "plantlike", 4 | waving = 1, 5 | visual_scale = 1.3, 6 | tiles = {"mars_redgrass.png"}, 7 | inventory_image = "mars_redgrass.png", 8 | wield_image = "mars_redgrass.png", 9 | paramtype = "light", 10 | sunlight_propagates = true, 11 | walkable = false, 12 | buildable_to = true, 13 | groups = {snappy=3,flora=1,attached_node=1}, 14 | sounds = default.node_sound_leaves_defaults(), 15 | selection_box = { 16 | type = "fixed", 17 | fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, 18 | }, 19 | }) 20 | 21 | minetest.register_node(":mars:redweed", { 22 | description = "Red Weed", 23 | drawtype = "plantlike", 24 | waving = 1, 25 | visual_scale = 1.3, 26 | tiles = {"mars_redweed.png"}, 27 | inventory_image = "mars_redweed.png", 28 | wield_image = "mars_redweed.png", 29 | paramtype = "light", 30 | sunlight_propagates = true, 31 | walkable = false, 32 | buildable_to = true, 33 | groups = {snappy=3,flora=1,attached_node=1}, 34 | sounds = default.node_sound_leaves_defaults(), 35 | selection_box = { 36 | type = "fixed", 37 | fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, 38 | }, 39 | }) 40 | 41 | minetest.register_node(":mars:moss", { 42 | description = "Martian Moss", 43 | drawtype = "nodebox", 44 | tiles = {"mars_moss.png"}, 45 | inventory_image = "mars_moss.png", 46 | wield_image = "mars_moss.png", 47 | paramtype = "light", 48 | paramtype2 = "facedir", 49 | sunlight_propagates = true, 50 | walkable = false, 51 | node_box = { 52 | type = "fixed", 53 | fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2}, 54 | }, 55 | selection_box = { 56 | type = "fixed", 57 | fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2}, 58 | }, 59 | groups = {snappy=3,flora=1,attached_node=1}, 60 | sounds = default.node_sound_leaves_defaults(), 61 | }) 62 | 63 | 64 | --mars grass 65 | minetest.register_node(":mars:grass_1", { 66 | description = "Martian Grass", 67 | drawtype = "plantlike", 68 | waving = 1, 69 | tiles = {"mars_grass_1.png"}, 70 | inventory_image = "mars_grass_3.png", 71 | wield_image = "mars_grass_3.png", 72 | paramtype = "light", 73 | sunlight_propagates = true, 74 | walkable = false, 75 | buildable_to = true, 76 | groups = {snappy=3,flora=1,attached_node=1}, 77 | sounds = default.node_sound_leaves_defaults(), 78 | selection_box = { 79 | type = "fixed", 80 | fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, 81 | }, 82 | 83 | on_place = function(itemstack, placer, pointed_thing) 84 | -- place a random grass node 85 | local stack = ItemStack("mars:grass_"..math.random(1,5)) 86 | local ret = minetest.item_place(stack, placer, pointed_thing) 87 | return ItemStack("mars:grass_1 "..itemstack:get_count()-(1-ret:get_count())) 88 | end, 89 | }) 90 | 91 | for i=2,5 do 92 | minetest.register_node(":mars:grass_"..i, { 93 | description = "Martian Grass", 94 | drawtype = "plantlike", 95 | waving = 1, 96 | tiles = {"mars_grass_"..i..".png"}, 97 | inventory_image = "mars_grass_"..i..".png", 98 | wield_image = "mars_grass_"..i..".png", 99 | paramtype = "light", 100 | sunlight_propagates = true, 101 | walkable = false, 102 | buildable_to = true, 103 | drop = "mars:grass_1", 104 | groups = {snappy=3,flora=1,attached_node=1,not_in_creative_inventory=1}, 105 | sounds = default.node_sound_leaves_defaults(), 106 | selection_box = { 107 | type = "fixed", 108 | fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, 109 | }, 110 | }) 111 | end -------------------------------------------------------------------------------- /space_nodes.lua: -------------------------------------------------------------------------------- 1 | -- Nodes 2 | 3 | minetest.register_node(":asteroid:stone", { 4 | description = "Asteroid Stone", 5 | tiles = {"default_stone.png"}, 6 | is_ground_content = false, 7 | drop = 'asteroid:cobble', 8 | groups = {cracky = 3, not_in_creative_inventory=1}, 9 | sounds = default.node_sound_stone_defaults(), 10 | }) 11 | 12 | minetest.register_node(":asteroid:redstone", { 13 | description = "Asteroid Stone", 14 | tiles = {"asteroid_redstone.png"}, 15 | is_ground_content = false, 16 | drop = 'asteroid:redcobble', 17 | groups = {cracky = 3}, 18 | sounds = default.node_sound_stone_defaults(), 19 | }) 20 | 21 | minetest.register_node(":asteroid:cobble", { 22 | description = "Asteroid Cobble", 23 | tiles = {"asteroid_cobble.png"}, 24 | is_ground_content = false, 25 | groups = {cracky = 3}, 26 | sounds = default.node_sound_stone_defaults(), 27 | }) 28 | 29 | minetest.register_node(":asteroid:redcobble", { 30 | description = "Asteroid Cobble", 31 | tiles = {"asteroid_redcobble.png"}, 32 | is_ground_content = false, 33 | groups = {cracky = 3}, 34 | sounds = default.node_sound_stone_defaults(), 35 | }) 36 | 37 | minetest.register_node(":asteroid:gravel", { 38 | description = "Asteroid Gravel", 39 | tiles = {"asteroid_gravel.png"}, 40 | is_ground_content = false, 41 | groups = {crumbly = 2}, 42 | sounds = default.node_sound_dirt_defaults({ 43 | footstep = {name = "default_gravel_footstep", gain = 0.2}, 44 | }), 45 | }) 46 | 47 | minetest.register_node(":asteroid:redgravel", { 48 | description = "Asteroid Gravel", 49 | tiles = {"asteroid_redgravel.png"}, 50 | is_ground_content = false, 51 | groups = {crumbly = 2}, 52 | sounds = default.node_sound_dirt_defaults({ 53 | footstep = {name = "default_gravel_footstep", gain = 0.2}, 54 | }), 55 | }) 56 | 57 | minetest.register_node(":asteroid:dust", { 58 | description = "Asteroid Dust", 59 | tiles = {"asteroid_dust.png"}, 60 | is_ground_content = false, 61 | groups = {crumbly = 3}, 62 | sounds = default.node_sound_dirt_defaults({ 63 | footstep = {name = "default_gravel_footstep", gain = 0.1}, 64 | }), 65 | }) 66 | 67 | minetest.register_node(":asteroid:reddust", { 68 | description = "Asteroid Dust", 69 | tiles = {"asteroid_reddust.png"}, 70 | is_ground_content = false, 71 | groups = {crumbly = 3}, 72 | sounds = default.node_sound_dirt_defaults({ 73 | footstep = {name = "default_gravel_footstep", gain = 0.1}, 74 | }), 75 | }) 76 | 77 | minetest.register_node(":asteroid:ironore", { 78 | description = "Asteroid Iron Ore", 79 | tiles = {"asteroid_redstone.png^default_mineral_iron.png"}, 80 | is_ground_content = false, 81 | groups = {cracky = 2}, 82 | drop = "default:iron_lump", 83 | sounds = default.node_sound_stone_defaults(), 84 | }) 85 | 86 | minetest.register_node(":asteroid:copperore", { 87 | description = "Asteroid Copper Ore", 88 | tiles = {"asteroid_redstone.png^default_mineral_copper.png"}, 89 | is_ground_content = false, 90 | groups = {cracky = 2}, 91 | drop = "default:copper_lump", 92 | sounds = default.node_sound_stone_defaults(), 93 | }) 94 | 95 | minetest.register_node(":asteroid:goldore", { 96 | description = "Asteroid Gold Ore", 97 | tiles = {"asteroid_redstone.png^default_mineral_gold.png"}, 98 | is_ground_content = false, 99 | groups = {cracky = 2}, 100 | drop = "default:gold_lump", 101 | sounds = default.node_sound_stone_defaults(), 102 | }) 103 | 104 | minetest.register_node(":asteroid:diamondore", { 105 | description = "Asteroid Diamond Ore", 106 | tiles = {"asteroid_redstone.png^default_mineral_diamond.png"}, 107 | is_ground_content = false, 108 | groups = {cracky = 1}, 109 | drop = "default:diamond", 110 | sounds = default.node_sound_stone_defaults(), 111 | }) 112 | 113 | minetest.register_node(":asteroid:meseore", { 114 | description = "Asteroid Mese Ore", 115 | tiles = {"asteroid_redstone.png^default_mineral_mese.png"}, 116 | is_ground_content = false, 117 | groups = {cracky = 1}, 118 | drop = "default:mese_crystal", 119 | sounds = default.node_sound_stone_defaults(), 120 | }) 121 | 122 | minetest.register_node(":asteroid:atmos", { 123 | description = "Comet Atmosphere", 124 | drawtype = "glasslike", 125 | tiles = {"asteroid_atmos.png"}, 126 | paramtype = "light", 127 | sunlight_propagates = true, 128 | walkable = false, 129 | pointable = false, 130 | diggable = false, 131 | buildable_to = true, 132 | is_ground_content = false, 133 | use_texture_alpha = true, 134 | post_effect_color = {a = 31, r = 241, g = 248, b = 255}, 135 | groups = {not_in_creative_inventory = 1}, 136 | }) 137 | -------------------------------------------------------------------------------- /models/crystal_shape02.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.77 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib crystal_shape02.mtl 4 | o Crystal_Taya2.000 5 | v 0.006739 0.025244 0.012075 6 | v 0.001956 0.043504 0.004196 7 | v 0.004129 0.024144 0.013098 8 | v 0.011672 0.002214 0.025031 9 | v 0.000000 0.051819 0.000000 10 | v 0.026389 -0.000477 -0.012306 11 | v 0.023148 -0.023541 0.023148 12 | v 0.012306 -0.000477 0.026389 13 | v 0.023266 -0.013100 -0.018731 14 | v 0.024664 -0.012754 -0.016476 15 | v 0.023359 -0.022037 -0.022441 16 | v -0.006315 0.024980 -0.013543 17 | v -0.008197 0.010863 -0.020143 18 | v 0.023148 -0.023541 -0.023148 19 | v -0.011933 0.001106 -0.025590 20 | v -0.012306 -0.000477 -0.026389 21 | v -0.010407 0.010810 -0.018614 22 | v -0.018415 0.015325 0.008587 23 | v -0.009799 0.031187 0.003172 24 | v -0.001187 0.049467 0.000554 25 | v -0.023148 -0.023541 -0.023148 26 | v -0.026389 -0.000477 0.012306 27 | v -0.009284 0.030199 0.005679 28 | v -0.023148 -0.023541 0.023148 29 | v -0.019685 -0.048181 -0.019685 30 | v 0.019685 -0.048181 -0.019685 31 | v 0.019685 -0.048181 0.019685 32 | v -0.019685 -0.048181 0.019685 33 | vt 0.0323 -0.2020 34 | vt -0.0000 0.0000 35 | vt 0.0048 -0.2141 36 | vt 0.0306 -0.2671 37 | vt -0.0000 0.0000 38 | vt -0.0273 -0.0128 39 | vt 0.0000 0.0000 40 | vt -0.0327 -0.0894 41 | vt 0.2059 -0.5620 42 | vt -0.0904 -0.2856 43 | vt -0.1383 -0.8099 44 | vt -0.1953 -0.5331 45 | vt -0.2059 -0.5620 46 | vt 0.0710 -0.1265 47 | vt -0.0000 0.0000 48 | vt 0.0445 -0.1230 49 | vt 0.0304 -0.0919 50 | vt -0.0000 0.0000 51 | vt -0.0265 0.0036 52 | vt -0.2059 -0.5620 53 | vt 0.1057 -0.2884 54 | vt -0.1546 -0.6977 55 | vt 0.1459 -0.4402 56 | vt -0.1383 -0.8099 57 | vt 0.1997 -0.5450 58 | vt 0.2059 -0.5620 59 | vt -0.1428 -0.7937 60 | vt 0.0000 0.0000 61 | vt 0.0280 0.1172 62 | vt 0.0012 0.1178 63 | vt 0.0000 0.0000 64 | vt -0.0042 0.1559 65 | vt -0.0269 0.0006 66 | vt -0.1393 -0.4407 67 | vt 0.1437 -0.3922 68 | vt -0.1057 -0.2884 69 | vt 0.0633 -0.2217 70 | vt 0.0093 -0.0253 71 | vt -0.1383 -0.8099 72 | vt -0.1997 -0.5450 73 | vt -0.2059 -0.5620 74 | vt 0.2059 -0.5620 75 | vt 0.0000 0.0000 76 | vt 0.0137 0.1764 77 | vt -0.0111 0.1881 78 | vt 0.0000 0.0000 79 | vt -0.0163 0.2146 80 | vt -0.0251 0.0110 81 | vt 0.0327 -0.0894 82 | vt -0.0678 -0.2324 83 | vt 0.0836 -0.2974 84 | vt -0.1437 -0.3922 85 | vt -0.1383 -0.8099 86 | vt -0.2059 -0.5620 87 | vt -0.0093 -0.0253 88 | vt 0.2059 -0.5620 89 | vt 0.1953 -0.5331 90 | vt -0.0738 0.4817 91 | vt -0.4283 0.2488 92 | vt 0.0346 0.2488 93 | vt 0.0000 0.0000 94 | vt -0.3937 0.0000 95 | vt -0.0738 0.4817 96 | vt -0.4283 0.2488 97 | vt -0.0321 0.3577 98 | vt 0.0276 0.2640 99 | vt 0.0346 0.2488 100 | vt 0.0000 0.0000 101 | vt -0.3937 0.0000 102 | vt -0.0738 0.4817 103 | vt -0.4283 0.2488 104 | vt 0.0346 0.2488 105 | vt 0.0000 0.0000 106 | vt -0.3937 0.0000 107 | vt -0.0738 0.4817 108 | vt -0.4283 0.2488 109 | vt 0.0346 0.2488 110 | vt 0.0000 0.0000 111 | vt -0.3937 0.0000 112 | vt 0.1969 0.1969 113 | vt -0.1969 0.1969 114 | vt 0.1969 -0.1969 115 | vt -0.1969 -0.1969 116 | vn 0.1681 0.4273 0.8883 117 | vn 0.1213 0.5063 0.8538 118 | vn 0.8744 0.3663 0.3183 119 | vn 0.8744 0.3663 0.3182 120 | vn 0.8745 0.3664 0.3178 121 | vn 0.8439 0.0624 -0.5328 122 | vn 0.8105 0.2318 -0.5380 123 | vn 0.3182 0.3663 -0.8744 124 | vn 0.3183 0.3663 -0.8744 125 | vn 0.3181 0.3663 -0.8744 126 | vn -0.4802 0.5605 -0.6747 127 | vn -0.5239 0.4171 -0.7427 128 | vn -0.8744 0.3663 -0.3182 129 | vn -0.8744 0.3663 -0.3183 130 | vn -0.8744 0.3663 -0.3181 131 | vn -0.7587 0.5377 0.3678 132 | vn -0.8295 0.4401 0.3438 133 | vn -0.3182 0.3663 0.8744 134 | vn -0.3183 0.3663 0.8744 135 | vn -0.3181 0.3663 0.8744 136 | vn -0.3180 0.3664 0.8744 137 | vn -0.3181 0.3664 0.8744 138 | vn 0.0000 -0.1392 -0.9903 139 | vn 0.9903 -0.1391 0.0000 140 | vn 0.9903 -0.1392 0.0000 141 | vn 0.9903 -0.1390 -0.0000 142 | vn 0.0000 -0.1392 0.9903 143 | vn -0.9903 -0.1392 -0.0000 144 | vn 0.0000 -1.0000 -0.0000 145 | usemtl wire_191191191.000 146 | s 1 147 | f 1/1/1 2/2/1 3/3/1 148 | f 4/4/2 1/5/2 3/6/2 149 | f 5/7/3 2/8/3 6/9/4 150 | f 6/9/4 2/8/3 1/10/4 151 | f 6/9/4 1/10/4 7/11/4 152 | f 7/11/4 1/10/4 4/12/4 153 | f 7/11/4 4/12/4 8/13/5 154 | f 9/14/6 6/15/6 10/16/6 155 | f 11/17/7 9/18/7 10/19/7 156 | f 5/7/8 6/20/8 12/21/8 157 | f 12/21/8 6/20/8 9/22/8 158 | f 12/21/8 9/22/8 13/23/8 159 | f 13/23/8 9/22/8 14/24/9 160 | f 13/23/8 14/24/9 15/25/8 161 | f 15/25/8 14/24/9 16/26/8 162 | f 9/22/8 11/27/10 14/24/9 163 | f 15/28/11 17/29/11 13/30/11 164 | f 17/31/12 12/32/12 13/33/12 165 | f 17/34/13 18/35/13 12/36/14 166 | f 12/36/14 18/35/13 19/37/14 167 | f 12/36/14 19/37/14 20/38/13 168 | f 18/35/13 17/34/13 21/39/13 169 | f 21/39/13 17/34/13 15/40/13 170 | f 21/39/13 15/40/13 16/41/15 171 | f 21/39/13 22/42/13 18/35/13 172 | f 20/38/13 5/7/13 12/36/14 173 | f 18/43/16 23/44/16 19/45/16 174 | f 23/46/17 20/47/17 19/48/17 175 | f 2/49/18 23/50/19 3/51/19 176 | f 3/51/19 23/50/19 18/52/18 177 | f 3/51/19 18/52/18 24/53/18 178 | f 24/53/18 18/52/18 22/54/20 179 | f 5/7/21 20/55/22 2/49/18 180 | f 2/49/18 20/55/22 23/50/19 181 | f 8/56/18 4/57/18 24/53/18 182 | f 24/53/18 4/57/18 3/51/19 183 | f 16/58/23 14/59/23 21/60/23 184 | f 21/60/23 14/59/23 25/61/23 185 | f 25/61/23 14/59/23 26/62/23 186 | f 6/63/24 7/64/25 10/65/25 187 | f 10/65/25 7/64/25 11/66/26 188 | f 11/66/26 7/64/25 14/67/24 189 | f 14/67/24 7/64/25 26/68/25 190 | f 26/68/25 7/64/25 27/69/25 191 | f 8/70/27 24/71/27 7/72/27 192 | f 7/72/27 24/71/27 27/73/27 193 | f 27/73/27 24/71/27 28/74/27 194 | f 22/75/28 21/76/28 24/77/28 195 | f 24/77/28 21/76/28 28/78/28 196 | f 28/78/28 21/76/28 25/79/28 197 | f 27/80/29 28/81/29 26/82/29 198 | f 26/82/29 28/81/29 25/83/29 199 | -------------------------------------------------------------------------------- /models/crystal_shape01.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.77 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib crystal_shape01.mtl 4 | o Crystal_Taya1.001 5 | v 0.019427 0.022291 -0.013603 6 | v 0.012823 0.031159 -0.009449 7 | v 0.013985 0.030045 -0.009115 8 | v 0.008443 0.038346 -0.005912 9 | v 0.000000 0.050687 0.000000 10 | v -0.015208 0.018939 -0.021719 11 | v 0.020909 0.009672 -0.020909 12 | v 0.021719 0.018939 -0.015208 13 | v -0.016684 -0.038612 -0.014735 14 | v -0.017468 -0.029657 -0.017468 15 | v -0.015357 -0.037747 -0.016760 16 | v -0.015748 -0.040752 -0.016497 17 | v -0.015913 -0.047431 -0.015913 18 | v -0.017109 -0.033753 0.015516 19 | v -0.018018 -0.023370 0.018018 20 | v -0.018512 -0.017718 0.018512 21 | v -0.016177 -0.044411 0.016177 22 | v -0.015748 -0.049313 0.015748 23 | v -0.015748 -0.049313 -0.015748 24 | v -0.019675 -0.004427 0.016381 25 | v -0.020909 0.009672 -0.020909 26 | v -0.020741 0.007752 0.020741 27 | v -0.021719 0.018939 0.015208 28 | v -0.020909 0.009672 0.020909 29 | v -0.018512 -0.003302 0.019773 30 | v 0.020560 0.005685 0.020560 31 | v 0.015208 0.018939 0.021719 32 | v 0.017174 -0.008451 0.019323 33 | v 0.018163 -0.021714 0.018163 34 | v -0.016177 -0.030600 0.017385 35 | v 0.015748 -0.049313 0.015748 36 | v 0.020909 0.009672 0.020909 37 | v 0.019672 -0.004460 0.017730 38 | v 0.020488 0.004867 -0.020488 39 | v 0.019075 -0.011285 -0.016746 40 | v 0.016094 -0.045364 -0.016094 41 | v 0.015748 -0.049313 -0.015748 42 | v 0.017187 -0.010187 -0.019171 43 | vt 0.0000 0.0000 44 | vt -0.0148 0.1172 45 | vt -0.0221 0.1025 46 | vt 0.0000 0.0000 47 | vt -0.0100 0.0907 48 | vt -0.0085 -0.0141 49 | vt -0.0000 0.0000 50 | vt -0.0729 -0.1433 51 | vt 0.1875 -0.3687 52 | vt -0.1099 -0.2268 53 | vt -0.1696 -0.4763 54 | vt -0.1677 -0.3298 55 | vt -0.1875 -0.3687 56 | vt 0.0165 -0.0925 57 | vt -0.0000 0.0000 58 | vt -0.0076 -0.0836 59 | vt -0.0199 -0.0214 60 | vt -0.0000 0.0000 61 | vt -0.0242 0.0087 62 | vt -0.0140 -0.0882 63 | vt -0.0200 -0.0214 64 | vt -0.3048 0.1074 65 | vt -0.0023 0.1562 66 | vt -0.3322 0.1973 67 | vt 0.0227 0.2604 68 | vt 0.0276 0.3172 69 | vt 0.0043 0.0492 70 | vt -0.3166 0.0189 71 | vt 0.0000 0.0000 72 | vt -0.3150 0.0000 73 | vt 0.0063 0.4506 74 | vt -0.3666 0.5921 75 | vt 0.0499 0.5728 76 | vt -0.0054 0.6851 77 | vt 0.0516 0.5921 78 | vt -0.0003 -0.1132 79 | vt -0.0000 0.0000 80 | vt -0.0360 -0.1247 81 | vt -0.0119 -0.1442 82 | vt -0.0000 0.0000 83 | vt -0.0359 -0.0113 84 | vt -0.3426 0.4619 85 | vt 0.0481 0.5521 86 | vt -0.3649 0.5728 87 | vt -0.0054 0.6851 88 | vt -0.3666 0.5921 89 | vt 0.0143 0.4102 90 | vt -0.3426 0.3172 91 | vt 0.0241 0.2770 92 | vt -0.3377 0.2604 93 | vt -0.3192 0.1878 94 | vt 0.0000 0.0000 95 | vt -0.3192 0.0492 96 | vt -0.3150 0.0000 97 | vt 0.0516 0.5921 98 | vt 0.0093 -0.0743 99 | vt -0.0000 0.0000 100 | vt -0.0102 -0.1067 101 | vt -0.0104 -0.1382 102 | vt -0.0000 0.0000 103 | vt -0.0208 -0.0316 104 | vt 0.0000 0.0000 105 | vt 0.0149 0.1726 106 | vt -0.0147 0.1327 107 | vt 0.0000 0.0000 108 | vt -0.0166 0.1044 109 | vt -0.0280 -0.0411 110 | vt -0.3348 0.4502 111 | vt 0.0474 0.5439 112 | vt -0.3631 0.5521 113 | vt -0.0054 0.6851 114 | vt -0.3666 0.5921 115 | vt 0.0100 0.3817 116 | vt -0.3391 0.2770 117 | vt 0.0035 0.0396 118 | vt -0.3150 0.0000 119 | vt 0.0000 0.0000 120 | vt 0.0516 0.5921 121 | vt 0.0000 0.0000 122 | vt 0.0168 0.3529 123 | vt -0.0139 0.3419 124 | vt 0.0000 0.0000 125 | vt -0.0126 0.1542 126 | vt -0.0306 -0.0113 127 | vt 0.0000 0.0859 128 | vt -0.0039 0.1161 129 | vt -0.3184 0.0396 130 | vt 0.0172 0.1973 131 | vt -0.3293 0.3928 132 | vt 0.0516 0.5921 133 | vt -0.3624 0.5439 134 | vt -0.0054 0.6851 135 | vt -0.3666 0.5921 136 | vt 0.0016 0.0189 137 | vt -0.3150 0.0000 138 | vt 0.0000 0.0000 139 | vt -0.1696 -0.4763 140 | vt 0.1875 -0.3687 141 | vt -0.1875 -0.3687 142 | vt -0.1696 -0.4763 143 | vt 0.1875 -0.3687 144 | vt -0.1875 -0.3687 145 | vt 0.0729 -0.1433 146 | vt -0.1875 -0.3687 147 | vt 0.1141 -0.2397 148 | vt -0.1696 -0.4763 149 | vt 0.1677 -0.3298 150 | vt 0.1875 -0.3687 151 | vt 0.1575 0.1575 152 | vt -0.1575 0.1575 153 | vt 0.1575 -0.1575 154 | vt -0.1575 -0.1575 155 | usemtl wire_191191191.001 156 | s 1 157 | f 1/1 2/2 3/3 158 | f 2/4 4/5 3/6 159 | f 5/7 4/8 6/9 160 | f 6/9 4/8 2/10 161 | f 6/9 2/10 7/11 162 | f 7/11 2/10 1/12 163 | f 7/11 1/12 8/13 164 | f 9/14 10/15 11/16 165 | f 12/17 9/18 11/19 166 | f 13/20 9/18 12/21 167 | f 9/22 14/23 10/24 168 | f 10/24 14/23 15/25 169 | f 10/24 15/25 16/26 170 | f 14/23 9/22 17/27 171 | f 17/27 9/22 13/28 172 | f 17/27 13/28 18/29 173 | f 18/29 13/28 19/30 174 | f 16/26 20/31 10/24 175 | f 10/24 20/31 21/32 176 | f 21/32 20/31 22/33 177 | f 21/32 22/33 23/34 178 | f 23/34 22/33 24/35 179 | f 25/36 22/37 20/38 180 | f 16/39 25/40 20/41 181 | f 25/42 26/43 22/44 182 | f 22/44 26/43 27/45 183 | f 22/44 27/45 24/46 184 | f 26/43 25/42 28/47 185 | f 28/47 25/42 16/48 186 | f 28/47 16/48 29/49 187 | f 29/49 16/48 15/50 188 | f 29/49 15/50 30/51 189 | f 29/49 30/51 31/52 190 | f 31/52 30/51 17/53 191 | f 31/52 17/53 18/54 192 | f 26/43 32/55 27/45 193 | f 30/56 15/57 14/58 194 | f 17/59 30/60 14/61 195 | f 29/62 33/63 28/64 196 | f 33/65 26/66 28/67 197 | f 33/68 34/69 26/70 198 | f 26/70 34/69 8/71 199 | f 26/70 8/71 32/72 200 | f 34/69 33/68 35/73 201 | f 35/73 33/68 29/74 202 | f 35/73 29/74 36/75 203 | f 36/75 29/74 31/76 204 | f 36/75 31/76 37/77 205 | f 34/69 7/78 8/71 206 | f 36/79 38/80 35/81 207 | f 38/82 34/83 35/84 208 | f 12/85 11/86 36/87 209 | f 36/87 11/86 10/88 210 | f 36/87 10/88 38/89 211 | f 38/89 10/88 21/90 212 | f 38/89 21/90 34/91 213 | f 34/91 21/90 6/92 214 | f 34/91 6/92 7/93 215 | f 12/85 36/87 13/94 216 | f 13/94 36/87 37/95 217 | f 13/94 37/95 19/96 218 | f 21/97 23/98 6/99 219 | f 6/99 23/98 5/7 220 | f 24/100 27/101 23/102 221 | f 23/102 27/101 5/7 222 | f 4/103 27/104 3/105 223 | f 3/105 27/104 32/106 224 | f 3/105 32/106 1/107 225 | f 1/107 32/106 8/108 226 | f 4/103 5/7 27/104 227 | f 31/109 18/110 37/111 228 | f 37/111 18/110 19/112 229 | -------------------------------------------------------------------------------- /asteroid_layer_helpers.lua: -------------------------------------------------------------------------------- 1 | 2 | -- submodule 3 | otherworlds.asteroids = {} 4 | 5 | -- Approximate realm limits. 6 | local XMIN = -33000 7 | local XMAX = 33000 8 | local ZMIN = -33000 9 | local ZMAX = 33000 10 | 11 | local ASCOT = 1.0 -- Large asteroid / comet nucleus noise threshold. 12 | local SASCOT = 1.0 -- Small asteroid / comet nucleus noise threshold. 13 | local STOT = 0.125 -- Asteroid stone threshold. 14 | local COBT = 0.05 -- Asteroid cobble threshold. 15 | local GRAT = 0.02 -- Asteroid gravel threshold. 16 | local ICET = 0.05 -- Comet ice threshold. 17 | local ATMOT = -0.2 -- Comet atmosphere threshold. 18 | local FISTS = 0.01 -- Fissure noise threshold at surface. Controls size of fissures and amount / size of fissure entrances. 19 | local FISEXP = 0.3 -- Fissure expansion rate under surface. 20 | local ORECHA = 3*3*3 -- Ore 1/x chance per stone node. 21 | local CPCHU = 0 -- Maximum craters per chunk. 22 | local CRMIN = 5 -- Crater radius minimum, radius includes dust and obsidian layers. 23 | local CRRAN = 8 -- Crater radius range. 24 | 25 | 26 | -- Note: for fewer large objects: increase the 'spread' numbers in 'np_large' noise parameters. For fewer small objects do the same in 'np_small'. Then tune size with 'ASCOT'. 27 | 28 | -- 3D Perlin noise 1 for large structures 29 | local np_large = { 30 | offset = 0, 31 | scale = 1, 32 | spread = {x=256, y=128, z=256}, 33 | seed = -83928935, 34 | octaves = 5, 35 | persist = 0.6 36 | } 37 | 38 | -- 3D Perlin noise 3 for fissures 39 | local np_fissure = { 40 | offset = 0, 41 | scale = 1, 42 | spread = {x=64, y=64, z=64}, 43 | seed = -188881, 44 | octaves = 4, 45 | persist = 0.5 46 | } 47 | 48 | -- 3D Perlin noise 4 for small structures 49 | local np_small = { 50 | offset = 0, 51 | scale = 1, 52 | spread = {x=128, y=64, z=128}, 53 | seed = 1000760700090, 54 | octaves = 4, 55 | persist = 0.6 56 | } 57 | 58 | -- 3D Perlin noise 5 for ore selection 59 | local np_ores = { 60 | offset = 0, 61 | scale = 1, 62 | spread = {x=128, y=128, z=128}, 63 | seed = -70242, 64 | octaves = 1, 65 | persist = 0.5 66 | } 67 | 68 | -- 3D Perlin noise 6 for comet atmosphere 69 | local np_latmos = { 70 | offset = 0, 71 | scale = 1, 72 | spread = {x=256, y=128, z=256}, 73 | seed = -83928935, 74 | octaves = 3, 75 | persist = 0.6 76 | } 77 | 78 | -- 3D Perlin noise 7 for small comet atmosphere 79 | local np_satmos = { 80 | offset = 0, 81 | scale = 1, 82 | spread = {x=128, y=64, z=128}, 83 | seed = 1000760700090, 84 | octaves = 2, 85 | persist = 0.6 86 | } 87 | 88 | 89 | -- On dignode function. Atmosphere flows into a dug hole. 90 | minetest.register_on_dignode(function(pos, oldnode, digger) 91 | if minetest.find_node_near(pos, 1, {"asteroid:atmos"}) then 92 | minetest.set_node(pos, {name = "asteroid:atmos"}) 93 | end 94 | end) 95 | 96 | -- Generate on_generated function based on parameters 97 | function otherworlds.asteroids.create_on_generated(ymin, ymax, content_ids) 98 | local YMIN = ymin 99 | local YMAX = ymax 100 | 101 | local c_air = content_ids.c_air 102 | local c_stone = content_ids.c_stone 103 | local c_cobble = content_ids.c_cobble 104 | local c_gravel = content_ids.c_gravel 105 | local c_dust = content_ids.c_dust 106 | local c_ironore = content_ids.c_ironore 107 | local c_copperore = content_ids.c_copperore 108 | local c_goldore = content_ids.c_goldore 109 | local c_diamondore = content_ids.c_diamondore 110 | local c_meseore = content_ids.c_meseore 111 | local c_waterice = content_ids.c_waterice 112 | local c_atmos = content_ids.c_atmos 113 | local c_snowblock = content_ids.c_snowblock 114 | local c_obsidian = content_ids.c_obsidian 115 | 116 | -- return the function closed over the upvalues we want 117 | return function(minp, maxp, seed) 118 | if minp.x < XMIN or maxp.x > XMAX 119 | or minp.y < YMIN or maxp.y > YMAX 120 | or minp.z < ZMIN or maxp.z > ZMAX then 121 | return 122 | end 123 | -- local t1 = os.clock() 124 | local x1 = maxp.x 125 | local y1 = maxp.y 126 | local z1 = maxp.z 127 | local x0 = minp.x 128 | local y0 = minp.y 129 | local z0 = minp.z 130 | --print ("[asteroid] chunk ("..x0.." "..y0.." "..z0..")") 131 | local sidelen = x1 - x0 + 1 -- chunk side length 132 | --local vplanarea = sidelen ^ 2 -- vertical plane area, used if calculating noise index from x y z 133 | local chulens = {x=sidelen, y=sidelen, z=sidelen} 134 | local minpos = {x=x0, y=y0, z=z0} 135 | 136 | local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") 137 | local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax} 138 | local data = vm:get_data() 139 | 140 | local nvals1 = minetest.get_perlin_map(np_large, chulens):get3dMap_flat(minpos) 141 | local nvals3 = minetest.get_perlin_map(np_fissure, chulens):get3dMap_flat(minpos) 142 | local nvals4 = minetest.get_perlin_map(np_small, chulens):get3dMap_flat(minpos) 143 | local nvals5 = minetest.get_perlin_map(np_ores, chulens):get3dMap_flat(minpos) 144 | local nvals6 = minetest.get_perlin_map(np_latmos, chulens):get3dMap_flat(minpos) 145 | local nvals7 = minetest.get_perlin_map(np_satmos, chulens):get3dMap_flat(minpos) 146 | 147 | local ni = 1 148 | for z = z0, z1 do -- for each vertical plane do 149 | for y = y0, y1 do -- for each horizontal row do 150 | local vi = area:index(x0, y, z) -- LVM index for first node in x row 151 | for x = x0, x1 do -- for each node do 152 | local noise1abs = math.abs(nvals1[ni]) 153 | local noise4abs = math.abs(nvals4[ni]) 154 | local comet = false 155 | if nvals6[ni] < -(ASCOT + ATMOT) or (nvals7[ni] < -(SASCOT + ATMOT) and nvals1[ni] < ASCOT) then 156 | comet = true -- comet biome 157 | end 158 | if noise1abs > ASCOT or noise4abs > SASCOT then -- if below surface then 159 | local noise1dep = noise1abs - ASCOT -- noise1dep zero at surface, positive beneath 160 | if math.abs(nvals3[ni]) > FISTS + noise1dep * FISEXP then -- if no fissure then 161 | local noise4dep = noise4abs - SASCOT -- noise4dep zero at surface, positive beneath 162 | if not comet or (comet and (noise1dep > math.random() + ICET or noise4dep > math.random() + ICET)) then 163 | -- asteroid or asteroid materials in comet 164 | if noise1dep >= STOT or noise4dep >= STOT then 165 | -- stone/ores 166 | if math.random(ORECHA) == 2 then 167 | if nvals5[ni] > 0.6 then 168 | data[vi] = c_goldore 169 | elseif nvals5[ni] < -0.6 then 170 | data[vi] = c_diamondore 171 | elseif nvals5[ni] > 0.2 then 172 | data[vi] = c_meseore 173 | elseif nvals5[ni] < -0.2 then 174 | data[vi] = c_copperore 175 | else 176 | data[vi] = c_ironore 177 | end 178 | else 179 | data[vi] = c_stone 180 | end 181 | elseif noise1dep >= COBT or noise4dep >= COBT then 182 | data[vi] = c_cobble 183 | elseif noise1dep >= GRAT or noise4dep >= GRAT then 184 | data[vi] = c_gravel 185 | else 186 | data[vi] = c_dust 187 | end 188 | else -- comet materials 189 | if noise1dep >= ICET or noise4dep >= ICET then 190 | data[vi] = c_waterice 191 | else 192 | data[vi] = c_snowblock 193 | end 194 | end 195 | elseif comet then -- fissures, if comet then add comet atmosphere 196 | data[vi] = c_atmos 197 | end 198 | elseif comet then -- if comet atmosphere then 199 | data[vi] = c_atmos 200 | end 201 | ni = ni + 1 202 | vi = vi + 1 203 | end 204 | end 205 | end 206 | -- craters 207 | for ci = 1, CPCHU do -- iterate 208 | local cr = CRMIN + math.floor(math.random() ^ 2 * CRRAN) -- exponential radius 209 | local cx = math.random(minp.x + cr, maxp.x - cr) -- centre x 210 | local cz = math.random(minp.z + cr, maxp.z - cr) -- centre z 211 | local comet = false 212 | local surfy = false 213 | for y = y1, y0 + cr, -1 do 214 | local vi = area:index(cx, y, cz) -- LVM index for node 215 | local nodeid = data[vi] 216 | if nodeid == c_dust 217 | or nodeid == c_gravel 218 | or nodeid == c_cobble then 219 | surfy = y 220 | break 221 | elseif nodename == c_snowblock 222 | or nodename == c_waterice then 223 | comet = true 224 | surfy = y 225 | break 226 | end 227 | end 228 | if surfy and y1 - surfy > 8 then -- if surface found and 8 node space above impact node then 229 | for x = cx - cr, cx + cr do -- for each plane do 230 | for z = cz - cr, cz + cr do -- for each column do 231 | for y = surfy - cr, surfy + cr do -- for each node do 232 | local vi = area:index(x, y, z) -- LVM index for node 233 | local nr = ((x - cx) ^ 2 + (y - surfy) ^ 2 + (z - cz) ^ 2) ^ 0.5 234 | if nr <= cr - 2 then 235 | if comet then 236 | data[vi] = c_atmos 237 | else 238 | data[vi] = c_air 239 | end 240 | elseif nr <= cr - 1 then 241 | local nodeid = data[vi] 242 | if nodeid == c_gravel 243 | or nodeid == c_cobble 244 | or nodeid == c_stone 245 | or nodeid == c_diamondore 246 | or nodeid == c_goldore 247 | or nodeid == c_meseore 248 | or nodeid == c_copperore 249 | or nodeid == c_ironore then 250 | data[vi] = c_dust 251 | end 252 | elseif nr <= cr then 253 | local nodeid = data[vi] 254 | if nodeid == c_cobble 255 | or nodeid == c_stone then 256 | data[vi] = c_obsidian -- obsidian buried under dust 257 | end 258 | end 259 | end 260 | end 261 | end 262 | end 263 | end 264 | vm:set_data(data) 265 | vm:set_lighting({day=0, night=0}) 266 | vm:calc_lighting() 267 | vm:write_to_map(data) 268 | -- local chugent = math.ceil((os.clock() - t1) * 1000) 269 | --print ("[asteroid] time "..chugent.." ms") 270 | data = nil 271 | end 272 | end 273 | --------------------------------------------------------------------------------