176 Commits

Author SHA1 Message Date
Aaron Suen
e28584b881 Add subtle door indicators
It was always weird that the player character could
sense hinged panels even when the faces shown were
completely undifferentiated from their non-panel
counterparts.  Add a fairly subtle visual indicator that
makes it obvious why the player can spot them.

Players can still hide doors in plain sight, they may
just need to take more advantage of shadows and
other geometry tricks to ensure they don't stand out
against a field of similar nodes, or use psychological
tricks to distract other players from spotting the
patterns.
2022-05-01 19:46:25 -04:00
Aaron Suen
10a512d77b Remove debug code 2022-04-30 15:00:05 -04:00
Aaron Suen
f43433ce8a Make lava/water springs more common far from y=0
Spring density increases quadratically as distance
from y=0 of the bottom of the mapchunk increases,
up to a maximum of 4x at distance 256.
2022-04-30 14:54:28 -04:00
Aaron Suen
a2f81d9ee1 DNT auto-start refinements
- Regen with LBM too.
- Allow different delay time for "just loaded" case.
- Use DNT auto-start for more things, replacing
  regen ABM/LBM where possible.

Also tried to improve door ablation reliabiity:
- Use DNT autostart for door ablation.
- Faster DNT check so we don't need the ABM
  neighbor scan anymore.
- On early ablation trigger, set DNT for right after
  cooldown ends instead of letting DNT loop die,
  removing one scenario that could cause
  sponge squeezer stalls.
2022-02-10 22:08:58 -05:00
Aaron Suen
67d210cbf4 Rename "grassable" API to be less deceptive.
The grassable group means "grass can grow here"
but the API means "grass can grow under here"; make
the name clarify the difference.
2021-12-26 09:13:09 -05:00
Aaron Suen
a12e1b359a Fix wrong group in grass check
This allows mods (e.g. WC Naturae) to register stuff
that's suitable for grass growth but not usable for
cultivating other, more complex plant life.
2021-12-26 09:06:36 -05:00
Aaron Suen
31de8b0fde Add automatic unload testing for DNTs 2021-12-18 12:05:25 -05:00
Aaron Suen
a1b2df3941 Begin standardization of unload bounds check
- New near_unloaded API that supports custom
  distance parameter, map bounds check, and
  some optimizations.
- Add area automatic unload check support to ABM
  API and add to applicable ABMs, replacing many
  old manual checks.

Note that the explicit unload check is only strictly
necessary when something will happen due to
a node NOT being present in the area, e.g. something
igniting due to absent coolant, or soaking quantity
being reset due to missing sources.  In simple cases
where the absence of a thing causes the ABM to do
nothing, then the standard check can work because
the default action is to do nothing anyway.
2021-12-18 11:28:14 -05:00
Aaron Suen
2537bb7c27 Finish basic hint reform 2021-12-16 22:49:07 -05:00
Aaron Suen
1175aa0339 Fix missing back faces on flowing liquids 2021-12-15 21:36:20 -05:00
Aaron Suen
0e96a579b1 Fix leaching hints 2021-12-12 00:33:17 -05:00
Aaron Suen
c34bc39530 Soil leaching now requires raked soils
This is a design compromise to knock out the
worst offender in ABM cost, by requiring a node
that must be created by player action instead
of ubiquitous naturally-occuring nodes that all
need to be checked.

Leaching is really meant to be more of a minor
gameplay element anyway, for either skyblock
purposes, or for people who are bored enough
that they want to take on a challenge like a
neutral eco footprint; most normal players just
gather the materials from mapgen and hardly
bother with leaching recipes anyway.
2021-12-11 11:25:18 -05:00
Aaron Suen
ffadef37fc Fix misisng grass group 2021-12-07 00:41:29 -05:00
Aaron Suen
d99e8ca55c Dirt leaching ABM nano-optimization
Slightly accelerate the most common case, of dirt
not exposed to water at all.
2021-12-05 09:04:59 -05:00
Aaron Suen
8edd665b68 Revert "Make grass node undersides subtly distinguishable from dirt"
This reverts commit b1661c976e3a6420c3917a5322ee72e0dd9ddb6d.

This was done inconsistently and the problem extends to a number
of nodes, which should probably all be fixed at the same time.
2021-12-04 21:31:08 -05:00
Aaron Suen
b1661c976e Make grass node undersides subtly distinguishable from dirt
Add grass root texture to underside (and visible part of dirt
on sides) of grass node.  The difference in node sounds but same
visuals was always an inconsistency, and since touchtips became
looktips, players being able to distinguish grass from dirt from
the underside didn't make sense without an actual visual
difference.
2021-12-03 08:15:56 -05:00
Aaron Suen
a861cb7cba Wet things also suffocate grass
Wet or living sponges on top of grass will not allow
air in and will suffocate grass.
2021-12-02 18:39:34 -05:00
Aaron Suen
d2b157199e Document all groups in use by the game
Add a dump system to help detect new groups
that need to be documented.
2021-11-21 00:48:14 -05:00
Aaron Suen
47d0b68dba Unify dungeon API RNG
Avoid having to have each dungeon generation method manage its
own RNG, which should save a lot of time on RNG seeding.
2021-09-27 08:04:09 -04:00
Aaron Suen
7bf0507cfd Fix uninitialized dungeons below y=-80
This was caused by a missing biome definition at this depth,
causing stonework and loot not to populate.
2021-09-27 06:50:41 -04:00
Aaron Suen
b73d1d1290 Pre-clean-transparent filter on all textures
Some users may use filtering but not have the "clean transparent"
filter enabled in the Minetest engine config.  Bake this filter
into all images to (1) avoid the consequences of this (i.e. black
halos), and (2) possibly speed up startup time (the filter will
converge immediately).
2021-09-23 07:36:21 -04:00
Aaron Suen
92a9b2bed3 Allow artificial water sources to overwrite flows
Sponges can "time out" due to having been unloaded, and having
their check timer fire before an automated squeezer door timer
fires.  If this happens, the water needed to drain completely
before it could be re-squeezed, forcing a break in the water
flow.

This allows water sources to replace the water flows, so that
unbroken water sources will work even in load/unload boundary
conditions.
2021-09-17 07:17:51 -04:00
Aaron Suen
afeddfd8ee Add rudimentary river water support
This is demanded by the valleys mapgen,
and it's probably easier to give it some
support than justify disabling it.
2021-09-06 22:00:25 -04:00
Aaron Suen
4f3f613f4b Don't generate sand deep underground 2021-08-27 21:24:39 -04:00
Aaron Suen
5639ec773c Simplify early-game hints
Lock more things behind prerequisite hints, even if
they're not absolutely strictly necessary to complete
in that order, if they would commonly be done in
that order.  This reduces players being overwhelmed
by available hints very early in the game, and avoids
red herrings like "find lux" which can technically be
accomplished but yields no useful results until the
player can act on them.
2021-08-14 08:29:27 -04:00
Aaron Suen
5c92ac7984 Fix dirt leaching hint
Was called in wrong order so it was looking for
dirt there instead of sand
2021-08-06 22:59:16 -04:00
Aaron Suen
0e0a423e7e Make all liquids never exist as item stacks
Any liquids that are dropped should become
placed nodes.  It was observed before this that
wet concrete may have been displaced in such
a way that it created a stack node; this ensures
such things are precluded as much as possible.
2021-08-06 21:20:45 -04:00
Aaron Suen
6aafecf475 Optimize soaking check for dirt leaching
This was triggering on all dirt nodes everywhere, so optimize the
most common code path, i.e. one where there is no water above
and the soaking data must be reset.
2021-08-05 08:02:48 -04:00
Aaron Suen
135701f4f8 Remove soaking neighbor checks
These cause some issues, like the ability to soak
dirt under water for a short time to initialize the
soaking metadata, then remove the water flow,
then add it in and have leaching complete instantly
because the neighbor check prevented the soaking
ABM from firing to detect that the water was
removed.

In the course of investigating why ABMs are so slow
to begin with, it was discovered that having neighbor
checks can slow an ABM down by a factor of something
like 7x, so clearly the assumption that the neigbor check
being done in C++ as "efficient" was false.  This means
that we may be better off just always firing the ABM and
letting Lua check only a couple of relevant nodes (e.g.
for water flows in the space above) instead for
performance.

The main performance concern was dirt leaching, since
dirt generates naturally in the world in bulk, but if the
single check for water above may be faster than checking
all 26 neighbors in C++ anyway, we might as well let the
soaking API run for it so that it can detect the water having
been removed and reset the counters.
2021-07-10 11:23:09 -04:00
Aaron Suen
9fb4cf55b2 Deprecate register_limited_abm
This has just been an alias to minetest.register_abm
for a while now, and all ABM enhancement features
have been added directly to the core API.
2021-07-10 11:09:44 -04:00
Aaron Suen
96cc4d5d37 erge branch 'master' into dev 2021-07-02 09:28:53 -04:00
Aaron Suen
9b1cbdb3a2 Fix sponge squeezing not displacing glyphs
- Check for floodability, not just air equiv.
- Consolidate check responsibility into API.
2021-07-02 09:28:40 -04:00
Aaron Suen
ab96e29c6e Fix water/lava springs
- Fix stone detection so they actually generate
- Buff pumwater frequency 2x, to 1/4 water
- Try to enqueue liquids for flow transform as soon
  as the mapblocks are loaded
2021-06-30 21:42:35 -04:00
Aaron Suen
b62e5096e0 Add sedges 2021-06-29 20:27:25 -04:00
Aaron Suen
e6463eb259 Rush spreading and refinements 2021-06-28 21:05:31 -04:00
Aaron Suen
3dd945085e Remove the txp_* overlay image feature
- For inventory and wield images, this is already
  possible via override.txt since 5.3.
- For special tiles, this will be possible in 5.4.
- This complicates things, and introduces warning
  messages into mods built without awareness of
  this feaure.
- As far as I know, no texture packs have actually
  ever used this feature.
2021-04-11 10:42:27 -04:00
Aaron Suen
f91bc9d2a1 New general artificial water API
Now nodes other than sponges (i.e. downstream
mods) can create artificial temporary water sources
similar to sponge squeezing.

The API allows specifying a source node and position,
so the water will dissipate if the source node is
removed.  A min/max TTL can also be specified, so
like the sponge, it can require external triggering to
maintain the water flow as well as the presence of
the node.
2021-04-10 08:25:21 -04:00
Aaron Suen
a6308d8378 Don't pre-initialize stone strata arrays
The original theory was that preallocating the array forced lua
to use the "array part" of a table instead of the "hash part",
which should be faster since lookups are a simple linear offset
calculation and not a hash with collision check.

It turns out, however, that in empirical testing, whether the
array-preallocated or the naive-allocated version is faster depends
on circumstances, such as how sparse the array is, how uniform
access is, or how much other load the system is under.  This seems
to suggest that arrays are more computationally-efficient but less
cache-efficient, so cache evictions caused by other concurrent
processes may slow this method down significantly.

Worst-case performance will be the most noticeable here, since a
system that's heavily loaded would have the most need for speed
in the first place, so it's probably better generally to use the
naive allocation.

In all, the naive allocation method also seemed to be the least
sensitive to external factors.  In addition to the array method,
attempts to pre-compile the dynamic checks into a binary tree of
if/then statements (which could be JITted and optimized) failed
as well.
2021-04-07 07:44:13 -04:00
Aaron Suen
7e351e8a1c Try reintroducing dungeon LBM
It doesn't catch 100% of everything, but presumably
it catches at least some things, and has little
marginal cost on top of the ABM alone.

Players have been remarking about the fact that
dungeons sometimes initialize right before their
eyes.  LBMs SHOULD be able to fire outside of the
ABM active range, giving us a chance to catch these
a little earlier before the player is close enough to
notice...?
2021-03-31 20:04:20 -04:00
Aaron Suen
267450add4 Register a few obvious inversions
Ones that were not done manually before,
and can probably give us a noticeable
speed-up right now.
2021-03-21 12:08:55 -04:00
Aaron Suen
cbea186eab Remove dungeon cobble name
Simplify things for translations
2021-03-11 07:58:07 -05:00
Aaron Suen
95f0fb0ee9 Heaviest image compression option 2021-03-09 08:33:58 -05:00
Aaron Suen
410ebd5d8d Recompression using ECT
https://github.com/fhanau/Efficient-Compression-Tool
2021-03-09 08:16:23 -05:00
Aaron Suen
b89f2b7d86 Disable fast dungeon initialization methods
Apparently on top of dungeons regenerating
over top of themselves, caves can also carve
into dungeons, and this may cause issues
with dungeon loot, where the loot nodes are
removed (but w/o the destructor) so that
floating fake visinv entities are sometimes
left floating in place.

Instead, give the engine time to finish
initializing dungeons, and then use only the
ABM (sigh, it's always only ABMs that are
actually eventually reliable after all) to do
delayed initialization.

This kind of sucks if the player starts out in
a dungeon in a new map, but the old "fast"
methods weren't fast enough to prevent a
flash of uninitialized dungeon anyway, so we
just have to hope that the dungeons will get
initialized while on the map horizon before
the player gets close enough for it to matter.

Get rid of the different dungeon cobble now
to mitigate this, also since we no longer
need it to debug uninitialized dungeons.
2021-03-05 21:02:36 -05:00
Aaron Suen
4c39a6b51f Remove debugging chatter 2021-03-04 23:13:15 -05:00
Aaron Suen
5de517dbe9 New dungeon content API
Mods can now nodecore.register_dungeongen(def)
similar to how mapgen_shared works, except func is
run for each (pos, node) in dungeons.  This tries to
catch all dungeons as soon as possible, but some
nodes may experience arbitrary delays before
they're processed.  We hope this won't be a problem
in practice because dungeons should usually
generate on the periphery of view range and have
plenty of time to process before they arrive at the
player's current location.

This API could be used in theory to customize the
materials used in dungeons or add treasures.
2021-03-04 21:46:49 -05:00
Aaron Suen
be71e234d4 Some basic biome tweaks from WintersKnight
- Deeper dirt on land
- Reduce size of beaches
2021-03-02 21:36:01 -05:00
Aaron Suen
1b5df3c67c Grass check logic microoptimization 2021-03-02 21:09:24 -05:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
dabf8ac697 Fix node registration alpha for 5.4+ 2021-02-07 12:40:10 -05:00