Physics Engine
The idea is that the engine offers a number of different simulations, that can be turned on or off depending on the container type and the settings on the server. Different containers or areas in the game will have different requirements for the level of realism needed in physics simulationFor example, when under the water the pressure will vary significantly with the depth, but when above the water at around sea level the air pressure can be treated as constant.
Or a planet surface container could just use a constant gravitation, directed downwards, while a solar system container would have to calculate the gravitation force vector for each body depending on nearby planets, moons, or stars.
Sometimes realistic and lightweight versions of some similar simulation could be given, and in that case it would be up to the admin to select which one to use (for example accuracy of collision detection). The simulations could also be configured with parameters (how often to recalculate gravitation forces acting on an object in space, etc).
Goals
Here's a list of different situations that the physics engine should be able to handle more or less satisfactory. The picture also illustrates different physical phenomena that could be simulated.
- Friction between items attached by some sliding or moving attachment. Includes rotation, sliding along track, moving on a surface, and floating in a fluid.
- Buoyancy of different things. A character diving in the sea, a hot air balloon, a marble in a glass of mercury.
- Breakage of houses and other structures made by attaching items, as a result of forces acting on them (including their own weight).
- Flow of fluids in and between containers (a redirected river filling up an orc den, leaving pockets of air at cave ceilings, air escaping from a spaceship through a hole in the hull, poison gas forming a cloud that drifts with the wind and slowly dissolves.
- Temperature of items
- Temperature in containers, as a result of in flow, outflow, heat sources, and heat absorbers. For example a room warmed by a fire on a cold night, a planet slowly heating as a result of a high carbon dioxide percentage, or a swimming pool cooled as a result of dropping in liquid helium.
- Effects of temperature on materials. Ice melting when warmed, clay hardening to ceramics when heated, wood catching fire when heated enough, the hot air in a hot air balloon having a lower density than cold air, and a character becoming very brittle and very frozen after being hit by a nitro-freeze spell.
- Rebounding or attachment of objects on collision, as a result of their elasticity etc. For example, bouncing a ball.
Features
This is a list of the main functionality areas that the physics engine will have, and what they contain.Bodies
The engine will operate on a few different types of physical bodies.Entity
An entity is a more or less solid object, possibly consisting of many attached component objects.Rope
A rope is an one-dimensional object, with a length and thickness, and some constant describing how bendable and elastic it is. These constants can depend on the material it is made of, but also depend in it's shape, for example an iron chain is bendable even if iron isn't.Rope can be simulated as a number of connected line segments or springs. The rope may be attached to other bodies at any point, or a sliding attachment can be used.
Liquid body
How exactly to simulate bodies of liquid is still open. In the landscape, they can be terrain layers. But flooding a house built from entity blocks is a bit more tricky. The concept of a container, and openings in a container, might be practical here.Fluid cloud
A fluid cloud can either be a cloud of gas, or a 'cloud' formed by releasing some liquid into a body of another liquid. A cloud will normally eventually expand and thin out, until it is either so diluted that it can be ignored, or has filled up the whole container that it was in, in which case the atmosphere or liquid in the container is updated to include the contents of the cloud.Ground
A ground is made up of layers of different types of matter, some of which can be liquid too. The ground is always completely spanning a given container, varying in height in the y direction. The ground can also contain caves or overhanging terrain. A planet surface can be simulated by a number of triangular containers, arranged suitably.Stellar or planetary body
This is used in space to represent large bodies that will decompose into containers with ground terrain on close range.Mechanics
Movement
A body will accelerate and move as a result of forces acting on it.Gravitation
This can be either constant, or depend on large bodies in the current container and possibly a constant outside gravitation. The former is used on planet surfaces, and the latter in space.Artificial or magical force fields can also affect the local gravitation / forces acting on different bodies in a container.
Collision
Detect collision between bodies, and simulate the result.Attachments
Attachments are different types of connections between physical bodies. If two bodies are attached, possibly with some degrees of freedom, they can in some cases be treated as one body, and there is also no need to perform collision checks between them.Solid attachment
This is an unbending, unmoving attachment of some strength. For example, two wall blocks nailed together, or a spear head of stone tied to a wooden spear.Rotating attachment
The attachment is free to rotate in some directions and ways. It can also be steered with some force by either body if the body is active in some way (a machine part, a body part, etc).Sliding attachment
A body that is attached to some track or rope, that allows it to slide along the track. Again, the sliding body or the track could actively apply some force to move the sliding body. There can also be branchings in the track. The attachment can either be hindered by these, or be able to switch to one of them depending on in what direction it is pushed, or on how the track allows it to move. There is also some friction between the track and the body moving on it. The moving body could also be able to rotate in different ways.Moving attachment
Two bodies can be pushed together as a result of various forces. They are free to move along the contact surface, but friction will affect that movement.There's many different cases of this; an entity moving over a terrain, an entity moving over a water surface, and an entity moving along the surface of another entity. In most cases there's some force that is needed to separate the two attached objects.
Examples are humans pressed towards the terrain surface by gravitation, an alien in magnet shoes walking on a metallic space ship hull, or a duck floating on the surface of a pond.
Freely floating attachment
This might be used to simulate the effect of an object being immersed in a fluid or liquid, and moving when the body of liquid is moved.For example, a goldfish in a fishbowl, or a passenger in some sci-fi gravitation suspension field.
I'm not sure if this should be modeled as an attachment.
Pressure
Buoyancy
Floating on a fluid/liquid surface
Movement of fluids
Includes both wind outdoors, and approximation of turbulent flow of fluids in pipes.Flow of fluid between containers
Simulation of fluid movements in containers with portals to other containers. The container could be a living room with doors to a few other rooms and to outside, or a pressurized vat connected through pipes with vents to two other vats.Addresses problems such as simulating a room filling up with water.
Flow of liquids over terrain
Water and other liquid layers, storing only flow information of rivers etc without simulating them in detail, and so on.Thermodynamics
Temperature of physical bodies
Each material type has some heat conductivity.Radiation
Spreading of heat through infra red radiationConvection
Spreading of heat through a fluid medium, such as air or water.Materials
material properties and reactions of materials on temperature, stress, and chemical reactions with other materials.Material state
Solid, powder, liquid, gas.Mixing materials
Properties of mixed materials, etc.Stress
Reactions of materials on stress.Temperature
Reactions of materials on temperatureMaterial Reactions
There's also complicated reactions such as:- Chemical reactions of mixing materials. Can also be affected by the temperature.
- Biological reactions. Reactions of organic or living materials on different things.
- Magical reactions.
- Reactions of 'intelligent' nanotechnology based materials.
The exact way this should be implemented needs more thought. There could also be different implementations with different degrees of flexibility and computational weight.
Light
I'm not sure, but we might also have to address light levels and sources in the physics engine. The general light level and sources in a container will be needed, and light radiation can also be converted to other energy forms.Sound
We'll eventually have to simulate the movement of sound somewhere.Electricity
Not sure if we need to address this very much. The energy transported in the mechanical system is of unspecified form. It seems only lightning strikes etc would be cases where electricity will have to be directly simulated in the game, and even there a fairly simply approximation will be enough.Radiation
Well, not needed that much in fantasy games, and in sci-fi etc we can assume that engines etc have built in protection. The only case might be explosions that release a lot of radiation, and those are short enough to be easy to deal with.- Home
- -
- About
- -
- Introduction
- -
- FAQ
- -
- Team
- -
- Newbie Guide
- -
- Getting Started
- Editing Guide
- -
- Edit
- -
- Manage
- -
- New Page
- -
- Changes
- -
- Map
- -
- Password
- -
- Deprecation