Escape
is the arcade game with Fluids
simulation and smart AI
.
MonoGame
Framework is used.
Escape uses 2D Fluid Simulation
on GPU
with Vorticity Confinement
and MacCormak Advection
scheme based on Navier-Stokes
equations for incompressible flow. To solve them numerical methods are used.
-
Because of the large amount of parallelism in graphics hardware, the simulation runs significantly faster on the
GPU
than on theCPU
. Implementation is based onHLSL
shaders, samplers andrender to texture
technique. -
To achieve higher-order accuracy, Escape uses a
MacCormack
scheme that performs two intermediatesemi-Lagrangian
advection steps. -
Also there are arbitrary boundaries conditions around obstacles implemented. In 3D realization, the
Fluid
is rendered byRay-Casting
technique.
Fluid integration into gameplay mechanics performed on CPU
is shown on the diagram below:
It is based on the Composition design pattern. It provides uniform interface to handle either single Object
or entire Objects
hierarchy:
Drawing of game objects is performed by the Drawable
class.
It is included into Object
through composition.