Skip to content

Commit

Permalink
Replacement for Minimal Development Test (PR) (#9450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 committed May 24, 2020
1 parent a9b74f4 commit 6456aba
Show file tree
Hide file tree
Showing 465 changed files with 5,140 additions and 3,485 deletions.
4 changes: 4 additions & 0 deletions games/minimal/LICENSE.txt
@@ -0,0 +1,4 @@
License information for Developer Test
--------------------------------------

The same license as for Minetest applies.
52 changes: 52 additions & 0 deletions games/minimal/README.md
@@ -0,0 +1,52 @@
# Minimal development test

This is a basic testing environment that contains a bunch of things to test the engine, but it could also be used as a minimal testbed for testing out mods.

## Features

* Basic nodes for mapgen
* Basic, minimal map generator
* Lots of example nodes for testing drawtypes, param2, light level, and many other node properties
* Example entities
* Other example items
* Formspec test (via `/test_formspec` command)
* Automated unit tests (disabled by default)
* Tools for manipulating nodes and entities, like the "Param2 Tool"

## Getting started

Basically, just create a world and start. A few important things to note:

* Items are gotten from the “Chest of Everything” (`chest_of_everything:chest`)
* When you lost your initial items, type in `/stuff` command to get them back
* By default, Creative Mode activates infinite node placement. This behavior can be changed with the `devtest_infplace` setting
* Use the `/infplace` command to toggle infinite node placement in-game
* Use the Param2 Tool to change the param2 of nodes; it's useful to experiment with the various drawtype test nodes
* Check out the game settings and server commands for additional tests and features
* Creative Mode does nothing (apart from default engine behavior)

Confused by a certain node or item? Check out for inline code comments.

### Example tests

* You can use this to test what happens if a player is simultaneously in 2 nodes with `damage_per_second` but with a different value.
* Or use the Falling Node Tool on various test nodes to see how they behave when falling.
* You could also use this as a testbed for dependency-free mods, e.g. to test out how your formspecs behave without theming.

## Random notes

* Experimental/strange/unstructured tests can be found in the `experimental` mod
* Textures of drawtype test nodes have a red dot at the top left corner. This is to see whether the textures are oriented properly

## Design philosophy

This should loosely follow the following principles:

* Engine testing: The main focus of this is to aid testing of *engine* features, such as mapgen or node drawtypes
* Mod testing: The secondary focus is to help modders as well, either as a minimal testbed for mods or even as a code example
* Minimal interference: Under default settings, it shall not interfere with APIs except on explicit user wish. Non-trivial tests and features need to be enabled by a setting first
* Convenience: Have various tools to make usage easier and more convenient
* Reproducing engine bugs: When an engine bug was found, consider creating a test case
* Clarity: Textures and names need to be designed to keep different things clearly visually apart at a glance
* Low loading time: It must load blazing-fast so stuff can be tested quickly

2 changes: 1 addition & 1 deletion games/minimal/game.conf
@@ -1,2 +1,2 @@
name = Minimal development test

description = Testing environment to help with testing the engine features of Minetest. It can also be helpful in mod development.
Binary file modified games/minimal/menu/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added games/minimal/menu/header.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified games/minimal/menu/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
334 changes: 334 additions & 0 deletions games/minimal/mods/basenodes/init.lua
@@ -0,0 +1,334 @@
local WATER_ALPHA = 160
local WATER_VISC = 1
local LAVA_VISC = 7

--
-- Node definitions
--

-- Register nodes

minetest.register_node("basenodes:stone", {
description = "Stone",
tiles = {"default_stone.png"},
groups = {cracky=3},
})

minetest.register_node("basenodes:desert_stone", {
description = "Desert Stone",
tiles = {"default_desert_stone.png"},
groups = {cracky=3},
})

minetest.register_node("basenodes:dirt_with_grass", {
description = "Dirt with Grass",
tiles ={"default_grass.png",
-- a little dot on the bottom to distinguish it from dirt
"default_dirt.png^basenodes_dirt_with_grass_bottom.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3, soil=1},
})

minetest.register_node("basenodes:dirt_with_snow", {
description = "Dirt with Snow",
tiles ={"basenodes_dirt_with_snow.png",
-- a little dot on the bottom to distinguish it from dirt
"default_dirt.png^basenodes_dirt_with_snow_bottom.png",
{name = "default_dirt.png^default_snow_side.png",
tileable_vertical = false}},
groups = {crumbly=3, soil=1},
})

minetest.register_node("basenodes:dirt", {
description = "Dirt",
tiles ={"default_dirt.png"},
groups = {crumbly=3, soil=1},
})

minetest.register_node("basenodes:sand", {
description = "Sand",
tiles ={"default_sand.png"},
groups = {crumbly=3},
})

minetest.register_node("basenodes:desert_sand", {
description = "Desert Sand",
tiles ={"default_desert_sand.png"},
groups = {crumbly=3},
})

minetest.register_node("basenodes:gravel", {
description = "Gravel",
tiles ={"default_gravel.png"},
groups = {crumbly=2},
})

minetest.register_node("basenodes:junglegrass", {
description = "Jungle Grass",
drawtype = "plantlike",
tiles ={"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
paramtype = "light",
walkable = false,
groups = {snappy=3},
})

minetest.register_node("basenodes:tree", {
description = "Normal Tree Trunk",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=1},
})

minetest.register_node("basenodes:leaves", {
description = "Normal Leaves",
drawtype = "allfaces_optional",
tiles = {"default_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3},
})

minetest.register_node("basenodes:jungletree", {
description = "Jungle Tree Trunk",
tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=1},
})

minetest.register_node("basenodes:jungleleaves", {
description = "Jungle Leaves",
drawtype = "allfaces_optional",
tiles = {"default_jungleleaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3},
})

minetest.register_node("basenodes:pine_tree", {
description = "Pine Tree Trunk",
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png", "default_pine_tree.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=1},
})

minetest.register_node("basenodes:pine_needles", {
description = "Pine Needles",
drawtype = "allfaces_optional",
tiles = {"default_pine_needles.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3},
})

minetest.register_node("basenodes:water_source", {
description = "Water Source",
drawtype = "liquid",
tiles = {"default_water.png"},
special_tiles = {
{name = "default_water.png", backface_culling = false},
{name = "default_water.png", backface_culling = true},
},
alpha = WATER_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "basenodes:water_flowing",
liquid_alternative_source = "basenodes:water_source",
liquid_viscosity = WATER_VISC,
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
groups = {water = 3, liquid = 3},
})

minetest.register_node("basenodes:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
tiles = {"default_water_flowing.png"},
special_tiles = {
{name = "default_water_flowing.png", backface_culling = false},
{name = "default_water_flowing.png", backface_culling = false},
},
alpha = WATER_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "basenodes:water_flowing",
liquid_alternative_source = "basenodes:water_source",
liquid_viscosity = WATER_VISC,
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
groups = {water = 3, liquid = 3},
})

minetest.register_node("basenodes:river_water_source", {
description = "River Water Source",
drawtype = "liquid",
tiles = { "default_river_water.png" },
special_tiles = {
{name = "default_river_water.png", backface_culling = false},
{name = "default_river_water.png", backface_culling = true},
},
alpha = WATER_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "basenodes:river_water_flowing",
liquid_alternative_source = "basenodes:river_water_source",
liquid_viscosity = 1,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
groups = {water = 3, liquid = 3, },
})

minetest.register_node("basenodes:river_water_flowing", {
description = "Flowing River Water",
drawtype = "flowingliquid",
tiles = {"default_river_water_flowing.png"},
special_tiles = {
{name = "default_river_water_flowing.png", backface_culling = false},
{name = "default_river_water_flowing.png", backface_culling = false},
},
alpha = WATER_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "basenodes:river_water_flowing",
liquid_alternative_source = "basenodes:river_water_source",
liquid_viscosity = 1,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
groups = {water = 3, liquid = 3, },
})

minetest.register_node("basenodes:lava_flowing", {
description = "Flowing Lava",
drawtype = "flowingliquid",
tiles = {"default_lava_flowing.png"},
special_tiles = {
{name="default_lava_flowing.png", backface_culling = false},
{name="default_lava_flowing.png", backface_culling = false},
},
paramtype = "light",
light_source = minetest.LIGHT_MAX,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
damage_per_second = 4,
liquidtype = "flowing",
liquid_alternative_flowing = "basenodes:lava_flowing",
liquid_alternative_source = "basenodes:lava_source",
liquid_viscosity = LAVA_VISC,
post_effect_color = {a=192, r=255, g=64, b=0},
groups = {lava=3, liquid=1},
})

minetest.register_node("basenodes:lava_source", {
description = "Lava Source",
drawtype = "liquid",
tiles = { "default_lava.png" },
special_tiles = {
{name = "default_lava.png", backface_culling = false},
{name = "default_lava.png", backface_culling = true},
},
paramtype = "light",
light_source = minetest.LIGHT_MAX,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drowning = 1,
damage_per_second = 4,
liquidtype = "source",
liquid_alternative_flowing = "basenodes:lava_flowing",
liquid_alternative_source = "basenodes:lava_source",
liquid_viscosity = LAVA_VISC,
post_effect_color = {a=192, r=255, g=64, b=0},
groups = {lava=3, liquid=1},
})

minetest.register_node("basenodes:cobble", {
description = "Cobblestone",
tiles ={"default_cobble.png"},
is_ground_content = false,
groups = {cracky=3},
})

minetest.register_node("basenodes:mossycobble", {
description = "Mossy Cobblestone",
tiles ={"default_mossycobble.png"},
is_ground_content = false,
groups = {cracky=3},
})

minetest.register_node("basenodes:apple", {
description = "Apple",
drawtype = "plantlike",
tiles ={"default_apple.png"},
inventory_image = "default_apple.png",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
walkable = false,
groups = {dig_immediate=3},

-- Make eatable because why not?
on_use = minetest.item_eat(2),
})

minetest.register_node("basenodes:ice", {
description = "Ice",
tiles ={"default_ice.png"},
groups = {cracky=3},
})

-- The snow nodes intentionally have different tints to make them more
-- distinguishable
minetest.register_node("basenodes:snow", {
description = "Snow Sheet",
tiles = {"basenodes_snow_sheet.png"},
groups = {crumbly=3},
walkable = false,
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
})

minetest.register_node("basenodes:snowblock", {
description = "Snow Block",
tiles ={"default_snow.png"},
groups = {crumbly=3},
})


2 changes: 2 additions & 0 deletions games/minimal/mods/basenodes/mod.conf
@@ -0,0 +1,2 @@
name = basenodes
description = Contains basic nodes for mapgen
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6456aba

Please sign in to comment.