Rename Minetest to Luanti
This commit is contained in:
parent
2a29951382
commit
c8df99aa4c
22
README.md
22
README.md
@ -2,14 +2,14 @@
|
||||
|
||||
Version: 1.0.3
|
||||
|
||||
Perlin Explorer is a mod for Minetest to allow to test and experiment around with Perlin noises.
|
||||
Perlin Explorer is a mod for Luanti to allow to test and experiment around with Perlin noises.
|
||||
|
||||
This is especially useful for game and mod developers who want to fine-tune the noises in an
|
||||
efficient manner. It’s also useful to discover useful noise parameters for the various
|
||||
mapgen settings in Minetest.
|
||||
mapgen settings in Luanti.
|
||||
|
||||
This mod uses Minetest’s builtin Perlin noise, so the same rules apply here.
|
||||
Refer to Minetest’s documentation to learn about noise parameters.
|
||||
This mod uses Luanti’s builtin Perlin noise, so the same rules apply here.
|
||||
Refer to Luanti’s documentation to learn about noise parameters.
|
||||
|
||||
## /!\ WARNING WARNING WARNING /!\
|
||||
|
||||
@ -29,7 +29,7 @@ security-tested.
|
||||
* Choose between solid nodes, transparent grid nodes, and tiny climbable cube nodes
|
||||
* Generate a small portion of the noise as map at a given area
|
||||
* Enable “mapgen mode” to automatically generate nodes as you move around
|
||||
* Load predefined Perlin noises from the Minetest configuration
|
||||
* Load predefined Perlin noises from the Luanti configuration
|
||||
* Save noise parameters into profiles for later use
|
||||
* Mathematical and statistical analysis of noises
|
||||
|
||||
@ -50,7 +50,7 @@ manage noise parameters, generate nodes and perform some basic
|
||||
analysis.
|
||||
|
||||
### What are noise parameters?
|
||||
These are used by Minetest for the Perlin noises.
|
||||
These are used by Luanti for the Perlin noises.
|
||||
Perlin noises are used for various things such as generating the world,
|
||||
decorations (trees, plants, etc.), ores, biomes and much more.
|
||||
|
||||
@ -62,11 +62,11 @@ detailed, and more.
|
||||
The Perlin Explorer mod’s main use case is to allow you to
|
||||
try out various parameters and to modify them in a quick
|
||||
manner so you can quickly get results. This is much more
|
||||
efficient than tweaking the noise in the Minetest settings
|
||||
efficient than tweaking the noise in the Luanti settings
|
||||
or Lua code.
|
||||
|
||||
This document is *not* an introduction to Perlin noises
|
||||
and noise parameters themselves! Please refer to the Minetest
|
||||
and noise parameters themselves! Please refer to the Luanti
|
||||
Lua API documentation to learn more.
|
||||
|
||||
### Active noise
|
||||
@ -114,7 +114,7 @@ The bottom part contains the actual noise parameters:
|
||||
* Lacunarity
|
||||
* Flags (defaults, eased, absvalue)
|
||||
|
||||
Please refer to Minetest Lua API documentation for a definition.
|
||||
Please refer to Luanti Lua API documentation for a definition.
|
||||
This mod enforces a few sanity checks on some for the values,
|
||||
i.e. octaves can’t be lower than 1.
|
||||
|
||||
@ -151,7 +151,7 @@ This list contains three types of profiles:
|
||||
* Active noise parameters: Special profile that represents
|
||||
the currently active noise. Can not be deleted.
|
||||
* Builtin profiles are the noise parameters
|
||||
of the official Minetest mapgens, loaded from settings.
|
||||
of the official Luanti mapgens, loaded from settings.
|
||||
Their name always begins with `mg_`
|
||||
Can not be deleted.
|
||||
* User profiles: These are your profiles, you can
|
||||
@ -176,7 +176,7 @@ These fields are available:
|
||||
* Number of dimensions (2D or 3D)
|
||||
* 2D: Noise is 2-dimensional. In the world, only the X and Z
|
||||
coordinates are used. The Y coordinate is ignored.
|
||||
* 3D: Noise uses the same 3 dimensions as the Minetest world,
|
||||
* 3D: Noise uses the same 3 dimensions as the Luanti world,
|
||||
with X, Y and Z coordinates.
|
||||
* Pixelization: If this number is higher than 1, the noise values
|
||||
will be repeated for this number of nodes, along every axis.
|
||||
|
26
init.lua
26
init.lua
@ -20,9 +20,9 @@ local mapgen_star = minetest.settings:get_bool("perlin_explorer_mapgen_star", tr
|
||||
|
||||
-- The number of available test node colors.
|
||||
-- Higher values lead to worse performance but a coarse color scheme.
|
||||
-- This value is only used for performance reason, because Minetest
|
||||
-- This value is only used for performance reason, because Luanti
|
||||
-- has a sharp performance drop when there are many different node colors on screen.
|
||||
-- Consider removing this one when Minetest's performance problem has been solved.
|
||||
-- Consider removing this one when Luanti's performance problem has been solved.
|
||||
local color_count = tonumber(minetest.settings:get("perlin_explorer_color_count")) or 64
|
||||
local color_lookup = {
|
||||
[256] = 1, -- full color palette
|
||||
@ -45,7 +45,7 @@ end
|
||||
-- Time to wait in seconds before checking and generating new nodes in autobuild mode.
|
||||
local AUTOBUILD_UPDATE_TIME = 0.1
|
||||
|
||||
-- x/y/z size of "noisechunks" (like chunks in the Minetest mapgen, but specific to this
|
||||
-- x/y/z size of "noisechunks" (like chunks in the Luanti mapgen, but specific to this
|
||||
-- mod) to generate in autobuild mode.
|
||||
local AUTOBUILD_SIZE = 16
|
||||
-- Amount of noisechunks to generate around player
|
||||
@ -79,7 +79,7 @@ local STATISTICS_ITERATIONS = 1000000
|
||||
-- noise spread.
|
||||
local STATISTICS_SPREAD_FACTOR = 69
|
||||
-- Maximum size of the statistics calculation area (side length of square area /
|
||||
-- cube volume). Must make sure that Minetest still accepts coordinates
|
||||
-- cube volume). Must make sure that Luanti still accepts coordinates
|
||||
-- in this range.
|
||||
local STATISTICS_MAX_SIZE = math.floor((2^32-1)/1000)
|
||||
-- Maximum allowed spread for statistics to still be supported.
|
||||
@ -98,7 +98,7 @@ local formspec_states = {}
|
||||
-- * name: Name as it appears in list (not set for user profiles)
|
||||
-- * np_type: Type
|
||||
-- * "active": Active noise parameters. Not deletable
|
||||
-- * "mapgen": Noise parameters loaded from Minetest settings. Not deletable
|
||||
-- * "mapgen": Noise parameters loaded from Luanti settings. Not deletable
|
||||
-- * "user": Profiles created by user. Deletable
|
||||
local np_profiles = {}
|
||||
|
||||
@ -249,15 +249,15 @@ end
|
||||
-- Appends invisible filler content, changing
|
||||
-- every time this function is called.
|
||||
-- This will force the formspec to be unique.
|
||||
-- Neccessary because Minetest doesn’t update
|
||||
-- Neccessary because Luanti doesn’t update
|
||||
-- the formspec when the same formspec was
|
||||
-- sent twice. This is a problem because the
|
||||
-- player might have edited a text field, causing
|
||||
-- the formspec to not properly update.
|
||||
-- Only use this function for one formspec
|
||||
-- type, otherwise it won’t work.
|
||||
-- Workaround confirmed working for: Minetest 5.5.0
|
||||
-- FIXME: Drop this when Minetest no longer does
|
||||
-- Workaround confirmed working for engine version 5.5.0
|
||||
-- FIXME: Drop this when Luanti no longer does
|
||||
-- this.
|
||||
local unique_formspec_spaces = function(player_name, formspec)
|
||||
-- Increase the sequence number every time
|
||||
@ -316,7 +316,7 @@ local parse_flags_string = function(flags)
|
||||
end
|
||||
|
||||
-- Sets the currently active Perlin noise.
|
||||
-- * noiseparams: NoiseParams table (see Minetest's Lua API documentation)
|
||||
-- * noiseparams: NoiseParams table (see Luanti's Lua API documentation)
|
||||
local set_perlin_noise = function(noiseparams)
|
||||
current_perlin.noise = PerlinNoise(noiseparams)
|
||||
current_perlin.noiseparams = noiseparams
|
||||
@ -1557,7 +1557,7 @@ local show_noise_formspec = function(player, noiseparams, profile_id, f_dimensio
|
||||
tooltip[toggle_autogen;]]..F(S("Toggle the automatic map generator"))..[[]
|
||||
container_end[]
|
||||
]]
|
||||
-- Hack to fix Minetest issue (see function comment)
|
||||
-- Hack to fix Luanti issue (see function comment)
|
||||
form = unique_formspec_spaces(player_name, form)
|
||||
minetest.show_formspec(player_name, "perlin_explorer:creator", form)
|
||||
end
|
||||
@ -1766,7 +1766,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
max_spread = math.max(max_spread, noiseparams.spread.y)
|
||||
max_spread = math.max(max_spread, noiseparams.spread.z)
|
||||
local ssize = max_spread * STATISTICS_SPREAD_FACTOR
|
||||
-- A very large size is not allowed because the Minetest functions start to fail and would start to distort the statistics.
|
||||
-- A very large size is not allowed because the Luanti functions start to fail and would start to distort the statistics.
|
||||
if ssize > STATISTICS_MAX_SIZE or max_spread > STATISTICS_MAX_SPREAD then
|
||||
show_error_formspec(player, S("Sorry, but Perlin Explorer doesn’t support calculating statistics if the spread of any axis is larger than @1.", STATISTICS_MAX_SPREAD), false)
|
||||
return
|
||||
@ -1870,12 +1870,12 @@ minetest.register_tool("perlin_explorer:creator", {
|
||||
})
|
||||
|
||||
-- Automatic map generation (autogen).
|
||||
-- The autogen is kind of a mapgen, but it doesn't use Minetest's
|
||||
-- The autogen is kind of a mapgen, but it doesn't use Luanti's
|
||||
-- mapgen, instead it writes directly to map. The benefit is
|
||||
-- that this will instantly update when the active noiseparams
|
||||
-- are changed.
|
||||
-- This will generate so-called noisechunks, which are like
|
||||
-- Minetest mapchunks, except with respect to this mod only.
|
||||
-- Luanti mapchunks, except with respect to this mod only.
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
|
Loading…
x
Reference in New Issue
Block a user