1257 Commits

Author SHA1 Message Date
Aaron Suen
282aa6d09c Disable stair auto-climb while sneaking 2020-06-02 18:04:51 -04:00
Aaron Suen
ef8b19cfaf Hard-reverse "no running up ladders" decision
- Climbing long ladders is often necessary (deep mining for key
  materials like molten rock) and boring.
- Running-up-ladder prevention hasn't really been working right
  anyway; it's trivial to bypass it by "wiggling" as you climb.
- Ladder running prevention was done as a "realism" thing, which
  we are always prepared to sacrifice if it interferes with fun.

Instead of simply allowing the previous "exploit" allowing players
to run up ladders as long as they're "running" into them, actually
allow fast ladder-climbing (and up-swimming) as a first-class
feature.
2020-06-02 06:34:27 -04:00
Aaron Suen
c309645f07 Experiment with stepheight >= 1 again
We tried this first back in 5.0, and found that there were issues:
- Some collision detection stuff broke.
- It felt choppy.
- Didn't work consistently on Android.
- There was already auto-jump anyway.

Since then, with the addition of auto-run, auto-jump has not felt
sufficient, especially for climbing terrain or staircases.  There
have also been a number of updates since the last time stepheight
was tried, including to collision detection and movement.

It's time to see how this feels in actual gameplay again.

Set stepheight to just a little above 1, so player can step up
a full node, plus a little margin of error for rounding etc.
2020-06-02 06:23:02 -04:00
Aaron Suen
3aed0d75c4 Buff fire radiant damage 2020-06-01 22:21:36 -04:00
Aaron Suen
95bebf9bbb Fix lower bound for radiant heat overlay 2020-06-01 22:16:36 -04:00
Aaron Suen
429c914e99 Try to simplify abm code a bit 2020-06-01 22:07:20 -04:00
Aaron Suen
0067c5d18d Remove delay/jitter from limited abm
Before, ABM firing was delayed by up to a full
interval, but the fulfillment timer could wander
around relative to the trigger, which could lead
to unreliable door ablation.

Instead, just always run the ABM fulfilment
triggers on the next tick, so limted_abm is
ONLY doing the limiting for events that arrive
within the same tick, as most ABMs do.
2020-06-01 21:44:22 -04:00
Aaron Suen
6e751a5996 Make sound on sponge squeeze expire 2020-06-01 21:19:45 -04:00
Aaron Suen
533bdd0de8 Fix sponge squeeze expiration
Apparently we can't trust node meta to return
the same data to us that we just pushed in for
a few seconds, so check an in-memory cache
first and only use the meta for newly loaded
areas.
2020-06-01 21:00:22 -04:00
Aaron Suen
20bf9bf3be HUD overlay for radiant/latent heat 2020-06-01 20:13:15 -04:00
Aaron Suen
5f165b4da3 Fix crash on completing stone brick chisel
Bug was introduced in 16a7c9fe, caused by
the fact that sometimes nodes are dug by nil,
i.e. the way the chisel is dug up automatically
in the chiseling process.
2020-06-01 18:08:59 -04:00
Aaron Suen
3817811014 Fix scaling node placement prediction 2020-05-31 20:47:11 -04:00
Aaron Suen
85b50092eb Work around stack placement double sounds
Regression introduced when placement
prediction was added for non-node items.
2020-05-31 20:24:41 -04:00
Aaron Suen
8d2a8c0890 Predict item stack placement client-side
This still suffers from some issues with sounds
doubling, but for now we'll have to see how it
behaves under high latency.
2020-05-31 17:45:32 -04:00
Aaron Suen
3986ee1502 Tweak eggcorn placement clent prediction
Place as an empty stack node (soon to be
replaced by the server as a non-empty one
anyway) so laggy clients can right-click with
dirt earlier.

This should mitigate Kimapr's high-latency
mass tree farming woes...?
2020-05-31 17:11:40 -04:00
Aaron Suen
f78c3d90a8 Make dynamic light air_equivalent too 2020-05-31 15:59:53 -04:00
Aaron Suen
4a784aeb8f Trigger visinv checks more smoothly
- Check item on same tick as creation.
- Stagger rechecks across ticks.
2020-05-31 10:36:11 -04:00
Aaron Suen
62ea6de01d Fix drop_in_place/silktouch item duplication
When digging a node that defines both a drop_in_place
and a drop (e.g. tarstone) silktouch wasn't canceling the
drop as well as the drop_in_place.

When we're using silktouch, assume that both drop and
drop_in_place are meant to be canceled, and move
the drop into a new drop_non_silktouch member, so
the builtin/engine doesn't process the drop.
2020-05-31 09:26:31 -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
3edf1b214c Add a way to access another tool tier
Lux resonance can boost tools by one more level!

This opens up some new opportunities for silk touch,
such as being able to relocate living grass.
2020-05-31 09:03:41 -04:00
Aaron Suen
14f4c505e5 Fix lode-sign stone being silktouchable
This should be consistent with plain terrain stone now.
2020-05-31 08:51:38 -04:00
Aaron Suen
16a7c9fe26 Completing a dig resets pummel
This should fix false pummel detection on long
hard-stone dig/drop-in-place sequences
2020-05-31 08:51:02 -04:00
Aaron Suen
b21b7c2da2 Fix pathological visinv scalabilty
Defer and coalesce visinv entity creation/removal
checks until the next tick, so we can process them more
efficiently in a batch.

The spawn area of the Community MP server was
lagging to something like 6x the dedicated step size,
due to the huge number of dropped items.  This code,
on the same machine, seems to appear the same to the
player, but produces almost no measurable lag.
2020-05-30 22:33:13 -04:00
Aaron Suen
b04c4596af Vary sound pitch by dig group level
This should make nodes that have hardness variations
like different kinds of stone have audible differences.
2020-05-30 21:34:50 -04:00
Aaron Suen
a5752fd9b6 Yet another emergency lighting redo
- Players no longer constantly glow in darkness.
- Players can now place light spots by scaling, faster
  than actual climbing spots.
- Climbing spots appear if player continues placement
  after light appears.
- Floor traversal mechanism is now obsolete.

This allows players to traverse dark caves reasonably
well, still, but only voluntarily, so darkness stealth
mechanics are possible again.
2020-05-30 19:00:22 -04:00
Aaron Suen
e5385bca3a Update all notes from Discord. 2020-05-29 09:20:40 -04:00
Aaron Suen
856eadcafc Prevent NodeCore being loaded on top of another game
Apparently some users have had problems installing NodeCore because
they assumed it was a modpack and just copied the mods/* into
~/.minetest/mods and enabled them in an MTG game world.  The result
apparently didn't immediately crash but wasn't really playable
either.

Detect NodeCore being combined with a mod named "default" and
throw an error immediately.  This should catch like 90% of the
games out there.  Some like LoTT or IKEA don't use a default, but
they're also not the ones that players would naively try to run
arbitrary mods on top of.
2020-05-27 07:00:13 -04:00
Aaron Suen
4426bd6a6c Get rid of old debug code. 2020-05-27 01:13:02 -04:00
Aaron Suen
8a04c5163b Make damage touch ignore non-pointables 2020-05-26 20:52:54 -04:00
Aaron Suen
2625f61fd1 Make light_source ents themselves glow 2020-05-26 19:43:09 -04:00
Aaron Suen
05abaf3199 Fix invisible players casting light 2020-05-26 19:32:15 -04:00
Aaron Suen
b1584290a8 Fix light overlap, torch fading in lode crate 2020-05-26 19:26:08 -04:00
Aaron Suen
2c85ee9a81 Unreorder a small calc 2020-05-26 19:07:28 -04:00
Aaron Suen
9865abd2ba Visinvs can cast dynamic light too, given space 2020-05-26 19:06:20 -04:00
Aaron Suen
533d8f3360 Remove old dead torch globalstep hook
This has now been replaced entirely by dynamic lighting and AISMs
2020-05-26 18:49:09 -04:00
Aaron Suen
55efdfa027 Fire ambiance consolidation
- Fire flame and torch flame use the same ambiance def via
  a new flame_ambiance group.
- Items can now emit ambiance via AISM.
2020-05-26 18:48:03 -04:00
Aaron Suen
63d9c3fdec Allow dynamic light displacement
If the node we want to place dynamic light in is occupied (e.g.
player is inside a ladder node space) then allow placement on one
of the 6 face-touching spaces.  This makes dynamic lights work
correctly on most ladders, and may fix other similar situations.
2020-05-26 18:46:06 -04:00
Aaron Suen
620e7c09a4 Change dynamic light API, smoother under lag?
Instead of registering the TTL for a light and expecting
more time to be pushed in, use a fixed TTL of 0.25s and
register a callback to check if the light is still valid, i.e.
lights now pull time as necessary.

This should prevent light flickering that can happen
under heavy server lag, i.e. when the time step is
wider than the dynamic light TTL.

Lights that don't register a callback will be ephemeral,
and will disappear after 0.25 seconds, which can be
used to increase the chance that the server has had an
opportunity to move the light, as per torch destructor.
2020-05-26 07:50:57 -04:00
Aaron Suen
11438a1625 Deprecate ent_prop_set() method 2020-05-25 11:43:51 -04:00
Aaron Suen
e7f6afd789 More entity property setting reforms
- Move comparison check into object metatable so
  it applies to all naive set_properties() calls.  This
  should help catching it in downstream mods.
- Remove sprite property filtering.  It seems the issue
  was actually caused by a 2D/3D vector
  disagreement between caller and property def,
  which the hack wouldn't have fixed for sprite-type
  visuals anyway; it only actually helped in the current
  code because the only entities trying to set them to
  3D vectors in the first place were non-sprite.
2020-05-25 11:27:20 -04:00
Aaron Suen
bb76463e77 Guard against future sprite prop noise
MT apparently internally ignores sprite properties on
entities that are not using a sprite visual, and returns
dummy values, rather than preserving what was sent
in, on get_properties().

Guard against set_property() noise on future/mod
calls explicitly rather than relying on the caller not
sending these props in when not applicable.
2020-05-25 09:57:28 -04:00
Aaron Suen
7fd4e3dc16 Don't set sprite props on non-sprite visuals 2020-05-25 09:49:06 -04:00
Aaron Suen
39cf68a575 Speed up objects_at_pos (in theory) 2020-05-25 00:00:40 -04:00
Aaron Suen
b4bf537513 Skip visinv checks for empty stacks 2020-05-24 23:18:33 -04:00
Aaron Suen
6147a11de6 Try to work around MT segfault (#9916)
The MT client crashes sometimes when trying to do a
lighting calc on upright_sprite entity visuals.

This may or may not be fixed in a future release, since it's
a heisenbug and a rare use-case, so for now try to
eliminate use of the rare and poorly supported upright_sprite
visual type by making empty inventory slots craftitem extrude
meshes.

As a limitation, for now, virtual_items such as injury or
lux burns will be invisible instead of showing the icon, as
we can't swap out the texture like we could for upright_sprite.
2020-05-23 08:59:16 -04:00
Aaron Suen
c2fab4b12d Rakes should be flammable
How did we miss that for so long...?
2020-05-22 15:34:39 -04:00
Aaron Suen
a35413ad2a Remove distance from player names 2020-05-22 08:21:42 -04:00
Aaron Suen
ab357c57ca Players lose runnig speed if stuck
This prevents the "running up a ladder"
exploit, and adds a bit of realism.

This MAY cause problems for players who
have sufficiently crappy network, so
hopefully the liberal stuck time of 2 full
seconds is enough.  Players with that much
latency probably can't pummel, so probably
can't play anyway.
2020-05-22 07:45:27 -04:00
Aaron Suen
fe23c34208 Player buoyancy fixes/refinements
- Nerf effect by 50% to be less disruptive
- Effect can be avoided by not being in a
  swimming position (matching model anim)
- Refactor swimming check into API
- Special checking and handling for linkdead
  players, for whom client knockback
  wouldn't work anyway.
2020-05-22 07:30:12 -04:00
Aaron Suen
c6cf1f9cb6 Players float when idle in water
This is done rather hackishly, but Minetest doesn't
seem to offer a sane way to register fluid buoyancy, or
even a reasonable hack to use negative gravity for this.
Instead, just push player upward with velocity impulses
every so often.

This is helpful gameplay-wise to make chatting while
swimming easier for players not using auto-forward, or
to prevent players from drowning and losing their stuff
while swimming long-distance and dropping network
connection and their in-game character waiting in the
water for the timeout.  Instead, players will return to the
surface and remain where they can breathe until the
player can take control again.
2020-05-18 20:49:30 -04:00