62 Commits

Author SHA1 Message Date
Aaron Suen
b27c696c06 Somehow lost the var name 2022-09-26 07:44:03 -04:00
Aaron Suen
f15e1369f1 Always spawn wield ents at live player pos
Don't use the stored pos, which might be at the time of
player login, and thus arbitrarily far from where the player
is now, such that it might never actually be loaded.
2022-09-26 07:31:20 -04:00
Aaron Suen
0f573537bf Regenerate bandolier attachments periodically
An engine bug can cause bandolier attachments to become
detached from the perspective of a player if they and another
player wander farther than the server's player transfer
distance from one another and then re-meet later.
Sometimes the attached entities appear to be floating at the
place where the player was reloaded from the other player's
perspective instead of attached.

Work around this for now by just periodically regenerating
the bandolier attachments for all players, so that at least if
it happens, it will self-correct in time and not be stuck
indefinitely broken.

This was avoided in the past due to an old engine bug that
caused attachments that were attached while a player was
in 3rd person mode not to be visible to that player until they
toggled view mode again ... but this seems to have been
fixed at least in recent versions.

As of now, other-player bandoliers in MP are probably more
important than own-bandoliers in 3rd person view for most
serious use-cases anyway.
2022-01-18 20:19:23 -05:00
Aaron Suen
b73d1d1290 Pre-clean-transparent filter on all textures
Some users may use filtering but not have the "clean transparent"
filter enabled in the Minetest engine config.  Bake this filter
into all images to (1) avoid the consequences of this (i.e. black
halos), and (2) possibly speed up startup time (the filter will
converge immediately).
2021-09-23 07:36:21 -04:00
Aaron Suen
f23f87cc47 Make sure empty bandolier slots never glow 2021-09-12 16:41:05 -04:00
Aaron Suen
f9e02b681e Remove no-longer-used sound 2021-08-11 06:55:48 -04:00
Aaron Suen
d5233b5f19 Visible bandolier on player skin 2021-08-09 08:24:41 -04:00
Aaron Suen
d8b29d047f Back out pickpocketing
- It was never really a major gameplay feature,
  and more than anything probably more annoying
  when mining close to someone and accidentally
  hitting their items.
- Broken with looktips due to an engine bug, not
  worth trying to fix or work around as is.
- May be readded later if a better way to do it is
  discovered.
- This may be part of a pivot toward a simpler
  plan for YCTIWY integration...
- Already served its purpose in getting rid of
  writers' block :-)
2021-08-04 21:00:51 -04:00
Aaron Suen
410ebd5d8d Recompression using ECT
https://github.com/fhanau/Efficient-Compression-Tool
2021-03-09 08:16:23 -05:00
Aaron Suen
19e4a225e0 Don't translate player names
- Simplify wield item player owner display
- Don't try to translate player names
2021-03-09 07:51:03 -05:00
Aaron Suen
fa1f9ec9c1 Pickpocketing tweaks
- Can inspect items at a greater distance than
  you can actually steal.
- Can steal at slightly greater distance.
- Reorganized and reordered checks.
2021-03-02 19:04:20 -05:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
f0f348510a More nuanced pickpocketing
- Touchtip
- Can now inspect items w/o stealing by
  just punching once
- Sound/visual effects build over time
  instead of being constant intensity
2021-03-01 19:16:05 -05:00
Aaron Suen
34953038c1 Pickpocketing visual, layered audio 2021-02-28 21:26:30 -05:00
Aaron Suen
aad575b685 New "pickpocketing" feature
Complement to YCTIWY (which may be merged
sooner or later).  Bandolier items are now
pointable and can be "dug" to take them.

Pickpocketing requires reasonable aim (players
can protect themselves by moving), produces
sound, and logs the action.  Players also cannot
pickpocket from far away or behind.

TODO: Visual hint that it's happening for players
without sound.
2021-02-28 20:40:30 -05:00
Aaron Suen
0792c426a4 Bandolier upright_sprights work again in 5.3+
Now that 5.2- is retired we can stop using the
geometrically-expensive wieldmesh visuals for
empty slots.
2021-02-28 19:36:30 -05:00
Aaron Suen
dc912f776c Make sure all things have explicit descriptions
This avoids issues with the translation informer
including technical names in the translation source
2020-10-18 11:50:04 -04:00
Aaron Suen
ed9002e519 Fix crash on unknown item 2020-06-28 16:09:33 -04:00
Aaron Suen
9cb6a72d6d Correct wield tool position (in mining anim) 2020-06-17 01:37:15 -04:00
Aaron Suen
1ac9ed3f07 Even more wield/visinv microoptimizations
- Bake in on_step so we aren't doing metatable fallback each tick.
- Localize and tail-call some functions.
- Reduce redundant data lookups.
2020-06-16 06:43:08 -04:00
Aaron Suen
82100b7519 Player wield view optimizations
Based on the profiler, this was taking like 20%
to 30% of the time and now it's down to like
5% to 6%.
2020-06-15 21:31:37 -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
e95dbf5fba Enlarge tools, fix wield glow 2020-06-13 18:53:24 -04:00
Aaron Suen
11438a1625 Deprecate ent_prop_set() method 2020-05-25 11:43:51 -04:00
Aaron Suen
7fd4e3dc16 Don't set sprite props on non-sprite visuals 2020-05-25 09:49:06 -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
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
b581769965 Fix unoptimized textures 2020-03-22 21:39:05 -04:00
Aaron Suen
7c623da9cc Another bandolier visual update
Show the sel slot after all, since it balances
out an empty bandolier.
2020-03-22 21:38:43 -04:00
Aaron Suen
8864d30556 Fix bandolier slot visuals.
Alpha blending is apparently broken for
upright_sprite as of the latest v5.2-dev.

Use a simpler, more solid texture for
empty bandolier slots that looks a bit
more reminiscent of a stitched-on pocket
but still abstract.

Just hide selected slot altogether instead
of showing an alternate "selected slot"
texture.
2020-03-22 21:33:54 -04: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
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
a12d44c4f8 Tighten up interact checks. 2019-11-28 08:55:09 -05:00
LoneWolfHT
3e793863ff Add bandolier bone 2019-11-25 18:29:53 -08:00
Aaron Suen
7b1ab03d98 Re-enable bandolier for testing. 2019-11-21 06:34:33 -05:00
Aaron Suen
3d39735e7f Re-disable buggy bandolier so we can make a release. 2019-11-21 06:32:51 -05:00
Aaron Suen
aeabc47c46 Attach inv-view to chest bone to fix swim anim.
Unfortunately this now exposes a bug in the model where the
chest bone is rotated 180 degrees in walking and swimming
anims, but not standing ones...
2019-11-19 00:26:03 -05:00
Aaron Suen
a64b45c55a Make burns/injury visible in wieldview too. 2019-11-18 23:32:08 -05:00
Aaron Suen
138e4fae72 Bandolier slots should tilt the other way. :-) 2019-11-18 20:35:55 -05:00
Aaron Suen
a9531b5225 Show bandolier slots as placeholder ents. 2019-11-18 20:28:58 -05:00
Aaron Suen
2e991f325b Try reinstating "full inventory wieldview".
Supposedly entity attachment is fixed in v5.1+.

Replace the "rotating toolbelt" with a front bandolier placement.
- Should be sufficiently realistic.
- Explains quick access to items (backpack wouldn't).
- Keeps "social surface" of player on front.
2019-11-17 14:16:49 -05:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -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
68d996e1f3 Begin EOS for MT 0.4.
We actually haven't been testing in 0.4 at all for quite a while
now.  Since this is a standalone base game without complex
interdependency relationships, there isn't really any need to
maintain compat with old versions of the engine.  Players can
upgrade to play; keeping a separate copy just to play on old 0.4
servers is even still an option.

There is some internal cruft that has been building up to support
0.4, and this allows us to purge most of it.  The larger benefit
may come when we're able to remove line_of_sight in favor of the
more efficient raycast (still yet to be done).
2019-04-06 11:21:34 -04:00
Aaron Suen
9607bcc6a6 Start working on sounds, plus minor refinements.
- Clean up registered_* usage patterns.
- Reduce tendancy of leaves to create stack nodes.
  Now they tend to stack up properly in-world more often.
- Tweak damage system to create "headroom" where minor
  damage doesn't cost inv slots immediately.
- Make player hand skin color match model skin.
- Cleanup/unify grass abm logic.
- Start installing new sounds by MagikEh

Sound source:
  https://github.com/MagikEh/SoundsOfWarr
2019-03-13 23:51:59 -04:00
Aaron Suen
402769962b Disable toolbelt display.
This was effectively never really working in practice on MP, and
only ended up more of an eyesore than anything.  Since it was
really only ever cosmetic, it's probably okay to just leave
this one out.

Clean up some old issues that are probably not worth worrying
about anymore.
2019-03-12 22:12:40 -04:00
Aaron Suen
1f6239f101 Fixed injury showing in wield view, clean up stubs. 2019-03-12 21:27:29 -04:00