134 Commits

Author SHA1 Message Date
Aaron Suen
e35b45c011 Fix getting "find lux" hint upon making a lantern 2023-10-28 15:37:00 -04:00
Lars Mueller
1c41f117c9 Fix texture modifiers relying on undocumented behavior 2023-05-27 19:24:25 +02:00
Aaron Suen
c1d165031c Don't drop unsoftened ores
Fixes inconsistencies with high-tier tools in custom mods
2023-04-22 19:39:49 -04: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
Giuseppe Bilotta
31223ddb00 Typo fix in group name 2022-03-13 23:24:17 +01:00
Aaron Suen
d9d33d1a4f Fix rad damage blocking
Instead of trying to skip everything (and not
updating stats), just set rate to 0.
2022-01-22 22:17:35 -05:00
Aaron Suen
46241b06d4 Invincible players also clear rad HUD 2022-01-22 14:52:11 -05:00
Aaron Suen
a75e2ca886 Make non-visible players not interact with luxrad
Also remove HUDs from things that don't affect
non-visible players.
2022-01-22 14:47:28 -05:00
Aaron Suen
860bf97905 Special case: reset rad rate when resetting level 2021-12-27 00:32:25 -05:00
Aaron Suen
09af14ced5 Add a "set" method for the health API 2021-12-27 00:31:14 -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
f5e966480b Fix delayed witness mis-ordering
Witness checks include data about the node in
place at the time that the witness even occurred,
so players are not awarded credit if the node they
see there was changed again afterwards.  A lot of
old witness code inserted the witness right
before the node was changed, since the node
change was done as a tail call, but this does not
work with delayed witnessing because the
delayed witness data would be tied to the old
node, not the replacement one.

Moving witness to after node setting should fix
a number of broken hints that should have been
delayed-witnessable, e.g. brick bonding.
2021-12-12 00:04:37 -05:00
Aaron Suen
502cafc852 Fix misnamed cherenkov ABM 2021-12-11 23:36:01 -05:00
Aaron Suen
34a2562964 Polyfill for player:get_velocity, clean up other hooks
This gets rid of the 5.4+ "deprecated get_player_velocity" warning
and modernizes the code to use get_velocity() everywhere, while
still remaining compatible with 5.3 for now (tested).  The polyfill
had to be on joinplayer because the nc_player_pickup auto-one-time
method of using after() won't reliably patch the player before some
other globalstep tries to read player velocity.

When MT 5.5 is released and 5.3 support ends, the polyfill just
needs to be removed to clean it up.

Also tidied up and consistentized the logging for other hooks.
2021-12-03 08:09:57 -05: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
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
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
40e8d23a16 Proof of concept sand-raking nodes 2021-07-02 15:40:52 -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
f633e86235 Make raw ores not silk-touchable
For one thing, it's a bit overpowered when you go
right from infused still digging lode ore as loose
cobble, right to boosted-infused digging it as raw
ore.

For another, uncobbled lux stone is purposefully
labeled as just plain stone to force the player to
pay attention to light cues, but this would make
inventory management problematic once smooth
lux stone has been collected with boosted tools.
2021-03-15 00:11:05 -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
dabf8ac697 Fix node registration alpha for 5.4+ 2021-02-07 12:40:10 -05:00
Aaron Suen
8e5428cedf Fix lux infusion
Tables containing lists of items to register AISMs
for are broken out into indexes at the time of
registration, so if we delay building the lists, we
need to delay registering the AISMs.  Luckily
AISMs can be registered later at runtime.
2021-01-03 08:56:47 -05:00
Aaron Suen
e1dc632779 New lux tool infusion API
- Split infusion logic from tool registration
  so tools aren't depending on sharing local
  tables with infusion logic.
- Use alternative_lux_* fields on tool item
  registrations to control how lux infusion and
  boost/unboost applies to tools.
- It should now be possible to register tools
  independently that can tap into lux infusion
  and boost features.
- It should now be possible to make tools
  boostable, unboostable, and infusable all
  independently, so they don't need to support
  all those actions, and they don't need to
  round-trip from e.g. a boost/unboost operation.
- We no longer depend on a naming convention
  for boost/unboost pairs (though in practice we
  follow it in the core game, but mods are not
  required to).
2020-12-28 20:54:57 -05:00
Aaron Suen
aae1ed78bb Support unboostable infused tools
Just make sure the boost/unboosted item is
actually registered before trying to overwrite
the stack.
2020-12-28 00:31:51 -05:00
Aaron Suen
bca338246c Tweak rad hud math again
Use an exponential scale for alpha intensity so
subtler shading gets narrower gradations
2020-09-28 23:07:43 -04:00
Aaron Suen
a346b5457f Reduce lag from continuous rad hud redraw
Round alpha channel to 16 levels, so we will have
cached all possible alpha values after not too long.
2020-09-27 22:49:34 -04:00
Aaron Suen
723d30897d Fix a couple more hints 2020-09-26 14:55:15 -04:00
Aaron Suen
7e2a4c0b0c Reintroduce radiation HUD 2020-09-14 09:36:59 -04:00
Aaron Suen
4ea87829b7 Another radiation nerf
When I was watching other people work on their
reactors, I was standing some distance off and
still got significant radiation damage after a
short time, even with the reactors subcritical.

Cut the radiation accumulation rate by 75% this
time, while buffing flux a little more relative to
solids.
2020-09-13 19:43:21 -04:00
Aaron Suen
6e939c5877 Nerf rad a bit more, still mainly off solids 2020-09-12 20:38:37 -04:00
Aaron Suen
367e0ec514 Fix rad damage immunity priv 2020-09-12 20:19:19 -04:00
Aaron Suen
4272204cb9 Nerf rads from tools and solids 2020-09-12 18:30:28 -04:00
Aaron Suen
8742b48fc8 New inventory radiation mechanics
Items in inventory can both emit radiation
and shield you from in-inventory radiation.
This process happens separately from
node-space radiation, though.
2020-09-12 16:43:00 -04:00
Aaron Suen
cb74ad204b Remove now-defuct HUD
Lux no longer has a "build-up" level, so
we have no good way to show the HUD
anymore anyway.
2020-09-12 16:31:53 -04:00
Aaron Suen
7ceb716473 Finished node rad emit/absorb
Lux things outside the player now
emit/absorb/scatter radiation, and can
also wash away radiation damage.

Remaining to do: player inventory
2020-09-12 16:27:15 -04:00
Aaron Suen
e6bd880528 Start work on redoing lux radiation logicUse a more direct, straightforward approach tolux radiation. Perhaps allow exposure to be morestochastic and less "smoothed". Offer more directand varied effects from sheilding.The end goal is to make radiation a significant force,but easily, and as intuitively as possible,manageable. 2020-09-12 12:10:18 -04:00
Aaron Suen
ae74e4f546 Complete basic hint audit of all mods 2020-09-11 17:20:21 -04:00
Aaron Suen
8624ee3a89 Fix lux rake durability issues 2020-09-08 21:23:03 -04:00
Aaron Suen
3915426d7b Add exclusive use for infused rake
Recalculate rake function based on update tool
capabilities so rakes can work on pumice now, and
theoretically even a future snappy=3 material.
2020-09-06 17:48:47 -04:00
Aaron Suen
6e9865487c Initial lux rakes
Operation on existing loose/snappy/crumbly stuff
is acceptable.  TBD is operation on pumice.
2020-09-06 17:25:03 -04:00
Aaron Suen
065bef313c Remove retired virtual item icons 2020-09-05 09:33:20 -04:00
Aaron Suen
94440b3912 Add a HUD for incident radiation 2020-09-05 09:32:02 -04:00
Aaron Suen
66d1a5fe34 Buff lux exposure rate even more 2020-09-05 09:16:39 -04:00
Aaron Suen
d35819b9af Merge branch 'dev' into luxbuff 2020-09-05 08:59:37 -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