45 Commits

Author SHA1 Message Date
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
Aaron Suen
3a299e712f Some minor API cleanup (celebrating 5.0 release). 2019-03-04 19:33:55 -05:00
Aaron Suen
41f7b71fbf Still more damn wieldview issues.
This has got to be an engine problem by now.
2019-03-03 12:32:07 -05:00
Aaron Suen
bc0c2728d5 Fix wield item size regression. 2019-03-03 12:15:38 -05:00
Aaron Suen
3bef72b665 Unify detecting old version of MT. 2019-03-03 12:08:47 -05:00
Aaron Suen
9951114b7f No need to duplicate (almost) this table... 2019-03-03 12:04:57 -05:00
Aaron Suen
a3c02afb5c Another wield view restructuring.
- Simplify queue handling, FIFO retry for ents not created due
  to world not loaded.
- Make ents responsible for own attachment, to reduce the chance
  of non-attachment due to out-of-order replication.
- Unify config object passed to ents, allowing ents to self-manage
  more.
2019-03-03 12:02:57 -05:00
Aaron Suen
18722ccccd Make toolbelt loading more reliable in 5.0.
Make sure area into which ents are to be spawned is loaded first.
2019-03-03 00:07:37 -05:00
Aaron Suen
287b5a1014 Tweak belt position. 2019-03-02 23:39:56 -05:00
Aaron Suen
4426c91eec Tweak hand ent position. 2019-03-02 23:37:39 -05:00
Aaron Suen
f8dd726df8 Fix a couple crashers.
- Failure to get light level on unloaded areas(?)
- Wrong method to clear ents on logout.
2019-03-02 23:24:55 -05:00
Aaron Suen
dfb04e9eee Adapted wield view for MT 5.0+.
There is some wierd issue in 5.0+, besides the different model
coordinate system.  If I try to create and attach all ents in the
very first tick on player join, only like 3 of them work.  Queue
them up and apply them gradually, one per world tick, to try to
work around this.  Need to figure out what limitation I'm hitting
that's causing this...
2019-03-02 23:14:41 -05:00
Aaron Suen
2a73cb68c3 Experimental new wield view mod.
Show player item in hand, AND all 7 other items on the player's
"toolbelt" as attached wield_item ents.
2019-03-02 22:53:42 -05:00