41 Commits

Author SHA1 Message Date
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
d0e6dcc410 Add "stasis" option and command.
This freezes many things that normally happen automatically
in the world, including most ABMs and AISMs, and a few other
custom step logic items like the player "hot potato" logic.

This can be used for "creative mode" purposes to setup a complex
build without it running itself away from you, and for texture
pack authors, to have time to see things that are normally
transient or difficult to observe because of the effects they have
on nearby things or players.
2020-01-10 06:26:07 -05:00
Aaron Suen
4d47ab2e75 NC API dependency simplification.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.

This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order.  That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway.  If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
2020-01-05 12:59:12 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
511455fff9 Player/ent freefall physics cleanup.
- Thrown objects inherit initial velocity.
- Player and objects have matched terminal
  velocity and can free-fall in tandem.
- Thrown objects experience horizontal air
  friction too.
2020-01-02 23:03:23 -05:00
Aaron Suen
fb256cf8bd Experimental player terminal velocity.
Note that for extremely long falls, something
still needs to be done for items falling in
parallel with players, since as it is right now,
then fall at different speeds.

Even with player velocity being limited,
objects tend to fall at much slower speeds
initially than players, and collide with
unloaded areas and "settle" into node space,
requriing an ABM to release them again.
Instead, when a falling item collides with an
unloaded area, we need a way to preserve
its speed until the area is loaded, and then
continue falling.
2019-12-31 23:24:29 -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
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
9e20b3ce66 Sneaking actually makes player make less sound. 2019-09-09 08:11:06 -04:00
Aaron Suen
310ce1bc6c Treat NodeCore as a unified thing.
- Collapse all nodecore "core" mods in the /mods listing, so it's
  easier to find the actual add-on mods.
- Parameterize in-game branding to make renaming derivatives just
  a little easier.
2019-09-07 09:08:57 -04:00
Aaron Suen
39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -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
35cac87a78 The /stuck command is now obsoleted (probably) by cliff scaling. 2019-08-26 23:17:47 -04:00
Aaron Suen
28108e1e40 Add translation support, esp. for TouchTips.
Translations are currently by holistic strings, i.e.
no parameterization.  This may create some busy
work for translators, but gives them more freedom
to account for differences between languages.

A translation template file is written out to the world
path on game start, so translators have a seed to
work from.
2019-08-23 20:40:33 -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
31fbfd8d33 Hear other players get hurt, reorg player health mod. 2019-04-06 21:23:14 -04:00
Aaron Suen
b7372fd05d Eliminate all non-main inventory lists. 2019-04-06 20:49:27 -04:00
Aaron Suen
42f5784c64 Prevent flying via /stuck. 2019-04-02 08:26:24 -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
47b4ae9bc6 Promote inventory pickup changes to a first-class feature mod.
Use interception where possible to modify destintion for items
directly instead of relying on post-hoc inventory rearrangement.

This should resolve the glitches where items appear in the wrong
place in inventory for a flash before being moved.
2019-03-27 22:10:45 -04:00
Aaron Suen
06194e0bf6 Player choice for real items only, not "virtual" (injury) items. 2019-03-24 19:19:43 -04:00
Aaron Suen
170605dd6b EXPERIMENTAL direct player inventory pickup control.
Players can specify the exact slot they want picked up items to go
into.  Items will try to fit into the currently selected slot first
before filling additional slots according to normal rules.

This is experimental and may lead to lost or duplicate items!!

Hopefully this should end up being a lot more intuitive and
immersive than the old sneak-dig hack that only worked for certain
objects.  It's consistent across all functionality that causes
items to be added to player invetory (including /give).

Unfortunately it adds yet another globalstep function, and a
fairly complex one at that...
2019-03-24 18:24:54 -04:00
Aaron Suen
d00321476e Clean up player damage sound a bit. 2019-03-14 20:22:28 -04:00
Aaron Suen
d4f3e830b4 Created player hurt sound. 2019-03-14 01:04:38 -04:00
Aaron Suen
1f6239f101 Fixed injury showing in wield view, clean up stubs. 2019-03-12 21:27:29 -04:00
Aaron Suen
ff57c0aaba Replace suicide command with stuck command.
It does something similar, though it doesn't send you back to
spawn, just "phase shifts" nearby.
2019-03-11 23:00:42 -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
Aaron Suen
7f123aea91 Goodbye, last GUI!
- Inventory screen is now no longer game-interactive, and serves
  as purely an "about" screen.
- Move the HUD components out of inv mod and into hud mod.
- Separate player setup mod for static physical limitations like
  step height, inv size, etc.
2019-03-03 16:53:12 -05:00