80 Commits

Author SHA1 Message Date
Aaron Suen
9674a3cbe8 Fix "not pos" logic for sponge death in storeboxes
Presumably this had to do with tote survival
2023-06-04 21:19:14 -04:00
Aaron Suen
2a6deed2bd Fix sponge case survival inconsistency
Instead of hard-coding for the special glass case, check only open
faces of a storebox if the storebox_sealed group is set, otherwise
keep using the old logic of all directions.

A sponge will survive in a shelf or lode crate as long as no side
is exposed to air.  It will survive in glass cases as long as the
open top is not exposed to air; the sides are not checked.
2023-06-04 21:17:10 -04:00
Aaron Suen
7950f62fde Promote sponge survival check to public API
Allowing matching logic to be used in mods
2023-04-21 18:23:09 -04:00
Aaron Suen
d04cb85e23 Fix sponge over-growth bug
When growing a new sponge, always clear the
cumulative growth, don't allow a single sponge
to keep spawning more sponges ad infinitum
each time the ABM fires.
2022-12-14 23:31:39 -05:00
Aaron Suen
6b03f79561 Revert sponge death ABM timing
The checks may be a bit pricey, so we shouldn't
just blindly increase the net run rate.
2022-01-17 08:11:44 -05:00
Aaron Suen
fd6f0508ea Make sponge node death less arbitrary
Sponge nodes die if exposed to air for >= 2 seconds.  They
are still more fragile in item form.  This allows reliably
swapping a node used to seal in a living sponge without
instantly killing it, which used to be possible but risky,
depending on racing with the ABM timer.
2022-01-17 08:09:17 -05:00
Aaron Suen
17c3f1700f Area load check for AISMs 2021-12-18 12:10:58 -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
ae24ff0655 Lower some ABM costs 2021-12-11 12:14:42 -05:00
Aaron Suen
ad8bf99800 Reduce sponge colony growth load 2021-12-05 14:30:11 -05: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
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
9995d9bfc8 Add a use for dry sponges
Dry sponges act as air tanks while diving, but the effect is
limited by their tendency to soak up water from the environment.
2021-07-27 07:42:40 -04:00
Aaron Suen
87e6e72d76 Offline-soaking sponge growth 2021-07-11 20:28:05 -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
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
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
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
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
18b01c1ae7 Redistribute hints into each mod
Hints themselves have not been tided up
much, but this makes the project of fixing the
hints for each mod a little more manageable
and breaks up the hard-to-navigate single
monolithic hints file in the old guide mod.

The old guide mod has now been completely
retired.  Hints are now a full-fledged API-layer
standard feature.
2020-09-04 19:07:45 -04:00
Aaron Suen
2bf8c4ee3c Remove debug code 2020-06-30 19:15:15 -04:00
Aaron Suen
e86545f5e7 Texture modifier helper library
Useful for more complex transformations like assembling
animations or tiling.

Use in a couple places to try it out, esp. the new living
sponge animation.
2020-06-30 07:10:48 -04:00
Aaron Suen
55f5e9bb25 Slightly improved subtle sponge effect 2020-06-30 00:42:42 -04:00
Aaron Suen
280661fddc Subtle living sponge visual 2020-06-30 00:42:38 -04:00
Aaron Suen
b2f78c0daa Indexing for craft checks
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
2020-06-27 12:20:35 -04:00
Aaron Suen
42f125c716 Make most recipes indexable
Register a "rootmatch" property for all
recipes that represents a broader, quicker
test for recipe eligibility.  False positives are
allowed but false negatives are not.

Since most recipes are eligible, we can
use this to build an index for fast lookups
of subsets of recipes to run and skip most
of the other ones.
2020-06-27 11:06:43 -04:00
Aaron Suen
9879a23680 Mapgen determinism
This should cause maps that have the same
seeds to have much more similar results
than before, e.g. sponge deposits will be in
the same places determined by seed and not
random each regeneration of the map.

- Mapgen shared now provides an RNG which
  will be deterministic when feasible, for
  repeatable mapgen results.
- Make existing rng-using mapgen hooks use
  the new deterministic RNG.
- Mapgen shared hooks are also run in
  deterministic order too.
- Tidy up mapgen_shared API a little more.
2020-06-20 23:48:29 -04:00
Aaron Suen
a772e4e084 Fix ignores killing sponges. 2020-06-20 22:48:39 -04:00
Aaron Suen
984e87e155 Consistent ABM labeling
- Make sure every ABM has a label
- Use consistent case
- More concise names / consistent voice
2020-06-17 07:09:20 -04:00
Aaron Suen
6e751a5996 Make sound on sponge squeeze expire 2020-06-01 21:19:45 -04:00
Aaron Suen
533bdd0de8 Fix sponge squeeze expiration
Apparently we can't trust node meta to return
the same data to us that we just pushed in for
a few seconds, so check an in-memory cache
first and only use the meta for newly loaded
areas.
2020-06-01 21:00:22 -04:00
Aaron Suen
e5385bca3a Update all notes from Discord. 2020-05-29 09:20:40 -04:00
Aaron Suen
d33877fbc7 Fix sponge tote crash 2020-04-16 01:07:48 -04:00
Aaron Suen
920fba34ee Separate node stand/touch/radiant damage types
Don't reuse damage_per_second for damage on punch and radiant
damage.  This allows these to be defined separately, i.e. no longer
assuming that all damage is from "heat" and can radiate.  This
allows for things like thorny plants that hurt if you touch them
or stand in them but not if you stand near them.

Thanks to WintersKnight94 for reporting this.
2020-04-09 06:56:18 -04:00
Aaron Suen
35292eb259 Switch to an internal sound API
Avoid mangling official Minetest API
functions that mods may want to
use directly.
2020-04-05 21:22:51 -04:00
Aaron Suen
ba95b0989a Mapgen: lava and water springs.
Rarity values may need to be adjusted.
2020-03-21 09:05:53 -04:00
Aaron Suen
6db8d9fc26 Adjust things to work in twilight.
- Lenses no longer produce light from sun at all;
  artificial light is always needed.
- Grass and trees survive, don't do dual-time check.
- Breeze sounds work in twilight.
- Sponge drying only requires twilight, now also can
  happen under artificial light.
- Peat to grass happens under twilight.
2020-02-22 16:55:42 -05:00
Aaron Suen
c7a322941e Experimental new natural light system.
- No day/night cycle, no sun/moon.
- Get rid of clouds too.
- Skybox is now 100% texture-packable.
- Natural light diminishes with depth.

Night-time no longer disrupts gameplay topside, but
skylights are no longer useful to an infinite depth and
artificial light is necessary for all deep mining.
2020-02-22 10:38:03 -05:00
Aaron Suen
03223f72aa Fix sponges never drying in sunlight anymore. 2020-02-22 09:17:36 -05:00
Aaron Suen
2d73df30e7 New API to check if air passes thru node.
Can be used for things like sponge air exposure
or environmental exposure checks.
2020-01-18 09:57:39 -05:00
Aaron Suen
7bc1a4ddad Standardize node placement sounds.
Add node placement sounds to processes
missing them, like tree growth.
2020-01-16 22:02:59 -05:00
Aaron Suen
19de5dfd1e mapgen_shared improvements.
- Register def tables instead of bare funcs.
- Add labels for mod logic use.
- Automatically skip for singlenode mapgens,
  e.g. for the skyblock modpack.
2020-01-12 10:30:02 -05:00
Aaron Suen
4d47ab2e75 NC API dependency simplification.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.

This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order.  That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway.  If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
2020-01-05 12:59:12 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00
Aaron Suen
2106569e7b New sponge squeezing mechanics.- Squeezing a sponge creates flows of temporar water.- Re-squeezing the sponge maintains the water flows.- Since fluid is non-renewable, we no longer need to worry about checking for neighbors. 2019-12-25 11:55:47 -05:00
Aaron Suen
51d687e832 Tweak sponge intervals.
Sponges die more easily when in itemstack form,
for transport.  Make them a bit less likely to die
from air exposure when in node form, to reduce
the number dying from temporary air bubbles after
neighoring sponges have been harvested.
2019-12-19 20:15:12 -05:00
Aaron Suen
e4ba14a2a5 Don't allow living sponges to dry out directly.
They have to die first, so anything that keeps them
alive must also be keeping them wet.
2019-12-18 20:27:56 -05:00
Aaron Suen
e48722e731 Add a little color to living sponges.
Make them visually distinguishable, and allow
players to tell when their living sponges have died.
2019-12-18 20:21:54 -05:00