98 Commits

Author SHA1 Message Date
Aaron Suen
70a10826d2 Simplify progressive zoom controls
Just hold the zoom button for a couple of seconds
(gives the player a chance to take screenshots with
the fixed zoom level) and then progressive zoom will
kick in automatically as long as zoom and no other
input control is held down.

This also prevents problems with the sneak/aux
causing unwanted movement while zooming.
2023-11-05 12:40:32 -05:00
Aaron Suen
4a86163534 Prototype lode tongs
- Pick up and carry hot lode things
- Sane tool wear management

Known Issues:

- No recipes yet
- Glowing things don't anneal/temper when inside
  player inventory
2023-10-09 21:41:08 -04:00
Aaron Suen
00a274e763 Fix damage when trying to chop glowing lode in node form
There's now a separate damage_pickup group that only damages you
if you try to actually pick up the thing, not if you try to
punch/pummel it.
2023-04-28 21:17:17 -04:00
Aaron Suen
2545124756 Boost the default brightness a bit 2023-04-14 20:40:04 -04:00
Aaron Suen
73cc6ced50 Enable experimental dynamic exposure
Players still need to enable some settings:
- Enable shaders in Settings
- Hunt for "auto exposure" in advanced settings and enable it

The game will try to adjust the brightness automatically based on
the local light level.  Unfortunately there are problems with it
(e.g. it seems to detect light based on the light level where you
are standing instead of where you're looking) but it may help
improve the "caving" experience without having to mess with gamma
curves.
2023-04-14 07:15:04 -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
ee99c24d52 More aggressive priv caching strategy
Instead of caching privs only for the current tick, and only for
NodeCore itself, change the base API to use caching universally,
including for naive mod code.  Privs are cached until invalidated
by a change; it's assumed here that the "auth_reload" command
exists in the first place because this kind of caching is allowed
and accounted for, even if it's not actually done by the engine
or builtin.
2022-10-07 06:59:04 -04:00
Aaron Suen
433161466b Unify cached privs checks
All base-game priv checks should now only
require one priv lookup per player per tick,
except in special cases where a player's privs
changed during that tick.
2022-09-24 00:20:27 -04:00
Aaron Suen
42d92f4ca9 Disallow basic_debug by default (FINALLY) 2022-08-12 05:47:27 -04:00
Aaron Suen
9c03cf35eb Log format cleanups 2022-01-19 23:30:56 -05:00
Aaron Suen
b3eb4b474b Allow run-up-ladders for "split" ladders 2021-12-16 23:41:15 -05:00
Aaron Suen
34a2562964 Polyfill for player:get_velocity, clean up other hooks
This gets rid of the 5.4+ "deprecated get_player_velocity" warning
and modernizes the code to use get_velocity() everywhere, while
still remaining compatible with 5.3 for now (tested).  The polyfill
had to be on joinplayer because the nc_player_pickup auto-one-time
method of using after() won't reliably patch the player before some
other globalstep tries to read player velocity.

When MT 5.5 is released and 5.3 support ends, the polyfill just
needs to be removed to clean it up.

Also tidied up and consistentized the logging for other hooks.
2021-12-03 08:09:57 -05:00
Aaron Suen
a5985dd43e Don't push player out of item stack nodes 2021-11-27 08:41:29 -05:00
Aaron Suen
e77094d39d Try to fix missing footstep sounds
Apparently "rounding error" margin for the bounding box for feet
was too large for MT to detect player's feet on the ground.
Shrink it to a very small amount that should be large enough not
to be lost in rounding error but small enough to allow footstep
sounds.
2021-07-21 07:08:18 -04:00
Aaron Suen
074e8035bf Add padding to bottom of player collisionbox
- This nudges the player upward a bit and gets the
  feet of the model out of the ground.
- This also compensates for a rounding issue that
  causes players to be detected as stuck in the
  node below their feet instead of the space above
  it.  The old workaround worked for pushout but
  didn't help with mods like ziprunes.
2021-07-10 23:13:08 -04:00
Aaron Suen
8a8bed8e5d Major settings cleanup
- Run all settings through a common API.
- Use modname prefix consistently for setting
  keys instead of "nodecore".
- Add automatic dumping of settingtypes.txt
  metadata for maintenance.
- Include initial settingtypes.txt for game for
  main menu use.
- Remove per-recipe tuning for pummel recipes,
  as there were way too many of those to be
  possibly useful and it was clogging up the
  settings menu.  Use tool rate adjustments to
  control it instead.
- Remove vestigial enable_damage setting.
2021-07-10 10:04:03 -04:00
Aaron Suen
c102758133 Revert "Add an emergeny escape feature"
This reverts commit a722bd8a9fbf21ce25facb1ff5b00840d9c39aa7.

...in anticipation of yet another alternative approach.
2021-06-23 19:59:17 -04:00
Aaron Suen
a722bd8a9f Add an emergeny escape feature
Described in player guide "movement" tab.
It's analogous to the old "/stuck" command that
was removed once long ago, but much more
tedious to execute, so players still have an
incentive to extricate themselves manually.
2021-06-20 10:23:41 -04:00
Aaron Suen
1b6a6fb6b6 Workaround pseudo-rubberbanding issue
Old behavior used to round exactly-off-by-half
values up toward +inf, but since
https://github.com/minetest/minetest/pull/10803
they are rounded toward +/-inf, which means that
if a player's y coord was exactly -1.5, it used to
round up to -1.0 but now rounds down to -2.0.

This affects using vector.round to get the pos of
the node the player's feet are standing INSIDE,
because if the player's y coord is exactly -0.5, as
would happen while they're standing perfectly at
rest on top of a node, it will instead give us the
node they're standing ON.

This causes spurious player "pushout" events,
because the game thinks players are standing
inside the node they're actually standing on top
of.

To work around this, just add a small positive
fudge factor to the player's y coord to bias it
toward +inf.
2021-06-11 09:17:06 -04:00
Aaron Suen
99aec737d5 Dump inventory on all teleports by default
A low-level player teleportation must be explicitly
declared nodecorian via a keepinv property on
the position, or the player must be exempted via
the keepinv priv, to be allowed to teleport without
leaving the inventory behind.

This means that naive mods like /home commands
will now work correctly and teleport only the
player, and not items.
2021-03-17 08:13:36 -04:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
51b5aa8b94 Playerstep microoptimization
Avoid calling get_player_name too much
2021-03-01 18:58:34 -05:00
Aaron Suen
171ebaf5b4 Reset speed on taking normal damage 2021-03-01 18:44:13 -05:00
Aaron Suen
3d72999ef6 Log player push-out
It seems as though there might be something
weird happening with this on join.  Add extra
logging so we can see what's happening.
2020-09-16 19:59:07 -04:00
Aaron Suen
efa2446e42 Add hints for player mods 2020-09-10 22:28:25 -04:00
Aaron Suen
7cc597156d Pushout refactors 2020-07-14 08:07:03 -04:00
Aaron Suen
41975051cb Set player down on ground in pushout 2020-07-11 21:55:15 -04:00
Aaron Suen
4e8bccc9f4 Consistently bias pushout toward origin
Under pathological circumstances such as players
getting stuck near mapgen_limit, we don't want them getting stuck outside the bounds and then
pushed up past the ceiling.  Instead always try to
bias the push toward the origin, under the
assumption that some place near there should
be safe.
2020-07-11 21:13:05 -04:00
Aaron Suen
574f4f1ccb Fix definition of solids for pushout 2020-07-11 21:02:41 -04:00
Aaron Suen
03945dcbbd Push players out of solids 2020-07-11 20:50:00 -04:00
Aaron Suen
943464be23 Fix hot potato running on stasis 2020-06-30 22:11:38 -04:00
Aaron Suen
cf799989b3 Fix players not dropping items on losing arms 2020-06-30 07:14:34 -04:00
Aaron Suen
5379c14935 Fix some player visibility bugs 2020-06-23 00:44:54 -04:00
Aaron Suen
5648331c9f Replace all perplayer with playerstep 2020-06-22 22:47:33 -04:00
Aaron Suen
c1a7ef6923 Fix focus zoom
Apparently another control bit must have
been added, maybe for the zoom key itself,
and it was throwing off the check.
2020-06-21 08:46:23 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
32e30328eb Delay breath HUD onset
The hack to start new players with full breath does
not apparently work with existing players, so players
are joining to find their breath half gone at the start
of play.

Instead, let's just hide the breath HUD entirely for the
initial half of underwater movement, and only show it
when the player is running low.  This effectively hides
the fact that players are losing the top half of breath
when joining, in the common case.

Players joining and being immediately submerged in
water is an uncommon enough case that this will
probably not affect gameplay significantly.
2020-06-07 14:17:20 -04:00
Aaron Suen
5fa2483d87 Refactor, fix new players starting a half breath 2020-06-07 12:26:27 -04:00
Aaron Suen
5ddfd621f2 Revert player buoyancy
This feature is too annoying in practice and makes
the player harder to control when in water under most
circumstances, and isn't worth it for the cases it does
handle.

Buffing player breath should help alleviate drowning
problems due to network issues or chat.  Players may
just have to manually resurface more frequently.

This feature could be reconsidered for inclusion if a
better way to do it could be found, and if it could limit
gameplay impact.  Ideally the player should simply
remain at a fixed location when not moving (i.e. the
player character should counteract any drift
automatically) but that would require engine/client
changes.
2020-06-07 12:18:51 -04:00
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
11438a1625 Deprecate ent_prop_set() method 2020-05-25 11:43:51 -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
Aaron Suen
920fba34ee Separate node stand/touch/radiant damage types
Don't reuse damage_per_second for damage on punch and radiant
damage.  This allows these to be defined separately, i.e. no longer
assuming that all damage is from "heat" and can radiate.  This
allows for things like thorny plants that hurt if you touch them
or stand in them but not if you stand near them.

Thanks to WintersKnight94 for reporting this.
2020-04-09 06:56:18 -04:00