63 Commits

Author SHA1 Message Date
Aaron Suen
0d9556e0ff Don't crash on climbing unknown nodes 2022-12-11 00:34:19 -05:00
Aaron Suen
166cfe5f14 Mitigate excess server block sends
The problem was pointed out by Josh
(gitlab.com/krazy-j) in merge request !22.
Apparently MT is not very smart about marking
mapblocks dirty to send to clients based on
calling mt.set_node(), i.e. it will mark them
dirty presumptively even if you set the node to
the same value it had already been.

This behavior can be confirmed by registering
an ABM against a common node like grass and
setting action = minetest.set_node.  This
causes every mapblock containing that node
to be invalidated every interval, causing a big
spike in the packets received each interval
that you can clearly see on the F5 graph.

Rather than just fixing it for the most easily
observed case (fire checks), add utlity functions
to check this for ALL node change situations,
and apply it more or less universally anywhere
that we are not certain that the node is being
changed and we don't need to worry about the
extra overhead cost of the check.

Note that we don't need a
nodecore.set_loud_check call, as set_loud was
only ever being used already in cases where
we were pretty sure we were actually changing
a node.
2022-08-24 20:44:14 -04: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
430d8dc7c2 Another image optimization 2021-12-13 23:47:33 -05:00
Aaron Suen
f936121be9 Tweak firestarting weights
Make sparks bias "downward" for igniting nearby
materials, making starting a fire on top of thatch
more useful, and making thatch a more useful
tinder material.
2021-12-13 23:42:28 -05:00
Aaron Suen
7d12ea4acb Use textures for all particles
These cannot be overridden by texturepacks
otherwise.
2021-12-13 22:18:06 -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
19652c2fe1 Begin major rework of nodenames matching, autostart DNTs
- Unify logic for expanding nodenames/itemnames lists into indexes
  of matching names, and comparing item names/defs to lists,
  with group expansion and deferral.
- Add "autostart" option to DNTs which registers construction traps
  and a patrol ABM automatically, use for some things that are a
  good match.
- Note that some things are doing more complex logic in ABMs, such
  as determining if a node is eligible, or custom timing logic;
  leave these as-is for now.
2021-08-04 07:41:00 -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
10a29b067b Preserve all node meta in displacement
Don't just preserve the stack, but assume that
any node with any meta could be displaced.
2021-06-26 09:10:35 -04:00
Aaron Suen
dac2de09ac Fix crash on invalid displaced nodes? 2021-06-25 22:15:49 -04:00
Aaron Suen
0406c2f631 Prevent displacing true undiggables 2021-06-25 22:04:08 -04:00
Aaron Suen
373b2125b8 New emergency dig system
Once again, you can dig any node given enough
time and patience, but now you no longer receive
the resources from that node, and the node goes
into a "displaced" state where you can move past
it but it will re-place itself as soon as you walk
away, similar to how scaling nodes work.
2021-06-23 20:57:24 -04:00
Aaron Suen
b05180da02 Make scaling exempt from protection
...similar to how loose items are.
- They're emphemeral/air-like anyway
- Prevent exploiting protection areas to make traps to
  capture players or their items.
2021-03-23 22:24:53 -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
bf8841f963 Add horizontal movement to wall scaling
This allows players a little more scaling mobility
when scaling a wall, and especially the ability to
navigate around outside corners.
2021-03-04 19:07:25 -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
dc912f776c Make sure all things have explicit descriptions
This avoids issues with the translation informer
including technical names in the translation source
2020-10-18 11:50:04 -04: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
edea123a1e Start on new unified Hint API
- Move hint handling down to API layer
- Simplify stat data; old nc_stats counting can
  be moved out to a separate mod.  We only
  need whether the player has seen or not.
- Invert inventory tab responsibility.
- Merge witness system in from crafting.

TODO:
- Redistribute hint registration responsibility
  to individual mods.
- Test external mod compat.
- Retire old nc_stats and nc_guide systems.
- Add a way to reset hints.
2020-09-04 16:28:27 -04:00
Aaron Suen
94401942ee Protect doors, standardize protection 2020-07-01 00:30:40 -04:00
Aaron Suen
544b306660 Fix more protection mechanics
- Report violation on scaling
- Prevent optic rotation
2020-06-30 23:48:21 -04:00
Aaron Suen
e34ce24d74 Scaling node placement respects protection
Players can still product dynamic "touch"
lights in protected areas, but can't place
actual climbable scaling nodes.
2020-06-30 23:38:03 -04:00
Aaron Suen
3367ca1857 Fast optic path obstruction response
Optics keep track of path dependency info
used in calculating state.  When a node is
added/removed in the path via the mod API
(i.e. not schematics, vmanip, etc.) then the
nodes whose state decisions depended on
paths going through there are automatically
triggered for a recheck.

This should make things like furnace sand
auto-loaders respond snappily.

Granted, memory use with this approach is
a concern, but we will just have to monitor it
under normal usage patterns.
2020-06-19 10:01:25 -04:00
Aaron Suen
b8bf2322fa More work on DNTs
- DNTs can have default time value
- Automatic loop option
- Optional node name filter
- Use DNT for scaling particles
- A few tail call optimizations
2020-06-19 09:38:03 -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
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
a5752fd9b6 Yet another emergency lighting redo
- Players no longer constantly glow in darkness.
- Players can now place light spots by scaling, faster
  than actual climbing spots.
- Climbing spots appear if player continues placement
  after light appears.
- Floor traversal mechanism is now obsolete.

This allows players to traverse dark caves reasonably
well, still, but only voluntarily, so darkness stealth
mechanics are possible again.
2020-05-30 19:00:22 -04:00
Aaron Suen
a43c915710 Buff scaling glow by 50%
Lots of issues with players being unable to figure out traversal
of dark caves.  Total darkness is probably too much of an ostacle
for players who haven't already learned how to avoid those kind
of circumstances.
2020-05-12 07:14:35 -04:00
Aaron Suen
48473ea34c A little tighter "airlike" detection. 2020-03-29 20:05:11 -04:00
Aaron Suen
0012c2673b More scaling time definitions
Also, scaling_time completely overrides
group-based scaling time logic.
2020-03-29 08:13:41 -04:00
Aaron Suen
1c612ee1f7 Cobbley group, generic scaling factors by group 2020-03-29 08:05:13 -04:00
Aaron Suen
f37a918f0f Scaling and touch-hurt reforms
- Storeboxes are now scalable.
- Standardize touch-hurt operation.
- Touch-hurt damage on scaling.
- Now possible to alter scaling time via scaling_time
  group (percent of original scaling time)
2020-03-29 07:55:54 -04:00
Aaron Suen
3200149cc4 Buff torch and scaling light sources.
- Better compat with low gamma play.
- Torch now emits some light when in inventory, even
  if not actively wielded.
- Dynamic light API for mod use.
2020-02-22 21:57:08 -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
d0e6dcc410 Add "stasis" option and command.
This freezes many things that normally happen automatically
in the world, including most ABMs and AISMs, and a few other
custom step logic items like the player "hot potato" logic.

This can be used for "creative mode" purposes to setup a complex
build without it running itself away from you, and for texture
pack authors, to have time to see things that are normally
transient or difficult to observe because of the effects they have
on nearby things or players.
2020-01-10 06:26:07 -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
c7a90debcb Fix scaling and charcoal writing.
Making hand dig everything broke logic that was
depending on things being "not hand diggable".
Continue to treat things as not-hand-diggable if they
would take a long enough time to dig.
2019-12-29 13:57:49 -05:00
Aaron Suen
0fd31152ca Relax scaling requirements (e.g. trees).
Nodes cannot be scaled only if they are BOTH falling
nodes AND diggable by hand.  Mostly this just means
sand cannot be scaled and needs to be dug out
instead.
2019-11-30 09:13:07 -05:00
Aaron Suen
f48b103e58 Players can only see nearby scaling particles.
If watching someone else scaling a cliff from a distance, you will not
see where the handholds are, but if you are nearby, you will be able to
see and share them.
2019-11-10 10:42:23 -05:00
Aaron Suen
cd3300a72e Scaling hints. 2019-11-10 10:09:03 -05:00
Aaron Suen
a90d49404b More scaling refinements.
- Cannot do "floor feeling" if floor is already lit.
- No need for steady-state particles on "floor feeling" nodes.
2019-11-10 10:03:15 -05:00
Aaron Suen
52dcebc696 Fix up scaling node upgrading.
- Prevent downgrading.
  Should prevent player from falling when overhangers replaced.
- Allow hanging construction through other scaling nodes.
  Should prevent full overhangs from being blocked by wall scaling.
2019-11-10 09:40:15 -05:00
Aaron Suen
126039e3ed Scaling Generation 3.
- Repeat/hold place (right-click) with empty hand instead of pummel.
- Otherwise, works similarly to first generation.
- Scaling nodes can overwrite each other now (upgrade wall to ceiling).
- Visuals are now particle-based instead of texture, like Gen 2.
2019-11-10 09:33:40 -05:00
Aaron Suen
ac77b41af5 Revert "Scaling overhaul."
While this makes scaling a little easier to do, it still doesn't
fix the fundamental problem of scaling being distracting and too
easy to trigger accidentally.

The "pummel" version of scaling caused some confusion when one
player accidentally triggered it trying to figure out how to get
lode out of lode ore.  The current one triggers accidentally all
the time just from tabbing out of a game with it running (e.g. it
isn't paused in multiplayer) leaving the character staring at a
wall.  While such a player WOULD have opportunity to find
handholds in the wall, we aren't differentiating between a player
who's scrutinizing a surface from one staring off into space.

The scaling needs to be made harder to trigger accidentally, like
reinstating the need for an empty hand.  Using a right-click
action may also help distinguish it from pummelng recipes.

Removing this from the alpha branch so players don't get too
accustomed to this functionality and then have it change AGAIN.

This reverts commit 943604cf9588a316dce19e0a60a4219b52c4d905.
2019-10-24 20:16:37 -04:00
Aaron Suen
943604cf95 Scaling overhaul.
- Remove pummel recipes.  Now find handholds just by
  staring at a particular spot.  Being closer or better focused
  helps.
- Use only particles instead of a facedir node, so facedir
  isn't a problem when adjacent to multiple walls/ceilings.
- Automatically upgrade "wall" climbing to "overhang" climbing
  when a ceiling is present.
2019-10-22 01:31:09 -04:00