- On door convey
- On item ent settling
Only able to support limited cases, and still can't
usefully animate nodes, but at least this makes
some item placement behavior look smoother.
If something is blocked, store it in a separate retry
queue. If the thing that blocked it moved out of
the way, re-queue the things waiting on it for retry.
This is probably theoretically less efficient than the
old approach since it relies on finding opportunities
to move items on the fly and probably queues a
number of retries that will ultimately fail, but it's
simpler and easier to maintain than the old way.
The old logic was extremely over-complicated, in
an attempt to allow door conveyance to work with
no gaps and support loops. This led to code that
was unmaintainable, and a node deletion bug that
was too difficult to fix.
The drawback to the new approach is that things
cannot be pushed by doors into spaces that are
occupied by another thing, even if that thing will
be pushed out of the way by the doors on the same
cycle. This means that chains of items on
conveyors will always have an air-gap between
them.
Unfortunately this also causes conveyors to jam for
one turn if there is no airgap between nodes on
certain conveyors, but it's better than the original
bug.
The special case of trying to push a single item into a storebox
is an overlap between the item catapult and the place-node recipe.
Change the priority order so the catapult check is done first.
This is not expected to cause problems in other cases because in
those, the presence of a "backstop" node causes them not to overlap.
If two stacks try to move into the same spot at the
same time, both will be placed there and one will
overwrite the other; instead, we should do a check for
the "head" of a moving item chain (the only one that
can be moving into a space not being vacated by
another) and block collisions.
Thanks to Kimapr for the basic approach, and proving
the concept.
Doors pressing a single-item stack now place that
item as a node, and trigger placement recipes. Doors
pressing nodes that don't have a single item stack
node form (sticks, leaves) also trigger placement
craft recipes.
All craft pressing recipes require some form of
backstop to provide pressure.
Hints themselves have not been tided up
much, but this makes the project of fixing the
hints for each mod a little more manageable
and breaks up the hard-to-navigate single
monolithic hints file in the old guide mod.
The old guide mod has now been completely
retired. Hints are now a full-fledged API-layer
standard feature.
- Move hint handling down to API layer
- Simplify stat data; old nc_stats counting can
be moved out to a separate mod. We only
need whether the player has seen or not.
- Invert inventory tab responsibility.
- Merge witness system in from crafting.
TODO:
- Redistribute hint registration responsibility
to individual mods.
- Test external mod compat.
- Retire old nc_stats and nc_guide systems.
- Add a way to reset hints.
For some reason pos_to_string gives us correct
behavior, but hash_node_position does not, even
though we check to make sure that nodes are
properly rounded so non-integer issues should not
apply here.
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
Register a "rootmatch" property for all
recipes that represents a broader, quicker
test for recipe eligibility. False positives are
allowed but false negatives are not.
Since most recipes are eligible, we can
use this to build an index for fast lookups
of subsets of recipes to run and skip most
of the other ones.
- New Delayed Node Trigger API that allows
the use of multiple externally-defined node
timer events, as long as on_timer of a node
is not explicitly overridden.
- Use the new DNT system to make door
ablation reliable.
Before, ABM firing was delayed by up to a full
interval, but the fulfillment timer could wander
around relative to the trigger, which could lead
to unreliable door ablation.
Instead, just always run the ABM fulfilment
triggers on the next tick, so limted_abm is
ONLY doing the limiting for events that arrive
within the same tick, as most ABMs do.
When 3rd-party mods try to register extensions, don't
crash on trying to register in wrong namespace.
Keep registrations to original mod namespace for now,
as I'm not certain whether I actually made assumptions
about mod name in some logic.
- Register groups for chiseling doors.
- Make recipe digging not use player inventory, but drop
as an item unconditionally. N.B. the old "replace with air
then drop item" method only worked with explicit item
names and not group detection.
Instead of instantly digging the rod, which makes it look like
it disappeared, try just "loosening" it into an item so it can be
scooped up without the pick.
It was always also possible to place the rod as an item and
pound that in, making it easier to pick up, but this may not
have been obvious to most players.