30 Commits

Author SHA1 Message Date
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
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
282aa6d09c Disable stair auto-climb while sneaking 2020-06-02 18:04:51 -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
afa36f1236 Standardize obj property setting.
This should more reliably minimize network traffic
incurred by excess property setting.

We could probably standardize a few more things,
like set attach, anim, yaw, pos...
2020-03-25 09:20:37 -04:00
Aaron Suen
65f3993272 Auto-sprint and player movement overhaul.
- Players start out at a brisk walk, accelerate to a run
  if moving continuously forward.
- Clean up and consolidate various player movement
  code, including footsteps, freefall, and zoom focus.
2020-01-25 09:08:13 -05:00
Aaron Suen
25f4a19761 Let's try another walking speed buff.
Walking is a big part of gameplay, and builds tend to be
big and clunky; this will shave of a bit of the boredom.
2020-01-24 21:05:42 -05:00
Aaron Suen
95bef1c074 Attempt to fix zoom focus mechanic... 2020-01-23 21:49:29 -05:00
Aaron Suen
42c8e21cd2 Experimental zoom control.
Player can zoom in more by standing still and holding sneak.
2020-01-23 21:07:02 -05:00
Aaron Suen
d7819762e5 Full proper support for spectator mods.
If players are invisible, NodeCore will not add any visible or
audible effects for them, allowing such players to be completely
non-interactive with gameplay.

This allows things like spectator or stealth-admin mods to
function properly.
2019-12-11 06:52:09 -05:00
Aaron Suen
dc8c483e01 Standardize virtual items, prevent them dropping. 2019-12-09 04:46:33 -05:00
Aaron Suen
78e4008aac Make players non-pointable for now.
Direct PvP is not (yet) a meaningful thing in NodeCore,
so there's no real benefit to targeting a player with a
tool.  However, having players be pointable CAN cause
issues with spectators blocking the selection path of
legit players in multiplayer.  This allows players to dig
around such spectators, and other players.

Players are not really "of the world" so this makes a
certain kind of sense...
2019-11-29 19:28:15 -05:00
Aaron Suen
a12d44c4f8 Tighten up interact checks. 2019-11-28 08:55:09 -05:00
Aaron Suen
a634777ecd Fix non-interact players dropping injuries. 2019-11-25 21:14:22 -05:00
Aaron Suen
bd3246c16c Non-interacting players have no inventory either.
Consistent with removal of the arms and wield hud,
remove the hotbar HUD and dump all inventory items
on the ground at time of revocation, if necessary.
2019-11-25 20:36:13 -05:00
Aaron Suen
9e20b3ce66 Sneaking actually makes player make less sound. 2019-09-09 08:11:06 -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
da7eae09cd Disable the now-long-useless /kill command. 2019-08-27 07:33:38 -04:00
Aaron Suen
5f277cfad1 Switch to hard-coded list names.
It seems that inv:get_lists() returns a list of userdata, instead
of names, at least in 5.0+, and can't necessarily be relied upon
for this purpose.
2019-04-10 08:33:34 -04:00
Aaron Suen
db5cbd3de4 Avoid lighting bugs, players messing w/ inventory via CSM. 2019-04-09 21:06:55 -04:00
Aaron Suen
b7372fd05d Eliminate all non-main inventory lists. 2019-04-06 20:49:27 -04:00
Aaron Suen
c83e3288d7 stepheight obsoleted by auto-jumping...?
Well, we'll have to see if that works out...
2019-03-29 23:53:27 -04:00
Aaron Suen
4d0f0734ba Beginning of a bold new health system.
- Eliminate health and breath stat bars.
- Players NO LONGER DIE FROM INJURY.
- Players no longer lose walking speed or mobility.
- Players lose inventory slots in proportion to injury; they're
  stuffed with an "injury" item, and items they displace are
  ejected.  Slots are displaced in random order.
- Healing rate is much faster, so players are usually mildly
  inconvenienced by injury, but can soon enough pick up their
  stuff and leave.
- Health and breath HUDs are gone.  Health is visible based on
  number of lost slots, and breath uses a vignette to narrow
  tunnel vision for O2 loss.

Overall, the old health system has been more of an immersion-
breaking annoyance than anything.  This allows health to get out
of the way of the primary gameplay.

UNFINISHED: Need a replacement for the old "suicide to get unstuck"
mechanic.
2019-03-10 15:47:22 -04:00
Aaron Suen
cbb7f823c3 Fix node dig prediction, allow limited zoom. 2019-03-07 10:08:22 -05:00
Aaron Suen
b012fd2356 Change item "desperate" placement logic.
Avoid above-grade placement, but randomly allow it, allowing
items that are "stuck" in a pile of leaves to gradually
random-walk their way out into a stable position.
2019-03-06 22:07:18 -05:00
Aaron Suen
3b08a8ee9a Documentation updates, new player guide interface.
Also restructured the player_inv/player_setup thing AGAIN.
Now setup is all rules and inv is all interface.
2019-03-05 19:20:38 -05:00