Home | Lehre | Videos | Texte | Vorträge | Software | Person | Impressum, Datenschutzerklärung | Blog
Game Engines
... are frameworks offering services such as:
-
Real-time rendering and animation, which includes scene management, typically
through scene graphs
-
Interaction
-
Real-time audio
-
Game-AI such as pathfinding and state machines
-
Networking
-
Resource Management
-
Physical simulations
-
Encapsulation of the APIs for graphics, networking, audio, etc., so that
the code gets platform-neutral
There is a zillion of half-baked game engines. Please don't add your own
to that list. We take a
closer look at one quite promising one for .NET: PurpleSharp.
Game (and Animation) Physics
-
Why simulate physics for film production and for games?
-
Less work, especially when many objects are to be animated
-
Plausibly-looking result
-
Real-time simulation allows interactive animation
-
Simulation of physics is one important of the many jobs that may be taken
over by a game engine or by a specialized engine such as Newton.
Note that there are .NET bindings
for Newton.
-
Physical effects appear in different forms:
-
Particles (point-like objects subject to force fields; typically no collisions;
cheap to compute)
-
Rigid body (for applications such as bowling and ragdolls = bodies without
stiffness; medium cost of computation)
-
Soft body (for material such as rubber, cloth, skin; very expensive to
compute; typically not real-time; fraught with numerical instabilities)
-
Liquids (see Maya Unlimited)
-
Examples in Cinema 4D and Newton
-
The three main ingredients of rigid-body physics:
-
Physics of motion of extended bodies subjected to force fields, possibly
with friction or buoyancy
-
Collision detection
-
Collision handling
-
Collision detection is needed heavily in both rigid-body and soft-body
physics.
-
n objects can collide in n(n-1)/2 pairs: The cost of a naive collision
test grows quadratically with the number of objects. Note that soft-body
physics even have to handle complex self-collisions.
-
Reduce the work needed:
-
Use spatial coherency: Start with rough tests in a "broad phase", then
apply precise tests in a "narrow phase" to the pairs of objects that are
still unresolved. Several levels of hierarchy may be used. The broad phase
is typically on approximations such as bounding boxes (axis-aligned = AABB
or oriented = OBB), bounding spheres, BSP trees, and quadtrees/octress.
-
Use temporal coherency: Objects that are far apart in one frame remain
so in the next frames, depending on their velocity.