147 Commits

Author SHA1 Message Date
Aaron Suen
c020726ae6 Fix lens flicker
Lenses won't transition directly from active to
shining, which only happens in flicker scenarios
2021-02-27 08:05:53 -05:00
Aaron Suen
d4fdf8c6e8 Fix items unplaceable due to stack/touch-hurt 2020-09-26 15:03:22 -04:00
Aaron Suen
1632b6352a Revert "Appease 5.4-dev texture_alpha warnings"
This reverts commit 253c2282917ecade5b8356d592edab40b1d517f5.

Apparently this warning is full of crap.  Explicitly
setting use_texture_alpha in the node def does
something DIFFERENT than what the engine says
it's doing enabling it internally.  use_texture_alpha
enables alpha BLENDING, which is what we
don't want with interpolation filters, whereas
leaving it off enables alpha THRESHOLDING which
is exactly what we want.
2020-09-05 23:46:44 -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
6cd356c191 Remove explicit node non-diggability
This opens up the possibility of mods adding
tools that CAN dig some of these more exotic
things.
2020-09-02 08:21:46 -04:00
Aaron Suen
253c228291 Appease 5.4-dev texture_alpha warnings
Apparently we will be required to enable
use_texture_alpha explicitly for anything using
any level of transparency, not just alpha
blending, in some future version.
2020-08-31 23:36:35 -04:00
Aaron Suen
78d321c24f Support explicit TP overrides for special_tiles
Hughes Ross has started to work on a PR for this
(https://github.com/minetest/minetest/pull/10140)
but it doesn't look like it will be ready until 5.4 at
least, and we will support pre-5.4 versions for
some time yet.  The ability for TP artists to
override special_tiles is necessary to allow things
like flowing liquid textures to be customized in
texture packs.

Add a hack for these, similar to how we did the
inventory/wield image hacks.

Note that we are also forcing overrides for special
tiles, since there may be cases where we reuse a
base image without modifiers but TP artists may
still want an independent override.
2020-07-04 19:25:37 -04:00
Aaron Suen
3e3260f789 Back out optic "virtualization"
Apparently this interacts badly with
optomechanics when multiple optic
tick cycles are running on a single
globalstep, since it may cause doors to
miss signals if they quiesce back to
off during the step.
2020-07-03 22:12:10 -04:00
Aaron Suen
dc1fc75321 Log warning on optic limiter 2020-07-03 09:56:38 -04:00
Aaron Suen
efa43e972d Change optic limit to CPU time-based
Instead of limiting the number of cycles
to some arbitrary upper bound, run as
many cycles as necessary up to a CPU
time limit, i.e. we only allow expansion
of globalstep time by a fixed limit.
2020-07-03 09:32:46 -04:00
Aaron Suen
12302342dc Backout hashed value caching
At only 50% hit ratio, it's probably
costing as much to cache as to recalc,
and this simplifies the code better.
2020-07-03 09:26:26 -04:00
Aaron Suen
f27378ca12 Optic "virtualization"
If we're running multiple optic ticks in
rapid succession, then we don't return
control to the rest of the game between
ticks, so there's no point in reading the
map more than once per pos, and no
point in updating the map until the end
when optics may have oscillated
across multiple states.

Maintain a cache and commit buffer
during each globalstep and only flush
them at the end.
2020-07-03 09:23:19 -04:00
Aaron Suen
ed57861fcc Better param naming 2020-07-03 08:38:15 -04:00
Aaron Suen
d6426e9a9f Remove redundant dependency logic 2020-07-03 08:37:09 -04:00
Aaron Suen
32902d5554 Un-hard-code optic config parameters 2020-07-03 08:31:03 -04:00
Aaron Suen
0675d943ad Make lenses sense input immediately 2020-07-03 08:24:09 -04:00
Aaron Suen
fe1a5e38b7 Microoptimization consistency
Carry the node pre-indexing a little further to
cover the scan case as well.
2020-07-01 21:40:32 -04:00
Aaron Suen
9203734e5a Optics overhaul: eliminate node meta
Apparently as oilboi pointed out, node metadata
is kinda gross, and in this case we didn't actually
need it, since the information could actually
always have been inferred from the nodes
themselves.

Instead of storing output state in node meta,
just register a callback on the node definition to
interrogate the node itself about its power output.
2020-07-01 21:35:23 -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
e7bd68a24b Reduce optic tick speed to 12Hz
This is the GCF between 60Hz and 144Hz
displays, so ideally a beefy enough
machine should be able to run optics
smoothly either way.
2020-06-24 08:16:51 -04:00
Aaron Suen
ec86f0f130 Reawaken optic circuits more reliably on load 2020-06-24 08:11:44 -04:00
Aaron Suen
2ea41b27ea Allow optic ticks to "slip" under load
If the server can't handle optics, it would lead to a
runaway effect and bring the system down.  Instead
only process up to half a second worth of optics on
each tick, so that this effect is capped and the server
will at least be able to chug along.
2020-06-24 08:03:42 -04:00
Aaron Suen
7b44fb2b29 Make optic systems tick at a consistent Hz 2020-06-24 07:45:20 -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
f6eedea1a1 Fix infinite sand exploit 2020-06-20 22:03:46 -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
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
aba8b27bb1 Reduce light source of non-shining optics
Minimize the impact of oscillating optics on
mapblock lighting recalcs, as the start of an
effort to prevent light loop strobe issues.
2020-06-15 22:36:56 -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
7a542abefe Fix float glass sunlight propagation 2020-06-06 21:39:26 -04:00
Aaron Suen
389ab23495 Never silk-touch prisms/lenses
They should always revert to unpowered when dug
2020-05-31 09:25:03 -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
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
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
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
e0d15dcd4b Simplify lens sensitivity.
Lenses work from sunlight up to roughly y = -10.

You can now have unlimited optic power from the sun,
but conducting it all the way down from the surface is
more of a pain than having a loop at depth.
2020-02-22 10:44:40 -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
bc7987f9c4 Set drowning damage the correct way. 2020-02-19 21:30:45 -05:00
Aaron Suen
bcbe77644e Buff drowning damage, nerf some node damage. 2020-02-19 19:55:22 -05:00
Aaron Suen
484c1a337f More subdued look for molten glass, image opt. 2020-02-18 20:10:08 -05:00
Aaron Suen
2ac5403149 The last few texture tweaks. 2020-02-18 19:57:30 -05:00
Aaron Suen
6a89bb5415 Compromise grass, and some more lode textures. 2020-02-18 19:02:52 -05:00
Aaron Suen
b141da2cb0 Tidy up hints, small issues. 2020-02-05 07:34:28 -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
053f3b718f Fix glass tank hammering properly.
First class recipe, explcitly test for contents.
2020-01-17 23:45:00 -05:00
Aaron Suen
750bb87b31 Disallow hammering glass tanks.
Hammering them to sand destroys their contents.
Instead, require burning away the binding.
2020-01-17 22:14:10 -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