How Megapop built Life Below’s living ocean with the Entity Component System

Jun 22, 2026|7 Min
Key art for Life Below by Megapop / Kasedo Games. Made with Unity. A dramatic image of a coral reef environment teeming with fish. A jellyfish-like creature presides over the scene.

Learn how Megapop built their dense, organically growing underwater city-builder by leveraging the performance and scalability of the Entity Component System (ECS).

THE CHALLENGE:

Simulating tens of thousands of interacting marine creatures, a custom AI task scheduler, and dynamic corals – all without bottlenecking the CPU

PLATFORMS:

PC (Steam)

LOCATION:

Oslo, Norway

TEAM SIZE:

14 full-time staff, 3 freelancers

How does a game like Life Below manage to simulate a dense, living ocean ecosystem without melting the player's PC?

Megapop's new “reef-builder” tasks players with restoring a dying ocean environment. Instead of placing concrete buildings on a grid, players act as nature itself, growing corals organically and managing the fragile ecosystem to attract over 55 real-world species of marine life, from clownfish and crabs to dolphins and sea otters.

Achieving Life Below's vibrant aesthetics and gameplay required a full commitment to data-oriented design. By treating this network of fish, wildlife, and NPC workers as pure data – numbers in contiguous memory rather than complex GameObjects – the team solved complex challenges around boid behaviors, rendering scale, spatial audio, and ecosystem simulation, to deliver a performant experience on PC.

YouTube video

The results:

  • Simulated schools of up to 250,000 fish of the same type during early stress tests
  • Maintains 60 fps on an RTX 3060 with thousands of active creatures late-game
  • Sustains 1,300+ interacting animals at 30 fps on lower-tier machines
  • Achieved a 97.2% approval rating from professional beta testers
  • Handles 15,000+ entities and 450+ systems in a 14-hour late-game save – and runs smoothly
  • Honorable Mention in the 2025 Unity for Humanity grant
YouTube video

Committing to the data-oriented approach

Megapop made the decision to build Life Below entirely on ECS during preproduction. “ECS allows us to structure the game as many small systems that work together, rather than relying on large class hierarchies,” says Jørgen Tharaldsen, the studio’s founder and CEO. “That makes it easier to build complex simulations by composing behavior from smaller pieces.”

Transitioning from an object-oriented to data-oriented development paradigm was a major shift for the Megapop team. To bridge the knowledge gap, ITR – tech lead on Life Below and the initial advocate for ECS on the project – drew on a variety of resources, from Unity’s official ECS documentation and ECS samples, to real-world advice from the Unity Discord community and YouTube. “The Hot Path Show hosted by Turbo Makes Games was also particularly useful for more niche info about DOTS and ECS,” says ITR.

When programmer Simen Wiig joined Megapop around 18 months before Life Below’s launch, learning ECS was baked into his onboarding. “The main thing was to wrap my head around data-oriented thinking instead of the usual object-oriented way of thinking,” he says. “Once I got that, I really liked how having components and entities helped me structure my code better.”

ITR identifies the principle that made the biggest difference for ECS onboarding: “Commit to the data-oriented approach instead of trying to mix too many different architectures. Keeping systems small and focused makes the project easier to scale as new features are added.”

In-game screenshot from Life Below by Megapop / Kasedo Games. Made with Unity. An isometric view of a dense coral environment.

Life Below | Megapop | Kasedo Games

Creating a task scheduler for NPCs

In Life Below, players don't issue direct orders to their NPC workers – a team of water sprites who maintain the reef. Instead, the player sets goals (place a coral here, harvest these resources) and a custom task scheduler automatically assigns the optimal worker for each task.

The scheduler runs within a Burst-compiled system and works in three stages: first, it uses ECS to collect broad information about worker availability, resource locations, and pending tasks; then an algorithm selects high-priority tasks while keeping the distribution across task types balanced; finally, it retrieves detailed information using ECS to find the best worker and plan each step. “We use hierarchical function programming to ensure it's easy to add new tasks while making sure the game doesn't get into a corrupt state,” ITR explains.

Around 100 workers operate simultaneously at peak late-game. The system is single-threaded – not because of a technical limitation, but because each task assignment depends on the outcome of the previous one. “It's similar to an operating system's task scheduler,” ITR says, “Except we know roughly how long a task will take before we schedule it, instead of after.”

A close-up screenshot from Life Below by Megapop/Kasedo Games. A blue worker floats among a jungle of multicolored corals.

Life Below | Megapop | Kasedo Games

Simulating complex boid behaviors

Many games implement flocking behavior using simple GPU or Burst solutions. For Life Below, Megapop needed species to hunt, flee, and interact dynamically – including in close-up, camera-facing encounters with the player.

“For simple boid simulations, it's easy to get something running using Burst or GPU calculations,” says Jørgen. “But we wanted more complex behavior where different species interact, and even where you interact with the wildlife in close-up camera views.”

Using the Job System, the team separated parallelizable portions of the boid logic – basic position updates and separation calculations – from complex branching interactions like predator pursuit. Not all species are equally demanding on performance: bottom feeders like crabs are relatively cheap to simulate, while predators like lionfish evaluate multiple conditions each frame to hunt, chase, and attack other species.

Managing spatial audio at scale

Getting dynamic spatial audio working alongside thousands of active entities was one of the harder challenges on the project. The solution, developed by programmer Fingar Bøen, was to group nearby creatures into clusters and drive audio from the behavior of the group rather than individual fish.

“Factors like species, group size, movement, and timing help determine when sounds should play,” Fingar explains. “That lets us represent thousands of creatures while keeping the soundscape natural and the CPU cost manageable.”

ECS Jobs and Burst handle the data-gathering phase – collecting entity positions and grouping them efficiently in parallel – while the managed code that triggers audio events is kept as minimal as possible. The team is also working to swap string-based FMOD event IDs for GUIDs, which will reduce garbage allocation and make more of the audio pipeline Burstable.

Rendering a living reef

Visualizing thousands of entities requires a highly optimized rendering pipeline. Megapop uses Vertex Animation Textures (VATs) for complex animal movements such as swimming cycles, and procedural animations for smaller schooling fish. The environment also responds to the ecosystem's health: corals dynamically display algal growth, stress, and damage states based on parameters passed directly from ECS.

Entities Graphics and GPU instancing

The team used GPU instancing from the start of development, initially through custom Graphics API calls before migrating to Unity's official Entities Graphics package. The switch wasn't driven by a performance uplift – both approaches are built on the same underlying technology – but Entities Graphics made the system far easier to work with and significantly improved ECS integration. “It was a lot easier to operate with and made it work much better with ECS,” says Adam Hove, technical artist and programmer at Megapop.

Entities Graphics supports custom ECS components that automatically upload their data to the GPU as per-entity values each frame – but only when those values have actually changed. This means hundreds of stable entities aren't re-uploading buffer data unnecessarily. GPU instancing itself ensures that having hundreds of corals and scatter decorations on screen doesn't multiply draw calls: “With GPU instancing you can render thousands of corals in a single draw call,” ITR explains. “So if we have five corals of a single type on screen, or five thousand of them, it renders just as fast.”

In-game screenshot from Life Below by Megapop/Kasedo Games. A rust-colored coral environment viewed from an isometric perspective. It looks almost like a scene on Mars.

Life Below | Megapop | Kasedo Games

Dynamic corals via Shader Graph

Each coral entity holds ECS components for health, algal growth, and stress state. Using the MaterialProperty attribute from Entity Graphics, these automatically upload to the GPU and drive Shader Graph parameters – producing visible changes like bleaching, stress coloring, and algae spread without any manual material management. Shader Graph also opened up the work to artists who don't write HLSL, letting them iterate on visual results directly and see the effect of changes in real time.

Debugging data-oriented code

Debugging a data-oriented codebase is a different discipline from debugging standard Unity projects, and Megapop's experience with Unity 6 reflects how much the tooling has matured. “6.0 added the search window, profiler markers, and render graph, all of which have been very useful for optimization,” says ITR.

The team upgraded to Unity 6.3 before release, and noted that tools like the Entities Hierarchy window and the native debugger had become substantially more stable in the latest supported LTS.

The Entities Hierarchy was essential for inspecting entity state at runtime, while JetBrains Rider's ECS-specific features – including the ability to see component information for specific entities while stepping through code – made the native debugger significantly more useful. ECS Journaling helped identify which system changed a component unexpectedly and flagged unnecessary writes during optimization.

For graphics, the Frame Debugger and RenderDoc were combined with Unity 6's render graph system to trace exactly where GPU resources were being touched.

Improving performance with Burst

A 14-hour player save submitted as a bug report contained 15,000 entities and over 450 active systems – and still ran smoothly at 60 fps. The full ecosystem simulation clocks in at approximately 0.5ms of CPU time per frame in a typical late-game scenario, which matters because the game supports time acceleration that runs the fixed update multiple times per render frame.

Burst is central to hitting these numbers: disabling it makes the simulation take more than three times as long per frame. “For a lot of systems we found that Burst was enough to optimize it,” ITR explains, “Jobs was better suited for specific parallelizable parts of the code that iterated over lots of entities."

In single-species stress tests: 3,500 crabs at 60 fps on ITR's eight-year-old personal computer, and 7,000 crabs or 5,500 clownfish at 50 fps on a high-end work laptop with active boid interactions throughout. DOTS-native collections and allocators also reduced per-frame garbage allocation significantly compared to the team's previous projects.

Learning from the experience

By blending authentic marine biology with complex systems engineering, Life Below carves out a distinctive space in the city-builder genre. Megapop’s latest release demonstrates the scalability of ECS for Unity when handling simulation-heavy games – and reveals structural benefits that extend well beyond pure performance. The team notes that having the ability to split assemblies cleanly into data and logic, for example, meant Life Below compiled much faster than other projects of a similar size.

For developers considering making a game with ECS for Unity, the team's experience is consistent: the learning curve is real, but the investment pays off. Adam, who’s serving as tech lead on Megapop's next project, is already planning to leverage ECS. "When you have it set up already, it's easy to build on and expand," he says.

Build better with Unity

Develop simulation-heavy games that scale. ECS for Unity gives you the performance and architectural tools to bring complex, living worlds to life.

Try Unity now