Minecraft-Console-Client/MinecraftClient/Pathing/Core/PathNode.cs
BruceChen da52aa5c3c pathing: sidewall runup precondition via EntryPreparation
Introduce an EntryPreparationState carried on PathNode + A* context so
sidewall parkour can explicitly request one or more runway traverses
before takeoff instead of silently dropping the move. ParkourFeasibility
gains TryGetRequiredStaticEntryRunupSteps + HasPreparedRunup helpers so
long descends (major=5, dy=-1) only remain feasible when the preceding
node proved the runup.

Widen HasDominantAxisRunUp to accept cold-start sprint-jumps within
~3.1-3.5 blocks horizontally so lone overhang / staircase takeoffs stay
feasible without a 2-block runway (matches Baritone's MomentumBehavior
.ALLOWED contract).

Add a runtime SidewallParkourController that implements the corner
commitment + wall-hug chain during execution.

Extend pathing test fixtures with InitialMomentumTicks, add sidewall
accepted/rejected scenarios, and refresh timing + contract baselines to
reflect the new planner shapes. Document the design in
docs/superpowers/specs and plans.

Made-with: Cursor
2026-04-19 17:03:03 +00:00

43 lines
1.2 KiB
C#

namespace MinecraftClient.Pathing.Core
{
/// <summary>
/// A* search node. Stored in the open/closed sets during pathfinding.
/// </summary>
public sealed class PathNode
{
public readonly int X;
public readonly int Y;
public readonly int Z;
public double GCost;
public double HCost;
public double FCost => GCost + HCost;
public PathNode? Parent;
public MoveType MoveUsed;
public ParkourProfile ParkourProfile;
public EntryPreparationState EntryPreparation;
public int HeapIndex;
public bool IsOpen;
public bool IsClosed;
public PathNode(int x, int y, int z)
{
X = x;
Y = y;
Z = z;
}
public long PackedPosition => Pack(X, Y, Z);
public static long Pack(int x, int y, int z)
{
// 26 bits for X (0..60M), 26 bits for Z (0..60M), 12 bits for Y (-2048..2047)
long px = (long)(x + 30_000_000) & 0x3FFFFFF;
long pz = (long)(z + 30_000_000) & 0x3FFFFFF;
long py = (long)(y + 2048) & 0xFFF;
return (px << 38) | (pz << 12) | py;
}
}
}