# Cobra (game engine)

Cobra is a cross-platform, 3D game engine, proprietary tools and tech by Frontier Developments. Various iterations of Cobra have been developed in-house since 1988. It includes a custom cross-platform game engine and licensed middleware.

## History

In 1988, Frontier developed their own game engine, because there were no commercial engines that could do everything they wanted for their games. The Cobra engine can be scaled, customized and optimized for specific tasks with custom tools and new features by their internal engine team.
Frontier Developments generally uses their own Cobra engine for games rather than off-the-shelf engines. This means their development teams have more programmers than usual. A typical dev team of Frontier has around 25 programmers and 55 other developers. In 2024, Frontier had over 800 employees including the subsidiary Complex Games in Canada who work with the proprietary Cobra technology.
Cobra uses C++ as the programming language. The development tools are created with C# / WPF / Forms and C++. Lua is used for gameplay features. It supports many platforms such as Microsoft Windows, Xbox One, PlayStation 4, iOS and Android devices. It supports cross-platform by allowing code and resources on PC to be compiled and run on other platforms. The game code and resources are isolated from the hardware by a common platform-neutral core API. It enables optimal use of a multi-processor, multi-threaded environment. There is a framework for rapid development of tools to view, tweak and review changes to resources on platforms in live sessions. The 4th generation of Cobra has cloud-based analytics for data-driven games. The proprietary tools, tech and pluggable modules enable the development a wide variety of games on tablets, smartphones, PC and consoles without making employees unable to contribute.

## Usage

Many of Frontier's games use iterations of the underlying Cobra engine. Frontier uses the term generation without disclosing the engine version numbers. Most notable genres that use Cobra are creative management simulation (CMS) and space simulation. For example Rollercoaster Tycoon 3, Kinectimals, Planet Coaster, Jurassic World Evolution and Elite Dangerous.

### CMS games

Planet Coaster has hybrid spline/piece-by-piece coaster and modular structure building tools, and a voxel terrain editor. Planet Coaster 2 uses the 4th generation of the Cobra cross-platform technology. They create the tools and run-time technology in-house. Frontier's games have unique tech such as the cats in Kinectimals, destructible environments in Screamride, the planets in Elite Dangerous, and world building in Planet Coaster.
Custom systems were developed for the life-like dinosaur motion and behavior in Jurassic World Evolution. The locomotion system blends animation for a dynamic range of speed and curvature. The simulation navigation code is converted to smooth paths with animation choices. The headlock system twists the neck bones in the right direction while the physics engine adds weight to the motion. The foot-planting system with inverse kinematics is for the body movement on player-authored terrain. The system blends between movement types so the dinosaurs adapt to terrain changes.
Planet Zoo has an entity component system model enables thousands of instances of specific systems to run efficiently and parallel to each other. Such as the animal behavior, staff logic and crowd navigation systems are combined with grouping of all instances of an object into sequential memory to enable the complex zoo simulation.

### Space simulation

The Cobra engine enables rendering of a procedurally generated Milky Way galaxy with billions of star systems in Elite Dangerous. Cobra's Stellar Forge simulates star systems with realistic physics from composition to star illumination on celestial spheres. The Stellar Forge generates approximately 400 billion star systems based on real-life astronomical data such as the Hipparcos Catalogue and Gliese Catalogue of Nearby Stars. It fills unknown areas with predictive calculations (star density, age, mass) and unaccounted mass of the Milky Way.
The planets are generated with real scientific principles. This includes the circumstances of its birth, materials, age and neighboring planetary bodies. Nearby star's properties such as gas, liquids, orbital distance and energy affects the planetary bodies. The body's gasses, liquids, solids and chemical reactions based on temperature are applied. Complex orbital systems are possible with binary planets. The Cobra engine generates topological features from orbit to human scale. Artists can customize this.
The Milky Way simulation was praised for its accuracy since it included a star system similar to Trappist-1 before NASA discovered it in 2017. The Stellar Forge's algorithm created the star system in nearly the same location 39 light-years from Earth, with a brown dwarf and 7 terrestrial planets.

## Games using Cobra engine

| Title | Year | Developer |
| Infestation | 2000 | Frontier Developments |
| Wallace & Gromit in Project Zoo | 2003 | Frontier Developments |
| RollerCoaster Tycoon 3 | 2004 | Frontier Developments |
| LostWinds | 2008 | Frontier Developments |
| LostWinds 2: Winter of the Melodias | 2009 | Frontier Developments |
| Kinectimals | 2010 | Frontier Developments |
| Kinect: Disneyland Adventures | 2011 | Frontier Developments |
| Zoo Tycoon | 2013 | Frontier Developments |
| Elite Dangerous | 2014 | Frontier Developments |
| Screamride | 2015 | Frontier Developments |
| Planet Coaster | 2016 | Frontier Developments |
| Jurassic World Evolution | 2018 | Frontier Developments |
| Planet Zoo | 2019 | Frontier Developments |
| Elite Dangerous: Odyssey | 2021 | Frontier Developments |
| Jurassic World Evolution 2 | 2021 | Frontier Developments |
| Warhammer Age of Sigmar: Realms of Ruin | 2023 | Frontier Developments |
| Planet Coaster 2 | 2024 | Frontier Developments |

## Licensing

Licensing Cobra to third parties was considered in 2014, but it's currently exclusively utilized for games by Frontier Developments.