#FOHL World Simulation Framework

1 messages · Page 1 of 1 (latest)

urban echo
#

Elevator Pitch

Build living worlds where every action reshapes the ecosystem forever. Bitwise isotropic hex lattice+fast bidirectional inheritance turn footsteps→PCG paths, overhunting→spawn shifts, quests→story changes. True emergence

Details

Problem:
Today's open-world games often require creators to balance static environments against the performance costs of dynamic systems. Many projects end up with worlds that become predictable over time, or they limit reactivity due to scalability challenges. Players increasingly seek experiences where player and NPC actions have lasting, cascading effects: ecosystems shift organically, societies remember past actions, and every footstep, hunt, or quest leaves a lasting mark. Footsteps eventually carve trails, overhunting shifts animal migration patterns, and quests change crime, monster, and political values that guide spawn rates and dynamic story progression. Current systems make this kind of deep, cascading simulation difficult and expensive to implement at scale.

Vision:
The FOHL World Simulation Framework addresses this at the foundational level. It is built around a rigid isotropic hexagonal lattice paired with a hierarchical sparse map container that enables bidirectional data stored at a coarse level to be immediately accessible to any child data point through direct key operations, while fine-grained player and NPC actions can aggregate upward to influence broader world states. Every layer includes configurable meta bits that allow creators to embed small custom values (e.g., ownership flags, AI priority levels) directly inside the key for low-overhead access.

urban echo
#

Current State:
The core architecture is functional and running inside Unreal Engine 5.7 today, with proven rigid translational symmetry and pure-bit hierarchical encoding.
Videos:

  • Visualization of 8 hexagonal layers with 4x scaling per layer.
  • Isotropy-proof showing key encode/decode is functional.

Currently working on radius query visualization.

Concrete Examples:
This structure supports persistent, reactive simulations. For example, a player who over-hunts a single valley can cause effects to propagate upward through biome layers, gradually shifting vegetation patterns and animal migration routes; NPC villages may adjust trading behavior, new trade routes can form, unused trails can become overgrown, and biome distributions can change. Similarly, the hierarchy enables planting an invasive species in one small clearing can initiate cascading feedback: native plants are displaced, herbivores lose food sources, spawn rates and locations shift for multiple species, and NPC behavior adjusts as the ecosystem responds.

Societal and story systems function in the same manner. Crime, cultural, and political data stored at higher layers is directly accessible to finer settlements, allowing dynamic adjustments to NPC schedules, quest availability, guard patrols, and merchant prices. A regional law change can propagate downward to influence faction alliances, trigger events, or reshape trade economies across many locations.

#

.
Technical Edge:
The rigid translational symmetry of the lattice combined with pure-bit hierarchical encoding ensures these outcomes occur naturally without requiring custom scripting for every scenario. Creators can therefore combine hand-crafted detail with persistent simulation at large scale.

The framework is engineered for massive worlds. Child existence bitflags allow queries to skip entire empty branches immediately via a single bitwise check, so performance scales with actual content density rather than world size. Any descendant key can retrieve its ancestor using a simple bitmask operation. Neighbors, rings, and cousins are computed through pure bitwise adjustments with a small precomputed table. Shards are grouped by shared ancestors to maintain cache locality for physically nearby data, supporting efficient parallel processing with reduced cache misses in dense zones. Lazy hierarchical sharding allocates memory only where content exists.

FOHL Wrapper

Flexible Optimized Hexagonal Lattice is a hierarchical spatial system that organizes massive open worlds using a multi-resolution hexagonal lattice. It handles sparse data across every scale in a single unified structure, from decimeter precision for footprints, interactables, and fine effects up through soil, scent, spawning, law, and gameplay systems to large-scale biome, culture, and climate layers.

Its defining novelty is perfect rigid translational symmetry across all hierarchy levels. This property enables clean, distortion-free subdivision, integer hot-path operations (minimal floating-point math for encoding, neighbor traversal, and batch queries), and seamless transitions between detail levels.

#

SHSMap Core

Sharded Hierarchical Sparse Map is the high-performance C++ container that powers FOHL. It delivers exceptional cache efficiency through intelligent spatial family grouping, contiguous memory layouts, dynamic lazy sharding, and opportunistic compaction. Combined with automatic hierarchical lifecycle management (parent creation and safe pruning), hybrid hinted entity caches, and strong per-shard reader-writer concurrency (unlimited read parallelism), it sustains high ops/sec with tight memory usage and bounded latency.

#

Example Usecases

Planting a flower at a 25cm (Layer0) resolution location could add the flower to the spawn table stored at its 64m (Layer5) resolution parent causing it to spawn anywhere within the 64m hexagon's area. But it's feasibility could be modified by soil health data stored in its 16m (Layer4) parent, maybe it can't grow there so it doesn't get added to the spawn table, or maybe it can but other 16m areas within the 64m area can't support it, so it'll never be spawned in those areas. Rain fall/drought data could be stored at its 1km (Layer7) resolution parent that modifies the spawn rates associate with the spawn table. A drought that lasts long enough could remove species from the spawn table.

A beehive nearby performs a radius search for blooming flowers. The hierarchical hexagonal lattice makes it extremely efficient, simple bit manipulation on the beehive's key generates the query's boundary keys that then seed the creation of keys that contain data within the radius. No physics or sphere overlap collisions.

An herbivore that spawns in an area might get overhunted by players, reducing its population faster than its birthrate, eventually causing it to no longer spawn there. The monsters that fed upon it now need to find elsewhere. Their hunger score increases, increasing their search radius until it overlaps a village. Now an emergent monster attack on the village is triggered.

urban echo
#

reserved

urban echo
#

FOHL World Simulation Framework

urban echo
urban echo
urban echo
#

Dynamic creation of bit masks for guided descent through the hexagon hierarchy for radius queries so only branches that lead to existing data are accessed