80 Commits

Author SHA1 Message Date
Aaron Suen
15936859c3 Persist stasis in modstore, not settings 2021-07-10 08:14:08 -04:00
Aaron Suen
4333c85d47 Fix ABM inversion with multiple candidates
This was apparently causing sand not to cook if it
had another sand node on top of it, because the
inverted cooking ABM would detect the top sand
node only and not process the cook check for the
lower one.
2021-05-28 14:47:32 -04:00
Aaron Suen
c227aa99f5 Fix ABM statistics 2021-03-25 18:28:54 -04:00
Aaron Suen
4b82eb6d56 Small DNT API cleanups
- Auto-remove deprecated DNTs
- Auto clear meta if no DNTs pending
- Remove redundant code
2021-03-24 06:51:07 -04:00
Aaron Suen
c1588a7656 Combined fair inverse ABM queueing 2021-03-23 21:00:25 -04:00
Aaron Suen
7fd51c1a6c ABM "inversion" API
This is useful when we want to perform an
action on a commonly-occuring node (like
sand or item stacks) with a requirement of
a neighbor of a less common node type (like
igniters).  Checking for B with A nearby can
be a lot faster than A with B nearby if B is
less common, so fewer neighbor checks
actually need to happen.

This was already done "manually" for the
flammable/igniter interaction, but now this is
a general API for all ABMs, that allows the
inversion to be done nearly transparently
with just a flag in the definition, and so the
ABM rules can be written more simply, with
the inversion handled elsewhere.

TODO: Rewrite current manual-inversions,
including the ones for flammable/igniter and
lava/stone hardening/softening.
2021-03-21 12:08:08 -04:00
Aaron Suen
abc5dc2cd2 ABM statistics reporting 2021-03-21 12:04:44 -04:00
Aaron Suen
319a3f7480 Fix dynamic lighting staying after torch goes out 2021-03-09 18:29:32 -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
51b5aa8b94 Playerstep microoptimization
Avoid calling get_player_name too much
2021-03-01 18:58:34 -05:00
Aaron Suen
32a5f30565 Merge in personal notes 2021-02-26 09:01:54 -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
6d39ebb77d Fix dynamic light DNT conversion 2020-09-09 10:15:48 -04:00
Aaron Suen
d95e7bb714 Disable timer-based light check for now 2020-09-09 10:00:13 -04:00
Aaron Suen
0a8583d4a5 Fix on_timer trap hook 2020-09-09 09:56:50 -04:00
Aaron Suen
d18eaf23fb Warn about missing mux for each node name 2020-09-07 23:23:20 -04:00
Aaron Suen
1e11f9d81e Remove compat hacks, bump min ver to 5.2+ 2020-07-14 08:20:46 -04:00
Aaron Suen
51def38621 Falling nodes honor stasis 2020-07-07 08:17:28 -04:00
Aaron Suen
478414385e Fix diagnostic for abm muxing 2020-07-02 00:10:16 -04:00
Aaron Suen
dafc220207 Allow DNTs to recheck
This should hopefully allow the "broken ziprune"
bug that happened on the Community server to
heal itself eventually if it happens again.
2020-07-01 22:17:49 -04:00
Aaron Suen
b5accf9d90 Allow force-resetting DNT timer 2020-06-28 17:15:32 -04:00
Aaron Suen
9b5db81149 Document DNTs 2020-06-28 17:05:53 -04:00
Aaron Suen
0eee06c8ea Officially retire the ABM laundering hack
Never saw any empirical evidence that this
helped one bit.
2020-06-27 21:01:23 -04:00
Aaron Suen
068937c482 Remove ABM laundering
See if this helps smooth out performance
issues in 5.3+.  It was never confirmed to
increase the number of ABMs we were able
to successfully process anyway.
2020-06-27 19:22:00 -04:00
Aaron Suen
085f700982 Fix ABM muxing, maybe?
Results so far are quite good: reduced ABM
total count from 82 to 36 (~60%) and got it
under the magic cache limit of 64.
2020-06-27 17:36:42 -04:00
Aaron Suen
88899be57b Experimental ABM Multiplexing
Detect ABMs that share the same "signature"
except for the central nodenames, and use a
single ABM to run them, looking up the core
bodies to run based on nodename on the Lua
side.  This could reduce the total number of
ABMs we're using by almost half, and
mitigate some of the performance issues
that MT continues to have with ABMs.
2020-06-27 16:37:47 -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
4b8d1b12e5 Fix a set_sky crash
We can't use push incremental changes to set_sky, we need to
push the whole sky definition each time.
2020-06-26 18:23:44 -04:00
Aaron Suen
0929d007ce Use nodecore.interval where appropriate
Fixes deprecated get_connected_players() at load time issue
2020-06-23 06:43:34 -04:00
Aaron Suen
79717b0d82 Remove failed profiler instrumenting 2020-06-22 23:19:14 -04:00
Aaron Suen
466805da48 Enroll skybox, fix some bugs 2020-06-22 23:17:01 -04:00
Aaron Suen
5648331c9f Replace all perplayer with playerstep 2020-06-22 22:47:33 -04:00
Aaron Suen
be452b4d52 Finish base playerstep API
Now all that's needed is converting existing
mods for proof of concept.
2020-06-22 21:14:40 -04:00
Aaron Suen
7ddca3e73a Start work on new player API...? 2020-06-21 15:32:18 -04:00
Aaron Suen
dd5e92266e Skip laundered ABMs on first tick
When unlaundered ABMs run, give the
laundered ABM pump a rest for 1 tick, to
ensure we don't run 2 batches worth of
ABMs on any 1 tick, to smooth things out.
2020-06-21 15:00:26 -04:00
Aaron Suen
ebcc7921e9 Smooth laundered ABMs across multiple ticks 2020-06-21 14:46:30 -04:00
Aaron Suen
3f262b5b35 Try reversing ABM stasis/launder nesting
Hopefully laundering the stasis check will
boost the number of mapblocks we can
process.
2020-06-21 11:15:01 -04:00
Aaron Suen
9c150a2054 Fix stasis
- Late-bind ABM registration alias so stasis
  wrapper is honored.
- Make DNTs wait in a loop until stasis is
  cleared.
- Make optics honor stasis.
2020-06-21 10:46:35 -04:00
Aaron Suen
41e744b0e9 Apply ABM laundering at base level 2020-06-21 10:25:07 -04:00
Aaron Suen
b70ea7d2c8 Disallow vanilla on_timer, Player API notes 2020-06-21 09:58:01 -04:00
Aaron Suen
3cc7ea83af Simplify AISM pre-check 2020-06-21 04:48:14 -04:00
Aaron Suen
ae08b74ee7 Microoptimize ABM laundering
Apparently table packing/unpacking is just a
little (like 10% maybe) more efficient than
closure-wrapping.
2020-06-21 01:24:10 -04:00
Aaron Suen
a4bf23e421 ABM Laundering: speed up to 4x
Instead of using 20% of CPU time to run
ABMs, defer 75% of them, so we are using
20% time to run 20% ABMs plus defer
a further 60%, giving us a total of roughly
80% CPU time for ABMs (not factoring in
overhead).

This should let us work around the engine's
hardcoded 20% ABM limit.
2020-06-21 00:48:30 -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
db2d748104 DNT API and reliable door ablation
- New Delayed Node Trigger API that allows
  the use of multiple externally-defined node
  timer events, as long as on_timer of a node
  is not explicitly overridden.
- Use the new DNT system to make door
  ablation reliable.
2020-06-18 22:35:47 -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
f509f9fba8 Change eye height when swimming
Suggested by oilboi to make the swimming eye
height match the model anim.   There is a bit of
jank switching between swimming and standing
height, but it doesn't seem to be too bad, and it
makes players have to actually break the
surface to breathe, and makes swimming a little
less bizarre in 3rd person view.
2020-06-16 21:14:11 -04:00
Aaron Suen
eb248aaf22 Removed register_limited_abm
- There was never any real proof that the
  limiting mechanism was necessary, and if it is,
  it may be better to use it sparingly.
- We suspect this may be complicit in some
  serious issues, such as door ablation failures.
- Despite 2 different revisions of the code,
  limited abms have never worked reliably.
- Instead of fixed count limits, either dynamic
  or time-based limits would be better.
2020-06-16 20:39:41 -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
6c640a11b1 Validate log message levels 2020-06-09 19:02:07 -04:00