51 Commits

Author SHA1 Message Date
Aaron Suen
ce2b2ddfd3 Fix glued lens activation 2022-01-09 13:28:45 -05:00
Aaron Suen
d37e9e9ace Genericize lens beam emitters
Look for optic_lens_emit group instead of explicit
lens_on node, to support multiple lens beam emitting
nodes (e.g. glued/unglued) for firestarting, door
ablation, etc.
2022-01-09 13:07:16 -05:00
Aaron Suen
85c96c8094 Glue optics in place with an eggcorn
This makes it possible to lock optics against
accidental rotation, which has been a problem.
2022-01-09 12:52:54 -05:00
Aaron Suen
7f5155f91d Glowing lens slow-start
Lenses enter a "glowing" state to propagate signal
immediately as before, but now they don't actually
produce light until powered steadily for 2 seconds.

This should mitigate the risk of "strobe" circuits that
cause excess lighting recalculations and irritate some
sensitive players.
2021-12-03 23:04:58 -05: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
54a18a6097 Make lenses a bit more sensitive to activation
Specifically, molten glass should now trigger them
(intended) as well as 1 more tier of lux (probably
not important).
2021-06-22 00:50:22 -04:00
Aaron Suen
275714df02 Rework optic domain wall particles
The old system effectively cached cross-block
boundary information forever and never expired
them, even if the node creating them was
removed (that would have been easy to fix) or
an obstacle placed in the path (that would have
been difficult to fix with the old method).

Instead just do the simplest thing and split this
into a separate loop, and run a 2-second DNT with
a separate forward-trace from all active optic
nodes.

Doing a second forward trace for each node output
may not be as efficient but ultimately we create more
problems than we solve when we try to be too clever.
2021-03-24 06:55:30 -04:00
Aaron Suen
c3519ca37c Fix backface culling on most mesh nodes 2021-03-15 19:17:25 -04:00
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
ed57861fcc Better param naming 2020-07-03 08:38:15 -04:00
Aaron Suen
0675d943ad Make lenses sense input immediately 2020-07-03 08:24:09 -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
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
389ab23495 Never silk-touch prisms/lenses
They should always revert to unpowered when dug
2020-05-31 09:25:03 -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
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
70fcb225ed Fix sand duplication bug.
This was probably a regression caused by making lenses silica
group, and then forgetting why the silica_lens group existed.
2019-12-18 07:41:01 -05:00
Aaron Suen
05aeb6dfaa Stop lenses z-fighting with water. 2019-12-04 19:35:35 -05:00
Aaron Suen
74b8a5cee0 Reverse lens active/shining bias.
Prefer shining state when fed from below even if given
sunlight above.  This should make open-air circuits
easier to build and less likely to act up under sunlight.
2019-12-04 00:17:07 -05:00
Aaron Suen
a03d13f9fc Larger, more consistent lens selection box. 2019-12-03 23:56:59 -05:00
Aaron Suen
09dd5de920 Tone down "active" glow a bit. 2019-11-30 19:50:19 -05:00
Aaron Suen
62f26784e4 More lens state distinctive textures.
Make all optics distinguishable at nearly any angle.
2019-11-30 19:37:43 -05:00
Aaron Suen
525a6f7c0f Make optics look distinct by state.
New brighter/bolder port textures make it easier to
distinguish active vs. inactive optics from a distance.
2019-11-30 18:44:51 -05:00
Aaron Suen
a5d5f381e5 Fix UV mapping for lens model. 2019-11-30 17:44:28 -05:00
Aaron Suen
7af74ee5d6 Redo lens as a mesh node.
This should cut triangle count by almost 75% and
improve framerates in complex optic scenes.
2019-11-30 16:40:07 -05:00
Aaron Suen
9beebc3498 Conservation of mass for burning stacks. 2019-11-28 11:18:03 -05:00
Aaron Suen
45c31cd203 Lenses can still burn transparent things.
The sunlight_propagates flag indicates that a node
can MOSTLY transmit light, like wooden frames, items,
or torches, but there are no purely transparent things
that are flammable, and all existing flammable things
are at least opaque at their centers, where lens light
would focus.
2019-11-28 11:03:45 -05:00
Aaron Suen
a208893e07 Fix biactive lens instability.
When lenses face one another and are each fed light to
become active, they now prefer the active state over the
shining state.

Interestingly, inline vs. angled configurations have different
numbers of stable configurations...
2019-11-23 08:52:12 -05:00
Aaron Suen
08437adb04 Tweak lens collisionbox to prevent tunneling. 2019-11-02 23:32:26 -04:00
Aaron Suen
5c37e4351d Merge branch 'dev' into writing 2019-10-01 20:05:31 -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
1b9b20c80b Initial proof-of-concept writing system.
It's barely usable/playable.

I'm not happy with how disjoint it is from the existing crafting
system, for little gain; there's a lot of on_nodepunch logic that
was added for this.

It also doesn't play very well.  Major issues:
- Awkward collision with existing logic, e.g. taking things from
  shelves, then drawing on side of shelf.  Probably need a group
  specifically for writable sufaces.
- Single action to rotate through all glyphs is bad.  Probably
  want one to change through the 8 shapes, and another to change
  rotation/reflection.
- Erasure is awkward, inconsistent, and not necessarily reliable.
  Should make it possible to recover charcoal in most cases, and
  use a unified set of hooks for it...

Should glyphs be pointable and run logic directly on node, or
should we keep it point-through...?
2019-04-01 19:15:01 -04:00
Aaron Suen
fbff15e2fe MAJOR fire api/logic rework.
- Expanded fire api, added "check" varieties of things that also
  perform relevant checks for eligibility.  Standardized testing
  for ventilation.
- Snuff embers to coals as fuel.
- Fuel is consumed randomly by flames.  This means that fuel that
  are surrounded by flame burn out quicker, while flames
  surrounded by fuel consume fuel from each node slower.  This
  adds subtlety to furnace design for efficiency.
2019-03-31 20:54:38 -04:00
Aaron Suen
85f87d1c17 Simplify some selectionboxes significantly. 2019-03-30 21:23:02 -04:00
Aaron Suen
fb63ad0a82 Fix some optics unloaded-area crashes. 2019-03-24 23:15:25 -04:00
Aaron Suen
a2e68a3e71 Glass sounds. 2019-03-14 20:13:37 -04:00
Aaron Suen
9607bcc6a6 Start working on sounds, plus minor refinements.
- Clean up registered_* usage patterns.
- Reduce tendancy of leaves to create stack nodes.
  Now they tend to stack up properly in-world more often.
- Tweak damage system to create "headroom" where minor
  damage doesn't cost inv slots immediately.
- Make player hand skin color match model skin.
- Cleanup/unify grass abm logic.
- Start installing new sounds by MagikEh

Sound source:
  https://github.com/MagikEh/SoundsOfWarr
2019-03-13 23:51:59 -04:00
Aaron Suen
8053bbc21c Transactional stability for optics.
- Make lens not flicker with light level dithering by using
  histerisis in threshold.
- Optical nodes always read the past world snapshot for creating
  the next snapshot, so there are no accidental fast paths
  through optical logic leading to glitches (hopefully).
2019-03-12 20:22:42 -04:00
Aaron Suen
0f0377da52 Make lens/prism light pass thru sunlight_propagates nodes.
This also prevents the lens from igniting them.

Made stick and staff at least as transarent as frames/ladders.
2019-03-09 19:46:52 -05:00
Aaron Suen
111338e56f Pound glass back into sand. Fix recipe prioritization for pummels. 2019-03-09 19:40:02 -05:00
Aaron Suen
122f1c1677 Lens firestarting. 2019-03-08 23:30:12 -05:00
Aaron Suen
c0e68a24b4 Add basic glass nodes, new textures. 2019-03-07 19:26:53 -05:00
Aaron Suen
0652636e47 Remove redundant rotations, simplifying node spinning. 2019-03-07 10:04:32 -05:00
Aaron Suen
cb78b5a334 Got immediate triggering working. 2019-03-07 01:40:26 -05:00
Aaron Suen
94082bc86a Prism and full logic basically working.
There seems to be an issue triggering events, so a lot of work
is being done by the abm to cover over this problem...

Much like my earlier work with sz_rotary, I suspect a lot of
fine-tuning will be needed.
2019-03-07 00:58:37 -05:00
Aaron Suen
e68693c062 Optic API works, lens basically works. 2019-03-07 00:35:27 -05:00