- Research on our new VRAGE 3 engine has started
- VRAGE Water
- Planetary scale (or small pond)
- Volumetric 3D (no 2D plane or height field)
- Flow simulation, arbitrary gravity
- Buoyancy, pressure, surface tension and more
- Overview of existing technologies
- Examples of work-in-progress experiments & next steps
Guest post by Petr Minařík, Senior Lead Programmer at Keen Software House
VRAGE™ is an in-house game engine developed by Keen Software House. VRAGE stands for “volumetric rage” and/or “voxel rage”.
VRAGE’s core feature is volumetricity within the environment. Volumetric objects are structures composed from block-like modules interlocked in a grid.
Volumetric objects behave like real physical objects with mass, inertia and velocity. Individual modules have real volume and storage capacity and can be assembled, disassembled, deformed and destroyed.
For a more detailed look at our research on VRAGE “Volumetric Water”, please watch the video below:
Any kind of simplification like plane or sphere approximation is a no go for us. Any simplification like that reduces player possibilities of interactivity.
Volumetric water must be simulated with all possible natural phenomena, on planetary scale, creating flows like rivers and waterfalls, all while still being interactive and allowing players to to fully interact with and manipulate it.
These are the features we consider as a top priority:
- Volumetricity - fully 3D simulation, no 2D planes or height fields
- Flow simulation - with an arbitrary gravity, throughput based on hole size, mass conservation
- Buoyancy - Archimedes principle, hole detection, ship sailing
- Scale - from a small pond to a water planet
- Pressure - level equalization, high hydrostatic pressure at high depths
- Surface tension - water creates globules in zero gravity
There are many features we might consider, like air pressure simulation, inner flows, vortices, viscosity, water color, gas / air tightness, lava, acids, moving sands, siphoning, AI simulation, and many others.
There are basically two main approaches used for liquid/fluid simulation. Both of them attempt to simulate water based on famous Navier-Stokes equations describing flow of incompressible liquids.
Smoothed particle hydrodynamics (SPH)
Based on simulation of a high amount of small particles. By their interaction with each other the effect of flowing liquid is created.
|Source: Github - SPlisHSPlasH
- Physical behavior (velocity, gravity, collisions)
- Realistic visuals
- Lots of existing GPU implementations
- Better suited for exact simulations
- Computationally extensive
- Unstable - more sensitive attributes
- Difficult to scale
- Surface tracking
Cellular automatas (CA)
Source:.jgallant - 2d-liquid-simulator-with-cellular-automaton-in-unity
- Fast & simple, stable
- Easy to parallelize
- Already used in games (Minecraft, Ylands)
- Axis aligned - Water surface & vertical gravity immutable
- Sand like issues - “Water piling”
- Complicated collisions with dynamic objects
Combinations of particle and grid based approach
- PIC - Particle in cell
- FLIP - Fluid implicit particle
- MAC - Marker and cell grid
- MLS MPM - Moving Least Squares Material Point Method
Source: UCLA Mathematics
VRAGE Water - Our solution
We use Center of mass (COM) in every cell, which can also be seen as one particle per cell. These are main properties of our system:
- Grid based simulation
- Velocity introduced to the cells to increase realism
- Center of mass (COM) introduced to avoid unwanted diffusion
- Compatible with voxel approach used in current VRAGE engine
- Velocity (calculated from forces)
- Center of mass (COM)
Example: Cells with indicated center of mass and velocity
These principles are similar to those used in fluid simulation. We use proper forces to keep the “fluid” liquid and simulate water behaviors.
- Gravity + tension forces can keep the fluid in a liquid state
- Pressure forces adjust water compression (Water Pressure)
- Surface tension to create nice globules
- Constant expansion/diffusion. If not limited, liquid can spread around.
- No maximum mass cell limit
First cell velocities are calculated from forces applied to cells. Then an advection step is executed where diffusion for every cell is applied. After these calculations, new values are copied to the content buffer.
VRAGE Water - Forces
- Surface tension
|Example: Interaction with mouse cursor - attracting and distracting force
- Gravity is dynamic and is different at different positions in the world
- It is non-linear and not aligned to any axis
- There can be no gravity at all
- Gravity center can be inside of a water pool
|Example: Water follows gravity center and creates a globule around it
|Example: Velocities aligned along gravity force
- Pressure distributes liquid in cells to keep same threshold
- Pressure helps liquid to get into places where water should naturally flow
- If there is no pressure, all water is compressed into several cells
- This force is not a hydrostatic pressure
- Air pressure is not considered
- Our water is compressible
- + it gets to proper level very fast
- - it takes a huge amount of water in depth
|Example: Water equalization in an U-bend
|Example: Surface tension creating globules in zero gravity
|Example: Velocities aligned to surface tension force
VRAGE Water - Diffusion
|Example: Diffusion with no velocity
|Example: Diffusion with velocity
|Example: Water drop expands to empty area, as no forces are applied
VRAGE Water - Work in progress
Example: Comparison scale on planetary level
|Example: Manula water LOD switching
Example: Viscous water - lava, honey, melted iron...
|Example: Boiling water
VRAGE Water - Next steps
- Lodding, large scale simulation, concealment
- Surface generation / marching cubes
- Moving to 3D space
Follow our social media to get the latest news!
If you’re interested in working on awesome games like Space Engineers, we’d love to hear from you!
Check out the open positions at Keen Software House and don’t forget to send us your English CV/resume and cover letter.
Remote collaboration is possible!
Our team is global.
Finding the best candidates to join Keen Software House means exploring every possible solution, including remote work. While we strive to provide team members with the best possible work-life balance here in Prague at our incredible Oranzerie offices, we understand that it is not always possible to transition, therefore we are very remote friendly. Here’s a map of where our teammates live.
Thank you for reading this blog!
Lead Programmer at Keen Software House
For more news:
Vrage Engine: www.keenswh.com/vrage/
Space Engineers: www.SpaceEngineersGame.com
Keen Software House: www.keenswh.com
Medieval Engineers: www.MedievalEngineers.com
General AI Challenge: www.General-AI-Challenge.org
Petr Minařík is lead programmer at Keen Software House, an independent game development studio best known for its best-seller Space Engineers (over 4 million copies sold). Petr is a former leader of the team who successfully developed and released Space Engineers, and who developed the most important parts of its codebase.
Petr has been interested in programming since his childhood, when he earned money by gathering old paper and bought Didaktik Gama, national clone of ZX Spectrum. He spent three years in 2K Czech working on Mafia 2 at various programming positions until the game was released. Then he started to work in Keen Software House with Marek Rosa on his game Miner Wars and during the last 11 years he has helped make Space Engineers unforgettable and the company famous. Petr loves solving challenging problems, especially those which everyone says it is impossible to solve.
At this time, Petr is working on the next generation of VRAGE engine, focused on liquid and fluid simulation.