Burnsies HideoutDocsBurnsie.Common

World & Positions — Positions

Burnsie.Common.World.Positions is position intelligence for dispatch decisions: what to call a location, whether the subject is in water, and whether ground units can plausibly reach a spot by road. All members must run on a GameFiber and degrade to safe defaults on failure — a failed lookup never breaks a dispatch.

For LSPDFR zone/county names ("Mission Row", counties, off-mainland checks) use ZoneInfo from the LSPDFR layer; Positions is the RPH-only core.

Street names

string street = Positions.StreetName(position);   // "" when unavailable
if (street.Length > 0)
{
    notifier.Show(Palette.Dispatch("units respond to " + Palette.Key(street)));
}

Water checks

if (Positions.IsInWater(Game.LocalPlayer.Character))
{
    // a drowning officer: bias dispatch toward air/EMS units
}

Null- and Exists()-safe; returns false on any failure.

Road reachability

The interesting one. IsRoadReachable answers: can ground units plausibly get to this position by road? It returns false for rooftops, cliff faces, piers far from roads, and places whose only road path is wildly indirect.

bool groundOk = Positions.IsRoadReachable(incidentPosition, Game.LocalPlayer.Character);
if (!groundOk)
{
    // bias the FIRST wave toward air units; never refuse dispatch outright
}

How the heuristic works

  1. Find the nearest street position. No street node at all → unreachable.
  2. If the street is more than 60 m away, or more than 12 m above/below the position (rooftop, overpass underside, cliff) → unreachable.
  3. With a reference entity supplied (typically the player ped): compare road travel distance against straight-line distance to the street point. No road path, or a path more than 6× the direct distance (when meaningfully far) → unreachable.
  4. If the heuristic itself throws, it returns true — when in doubt, dispatch normally.

Intended use

It is a bias, not a gate. Use it to pick unit composition (air first, ground later), never to refuse sending help. The failure direction is deliberate: wrongly sending ground units to a rooftop is a flavor miss; wrongly refusing dispatch is a broken feature.