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
paramat [Sat, 21 May 2016 02:32:50 +0000 (03:32 +0100)]
Vessels: Make shelf open on 2 sides not impossible 4 sides
Make shelf facedir rotatable as is now required
Duane Robertson [Sat, 21 May 2016 13:45:55 +0000 (08:45 -0500)]
Doors: Fix uninitialized state variable
Thomas--S [Thu, 19 May 2016 18:43:46 +0000 (20:43 +0200)]
Vessels: Smaller/improved textures, remove duplicated 'inv' textures
Removed unnecessary inventory textures
The drinking glass inventory texture now differs from
the node texture to be more clearly a drinking glass
Smaller textures to reduce size as nodes
red-001 [Thu, 19 May 2016 18:40:13 +0000 (19:40 +0100)]
Creative: Reset 'start_i' to 1 when the inventory filter is changed
paramat [Tue, 17 May 2016 00:34:52 +0000 (01:34 +0100)]
Default: Remove unnecessary infotexts for chests and signs
paramat [Sun, 8 May 2016 21:26:18 +0000 (22:26 +0100)]
Tnt: Avoid divide-by-zero errors in calc_velocity()
tenplus1 [Sat, 7 May 2016 09:12:58 +0000 (10:12 +0100)]
Creative: Fix inventory crash after toggling creative mode in-game
tenplus1 [Fri, 6 May 2016 14:14:38 +0000 (15:14 +0100)]
Creative: Fix '-' glitch in playername
Fix the glitch when players use the '-' character in their username
on a server, causing creative inventory to not pass page 2
tenplus1 [Thu, 21 Apr 2016 20:25:51 +0000 (21:25 +0100)]
Creative: Add global variable creative.formspec_add
This pull adds a new global variable called creative.formspec_add
that will allow mods to add to the creative inventory screen
without the need to fork the mod altogether. Simple solution
that works already for inventory_plus' BACK button
paramat [Wed, 4 May 2016 23:22:57 +0000 (00:22 +0100)]
Stairs/default: Make sandstone(brick) groups consistent
Sandstone is crumbly = 1 cracky = 3 to be slowly diggable by hand
Sandstonebrick(stair/slab) is cracky = 2
Foz [Tue, 3 May 2016 02:36:29 +0000 (22:36 -0400)]
Tnt: Fix bug in dropped item counting
paramat [Sat, 30 Apr 2016 19:11:08 +0000 (20:11 +0100)]
Default: Lower grass_side and snow_side textures
Half coverage for a more grassy appearance
Make snow_side universal by removing green pixels
Move KevDoy's heart texture credit to above sound credits
rubenwardy [Sat, 2 Jan 2016 12:28:07 +0000 (12:28 +0000)]
Add give_initial_items API
Auke Kok [Wed, 27 Apr 2016 07:26:18 +0000 (00:26 -0700)]
TNT: Combine adjacent TNT into the explosion
This uses a vmanip to count adjacent tnt nodes and explodes them
all at once, using an inverse square law to recalculate the radius.
The maximum explosion becomes 125 nodes of tnt yielding a radius of
15 nodes, which does not break my machine and makes it return
in under a second.
This makes both bigger explosions and less stability issues.
The drop code has been simplified and now drops at all times a
reasonable amount of drops, never blanketing the area with drops,
even at the larges explosion level.
Particles are scaled up according to explosion size as well - a
bigger explosion will show bigger particles.
To scale the tnt:boom particle, we move it to the _effects() function.
Auke Kok [Thu, 28 Apr 2016 03:15:52 +0000 (20:15 -0700)]
TNT: Allow mods to override entity physics.
Introduces an `on_blast(luaobj, damage)` callback that mods can attach
to an entity def. The function will get called with the damage that
TNT would make.
The function should return three values:
bool do_damage, bool do_knockback, table drops
do_damage allows the mod to tell the TNT code to perform damage on
the entity for the mod. The mod code should not do anything with
the entity HP. The entity should not be immortal. If false, then
the entity will not be damaged by the TNT mod.
do_knockback allows the mod to tell the TNT mod to perform an
entity knockback effect. If false, no knockback effect is applied
to the entity.
the drops table is a list of items to drop. It may be nil. E.g. {
"wool:red" }.
I've documented both on_blast() API methods in game_api.txt. It is
a better place than lua_api.txt.
Auke Kok [Wed, 27 Apr 2016 06:08:00 +0000 (23:08 -0700)]
TNT: Fix multiple explosions erasing drops
Any second explosion near a first TNT explosion will punch all
entities found nearby, including item drops. This causes the
item pickup code to think the item was picked up, but by
a `nil` player, thus removing the item.
We query for the immortal entity group, and if the item is in
the immortal group, do not punch the item.
Foz [Sun, 24 Apr 2016 22:10:46 +0000 (18:10 -0400)]
Default: Add function 'node_sound_gravel_defaults()'
paramat [Mon, 11 Apr 2016 01:11:17 +0000 (02:11 +0100)]
Default: New grass and grass_side textures
Derived from Casimir's Voxelgarden texture
tenplus1 [Mon, 28 Mar 2016 19:14:35 +0000 (20:14 +0100)]
Beds: Quicker saves with tidy output
Tweaked the beds.save_spawns() function to compile list then output
to file with shortened co-ordinates containing 1 decimal place
Auke Kok [Tue, 26 Apr 2016 00:51:38 +0000 (17:51 -0700)]
TNT: make tnt:boom visual a particle, and larger
We reuse the tnt:boom texture for a particle that is added by the
on_construct() of tnt:boom, and has a short expiry time (0.2sec).
It is 3 nodes larged, centered on the explosion.
We then make tnt:boom airlike so it doesn't have a texture, and it's
the thing that emits lots of light (we could even make it exist a
bit longer).
The nice thing about particles is that the client is less susceptible
to lag and will always remove them as fast as possible, so this makes
the visual more constant and responsive.
Auke Kok [Sat, 23 Apr 2016 05:24:19 +0000 (22:24 -0700)]
TNT: lower smoke particle count and speed.
The effect is similar, and the reduction in particles is a small
boost in responsiveness.
To compensate, I've lowered the spawner time and expiration length
as well.
Auke Kok [Mon, 18 Apr 2016 04:04:50 +0000 (21:04 -0700)]
TNT: self-start boom removal timer.
Auke Kok [Mon, 18 Apr 2016 03:52:45 +0000 (20:52 -0700)]
TNT: make tnt:burning a falling node.
This allows TNT to be used for e.g. traps (drop it from the
ceiling) or weird tnt effects with other explosions.
Auke Kok [Sat, 16 Apr 2016 19:13:13 +0000 (12:13 -0700)]
TNT: randomly vary ejecting velocity
We add a +/- 0.5 random value to the velocity vector of
ejecting nodes.
I've spotted a lot of nodes going exactly straight up if blowing
up sand above TNT. The extra variation looks less artificial.
Auke Kok [Sat, 16 Apr 2016 19:00:17 +0000 (12:00 -0700)]
TNT: Damage mobs, knock back players
We apply punch damage to mobs caught in the blast radius, as
this code previously only hurt players.
We "move" players back 1 node if they're caught in the blast, and
slightly up. We can't "eject" players due to missing API code to
support that, unfortunately.
Auke Kok [Sat, 16 Apr 2016 17:22:37 +0000 (10:22 -0700)]
TNT: Whitespace cleanup
Auke Kok [Sat, 16 Apr 2016 02:21:45 +0000 (19:21 -0700)]
TNT: Add on_blast to all nodes with an inventory
Adds a minor helper function that allows efficient retrieval of
several inventories from a node inventory. We use this helper to
quickly retrieve the items in chests, vessel shelves, book shelves
and furnaces, and return these with the nodes itself to the TNT caller.
The TNT caller then performs the entity physics, and we don't need
to do anything else.
We disable TNT doing anything with bones.
We expose a bug in the code that drops the items - metadata was lost
entirely. This patch corrects that by properly copying the metadata
and creating the drops list inclusive metadata.
paramat [Fri, 22 Apr 2016 15:20:47 +0000 (16:20 +0100)]
Farming: Add quiet sounds to seeds
kilbith [Thu, 21 Apr 2016 10:38:44 +0000 (12:38 +0200)]
Flowers: Fix waterlily node's duplication with stack of 1
KevDoy [Tue, 12 Apr 2016 06:52:56 +0000 (23:52 -0700)]
Default: New heart texture
Similar to before, add symmetry and slightly more rounded off
paramat [Wed, 6 Apr 2016 18:43:54 +0000 (19:43 +0100)]
Fire: Higher chance of removing flammable nodes
Flammable nodes burn away quicker
paramat [Sat, 16 Apr 2016 21:33:08 +0000 (22:33 +0100)]
Flowers: Make flower spread a public function to enable override
Remove search for 'group:flora_block'
Enable flora spread on 'dirt with dry grass'
Auke Kok [Sat, 16 Apr 2016 03:55:56 +0000 (20:55 -0700)]
Doors: Use LBM instead of ABM to convert doors.
This works much more efficiently to replace old style doors.
paramat [Sat, 16 Apr 2016 20:53:03 +0000 (21:53 +0100)]
Default: Create 'grass', 'dry_grass' groups, use in dirt conversion ABM
Auke Kok [Sat, 16 Apr 2016 20:42:48 +0000 (13:42 -0700)]
Character: Fix boat leg wobble.
There was a small leg wobble in the sitting animation (visible
when sitting on the boat). This removes it.
paramat [Fri, 15 Apr 2016 09:43:10 +0000 (10:43 +0100)]
Boats: Increase maximum velocity to 5n/s
tenplus1 [Sun, 3 Apr 2016 15:31:19 +0000 (16:31 +0100)]
Flowers: Tweak flower and mushroom spreading
Tidy up position numbers and code
Check for flora group aswell
Improve node light check for mushroom growth
Shrooms grow in 3 and below light
Auke Kok [Fri, 1 Apr 2016 04:58:59 +0000 (21:58 -0700)]
Change how dirt turns to dirt_with_(something)
This changes how dirt blocks turn to dirt_with -grass, -dry_grass
or -snow.
Previously, dirt that was sunlit would turn to dirt_with_grass no
matter what, but this happened without any context, so you could
get green patches of dirt_with_grass in the middle of a savannah or
even desert.
Dirt no longer turns to covered dirt unless it's within 1 node from
another dirt_with_grass or dirt_with_dry_grass or dirt_with_snow.
This makes dirt_with_grass "growback" a lot slower, since it now only
happens on the edges, but it retains the context nicely now.
If there is any dirt with a grass or dry grass plant, or snow on top,
and enough light, we'll convert it sporadically to dirt_with_grass
or dirt_with_dry_grass or dirt_with_snow.
This allows us to plant grass of our choice in a large dirt patch,
or in a region where otherwise that type of grass is not present.
This used to be done by 2 abms, but I've combined them in to a single
ABM that is ordered to run with maximum efficiency, solving for the
most common outcome first before attempting more complex checks.
Auke Kok [Mon, 4 Apr 2016 02:52:27 +0000 (19:52 -0700)]
Remove "grass under snow" from default:dirt_with_snow in darkness.
This is technically "dirt with grass" that's just under a snow
cover, so in darkness the grass on these nodes will also die,
turning it into dirt.
This doesn't convert dirt_with_snow under snow.
Auke Kok [Thu, 31 Mar 2016 23:07:15 +0000 (16:07 -0700)]
Call nodeupdate on the entire blast zone
This will make sand and gravel blocks on top of TNT actually fly
in the air.
https://youtu.be/4omndVZijLc
Auke Kok [Wed, 30 Mar 2016 06:09:47 +0000 (23:09 -0700)]
Limit entity speed to 250m/s.
Let's just call it "terminal" velocity.
Auke Kok [Tue, 29 Mar 2016 14:39:46 +0000 (07:39 -0700)]
TNT: Move timer start to on_create() for burning nodes.
We add on_create() handlers for both burning TNT and burning
gunpowder. Because gunpowder will explode TNT in 1 second,
and not 4, we need to modify the 4 second timer after we
make the TNT burning. Other mods can now place burning TNT
that will by default explode after 4 seconds.
Auke Kok [Tue, 29 Mar 2016 01:20:14 +0000 (18:20 -0700)]
TNT: Fix up nil derefs
I spotted two places where under stress (many explosions) luajit would
end up passing nil to these functions. I'm not entirely sure how,
but it seems good form to guard against it, which does make it
more robust. After this patch, I'm not able to crash the server. With
many explosions, it may still lag significantly, but always returns
in the end.
Auke Kok [Sun, 27 Mar 2016 17:51:55 +0000 (10:51 -0700)]
Fix API docs after various changes.
red-001 [Wed, 23 Mar 2016 11:01:59 +0000 (11:01 +0000)]
Restructure code to only check `def` once.
Auke Kok [Wed, 23 Mar 2016 05:05:34 +0000 (22:05 -0700)]
Calculate blast intensity at all locations.
We define the blast intensity as the square of the tnt_radius, divided
by the square of the distance to the explosion center, where distance
is limited to 1 at the lower end.
When destroying nodes, we calculate the intensity for each node, and
only destroy the nodes when the intensity is 1.0 or larger. To avoid
perfectly spherical explosions, we make sure to retain a randomness
factor of 20%. This will make explosion edges jagged and not smooth,
but not too much.
We pass the calculated intensity to on_blast() functions as well,
except we take the jitter here out and make sure it's always 1.0
or larger.
Auke Kok [Wed, 23 Mar 2016 04:25:44 +0000 (21:25 -0700)]
TNT: Limit amount of stacks ejected.
We apply a log scale to the size of the stacks ejected, so that
in larger explosions we are getting larger stacks. For normal r=3
explosions, this gives stack sizes ~6-7 or so, but for r=10 explosions
it could end up giving stacks of 25+.V
Auke Kok [Sat, 19 Mar 2016 06:31:10 +0000 (23:31 -0700)]
TNT: Chain reaction
With the new high res timer, we can make TNT much better create chain
reactions. This does exactly that.
Auke Kok [Sat, 19 Mar 2016 06:07:15 +0000 (23:07 -0700)]
TNT particles: use drops list smartly
The drops list already has quantities, so let's just select the one
with the highest quantity from it, and use that as tile. Fallback
tile will therefore only be used if explosion happens in air. Oh well.
Auke Kok [Sun, 13 Mar 2016 06:48:52 +0000 (22:48 -0800)]
TNT: Spacing / codestyle fixes
- Fix spacing errors around = and ..
- Indentation fixes
- Break up long lines
red-001 [Sun, 31 Jan 2016 19:42:07 +0000 (19:42 +0000)]
Make TNT faster by using `VoxelManip()` for removing nodes.
red-001 [Wed, 27 Jan 2016 16:33:32 +0000 (16:33 +0000)]
Fix TNT mod calculate blast intensity.
Currently the TNT mod uses a dummy vaule of 1 for this.
red-001 [Fri, 1 Jan 2016 22:49:32 +0000 (22:49 +0000)]
Add TNT API.
Auke Kok [Mon, 25 Jan 2016 07:48:38 +0000 (23:48 -0800)]
TNT: add some depth to the explosion effect
We add a dirt-like particle (drawn from scratch, uses some
colors from default_dirt's palette) to spawn many particles
that have collision enabled around the center of the blast.
This has the effect of obscuring the center of the blast, as
that is a painfully visible empty area when the explosion happens,
as there's only a little spark.
The dirt particles bounce around the walls and floor a bit,
and disappear rapidly, well before the smoke particles disappear.
This is a nice visual distraction that obscures the sudden
appearance of the gaping hole, and makes it a whole lot more
believable.
Auke Kok [Mon, 25 Jan 2016 07:27:50 +0000 (23:27 -0800)]
Make TNT a bit more fun.
But not too much.
TNT is a bit underwhelming at the moment. We can make it a bit
more interesting by ejecting not just one or two itemstacks,
but a bunch of them. This code splits up the drops into
separate itemstacks that are 2-5 items together, which
results in generally roughly 10 itemstacks being ejected.
Since now we have multiple ejecta, it makes sense to tune
the ejecta velocities a bit better to get the appearance of
an actual explosion better. The items will not all start
with the same vertical velocity, since that would look
like fireworks. Instead we give them all a different vertical
speed.
Auke Kok [Tue, 26 Jan 2016 06:27:15 +0000 (22:27 -0800)]
Allow the on_blast API to pass an itemstack.
If the node is special and has an on_blast() handler, we need
to call it instead of getting node drops manually. However, we
do want to know if drops should be added for the special nodes,
so we modify the on_blast() handler code to allow the nodedef
handlers to pass back itemstacks. This could be used by e.g.
the doors mod to drop door items after a blast.
Since this API is documented in lua_api.txt, a separate PR will
be incoming to update the on_blast() documentation.