paramat [Tue, 13 Sep 2016 02:14:22 +0000 (03:14 +0100)]
Default: New snow textures by Gambit
From PixelBOX2 texture pack.
Brightness increased for 'snow' and 'snow side'.
Auke Kok [Mon, 25 Jan 2016 12:45:25 +0000 (13:45 +0100)]
Stairs: Big simplification of slabs combination
Combine slabs if identical based on orientations using a simple lookup
table if the nodes are identical.
Otherwise relies on place_node() to place the node, which properly
handles rotation compared to adjacent nodes already, and can orient
based on look_dir as well.
Initial slabs placed are oriented based on (1) the orientation of
the pointed "face" (assumes nodes are cubic, of course), and uses
the player look direction to orient the node n/e/w/s if the slab
is horizontal or upside-down. If placed against a vertical face,
the slab is placed against the face without rotation around the axis
perpendicular to that vertical face. This allows upside down placement
and vertical placement without screwdriver.
If a slab is placed on top of an upside down slab, or below a normally
placed slab, the rotation is inverted so that no "floating" slab
is created.
Largely based on kilbith's #807 PR. Slab combining and place_node()
usage by sofar.
Since this relies entirely on `on_place` mechanics, this fails to
combine slabs into a plain node if the space *above* is occupied.
This is unavoidable due to the fact that on_place() happens after
the checks required to see if pointed_thing.above is empty or not.
tenplus1 [Wed, 7 Sep 2016 09:22:57 +0000 (10:22 +0100)]
Bones: Search for nearby 'air' for fallback bones placement
When a player dies on ladders or rope then a space can not be found at or
above player, so this change looks around player for a space to place bones.
Auke Kok [Thu, 17 Mar 2016 07:40:30 +0000 (00:40 -0700)]
Xpanes: Convert to connected nodeboxes
I've rewritten this to use connected nodeboxes, but with a caveat. In
order to make flat nodes look better, I'm keeping one non-connected
pane that is flat around to convert flat sections to the flat nodes
instead of connected, as these look better and are easier to work
with. Once more sides are needed we convert the panes on the fly to
connected nodes and recalculate the shape.
We don't paint any of the half-panes that the previous generation of
xpanes did. There's no need and it's harder to work with. Updating the
nodes also seems more natural and placement and removal works straight
forward.
The conversion of old panes relies on an LBM, and does a reasonable
conversion job, but it's not exact, since the panes behave slightly
different now.
The game API documentation was wrong to begin with. We discard param
nr. 2 of the API entirely, and correct the tile usage text.
paramat [Wed, 7 Sep 2016 23:16:16 +0000 (00:16 +0100)]
Licenses: (Part 4) Remove overlooked WTFPL text. Cleanup
paramat [Wed, 7 Sep 2016 01:52:57 +0000 (02:52 +0100)]
Change WTFPL to MIT (part 3)
Relicense WTFPL media to CC BY-SA 3.0.
Various corrections and edits.
paramat [Mon, 5 Sep 2016 06:24:18 +0000 (07:24 +0100)]
Licenses: Change WTFPL to MIT (part 2)
Add license.txt files.
Update and improve README.txt files.
Corrections to part 1.
paramat [Sun, 4 Sep 2016 05:31:01 +0000 (06:31 +0100)]
Licenses: Change WTFPL to MIT (part 1)
Part 1: All mods except default and xpanes.
Add license.txt files.
Add missing README.txt files.
Check and update copyright years for all contributors.
Improve text format and make more consistent.
paramat [Thu, 1 Sep 2016 04:56:21 +0000 (05:56 +0100)]
Default: Vary wood burn times according to wood density
Retain definitions for node groups to support mods.
Burn time is unchanged for applewood, and increases in the order:
aspen, pine, apple, acacia, jungle which is also the order of wood
colour darkness.
Auke Kok [Fri, 26 Aug 2016 18:00:49 +0000 (11:00 -0700)]
Default/furnace: Indicate dst full
Indicate in the infotext when a furnace has filled up `dst` but still
has fuel. The info text shows the item as 100% with added "(output
full)" text, indicating that while it can cook the item, there is no
place for it in the `dst`. Emptying the `dst` should make the item
cook immediately and furnace resume normal operation.
paramat [Tue, 23 Aug 2016 19:33:37 +0000 (20:33 +0100)]
Creative: Make dig times near-identical for nodes of all levels
Dig time is modified according to difference (leveldiff) between tool
'maxlevel' and node 'level'. Digtime is divided by the larger of leveldiff
and 1. In creative mode, where the hand is redefined to have maxlevel 3,
this results in higher level nodes taking significantly longer to break.
Now, to speed up digging, hand 'maxlevel' and 'digtime' have been
increased such that nodes of differing levels have an insignificant
effect on digtime. Dig time for all nodes is now identical to that of, for
example, dirt nodes.
Pinky Snow [Sat, 27 Aug 2016 22:28:02 +0000 (18:28 -0400)]
Default: Eliminate redundant 'get modpath' calls
paramat [Sat, 27 Aug 2016 01:41:31 +0000 (02:41 +0100)]
Default, stairs, doors: Vary wood flammable and choppy group values
Make the softer woods, pine and aspen, 'flammable = 3'.
Correct inconsistent flammability of wood and stairs in relation
to all other solid wood nodes in MTGame.
Make the the softer woods, pine and aspen, 'choppy = 3'.
rubenwardy [Sat, 27 Aug 2016 17:07:57 +0000 (18:07 +0100)]
Add search on enter press to creative inventory
Megaf [Sun, 21 Aug 2016 20:18:32 +0000 (21:18 +0100)]
Flowers: Add missing aliases for mushrooms from the mushroom mod
paramat [Mon, 15 Aug 2016 20:29:52 +0000 (21:29 +0100)]
Fire: Use 'enable fire' setting instead of 'disable fire'
pithydon [Sat, 30 Jul 2016 23:15:42 +0000 (17:15 -0600)]
Default: Improve fences inventory/wield images
tenplus1 [Wed, 10 Aug 2016 13:03:18 +0000 (14:03 +0100)]
Default/trees: Faster 'is snow nearby' function
Use 'find node near' instead of 'find nodes in area'
paramat [Sun, 7 Aug 2016 02:54:08 +0000 (03:54 +0100)]
Default: Optimise and simplify leafdecay ABM, remove cache
With thanks to contributor tenplus1
Remove leaf cache and globalstep accumulator limiter
Use 'pos' instead of 'p0'
Remove non-essential 'group:liquid' from 'neighbors'
Increase chance value to 10 to compensate for disabled cache
Disable 'catch-up' to avoid the ABM often becoming 10 times more
intensive
Remove use of 'do preserve' bool, instead simply 'return'
Remove unnecessary checks for 'd' and 'd == 0'
Don't 'get' n0, use already present 'node' instead
Swap order two conditionals so that the one most likely is first
tenplus1 [Mon, 8 Aug 2016 09:56:13 +0000 (10:56 +0100)]
Add labels to ABMs
Useful for searches and the mod profiler.
DonBatman [Mon, 8 Aug 2016 00:23:44 +0000 (17:23 -0700)]
Changed snow nodebox to 'walkable = false'
Allows walking in, and prevents being trapped in, 2 node high spaces.
Simulates player's feet sinking into snow.
Easier jumping up onto nodes with snow.
tenplus1 [Thu, 4 Aug 2016 09:22:41 +0000 (10:22 +0100)]
Tnt: Limit blown up dropped stacks to stack_max
This replaces the hardcoded 99 item limit and instead uses the
get_stack_max() limit for each item.
Tim [Fri, 5 Aug 2016 12:55:43 +0000 (14:55 +0200)]
Use minetest instead of core namespace, discourage via luacheck
Tim [Sun, 26 Jun 2016 15:12:40 +0000 (17:12 +0200)]
Let Travis-CI automatically run luacheck on the game
Tim [Fri, 5 Aug 2016 10:14:33 +0000 (12:14 +0200)]
Screwdriver: disallow rotation with `on_rotate = false`
Other screwdriver mods, or mods that cause rotation, might operate without the screwdriver mod loaded and have `screwdriver.disallow` unavailable.
This allows nodes to default to full-disallow rather than full-rotation in such a situation.
Tim [Tue, 2 Aug 2016 18:10:57 +0000 (20:10 +0200)]
Doors: Allow the screwdriver to rotate doors around y-axis.
Keep other axis' disabled to prevent the hidden placeholder node to become irremovable to players.
tenplus1 [Wed, 3 Aug 2016 08:10:09 +0000 (09:10 +0100)]
TNT: Fix bug with huge stacks
This fixes the TNT bug that can crash game when blowing up a container
which holds huge stacks above the norm... e.g. give yourself 65535 snow,
place in chest, blow up, stalled!
paramat [Wed, 3 Aug 2016 00:35:20 +0000 (01:35 +0100)]
Doors: Trim open fence gate collision box
Previously, the collision box extended into an empty node, causing
falling node objects to land on the open gate but not transform
back into normal nodes. Now fallng node objects will fall through and
either side of the end of the open gate and transform back.
Tim [Sat, 30 Jul 2016 12:21:30 +0000 (14:21 +0200)]
Doors: Fix potential crashes, code improvements
Fix crash when doors are placed under unknown nodes.
Share a can_dig among doors, that does not crash on nil-player.
Only set can_dig if we actually protect the door.
paramat [Sat, 30 Jul 2016 00:49:49 +0000 (01:49 +0100)]
Bones: Improve bones textures
Add mouth, remove jaw shadow, shade eyesockets.
Darker shading for spine and rotate texture using ^[transform2
instead of inverting texture.
Use 'node sound gravel defaults' for sounds.
SmallJoker [Mon, 25 Jul 2016 15:42:42 +0000 (17:42 +0200)]
Beds, boats: Replace deprecated get_look_yaw/set_look_yaw
paramat [Tue, 19 Jul 2016 00:01:59 +0000 (01:01 +0100)]
Default: Prevent placing sapling if grown tree intersects protection
Add a global 'intersects protection' function to functions.lua for
checking if a specified volume intersects with a protected volume.
A 3D lattice of points are checked with an adjustable interval.
Add a global 'sapling on place' function to avoid duplicated code in
nodes.lua.
tenplus1 [Mon, 21 Mar 2016 21:22:26 +0000 (21:22 +0000)]
Bones: Ability to change bones mode. Tidy up code
Add 'bones_mode' setting to minetest.conf -> Modes: bones, drop, keep
Remove table 'bones'
Add minetest.conf.example description
Remove protection check from may_replace
paramat [Tue, 19 Jul 2016 21:26:02 +0000 (22:26 +0100)]
Flowers: Fix waterlily on-place itemstack code
Add 'record_protection_violation()'
Thomas--S [Mon, 18 Jul 2016 05:14:01 +0000 (07:14 +0200)]
Doors: Fix orientations of trapdoor textures
paramat [Mon, 18 Jul 2016 22:07:11 +0000 (23:07 +0100)]
Nyancat: Fix texture names
paramat [Mon, 18 Jul 2016 21:50:00 +0000 (22:50 +0100)]
Default/trees: Update to 'get_mapgen_setting()'
Thomas--S [Sun, 17 Jul 2016 18:37:29 +0000 (20:37 +0200)]
Doors: Fix trapdoor on_blast
Removing the node above was an error and is unnecessary
Thomas--S [Sun, 17 Jul 2016 16:52:42 +0000 (18:52 +0200)]
Doors: Same naming for trapdoors as for doors
This makes register_trapdoor act the same as the register_door.
If `name` isn't prefixed, it will be prefixed with "doors:".
rubenwardy [Mon, 11 Jul 2016 16:55:17 +0000 (17:55 +0100)]
Move nyancats into a separate mod
Nyancats are independent in the default mod. Nothing else uses them or
their code. Separating it into a separate mod makes it easier for
subgames to remove them. It also makes it easier for a mod to depend
on nyancats, as lots of subgames don't have them.
Default/mapgen.lua: Register biomes, ores and decorations in
singlenode mapgen. These were never disabled anyway because
singlenode was removed from the world creation menu.
tenplus1 [Wed, 13 Jul 2016 18:24:49 +0000 (19:24 +0100)]
Doors: Make door groups consistent with corresponding materials
adrido [Tue, 12 Jul 2016 09:02:01 +0000 (11:02 +0200)]
Beds: Only register respawn callbacks if respawn is enabled
Tim [Mon, 11 Jul 2016 13:11:57 +0000 (15:11 +0200)]
Clean up fire ABM parameters.
Tim [Sun, 26 Jun 2016 12:46:15 +0000 (14:46 +0200)]
Stop shadowing upvalues and definitions.
Tim [Sun, 26 Jun 2016 11:34:14 +0000 (13:34 +0200)]
Remove unused and clean up missused variable-value assignments.
* Unused variables
* Unused values (assigned to variables, but overwritten before use)
* Defining already defined variables instead of reassigning to them.
tenplus1 [Fri, 20 May 2016 10:40:15 +0000 (11:40 +0100)]
Beds: Save respawn position when entering bed, only read bed spawns once
No longer require night to be skipped for resawn position to be saved
Remove constant beds.read_spawns() calls when a player joins as this
is only required once
Tim [Mon, 11 Jul 2016 15:50:19 +0000 (17:50 +0200)]
Doors: Fix missing node parameter passing
paramat [Sat, 9 Jul 2016 18:23:54 +0000 (19:23 +0100)]
Bones: New textures
Tim [Thu, 7 Jul 2016 22:51:54 +0000 (00:51 +0200)]
Doors: Fix trapdoor crash on can_dig with nil-player (e.g. minetest.dig_node)
tenplus1 [Fri, 8 Jul 2016 14:41:37 +0000 (15:41 +0100)]
Default/trees: Faster way to detect snow around pine saplings
Instead of using voxelmanip use 'find nodes in area' instead
Tim [Sat, 2 Jul 2016 00:30:45 +0000 (02:30 +0200)]
Doors: Remove unnecessary node lookups
Tim [Fri, 1 Jul 2016 20:43:02 +0000 (22:43 +0200)]
Always return the leftover ItemStack for on_place and on_rightclick
paramat [Thu, 7 Jul 2016 17:56:43 +0000 (18:56 +0100)]
TNT: Add missing 'then'
Tim [Tue, 5 Jul 2016 17:36:36 +0000 (19:36 +0200)]
Bucket: Allow liquid placed against unknown nodes instead of aborting abnormally
Tim [Tue, 5 Jul 2016 17:30:33 +0000 (19:30 +0200)]
Bucket: Prevent crashing when placing liquid against a buildable node into an unknown node
paramat [Thu, 7 Jul 2016 16:48:02 +0000 (17:48 +0100)]
Doors: Code cleanup
Remove spaces inside curly brackets
Split lines over 90 columns
paramat [Thu, 7 Jul 2016 16:25:42 +0000 (17:25 +0100)]
Doors / default: Remove 'hot', 'bendy' and 'melty' groups from nodes
paramat [Wed, 6 Jul 2016 16:14:39 +0000 (17:14 +0100)]
Default, flowers: Use 'get_mapgen_setting()'
tenplus1 [Mon, 27 Jun 2016 14:45:40 +0000 (16:45 +0200)]
TNT: When disabled leave some useful functionality enabled
- Only remove the TNT craft recipe, tnt:tnt node and the ABM
- Leave tnt:tnt_burning available for explosions in 3rd party mods
tenplus1 [Mon, 4 Jul 2016 10:59:07 +0000 (11:59 +0100)]
Game_api.txt: Add position table reference
tenplus1 [Mon, 4 Jul 2016 08:12:37 +0000 (09:12 +0100)]
Game_api.txt: Add API information for sethome functions
- Documentation for sethome.get, sethome.set and sethome.go
paramat [Sun, 3 Jul 2016 07:52:53 +0000 (08:52 +0100)]
Default/mapgen: Simplify iron ore registrations
Preserve overlapping registrations of large and small clusters
below y = -64 but now extend the small clusters up to y = 0 (the
previous highest iron ore level) in a similar to way to coal
paramat [Sun, 3 Jul 2016 06:33:48 +0000 (07:33 +0100)]
Default/mapgen: Add ores above y = 1024
Each ore's rarity is equal to that occuring below y= -1024
paramat [Sat, 2 Jul 2016 03:10:29 +0000 (04:10 +0100)]
Default/mapgen: Clean up ore registrations
Re-order registrations
Add and improve comments
Change sand blob ymax to 0 as sand does not always rise above 0
Remove dirt blobs from sandstone as it is unsuitable for
many sandstone biomes and ugly in stony sandstone desert
Change ymax of first iron region to 0
tenplus1 [Fri, 1 Jul 2016 15:45:24 +0000 (17:45 +0200)]
Bucket: Correct liquid placing in protected areas
- Placing liquid inside a protected area no longer returns an empty bucket
- Remove on_place function, tidy up code, return proper itemstack
- Shorten code (changes from HybridDog/patch-35)
tenplus1 [Sun, 3 Jul 2016 16:40:43 +0000 (17:40 +0100)]
Tidy sethome code, add global functions, round coords to 1 decimal
- Global functions sethome.set(name, pos) , sethome.get(name) and sethome.go(name)
- Tidy: trim coords to one decimal place and write to table and output table in one go.
- Add error checking
- Add t4im's homepos loader
paramat [Thu, 30 Jun 2016 21:16:46 +0000 (22:16 +0100)]
Flowers: Make waterlily floodable
When waterlilies are placed near river water source make flowing river
water remove waterlilies instead of flowing around them in an ugly way
Thomas--S [Thu, 30 Jun 2016 17:08:55 +0000 (19:08 +0200)]
Doors: Remove use_texture_alpha from door definition
HybridDog [Mon, 27 Jun 2016 12:04:35 +0000 (14:04 +0200)]
Wool: Use adv- and optipng to optimise texture files
HybridDog [Mon, 27 Jun 2016 12:02:44 +0000 (14:02 +0200)]
Wool: Clean up code
paramat [Thu, 23 Jun 2016 02:06:57 +0000 (03:06 +0100)]
Doors: Add dedicated sounds for glass doors
Changed node sounds for steel door/trapdoor to stone
defaults instead of wood defaults
paramat [Tue, 21 Jun 2016 21:53:09 +0000 (22:53 +0100)]
Default: New aspen tree schematics
tenplus1 [Mon, 23 May 2016 07:02:48 +0000 (08:02 +0100)]
Default: Enable crafting of mese crystal fragments into mese crystal
tenplus1 [Sun, 22 May 2016 09:31:21 +0000 (10:31 +0100)]
Default: Craft locked chest from chest plus steel ingot
tenplus1 [Wed, 18 May 2016 07:18:59 +0000 (08:18 +0100)]
Creative: Document creative.formspec_add in game_api.txt
paramat [Sun, 26 Jun 2016 02:57:30 +0000 (03:57 +0100)]
Stairs: Code cleanup, fix various errors
Improve registration format
Fix groups not matching corresponding full node
Improve some descriptions
paramat [Sun, 26 Jun 2016 02:11:42 +0000 (03:11 +0100)]
Stairs: Register stone / desert stone / sandstone / obsidian blocks
Tim [Sun, 20 Sep 2015 14:31:29 +0000 (16:31 +0200)]
Gitignore: Update to ignore additional ide/editors
paramat [Thu, 23 Jun 2016 03:37:19 +0000 (04:37 +0100)]
Default: Add stone / desert stone / sandstone / obsidian blocks
paramat [Wed, 22 Jun 2016 00:41:26 +0000 (01:41 +0100)]
Stairs: Stair recipe returns 8 stairs not 6
Make it consistent with the slab recipe which conserves volume
Xunto [Mon, 20 Jun 2016 15:05:07 +0000 (18:05 +0300)]
Default: Fix character model uv-mapping
Arm and leg textures are now edge-consistent
paramat [Sun, 19 Jun 2016 04:27:06 +0000 (05:27 +0100)]
Default: Remove mortar from stone brick, desert stone brick
Yutao Yuan [Fri, 17 Jun 2016 14:47:43 +0000 (22:47 +0800)]
Flowers: Fix misaligned waterlily texture
Previously waterlily has misaligned top and bottom textures and looks
different when viewed from below.
This also hides the flower in bottom texture.
Auke Kok [Sun, 13 Mar 2016 00:12:37 +0000 (16:12 -0800)]
Doors: Clean up nodedef usage
Allows for more properties to be passed through. Somewhat simplifies
the code as well.
cd2 [Sat, 11 Jun 2016 16:50:22 +0000 (18:50 +0200)]
Farming: Add negative fall_damage_add_percent to straw
This doubles the fall height without damage to 11 nodes.
Auke Kok [Sun, 29 May 2016 20:45:18 +0000 (13:45 -0700)]
Default: Make brick and plank nodes rotatable
Allow many crafted nodes to be rotated in any way possible.
These blocks all have slab and stair versions, which can create awkward
patterns if placed together. By allowing these to be rotated players
can create new patterns and appearances that were not before possible.
Since this wasn't possible before, there won't be any effect
to existing builds, as param2 should always be '0'. The current
screwdriver mod also refuses to rotate and alter param2, so this is
safe to enable from now on.
Personally, since these are all *crafted* nodes to begin with, it
should be apparent that they can be rotated to begin with, but I can
see people may disagree from a simplicity perspective. It also may
affect param2 usage that other mods rely on, although I'm not aware
of any mods that do this.
paramat [Tue, 14 Jun 2016 20:44:49 +0000 (21:44 +0100)]
Creative: Add missing 'formspec_escape' to fix bug
Symbols used in search caused the game to hang with a grey screen,
for example searching for 'diamond;ingot'
paramat [Tue, 14 Jun 2016 20:16:22 +0000 (21:16 +0100)]
Boats: Raise collisionbox top surface to fix boat behaviour
Lowering the top surface to be level with the boat top somehow
causes the boat to fall through world if underwater. Revert to
previous position that is needed for correct behaviour
Auke Kok [Mon, 30 May 2016 19:03:55 +0000 (12:03 -0700)]
Stairs: Add mossy cobble slab and stair
Allow water to turn cobble slab and stairs to turn into mossy versions.
There is no crafting recipe for mossy stairs and mossy slabs, the
stair/slab API has been modified to allow for a recipeitem that
is `nil`, which will omit adding a crafting recipe for these two
items. The API documentation is updated.
The slabs and stairs will turn mossy when water is adjacent, just like
cobblestone. You can either farm mossy versions by placing them in
water for a while, then collecting them, or run water over your craft.
paramat [Sun, 5 Jun 2016 16:21:15 +0000 (17:21 +0100)]
Mapgen: Add biome fields for riverbed node and depth
Auke Kok [Sun, 29 May 2016 06:21:54 +0000 (23:21 -0700)]
Farming: allow LBM's for other mods as well.
Fixes #1114
paramat [Wed, 4 May 2016 23:55:56 +0000 (00:55 +0100)]
Fire: Ignite tnt, gunpowder, permanent flame above coalblock
Enable ignition of tnt, gunpowder and permanent
flame above coalblock using flint and steel
Override coalblock to remove flame above when dug
Add depends.txt for default mod
Auke Kok [Sun, 29 May 2016 23:46:34 +0000 (16:46 -0700)]
Doors: Pass pointed_thing to on_rightclick() callback
This is an omission technicality. The callee should be able
to trust this isn't `nil`
paramat [Sat, 21 May 2016 23:54:57 +0000 (00:54 +0100)]
Default: New mese texture. Add missing texture credits
Mese texture is a classic-mese-yellow version
of celeron55's texture used in MTv0.4.0
Add missing texture credits for mese crystal
and mese crystal fragment
paramat [Tue, 24 May 2016 04:29:30 +0000 (05:29 +0100)]
Default: Bookshelf has 2 openings instead of 4
Make rotatable with 'paramtype2 = facedir'
Auke Kok [Sun, 13 Mar 2016 04:19:37 +0000 (20:19 -0800)]
Fire: move fire node removal out of ABM.
Because the fire nodes are not removed 100% when there are
no more burnable nodes nearby, they can potentially stay around
for very, very long times, leading to ABM trains every 5 seconds
for no good reason (only 1 in 16 will be removed every interval).
A much better method to remove fire nodes is to remove them by
timer, and give removal a 100% chance if no flammable nodes are
adjacent. This makes fire cleanup a lot faster and more natural,
and will reduce the amount of ABM hits making fire overall more
responsive.
We also remove the 1 in 4 chance and fold the removal of flammable
nodes into the ABM chance.
There's some low hanging fruit cleanups in here as well.
Auke Kok [Mon, 7 Mar 2016 05:39:07 +0000 (21:39 -0800)]
Default: Convert saplings to use node timers
Each sapling is given a single node timer that is between
2 and 4 days of game play time (40-80 minutes). If you walk out
of the zone, and come back later, the tree will always grow
to full if the timer has elapsed.
Because trees.lua is all functions, it needs to be parsed before
nodes.lua, since that references some of its functions. Hence,
change the order of parsing here. Otherwise saplings would not
grow to full.
Auke Kok [Tue, 23 Feb 2016 06:28:17 +0000 (22:28 -0800)]
Farming: Convert plants to use node timers
This PR requires @minetest/minetest#3677
Farming and plant growth has traditionally in minetest been
implemented using ABM's. These ABM's periodically tick and cause
plants to grow. The way these ABM's work has several side effects
that can be considered harmful.
Not to mention a comprehensive list of downsides here, but ABM's
are chance-dependent. That results in the chance that some nodes
potentially never get processed by the ABM action, and others get
processed always. One can easily find this effect by planting a large
field of crops, and seeing that some nodes are fully grown really
fast, and some just won't make it to fully grown status even after
hours or play time.
One could solve the problem by making the ABM's slower, and giving them
a 100% of action, but this would cause the entire field to grow a step
instantly at ABM intervals, and is both ugly, and a large number of
node updates that needs to be sent out to each client. Very un-ideal.
With NodeTimers though, each node will see a separate node timer event,
and they will likely not coalesce. This means that we can stop relying
on chance to distribute plant growth, and assign a single timer event
to grow the plant to the next phase. Due to the timer implementation,
we won't ever miss a growth event, and we can re-scehdule them until
the plant has reached full size.
Previously, plants would attempt to grow every 9 seconds, with a
chance of 1/20. This means typically, a plant would need 9*20 seconds
to grow 1 phase, and since there are 8 steps, a typical plant growth
would require 9*20*8 ABM node events. (spread out over 9*8 ABM actual
underlying events per block, roughly).
because plants are likely not growing to full for a very long time
due to statistics working against it (5% of the crops take 20x longer
than the median to grow to full, we'd be seeing ABMs fire possibly
up to 9*20*8*20 with a 95% confidence interval (the actual math
is likely off, but the scale should be correct). That's incredibly
wasteful. We'd reach those conditions easily with 20 plant nodes.
Now, after we convert to NodeTimers, each plant node will see exactly
8 NodeTimer events, and no more. This scales lineairly per plant.
I've tuned the growth rate of crops to be mature in just under 3
whole days. That's about 1hr of game time. Previously, about half
the crops would grow to full in under 2 days, but many plants would
still not be mature by the end of day 3. This is more consistent.
An additional problem in the farming mod was that the final fully-grown
plant was also included in the ABM, causing infinite more ABM's even
after the entire field had grown to completion.
Now, we're left with the problem that none of the pre-existing plants
have actual node timers started on them, and we do not want a new ABM
to fix this issue, since that would be wasteful. Fortunately, there
is now an LBM concept, and we can use it to assure that NodeTimers
on crop nodes are properly started, and only have to do the actual
conversion once per block, ever.
We want to provide a fairly similar growth rate after this conversion
and as such I've resorted to modelling some statistical data. For this
I created a virtual 32x32 crop field with 9 steps (8 transitions)
as is the default wheat crop. We then apply a step where 1 in 20
plants in the field grows a step (randomly chosen) and count the
number of steps needed to get to 25%, 50, 75% and 95% grown.
The resulting data looks as follows:
25% - ~120 steps * 9 sec / abm = 1080s
50% - ~152 steps = 1368s
75% - ~194 steps = 1746s
95% - ~255 steps = 2295s
Next, we want to create a model where the chance that a crop grows
is 100% every node timer. Since there will only be 8 steps ever,
we want the slowest crops to grow in intervals of ~ 2300 / 8 seconds
and the fastest 1/4 of crops to grow 1080 / 8 seconds intervals.
We can roughly compare this to a normal distribution with a median
of 1400 with a stddev of ~350 (thick fingering this one here).
The rest is a bit of thick-fingering to get similar growth rates,
taking into account that ABM's fire regularly so if they're missed
it's fairly painless, but our timers are going to be 1-2 minutes
apart at minimum. I calculate the timer should be around 150s
median, and experimented with several jitter ranges.
Eventually I settled for now on [80,200] with a redo of [40,80],
meaning that each growth step at minimum takes (80 to 200) seconds,
and if a negative growth condition was found (darkness, soil not
wet, etc), then the growth step is retried every (40 to 80) seconds.
The end result is a growth period from seed to full in ~ 2.25
minetest days. This is a little bit shorter than the current
growth rate but the chances you'll miss timer ticks is a bit
larger, so in normal gameplay it should be fairly comparable.
A side effect is that fields grow to full yield fairly quickly
after crops make it to mature growth, and no crops are mature
a very long time before the majority grows to full. The spread
and view over a growing field is also fairly even, there's no
large updates with plenty of nodes. Just a node here or there
every second or so in large fields.
Ultimately, we get rid of ABM rollercoasters that cause tens of
node updates every 9 seconds. This will help multiplayer servers
likely a lot.
Auke Kok [Sun, 22 May 2016 06:15:59 +0000 (23:15 -0700)]
Boats: Lower boat collision box top
Standing on a boat makes you appear to "hover" over it since this
collision box is way too high. Lower it so that it's low enough
to look normal when walking on top of a boat
paramat [Sat, 21 May 2016 02:49:28 +0000 (03:49 +0100)]
Vessels: Improve code style