60 Commits

Author SHA1 Message Date
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
Aaron Suen
89ac167d06 Slow down sponge death ABMs.
This should reduce the chance that sponges are
killed by a transient, like the absence of water caused
by digging sand out from under one.  It's still a bit
risky though.
2019-12-17 22:25:44 -05:00
Aaron Suen
b507e4c6f0 Buff sponge growth rate.
Sponges grow way too slow for the new cultivation
mechanics.  Extremely slow growth is no longer
necessary to prevent colony explosion due to the
introduction in gen2 of total colony size inhibition.
2019-12-17 22:15:18 -05:00
Aaron Suen
68bfa4dc70 Simplify sponge death to never eject stacks.
Sponges just always all die together instantly.
2019-12-17 22:13:29 -05:00
Aaron Suen
63c9a3f659 Initial living sponge gen3 overhaul.
- Sponge mod now depends on optics/glass.
- Living sponges die to wet sponges rapidly in air.
- Living sponges are preserved by water, or a
  water-tight container.
- Glass tanks with a watertight lid preserve sponges.
- Glass tanks inside a packed tote preserve sponges.
- Sponges have about a 2 second half-life in air.

The net effect is that capturing living sponges is no
longer a frustrating, probabilistic exercise, but now
transporting them involves significant technological and
problem-solving work.
2019-12-17 21:55:09 -05:00
Aaron Suen
6e1f3fee94 Standardize intra-line spacing in code. 2019-12-01 11:08:12 -05:00
Aaron Suen
b9e2f822f8 New flexible find_nodes_around api. 2019-11-30 10:28:35 -05:00
Aaron Suen
fdd881ae53 Active ItemStack Modifier overhaul.
AISM's now tick against stacks, including in piles, shelves,
and player inventories, (hopefully) efficiently compared to
the old way with separate ABMs.  Item entity support is also
possible, but not necessary yet.

This started out as a bugfix for being able to put a torch inside a
shelf, which didn't make much sense gameplay-wise.  It ended up
going quite a bit further.

- Aggregate now gets wet in stack form.  Swimming with dry
  concrete now has consequences.
- Lux reactions, radiation, and infusion should now behave more
  consistently.
- Sponges can now wet or dry in stack form, including inside
  containers.
- Torch ignition, quenching, and extinguishing is now more
  consistent regardless of context, and torches are now more
  dangerous, and can ignite things in more contexts.
2019-10-29 20:03:18 -04:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
b7f6d3c7cb Sponge mapgen spawning tweak.
Reinstate sponges spawning as mature colonies, and match mapgen
colonies to expected end-state of natural regrowth.  This should
make it harder to distinguish an "old growth" area where players
have been hanging around a long time from pristine sponges.
2019-09-23 21:46:23 -04:00
Aaron Suen
cc30c80069 Sponge cultivation overhaul.
- Inhibit sponge colony growth beyond a maximum size.  Players
  will have to prune colonies (or, smarter yet, split them) to
  grow more sponges.

- Allow sponge colony transplantation.  Sponges near the "core"
  of a colony (i.e. surrounded by more sponges) are more viable
  and more able to survive the player's crude harvesting.
2019-09-23 21:28:48 -04:00
Aaron Suen
7e75fd149a Quote consistency. 2019-09-14 09:49:06 -04:00
Aaron Suen
77d9f37408 Sponge drying sounds. 2019-09-13 22:35:30 -04:00
Aaron Suen
310ce1bc6c Treat NodeCore as a unified thing.
- Collapse all nodecore "core" mods in the /mods listing, so it's
  easier to find the actual add-on mods.
- Parameterize in-game branding to make renaming derivatives just
  a little easier.
2019-09-07 09:08:57 -04:00
Aaron Suen
39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -04:00
Aaron Suen
fe2c153f9e Clean up all lua code style.
Formatting rules based on Paul Kulchenko's perl-based formatter...
http://notebook.kulchenko.com/programming/lua-beautifier-in-55-lines-of-perl
...using a single tab for indent.

Mostly pure whitespace changes.
2019-08-27 19:14:51 -04:00
Aaron Suen
f4aa27299e New concrete mod provides access to smooth-stone.
Bash gravel down into ash to produce dry aggregate.

Dampen the aggregate to produce wet aggregate.  The ash chemically
reacts with gravel to produce a cement.

Let the wet aggregate dry and it will cure into smooth-stone.
It will tend to flow and wander if left uncontained though.
2019-08-23 22:45:08 -04:00
Aaron Suen
bba8edfc39 Lower sponge water TTL. 2019-08-23 21:42:48 -04:00
Aaron Suen
86ecd96cc9 One more tweak to sponge mechanic.
Water is now squeezed out, can be reabsorbed, BUT might disappear
before being reabsorbed anyway.  The original sponge can be
removed, though, and the water will just disappear on its own
after the timeout.
2019-08-23 21:39:54 -04:00
Aaron Suen
a2fa61b77f Alternative sponge mechanic.
When squeezing a wet sponge, it doesn't become dry, but must
remain wet and in place, and the water source it places lives only
a short time.
2019-08-23 21:36:11 -04:00
Aaron Suen
6141a6206e More sounds for sponge stuff. 2019-08-23 21:25:29 -04:00