COSC1186 Assignment Report

Alex Holkner 2107062K

Orc

Included Programs

Rather than being a stand-alone executable, the compiled program relies on external scripts to determine its behaviour and operation. Scripts can be written with any text editor, and are written in a language designed especially for this project.

Some scripts are designed to be "run" directly by the program. These scripts have the extension .program and can be specified as the command-line argument to the executable.

For example, running

./orc marionette

starts the program with the marionette.program script. The script determines the key bindings, orc geometry, animations and behaviour. Each of the included programs is detailed here.

Global key bindings

These keys are consistent across all programs. Use the function keys to toggle various rendering options:

F1
Shadows on/off
F2
Frames per second display on/off
F3
Skybox (environment texture) on/off
F4
Meshes / Bones
F5
Show X-axis on each bone
F6
Toggle wireframes / filled polygons
F7
Toggle smooth / flat shading
F8
Lights on / off

The program can take a screenshot and save it as a PNG: (by default, these are saved in the screenshots directory)

Shift + F5
Take a screenshot

The program can also take screenshots at regular intervals, which can later be compiled together into an MPEG, or similar.

Ctrl + F12
Start recording
F12
Stop recording

Ensure you have plenty of disk space before recording! By default, frames are recorded at 24 FPS, and are also saved in the screenshots directory. Using ImageMajick, an MPEG can be created with the command:

convert *.png movie.mpg

If a key binding is not available for a particular script, you can always enter command mode and type the directions immediately. To enter command mode press escape.

Escape
Enter/exit command mode

The bottom of the screen shows a ">" prompt while in command mode. No other key bindings will work in command mode; you have to exit command mode by pressing Escape again.

When in command mode, press Enter to execute a command, and use the up and down arrows to cycle through the command history (as with most Unix shells).

These mappings can simplify script debugging:

Shift + F1
Output the result of each statement
Shift + F2
Show the log on screen

Marionette Program

Start with:

./orc marionette

A single orc is under the direct control of the player. Use the arrow keys to move around. Different movement styles and poses can be selected with the keys:

Key bindings

Keyframer Program

Start with:

./orc keyframer

A single orc is created, without any scenery or behaviour. Use the left and right arrow keys to move between frames. The spacebar previews the current animation. The program provides two modes of operation: forward kinematics (the default) and inverse kinematics. You can toggle between them by pressing z.

Left/Right
Select frame to edit
Spacebar
Preview animation
z
Toggle forward / inverse kinematics

Forward Kinematics

Select a bone to move by pressing one of the keys:

Key bindings

The selected bone can then be rotated and translated using the number keypad:

Key bindings

Inverse Kinematics

Select an inverse kinematic chain, and its goal, by pressing the keys:

a
Select left foot goal
s
Select right foot goal

The selected goal can be moved in world space on the number keypad:

Key bindings

To solve a chain:

n
Solve for left foot
m
Solve for right foot

Press the solution key multiple times for a better match on each iteration.

Relevant Commands

While in keyframer mode there are some commands that can be used to simplify framing:

working = useweapon;
Change the working animation -- that is, the one that is previewed with the spacebar.
writeframes('orc.frames');
Write the current frames to the given filename.
insertframe(5);
Insert a new frame at the given index.
copyframe(1, 2);
Copy frame 1 to 2.
copypartialframe(1, 2, #LeftArm#)
Copy just the rotation and translation information of the given bone (geometry).

Duel Program

Start with:

./orc duel

This is a non-interactive demonstration of some simple orc behaviour. Two orcs are created, each trying to attack the other. If a hit is successful, the victim will "die", and can be resurrected by pressing the spacebar.

Mordor Program

Start with:

./orc mordor

This is another non-interactive demonstration of orc behaviour. The program starts with a single orc. More orcs can be added by pressing the spacebar. The orcs will exhibit some simple group behaviour.

Valid XHTML 1.1! Valid CSS!