72 Commits

Author SHA1 Message Date
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
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
baa54a6cd7 Damage logic consolidation 2020-03-22 08:19:39 -04:00
Aaron Suen
756b12b7d4 Better record damage/heal types for stats. 2020-02-20 07:16:19 -05:00
Aaron Suen
eac1285a3a Fix auto-run math bug 2020-01-26 16:37:37 -05:00
Aaron Suen
bd45313ff4 Tweak and parameterize autorun/zoom.
Auto-run acceleration starts at the same time but now
takes twice as long to complete (~8.3 seconds to max).

Anyone know enough calculus to figure out how much
distance is required for a "running start" for a maximum
long-jump now?
2020-01-26 10:23:41 -05:00
Aaron Suen
aaa66958a2 Fix auto-sprint while flying/falling. 2020-01-25 09:25:24 -05:00
Aaron Suen
47b09a78e2 Keep auto-sprint while swimming downwards. 2020-01-25 09:13:55 -05: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
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