39 Commits

Author SHA1 Message Date
Aaron Suen
775718256d Fix item entity bugs
- Crash due to pos being non-nil but velocity being nil?!
- Excessive item merging, i.e. on splitting planks, cancelling
  out outward item ejection.  Items now only merge at low
  absolute speed (detecting groups with low relative speed is
  too difficult to do efficiently for now).
2020-06-26 06:11:19 -04:00
Aaron Suen
e9639c856f Entity merges conserve momentum 2020-06-25 23:03:56 -04:00
Aaron Suen
dcdf3a6fc8 Efficiency tweak
Don't repeat string conversions
unnecessarily
2020-06-25 22:46:03 -04:00
Aaron Suen
70c5dcf191 Efficient rebuild of item entity merge
- O(n) efficiency walk of item entities
- Honor stack family merging, e.g. differing lux levels combine

Since the new walk should be much more efficient, the need to
handle "extremal" cases specially, e.g. creation of a multi-stack
ent, is probably unnecessary.  Remove it from the task list,
barring any future evidence that it's still relevant.
2020-06-25 07:50:34 -04:00
Aaron Suen
be452b4d52 Finish base playerstep API
Now all that's needed is converting existing
mods for proof of concept.
2020-06-22 21:14:40 -04:00
Aaron Suen
de22a58162 Fix eggcorn planted falling visual 2020-06-10 00:59:48 -04:00
Aaron Suen
acfd3d08dd Clean up a few log items, fix levels 2020-06-09 19:05:39 -04:00
Aaron Suen
6c640a11b1 Validate log message levels 2020-06-09 19:02:07 -04:00
Aaron Suen
a998009656 Merge branch 'master' of gitlab.com:yamanq/nodecore into dev 2020-06-09 18:57:34 -04:00
Aaron Suen
2cb09e21dd Buff lux tool radioactivity
Lux tools also glow a bit
2020-06-06 07:36:11 -04:00
Yaman Qalieh
a8147e9875 Add levels to log messages 2020-05-27 14:04:00 -04:00
Aaron Suen
2625f61fd1 Make light_source ents themselves glow 2020-05-26 19:43:09 -04:00
Aaron Suen
11438a1625 Deprecate ent_prop_set() method 2020-05-25 11:43:51 -04:00
Aaron Suen
e7f6afd789 More entity property setting reforms
- Move comparison check into object metatable so
  it applies to all naive set_properties() calls.  This
  should help catching it in downstream mods.
- Remove sprite property filtering.  It seems the issue
  was actually caused by a 2D/3D vector
  disagreement between caller and property def,
  which the hack wouldn't have fixed for sprite-type
  visuals anyway; it only actually helped in the current
  code because the only entities trying to set them to
  3D vectors in the first place were non-sprite.
2020-05-25 11:27:20 -04:00
Aaron Suen
bb76463e77 Guard against future sprite prop noise
MT apparently internally ignores sprite properties on
entities that are not using a sprite visual, and returns
dummy values, rather than preserving what was sent
in, on get_properties().

Guard against set_property() noise on future/mod
calls explicitly rather than relying on the caller not
sending these props in when not applicable.
2020-05-25 09:57:28 -04:00
Aaron Suen
7fd4e3dc16 Don't set sprite props on non-sprite visuals 2020-05-25 09:49:06 -04:00
Aaron Suen
b4bf537513 Skip visinv checks for empty stacks 2020-05-24 23:18:33 -04:00
Aaron Suen
9c9eb4b85a Guard against dummy objects in 5.3+
Some time in the 5.3 dev stream (docs updated at
217f3a42), object refs started being invalidated
immediately on calling obj:remove(), such that
obj:get_pos() starts to return nil instead of the object's
last known position.

This can cause some crashes in NodeCore, where we
assume that our object is still valid (or usable as if it
were still valid) even though we're looping through
handlers and any one of them may have remove()d the
object before other handlers get a chance to fire.

Instead, just watch for unexpected nil returns from
functions we expect would never return nil (e.g.
get_pos or get_properties) and return if we hit one.
We can assume all other calls will be non-nil after that
one, as long as we stay in the same function flow.
2020-05-18 18:36:06 -04:00
Aaron Suen
5883582370 Fixed a major network traffic bug 2020-04-12 16:17:06 -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
f2455c28f2 Stop entities falling of the bottom of the map. 2020-03-22 14:06:23 -04:00
Aaron Suen
d27c9cbc86 Mapgen limit API cleanup. 2020-03-22 10:59:06 -04:00
Aaron Suen
f140618e45 Partial ent settling on mapgen lower bound
Trying to make it so that the map lower bound
(via mapgen_limit) is solid to all built-in objects.
Before, entities would fall into this space, remain
until unloaded, and then be destroyed.

Falling nodes appear to work correctly.
Item ents still don't settle.
2020-03-22 10:42:01 -04:00
Aaron Suen
0b2f3fce52 Tweak settling check fix to be more cautious. 2020-03-21 08:22:58 -04:00
Aaron Suen
a37ef544ee Destabilize item ents stuck on edges.
Instead of checking only in the center below an entity,
check a random x/z offset below its bounding box, so
an ent that's stuck on an edge will eventually detect
the blocking node below that edge and settle.
2020-03-20 08:43:08 -04:00
Aaron Suen
266de04987 API for getting objects inside one node. 2020-02-09 10:11:13 -05:00
Aaron Suen
7bc1a4ddad Standardize node placement sounds.
Add node placement sounds to processes
missing them, like tree growth.
2020-01-16 22:02:59 -05:00
Aaron Suen
0c39f34ebb Fix falling_node rapid column settling. 2020-01-11 00:34:13 -05:00
Aaron Suen
23e7a789cb Try to make stone chipping recipe less boring.
- Items don't down settle when rising.
- Give stone chips some upward kick.
2020-01-09 22:32:33 -05:00
Aaron Suen
0aa054792c Falling nodes should be non-pointable. 2020-01-07 21:41:00 -05:00
Aaron Suen
9bf3b88483 One more entity behavior regression. 2020-01-07 21:36:59 -05:00
Aaron Suen
000d87ab0d Fix entity regressions. 2020-01-07 21:35:05 -05:00
Aaron Suen
726fd63183 Fix some entity behavior bugs.
- Items shooting upward on ladders.
- Suspected crash on hitting unloaded areas.
2020-01-07 21:20:18 -05:00
Aaron Suen
edf94dd666 Efficient item merging. 2020-01-05 15:07:40 -05:00
Aaron Suen
5d7f033c81 Rudimentary (inefficient) item merge. 2020-01-05 14:21:54 -05:00
Aaron Suen
9916922432 Drop float support, displace lava.
BOLO gameplay that feels too "exploity" with ability
to forcibly transport lava upwards.
2020-01-05 13:26:45 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00
Aaron Suen
b1fab67491 Start work on unifying/simplifying builtins.
falling_node rebuilt from scratch so far.
2020-01-04 10:51:10 -05:00