2443 Commits

Author SHA1 Message Date
Aaron Suen
3687f715e0 Merge branch 'dev' into lantern-nonlinear 2022-10-28 07:31:31 -04:00
Aaron Suen
a63eb4987a Fix coal/ember layer order
Always build up texture with lower layers inside and
higher layers outside.  This will fix the need for an
override in the NodeCore Improved Community Edition
texturepack for refined charcoal.
2022-10-27 19:35:16 -04:00
Aaron Suen
2d9b4b9417 Fix wrong texture identification
Misordering issue discovered when attempting to copy the textures
for hinged door panels into a texturepack to update overrides.
2022-10-27 08:18:16 -04:00
Aaron Suen
dd2a12d8c1 Hotfix for a texture alpha warning 2022-10-27 08:00:42 -04:00
Aaron Suen
cc6c0c236f Reorder/simplify bulk stack check 2022-10-26 08:32:07 -04:00
Aaron Suen
0586c69481 Pseudorandom rotation for bulk stack nodes
They don't exactly match the rotation that the entities use, but
relative to each other they help break up the isotropy in about
the same manner.
2022-10-26 08:24:51 -04:00
Aaron Suen
21e8575465 Fix nc_items:stack vs group:is_stack_only usage
Now that there are multiple is_stack_only nodes, always use the
group where possible.
2022-10-26 08:14:52 -04:00
Aaron Suen
af691675b9 Refactor, simplify, and limit to specific nodes
- Use the existing on_stack_change hook instead of creating new
  on_stack_[un]fill hooks, to simplify util_stack.
- Automatically register bulk nodes, but only for nodes being
  registered that request bulk optimization.
- Remove some code duplication and registration complexity.
- Hand-pick nodes for bulk storage optimization based on a survey
  of actual usage from a dump of the NodeCore Community server
  world map.
- Use a separate group for visinvs with hidden entities.
2022-10-26 07:58:23 -04:00
Aaron Suen
062838e491 Merge branch 'dev' into full-stack-nodeboxes
Code formatting, linting, cleanup
2022-10-26 07:23:59 -04:00
Aaron Suen
46549becef Translation sync 2022-10-25 07:53:03 -04:00
Aaron Suen
b393ce0a93 Improve player zoom control, doc updates
Players can use sneak and/or aux1 for far-zooming, so they can
far-zoom while treading water in an ocean to look at distant
islands, instead of using the aux1=climb down hack, which causes
all sorts of weird issues with other features that try to detect
movement controls
2022-10-25 07:48:01 -04:00
Aaron Suen
36fef1771f Players who are trying to move are not pushed out
...even if they're not actually successfully moving
2022-10-24 21:11:45 -04:00
Aaron Suen
7bc091dd2b Differentiate solids for head vs feet
Pointable/"viscous" liquids are "solid" when present at the head
location, but not at the feet location, so that players can still
wade on the surface of these liquids.
2022-10-24 21:07:29 -04:00
Aaron Suen
2117d11f9e Prevent players getting trapped in pumwater or similar liquids
If the liquid is "pointable" then it can block players from being
able to emergency-dig the container; in these cases, just push the
player out immedately.  This should only apply to some liquids
like pumwater, molten glass, or concrete.
2022-10-24 20:31:41 -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
e7c8fd9451 Merge branch 'dev' into lantern-nonlinear 2022-10-23 15:00:16 -04:00
Aaron Suen
ba39e9998d Cleaner, safer boolean expression 2022-10-23 14:35:01 -04:00
Aaron Suen
6fef1d9035 Fix importing mechanism
We can't check initial conditions because the legacy mod would
load after this one (to detect that it needs to be disabled), so
we have to provide an API entry point for it instead.
2022-10-23 14:24:33 -04:00
Aaron Suen
20fdb7e907 Path for auto importing from old external mod 2022-10-23 14:21:38 -04:00
Aaron Suen
adc8710a91 Shrink empty mod storage, earlier recheck on join/leave
When a player joins or leaves, schedule a recheck on the next
tick to prevent entities from lingering out of date by several
seconds.
2022-10-23 14:00:29 -04:00
Aaron Suen
ee7bc90ba9 Fix bug in disabled db pruning 2022-10-23 13:56:06 -04:00
Aaron Suen
d123dbded9 Fix core mod registration, settings 2022-10-23 13:44:59 -04:00
Aaron Suen
0673f3094a Add options to disable YCTIWY
There's a "soft disable" that just hides the entities
but keeps the database up to date, and a "hard
disable" that clears the database, keeping only
minimal data, until existing transactions (taken
items, dumped inventories) are flushed to the
world.
2022-10-23 13:22:14 -04:00
Aaron Suen
941d1545f2 Import YCTIWY mod nearly unaltered
I had wanted this to be a standard feature of the
game for a while but put off merging it because:
- I had hoped to find a better visual design for the
  ghost player entities that matched the bandolier
  in nc_player_wield better, and
- I had scalability concerns with large servers with
  thousands of offline players.

However, in practice it seems like the scalability
issues are not as critical, and the visuals are
acceptable as they are for now.

In making this a standard game feature, it
will probably also make sense to add an option
to effectively disable parts of it (e.g. avoiding
creating the ents, or even avoiding filling the
database except where players' items are already
taken).
2022-10-23 12:44:25 -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
ba284b52f8 Simplify door group check code 2022-10-21 21:39:32 -04:00
Aaron Suen
ff091fd3bc Attempt hotfix for automation-dug totes too 2022-10-21 07:26:14 -04:00
Aaron Suen
2e54974a09 Hotfix for totes placed by automation 2022-10-21 07:20:47 -04:00
Aaron Suen
650b44f7c0 Add LiberaPay link 2022-10-20 18:35:59 -04:00
Aaron Suen
d9e4af9ece Fix place_as_node facedir anisotropy
When a facedir node drops/lands on the ground, it should be
facing a random direction instead of biased toward one
specific orientation.
2022-10-20 07:27:03 -04:00
Aaron Suen
015b1fafff Digging light sources leaves dynamic light behind briefly
This helps to bridge the latency gap between the dig completing
on the client side, and the server sending the result, which might
include adding dynamic lights from a now-handheld light emitter,
e.g. for torches or lanterns.
2022-10-20 07:22:45 -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
44e2ccc92b Preserve original tweenfrom in door double-move
When lifting an item using the new door vertical
movement mechanic, tween the item from its
original position, not the intermediate one.
2022-10-19 23:04:03 -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
29e1b82506 Merge branch 'lantern' into dev 2022-10-19 22:37:00 -04:00
Aaron Suen
334946fcdd Increase effect of player wield light leading
When the player is moving forward, take autorun
speed into account for distance to lead, to better
counteract server latency and let players run at higher
speeds.  When standing still, still extend the light in
the player's looking direction a little bit, to get more
favorable "rounding".
2022-10-19 22:36:51 -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
553893b60a Detect accidental global sound playing
Every sound in the game (and all known mods for
it) should play either at a specific location, to a
specific player (e.g. chat beeps or notifications),
or bound to a specific physical object.  Detect any
that might be played globally by accident, e.g.
like a bug that existed in NC ZipRunes for a while,
to aid in debugging.
2022-10-19 19:22:55 -04:00
Aaron Suen
7c5ff2ff18 Merge branch 'dev' into lantern 2022-10-19 00:31:36 -04:00
Aaron Suen
0cc42fef14 Retire ABM performance stats
TurkeyMcMac's JIT Profiler mod provides much
better performance data anyway, and these
ABM stats haven't pointed out any really
useful actionable issues for a while.
2022-10-19 00:31:23 -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