Game Creation Kit: Last modified 02/02/07 17:04:05 cw
Prev | Chapter 26. Blenders game engine | Next

# 26.4. The RealtimeButtons

The RealtimeButtons are meant for making interactive 3-D worlds in Blender. Blender acts as a complete development tool for interactive worlds including a game engine to play the worlds. All this is done without compiling the game or interactive world. Just press PKEY and it runs in real-time. The main view for working with the Blender game engine are the RealtimeButtons ( ). Here you define your LogicBricks, which add the behavior to your objects.

Figure 26-4. RealtimeButtons left part

| The word "games" is here used for all kinds of interactive 3D-content; Blender is not limited to making and play games

The RealtimeButtons can logically be separated in two parts. The left part contains global settings for GameObjects.

This includes settings for general physics, like the damping or mass. Here you also define if an object should be calculated with the build-in physics, as an actor or should be handled as an object forming the level (like props on a stage).

Settings for GameObjects

Actor

  Activating "Actor" for an object causes the game engine to evaluate this object. The Actor button will produce more buttons described below. Objects without the "Actor" button activated can form the level (like props on a stage) and are seen by other actors as well.

Ghost

  Ghost objects that don't restitute to collisions, but still trigger a collision sensor.

Dynamic

  With this option activated, the object follows the laws of physics. This option spawns new buttons that allow you to define the object's attributes in more detail.

Rigid Body

  The "Rigid Body" button enables the use of advanced physics by the game engine. This makes it possible to make spheres roll automatically when they make contact with other objects and the friction between the materials is non-zero. The rigid body dynamics are a range of future changes to the game engine. Use the "Form:" factor to control the rolling speed.

Do Fh

  This button activates the Fh mechanism (see Section 26.6). With this option you can create a floating or swimming behavior for actors.

Rot Fh

  With this option set the object is rotated in such a way that the Z-axis points away from the ground when using the Fh mechanism.

Mass

  The mass of a dynamic actor has an effect on how the actor reacts when forces are applied to it. You need a bigger force to move a heavier object. Note that heavier objects don't fall faster! It is the air drag that causes a difference in the falling speed in our environment (without air, e.g. on the moon, a feather and a hammer fall at the same speed). Use the "Damp" value to simulate air drag.

Size

  The size of the bounding sphere. The bounding sphere determines the area with which collisions can occur. In future versions this will not be limited to spheres anymore.

Form

  A form factor which gives you control over the behaiviour of "Rigid Body" objects.

Damp

  General (movement) damping for the object. Use this value for simulating the damping an object receives from air or water. In a space scene you might want to use very low or zero damping, air needs a higher damping, use a very high damping to simulate water.

RotDamp

  Same as "Damp" but for rotations of the object.

Anisotropic

  When an actor moves on a surface you can define a friction between the objects. Friction will slow down objects, because it is a force that works against any existing forces in the direction of the surface. It is controlled in the dynamic material settings (MaterialButtons F5, see Section 26.6). This friction works equally in all directions of movement.

  With the "Anisotropic" option activated you can control the friction independently for the three axes. This is very helpful for racing games, where for example the car receives little friction in the driving direction (because of the rolling tires) and high friction sliding to the side .

Below the object settings you define the Properties of a GameObject. These Properties can carry values, which describe attributes of the object like variables in a programming language. Use "ADD property" to add properties (see Section 26.5).

The right part of the RealtimeButtons is the command center for adding logic to your objects and worlds. The logic consists of the Sensors, Controllers and Actuators.

Figure 26-5. Example of some LogicBricks

Sensors are like the senses of a life form; they react on key presses, collisions, contact with materials (touch), timer events or values of properties.

The Controllers are collecting events from the sensors and are able to calculate them to a result. These are similar to the mind or brain of a life form. Simple Controllers just do an AND on the inputs. An example is to test if a key is pressed AND a certain time has passed. There are also OR Controllers and you can also use Python scripting and expressions in the Expression Controller to create more complex behavior.

The Actuator actually performs actions on objects. A Motion Actuator for example is like a muscle. This muscle can apply forces to objects to move or rotate them. There are also Actuators for playing predefined animations (via Ipos), which can be compared to a reflex.

The logic is connected (wired) with the mouse, Sensors to Controllers and Controllers to Actuators. After wiring you are immediately able to play the game! If you discover something in the game you don't like, just stop the game engine, edit your 3-D world and restart. This way you can drastically cut down your development time!

Prev | Home | Next
Command line options for the game engine | Up | Properties