19 Commits

Author SHA1 Message Date
Aaron Suen
8a74b34907 Lantern rebalancing and nonlinear charge response
Using Oblomov's proposed sinusoidal brightness profile, making
the bright and dim extremes of the lantern's range shorter, and
stretching the middle.  Also nerfed the total useful lifetime
of lanterns since we no longer have to inflate it by as large of
a "useless" range at the bottom end.
2022-10-28 07:48:11 -04:00
Aaron Suen
882ae45d63 Continuing to tweak, still not satisfied
Seems like with higher exponents, the lantern quickly discharges
to virtual uselessness and actually spends most of its charge
range at a zero emission level.
2022-10-23 15:15:24 -04:00
Aaron Suen
90976fa618 First attempt at non-linear-izing lantern charge:glow ratio
Higher exponents >1 cause lantern to lose intense glow fast, but
glow dimly for longer, making them more realistic and "safer," as
players will have more time to get back to a charging station once
they start to feel the pressure of a dimming lantern.

Lower exponents <1 would cause a lantern to glow more intensely
but burn out quicker once it starts to dim, similar to torches,
making them also dangerous as it's easier to overestimate remaining
charge when budgeting time to get back out of a cave.

The new formula has some values that can be tweaked to alter the
gameplay balance effect of this, in addition to total max charge
and discharge rate.
2022-10-23 12:27:09 -04:00
Aaron Suen
8f1a538452 Lantern charging/discharging reforms/simplification
- Clean up group expansion logic
- Lanterns covered in lux will never net-discharge, even if they
  are not getting enough power to charge, so that they can be
  carried and installed as light fixtures, with a supply of
  flux from above, and can be "paused" in a flux flow when not
  in use without discharging.
2022-10-21 21:39:52 -04:00
Aaron Suen
ee48e9684f Convert lanterns from always-item to mainly-node
Relying on the dynamic light thing for lanterns when they are
placed on the ground causes unexpected behavior when it comes to
lens activation and the displacement of dynamic light outside of
the node space of the lantern itself.  It also causes issues with
lanterns lost deep underwater, i.e. they don't emit light when
they effectively should.
2022-10-20 07:20:48 -04:00
Aaron Suen
d0a508f029 Fix missing core mod registration 2022-10-20 00:04:05 -04:00
Aaron Suen
dcfed74689 Fix placement of lantern on craft
Put it where the tote was, not where the chroma
glass is being placed on the side.
2022-10-19 22:56:49 -04:00
Aaron Suen
fffe9e5d81 Nerf lanter charge capacity, buff water resistance 2022-10-19 22:25:42 -04:00
Aaron Suen
9764680fc5 Fixes and debug/tracing
- Check for water in same node (carried by player) and
  one node above (esp. for placed stack)
- Slightly optimize node group check
- Fix float rounding error, since meta floats are not
  perfectly round-tripped, to reduce spurious rate changes
- Add debugging info to trace phase transitions on all
  lantern items
- Correct initial charge setting (for /giveme'd items)
2022-10-19 22:06:21 -04:00
Aaron Suen
b78539dc5c Remove debug tracing 2022-10-19 21:38:44 -04:00
Aaron Suen
ad5f830fe0 Simplified/corrected charge/discharge logic
- Fix failure to detect immersion in water
- Reduce re-wield animations

Compute current charge based on past rate and
time, like a soaking AISM, but do NOT update the
totals in metadata unless the rate changed or
we crossed a charge level threshold.  This means
that we should only see the re-wield anim when
the charge level changes, the item is brought
in or out of water, or moved around a reactor.

We are losing the randomness factor from the
soaking AISM, but it's probably fine to have a
more exact discharge time for this sort of item.
2022-10-19 21:38:12 -04:00
Aaron Suen
bcfef7d749 Lantern code refactor and hints 2022-10-19 21:16:01 -04:00
Aaron Suen
8201017628 A few more things we don't need 2022-10-19 00:21:45 -04:00
Aaron Suen
2e6d1ab61c Place as item means we don't need facedir 2022-10-19 00:21:08 -04:00
Aaron Suen
5ac3a878db Place as stack, nerf charge, rename
Increase discharge bias, reduce total charge.
Place as stack means we only need the AISM.
2022-10-19 00:18:40 -04:00
Aaron Suen
2f215d2c9d Lantern balancing
- Discharge a bit faster when exposed to water
- Cut radiation levels in half
2022-10-18 23:47:27 -04:00
Aaron Suen
c24324c540 Charging/discharging
Basically works, but there are a few issues with it:
- I don't especially like the linearity of it
- Item "rewield" animation every 10 seconds
2022-10-18 23:30:30 -04:00
Aaron Suen
87975129d1 Craft and recycle recipes 2022-10-18 22:58:37 -04:00
Aaron Suen
e0c62ba6d7 Initial lantern node defs
- 8 different levels, from empty to full
- Models, textures
- Emit light, radiation
2022-10-18 22:45:39 -04:00