26 Commits

Author SHA1 Message Date
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
Aaron Suen
0d23186747 Start getting into nitty-gritty optical transmission protocol.
This is going to be a lot like sz_rotary from sztest, and one of
the more complex things to implement.
2019-03-04 23:49:16 -05:00