70 Commits

Author SHA1 Message Date
Aaron Suen
a064f52557 Fix unknown item crash. 2019-04-14 01:33:50 -04:00
Aaron Suen
a674184df0 Fix deprecated getpos -> get_pos. 2019-04-06 20:34:13 -04:00
Aaron Suen
47ac931f34 Easy targeted stack placement via drop key + raycast.
Attempt to place stack node directly when player is pointing at
a node space, instead of tossing out an item ent.

This makes item organization less tedious in the early game, as
players are manipulating node positions instead of calculating
ent ballistics in their heads when trying to lay out inventories
on the ground, or using naive shelving.

(Note that wooden shelves still have an advantage in how quickly
items can be taken from them).

Items are still tossed as ents if a player is not looking at a
valid place in nodespace, so inventories can still be e.g. thrown
over a cliff or jettisoned in the ocean...
2019-04-05 07:42:48 -04:00
Aaron Suen
3614068263 Bug fixes, tidier craft excess handling. 2019-04-03 08:10:03 -04:00
Aaron Suen
fbff15e2fe MAJOR fire api/logic rework.
- Expanded fire api, added "check" varieties of things that also
  perform relevant checks for eligibility.  Standardized testing
  for ventilation.
- Snuff embers to coals as fuel.
- Fuel is consumed randomly by flames.  This means that fuel that
  are surrounded by flame burn out quicker, while flames
  surrounded by fuel consume fuel from each node slower.  This
  adds subtlety to furnace design for efficiency.
2019-03-31 20:54:38 -04:00
Aaron Suen
359c625df8 Larger, bolder, easier to see item and stack ents.
This restores an old visual scale from the extremely early days
of NodeCore.  That style was removed to syncrhonize the scale of
stack nodes with item ents.  The syncrhonization can work the
other way, too, though.

This was triggered by wanting to make loose item ents more
visually distinct at a glance from settled stack nodes, by making
loose item ent rotation faster.  Since we were going to change the
properties either way, given that, then we might as well use the
better visual.

Since making stack nodes have a full-size collision hull, it was
distracting having the items inside be so mismatched in scale.
Also, the "pointing around stacks" thing becomes less important
in long-run gameplay with shelves in play, which do not allow
pointing around/through anyway.
2019-03-30 22:07:23 -04:00
Aaron Suen
367013941c Resimplify eggcorn planting.
- Allow applying dirt to eggcorns w/o sneak again.
- Allow dirting any face; basically just do the custom check
  directly.
- Back out the "shove eggcorns into placed dirt" recipe.
2019-03-23 16:56:02 -04:00
Aaron Suen
a8dbfb221f EggCorn Overhaul!
- Place EggCorns as items, not as nodes.
- Tweak visual scales, thicken them up a bit.
- Allow planting eggcorns into dirt, as well as throwing dirt
  over eggcorns, to make planting easier.
2019-03-23 13:01:31 -04:00
Aaron Suen
8a8533a8fc Convert lode to new cooking recipe system. 2019-03-22 22:55:30 -04:00
Aaron Suen
a9c89eac4c Fix collision boxes for shelf/stack to be full cubes. 2019-03-22 18:41:33 -04:00
Aaron Suen
27770dfdb7 Try to fix stack node sounds.
Use same node_sound hook as punch hook, to limit sound rate.
2019-03-16 17:10:20 -04:00
Aaron Suen
5de0cc54ec Add stony sounds, and sounds for stacks/shelves. 2019-03-14 00:31:09 -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
3865c1a795 Some more cleanup stuff. 2019-03-11 23:52:18 -04:00
Aaron Suen
96b5863fc0 Tools melt down to prills; reworking is necessary. 2019-03-08 23:22:14 -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
7cc662a854 No, simplify: just always allow a bump-up by 1. 2019-03-05 23:18:09 -05:00
Aaron Suen
21137f0465 Allow "bump-up" for stack placement inside walkables.
Observed items falling among stacks and getting ejected out to the
sides instead of stacking above.
2019-03-05 23:11:29 -05:00
Aaron Suen
d1e52fb303 Tote bug fixing.
The major bug was the lode heating/cooling logic wiping out the
tote's inventory when it was sitting in a stack node.

Also setup description text.
2019-02-28 23:47:36 -05:00
Aaron Suen
ce46564f8e Bare stacks coalesce, but items don't fall into top of shelves. 2019-02-27 23:12:19 -05:00
Aaron Suen
393210db69 Start proper spectator support.
Make sure that non-built-in content respects the interact priv
and prevents spectator players from doing nasty stuff.
2019-02-24 21:54:33 -05:00
Aaron Suen
58cd080fdf Apply big stack refactor. 2019-02-23 10:21:27 -05:00
Aaron Suen
b6650068a1 Trying to find a saner way to handle node stack recipes. 2019-02-23 02:29:16 -05:00
Aaron Suen
ceb95efae1 Fix itemstack repose/falling crash.
With item_eject trying to place stack nodes now instead of ents,
converting stack nodes to ents was causing an infinite loop.
Impart a tiny velocity on ents to make them ineligible for
automatic immediate stack placement.

Hacky.  Should probably have a separate API to indicate ejection
as an ent or as ent/stack or something.
2019-02-21 10:10:36 -05:00
Aaron Suen
d184209521 Fix item settling behavior.
The old code wasn't working in v5.0+, due to the separation of
item entity physical_state into separate moving/sliding states.
Instead, just check to see if its position has remained unchanged
for a nominal amount of time before settling.
2019-02-19 00:34:12 -05:00
Aaron Suen
70d9e7a320 Resolve flammable itemstack regression.
Using a separate ABM for this.  We may want the burn-up effect with
containers later, but it may have to be handled differently in
those cases as the container itself may have flammability
characteristics to take into account.

This SHOULD also resolve the problem with transient states of the
stack node (i.e. wherein it was temporarily empty) burning up,
which caused some things to burn up when they shouldn't.
Particularly egregious was the destruction of hot lode prills when
they dropped into forgefire.
2019-02-10 12:16:00 -05:00
Aaron Suen
b5bd67d5a7 Finished pummel-craft API, started converting recipes. 2019-02-09 22:44:56 -05:00
Aaron Suen
05d4d52eb4 Survey of how we're using pummels right now. 2019-02-08 21:12:10 -05:00
Aaron Suen
d67f736ac5 Merge node_is into match. 2019-02-03 12:44:33 -05:00
Aaron Suen
2b8cc8fba2 Finished refactoring crafting into a separate mod.
Appears to work with existing functionality.

Next step will be to rework pummel to use a "recipe" system and
reuse most of the useful parts of the crafting system.
2019-02-03 12:10:27 -05:00
Aaron Suen
9ef8b8520f Rip out the snooper and consolidate statistics/knowledge yet again.
Nobody was using the snooper; not worth the bother to host it.
Instead, consolidate player statistics tracking for the achievement
system.  We can still use it for statistics collection, but users
would probably have to post world dumps for that.
2019-01-30 21:02:19 -05:00
Aaron Suen
968bbcfe8b Allow adding 1 to a stack.
This should make pack-exact-stack recipes a little easier.
2019-01-29 23:12:07 -05:00
Aaron Suen
2d3b468c65 Knock out a bunch of small low-hanging issues.
- Eggcorn cleanup.  They look a little better falling out of the
  tree, and we don't have so many now.
- Crushing damage fixes.  Crushing is nuanced now, and most things
  don't smush you, and many do reduced damage.  A few may do more.
- Item stack convenience.  Items landing on a stack or right-
  clicked onto one attempt to merge into it.
- Ladders now fall (they don't connect to sides).  Use the new
  full-scale frames for ones that don't.
2019-01-29 20:41:29 -05:00
Aaron Suen
e4dc398b3a Start work on usage survey.
- Refactor player knowledge into player mod, to declutter API.
- Move player knowledge into mod storage so players don't need to
  be connected to access.  Old knowledge will be reset, but I
  doubt there was very much of it to lose.
- Start gathering some basic stats.
  - Main glaring omission is player moving and idle time.
2019-01-26 16:39:07 -05:00
Aaron Suen
bfad55456c Allow single-item loose stacks again.
Thrown single nodes placing themselves and then requiring the
proper tool to dig again was getting too annoying.
2019-01-26 16:14:01 -05:00
Aaron Suen
169f226ba7 Punch item entities to jar them loose if they get "stuck". 2019-01-26 12:50:06 -05:00
Aaron Suen
fcb8463953 Stone-tipped tools.
- Add a bit of stone to the tip of a wooden tool to harden it.
- Stone tools wear back down to their wooden originals.
- Stone tools dig faster, but wear quickly, so you need to pay
  attention to wear levels and carry spare stone tips.

Also:
- Nerfed mining speeds again, but made higher-tier tools much
  faster relative to lower.
- Nerfed tool durability as well.

Also:
- Standardized item ejection logic.
2019-01-25 09:26:15 -05:00
Aaron Suen
d70c20cd3b Item stacking refinements.
Try to place items into existing stacks when searching for a
settling location.

Try to launch items from reasonable corners of a source node in
item_eject so they don't self-collide and end up in one pile.
2019-01-25 01:15:14 -05:00
Aaron Suen
83481827f9 Break loose cobble into stone chips.
- Chip apart loose cobble with a pick.
- Hammer stones back together with a mallet.
- Repacking with mallets now wears tool.
2019-01-25 00:12:29 -05:00
Aaron Suen
375ed437d0 Significantly incrase item settling distance. 2019-01-24 23:34:08 -05:00
Aaron Suen
b6a83b2791 Pummel API overhaul.
- Make check/resolve functions naturally paired instead of having
  to test the "check" value, so we can use the "check" value for
  more specific parameter stuff.
- Make existing pummel logic use a standard tool speed check.
2019-01-24 23:16:12 -05:00
Aaron Suen
8e47b687d0 TOOL CAPABILITIES / LEVELS OVERHAUL
Try to standardize the way we handle tools, materials, digtimes.
- Levels start at 1 and work upwards.
  - Level 1 is for "hand" or "primitive" tools.
  - Levels 2+ are wood, stone, metal, etc.
- Link dig times, tool levels, and durability together.
- Material groups now define standard "base dig times" which
  are the main thing that makes e.g. stone harder to dig than dirt.

The speed of digging almost everything will probably have changed,
in some cases not for the better; much testing will be needed.
2019-01-24 22:08:05 -05:00
Aaron Suen
464a0e1d89 Finite fire rework.
- There are now 6 degrees of embers.  Better fuel sources will
  make better embers.
- Embers differ only in lifespan; each class lasts twice as long
  as the previous.  Top-grade fuels may last 15 minutes or
  longer.
- Embers decay stochastically.
- Embers decay 16x as fast when smothered, but still go through
  the same lifecycle.

Also:
- Plain ash now reposes.

There are no infinite fuel sources, nor are any specifically
planned at this time.
2019-01-17 00:01:00 -05:00
Aaron Suen
9a4dd3684c Don't rely on falling_node for stack nodes.
Falling nodes containing a node that contains an inventory can
cause a crash on trying to serialize.
2019-01-13 20:57:31 -05:00
Aaron Suen
45441071ab Make items on ground have a shadow.
There are 4 different states for things in the world:
- Regular node in world
- Item stack on ground
- Item entity (falling)
- Falling node entity

The entity states are not interactable at all, and regular node
doesn't rotate.  We can help differentiate node-in-air vs
node-stack-on-ground with a shadow visual.

Sometimes a node will get stuck as an entity inside another node's
negative space (e.g. a nodebox) and having a way to tell that it's
not a real one should maybe help.
2019-01-06 18:46:00 -05:00
Aaron Suen
f9abfc5e22 Fire refinements.
- Make some more materials flammable.

- Flammable items in stack form burn up too.

- Some items burn away without converting into fuel.
2019-01-06 14:51:09 -05:00
Aaron Suen
e2dd2de5ba Leaf decay, woodcraft wears tools. 2019-01-05 23:11:38 -05:00
Aaron Suen
6d5432bd6b Prevent pummeling non-single stacks.
Allowing this could let you pound a whole stack of loose sand
into a single node of regular sand.
2019-01-05 21:33:15 -05:00
Aaron Suen
3b0d6b4b57 Fixed various right-click-place issues, stub for new wood tools. 2019-01-04 20:11:04 -05:00
Aaron Suen
93b123ada5 Prevent placing a stack of nothing via right-click. 2019-01-03 23:54:49 -05:00