Chapter 3: Interactivity and Artificial Intelligence.
Chapter 0: Introduction: how to make games
This is not a reference manual, this is some beginners documentation on how
to start working with gameBlender to create a game.
Why gameBlender, what are the strengths ?
- Integrated environment, with modeling, animation and game player.
- Build-in Physics (rigid body dynamics) and Collision simulation
- Easy Interactivity with predefined Sensors and other Logic Bricks
- Powerfull scripting language Python for more advanced game play control
- True Multiplatform, All flavours of Windows, Linux, FreeBSD, BeOS, Irix and more
Instead of a long intro, I just take a few games genres, and tear them appart into some
pieces, and give reference to the Chapter that discusses them.
0.1) genre: 3D Shooter: Quake 3 or Unreal Tournament
sample: q3.blend (Olivier)
This genre could be much better done, content is working on this I think.
Parts:
0.1.1) consists of a 3D Environment (Part 1: Content)
0.1.2) main player (see 1.1), weapon that fires (see Chapter 3)
0.1.3) enemies with some artificial intellgence (see Chapter 3.2)
0.1.4) score (see Chapter 3)
0.2) Racing Game: Whipe-Out, Revolt (Acclaim) or Stunt GP (Team 17)
sample blend: Stunt Light Bulb.blend (Samo and IconJunky)
0.3) Sports
sample: skategirl.blend (Randall & Reevan)
0.4) Board game:
sample katmoko.blend (Carsten)
0.5) Simulation:
Incredible Machine
Sample .blend file: rigid_body.blend
0.6) Adventure
Parts:
0.6.1) a 3d environment (Chapter 1)
0.6.2) a plot or story, with goals
0.6.3) items to pick up (Chapter 3.0 intro on GameObjects and Properties)
0.6.4)
0.7) Arcade:
jump'n run and collect items
sample:to be done
0.7.1) 3d environment (Chapter 1)
0.7.2) navigation (Chapter 2)
0.7.3)
0.8) Puzzle: Seventh Guest
Chapter 1: Content: Graphics and Sound
1.1) Game Objects: the player, npc's (non-player characters, or enemies),
environment, lights and camera's.
Can have a Shape (Geometry), Appearance, Motion information (Chapter 2) and Interactivity Information (Chapter 3)
1.2) Geometry
Mesh, Polygon, Vertices
Sample (how to make a simple street (some cubes on a large plane)
1.3) Appearance
Textures, Colors, Material, Shaders
1.3) Light, a special kind of a Game Object
1.4) Camera, a special kind of a Game Object
Creating, Selecting, Positioning
Sample: adding a Camera, and selecting it, or select an other camera
1.5) Sound
1.6) Empty Object
Chapter 2: Motion: Simulation and Animation.
Relationship between a Game Object and Simulation / Animation
2.1) Animation by making use of Interpolation (also known as IPO's)
What is this for ?
What can be interpolated / animated ?
How do I create an interpolation / IPO ?
Sample: make a lift that goes up and down
2.2) Hierarchies
Parenting, Children
2.3) Rigid Body Dynamics, or Physics and Collision Detection
2.4) Inverse Kinematics (IKA's) (not yet)
Chapter 3: Interactivity and Artificial Intelligence.
The Game Engine is Interactive using a collection of Logic Bricks.
Relationship between a Game Object and Logic Bricks.
A Game Object can represent the a character, but also interactive elements like a door or moving platform.
It has memory in the form of properties.
Logic Behaviour in Ketsji consists of three parts:
3.1) triggering phase
this is handled by Sensors that can trigger on a certain condition.
3.2) artificial intelligence or scripting phase
Controllers takes care of this.
3.3) action phase
Actuators can influence the state of the Game Engine in several ways.
3.1 Sensors: Initiate or Trigger the start of a Behaviour
3.1.1: What is 'triggering', and when does a sensor trigger ?
Edge fall/rise, repeating etc.
(activating a controller)
3.2 Controllers: Artificial Intelligence or scripting phase
3.2.1 Simple Controllers
AND,OR, Expression controller
3.2.2 Advanced Controllers: Scripting Language
This is actually one of the strengths of the Game Engine: integration of Python scripting language. But a graphical userinterface for non-programmers is a future option.
Using Python scripting:
What can it do ?
Influence the Logic Bricks
Influence the GameObject that carries the script.
This can be done indirectly: first get the Python Controller (LogicBrick) that this script
is running, and then get the GameObject that is the owner of the controller
Create the script (text) (explain how)
samplecode like:
import GameLogic
controller = GameLogic.getCurrentController()
gameobject = controller.getOwner()
velocity = gameobject.getLinearVelocity()
Advanced for programmers: adding functionality to the Game Engine by writing a C or C++ module, that is accessible through python (Reevan�s cdplayer plugin)
write your own software in C or C++
make a python module of it
import the module in the game logic script
3.3 Actuators: Actions that influence the state of the Game Engine
Actuators
Shoot bullets (Add Object Actuator)
Play Animation (IPO Actuator)
Controll the Motion by applying force, torque etc. (Motion Actuator)