Handbook

From Golems Universal Constructor

Revision as of 18:35, 3 April 2011 by Axanon (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
image:icon_manual.png This article is the (almost) complete Golems Handbook. It is mostly intended for users who already have some basic knowledge of the game. If you are new to Golems and would like an introduction to the game's basic features, it is recommended you check the tutorial page first.

Contents

Game Menu

The main menu is accessed by pressing the escape key, or by clicking on "Menu" in the tool menu. The main menu allows you to save and load files, quit the game, adjust keyboard preferences, and contains numerous other options.

Main Menu

New Machine

Clear all current work in progress and begin a new machine.

Save Machine

Saves the current machine in your /Machines folder.

  • The Windows folder is located at Drive:\Documents and Settings\username\Machines
  • The Linux folder is located in your /home/username/Machines

Load Machine

Clear the current machine and load a new one.

Import Machine

Import another machine into the current workspace.

Record Video

Settings for video recording and control to begin recording. (also under Settings -> Recording options)

Exit Program

Self evident.

Settings

Display

The display sub-menu contains options to adjust the graphics quality to optimize performance on your computer. If you have a low-end graphics card or are encountering lag, you can try reducing the graphics quality (note that this will not affect how the physics is run). This menu also allows you to adjust the game resolution. If you switch aspect ratios (e.g. changing from 640x480 to 840x480), the graphics might be distorted until you restart the program.

Keyboard

View and customize the current control settings of Golems.

Recording Options

Settings for video recording and control to begin recording.

Machine

Name

In addition to the filename, you may set an internal name for your machine. Where you may name a file something like 'rocket01, rocket02, etc. the Name field in this section will remain static until it is changed.

Description

Here you may add an extended description of your machine. You could include instructions, ideas or give credit to somebody, or take credit for your work.

Environment

Speed

Sets the speed the machine plays back at when physics mode is engaged.

Gravity

If you set gravity as -9.81 on the y axis, then you are accelerating downwards at 9.81 units per second^2, which would make the distance units meters (assuming you are on earth - if you are not, then this scale is meaningless here). If you set gravity as -981 units, then you are accelerating downwards at 981 units per second^2, which would make the distance units cm.

The default densities for objects, however, are given in kg/L, which is equivalent to g/cm^3 but NOT to kg/m^3. Which is to say, that if you use the default densities, there are all exactly 1000 times too small if you consider the units to be meters.

In short, the most physically correct way to look at the Golems default settings is as being in centimeters, but with gravity at 1/10 of what earth gravity is at sea level. Which begs the question... why? Well, originally it was an accident. However, as it turns out, designing things that run in 1/10th gravity is much easier, especially for beginners, than designing things that run in full earth gravity. It also makes things easier on the physics engine. In other words, we got used to it, and now I am reluctant to change the settings.

This is something to consider changing in the future, and I could correct it in a number of ways... but this works quite nicely as it is.

The most natural way to look at things is that the units are cm, and gravity is 1/10 of earth as a result. Or, if you like the default gravity, then the most natural scale is meters, in which case things fall at the correct rate, but their densities are 1000 times too small. But the scale is entirely up to you, as is the gravity, and makes very little difference most of the time.

Angle to snap to (degrees)

When rotating objects with Snap Mode on, they will lock in at this specified number of degrees. For simple machines, 15 degrees (default) is usually sufficient, however when finer precision is required, this is customizable.

Grid Spacing

A formation produced using grid mode
A formation produced using grid mode

Grid mode allows you to "snap" objects between equally-spaced intervals. It is useful for when precisely-aligned components are needed, such as wheels and axles. It also allows you to "snap" while rotating an object between specified angles, and to snap objects to certain scales.

The default grid spacing is 1.0, but this can be adjusted in the Environment menu. Each axis (X, Y, Z) can have a different grid setting. The default angle interval is 15 degrees but this, too, can be customized.

There is always one grid point at the origin. This, combined with the grid spacing, determines the location of all the other grid points.

With a few exceptions, an object's centroid is what centers on the grid space. Therefore, resizing certain objects can occasionally cause them to leave the grid - for example, if a cube is stretched. When it is next moved in grid mode, it will re-center itself on the grid.

Axles center on the interface between the large and small half. Therefore, resizing axles will not cause them to wander off the grid.

Destroyable towers and walls can be easily produced by using a grid size such as 1.001 with blocks of size 1. Copying the block several times produces an array of blocks that are disconnected but closely spaced.

Grid mode is activated by pressing Caps Lock, or by clicking on the "Snap" indicator at the bottom right of the screen.


Background

By default, Golem's workspace background is quite basic and dark. This setting allows you to choose a color or 'skybox' (texture) to make your project look brighter and bring more life into your scene.

  • You may toggle the visibility of the workspace grid by checking the box beneath the dropdown menu.


Tool Menu

The Tool menu is where all of the objects that can be added into a Golems simulation are found. The menu appears when the cursor is moved to the left side of the Golems window. In addition, the menu can be made to always appear or always hide by using the minimize/maximize buttons at the top of the menu.

Buttons

Select
Rotate
Show Wires
Sphere
Tube
Cone
Capsule
Hinge
Ball-and-Socket
Function
Touch sensor
Multimeter
Gear
Island Select
Stretch
Box
Cylinder
Pyramid
Ellipsoid
Axle
Hydraulic
Battery
Oscilloscope
Distance Sensor
Rocket
Camera


Object Manipulation

Moving Objects

To move an object around in the editor, left-click on the object and drag the mouse. When the object is selected, it will turn bright green, and a movement direction disk will appear. This indicates the plane of movement of the object. In three-dimensional space, there are three planes of movement: The XZ-plane, which is horizontal; the XY-plane, which is vertical; and the YZ-plane, which is also vertical. The XZ plane is the default plane of movement. Holding ‘z’ or ‘x’ on the keyboard will change the plane of movement, and the movement direction disk will follow accordingly.

To make precise movements, use grid mode or axis mode. Grid mode, activated with the ‘caps lock’ key, creates an invisible grid of points are moved on. This makes it very easy to line up a wheel with an axle, for example. Axis mode is activated with the ‘tab’ key, and restricts movements to one direction at a time.

Selecting Multiple Objects

There are 4 ways to select multiple objects.

1.) Hold down the control key, and select each object you wish to move. The selected objects will be highlighted in green.

2.) While holding the control key and clicking on blank space you may draw a selection box around items you wish to select.

3.) The Island Select tool, will select all objects which are connected to each other.

4.) Layer select. The bottom-right menu has a 'Layer' mode. Objects assigned to a specific layer can be selected by pressing the Layer select button in the dialog box.


Rotating Objects

To rotate selected object(s), hold the shift key. Left click on the object and drag the mouse to position the object(s). When rotating multiple objects at once, you will notice that the rotation point is the center of the specific object you last clicked on, not the entire group.

The shift key changes the movement direction disk to the rotation direction disk. This indicates the axis about which the object is being rotated.

In 3D space there are three axes of rotation: X, Y, and Z. The Y axis (vertical) is the default axis of rotation. Holding ‘z’ or ‘x’ on the keyboard while holding shift will change the axis of rotation, and the rotation direction disk will follow accordingly. An alternative to using the shift key is to use the white rotation button, on the Tool menu.

To make precise rotations, use grid mode. By default this restricts rotations to increments of 15 degrees. This can be changed in the Main Menu under Environment settings.

Stretching Objects

To stretch an object, select the object with left-click, and press ‘alt’. Alternatively, press the white resize button on the Tool menu and select an object. A series of control points will appear which are specific to the type of object. Control points are white spheres that can be moved back and forth to control the dimensions of an object. For example, cubes have six control points, allowing each face to be stretched independently. A sphere has only one control point, which sets its radius. Left-click on the control point and drag it with the mouse to alter the size of an object.

To make precise stretches, use grid mode. This locks size increments to the grid.

Linux Note: On some Linux variations (Debian, Ubuntu/Mint) Alt is a hotkey to move the currently selected window. Although you can disable this key in your system preferences, it is recommended to use the button on the Tool menu.

Copy, Delete, Undo, Redo

To copy an object, select the object (with left-click), and press ‘c’. This creates an identical object at the same location as the original. To delete an object, select the object and press the ‘delete’ key. You can undo a mistake at any time by pressing control-z, and redo it by pressing control-y.

Object Properties

Objects have customizable properties, accessible from the object properties menu. To open the menu, left-click on an object and press enter. From this menu, you can adjust an object's material properties (like its density), change its colour, or for components like joints and rockets, adjust various parameters. You can also use this to make objects static or sticky.


Shapes

The eight shapes
The eight shapes

Golems supports eight basic shapes: Cubes, Spheres, Cylinders, Tubes, Pyramids, Cones, Capsules, and Ellipsoids.

Boxes

Boxes (technically cuboids or rectangular prisms) can be stretched into thin rods, wide planes, and large blocks using its six control points. They are very efficient; Golems can support hundreds of cubes colliding simultaneously with little perceptible performance drop on most computers.

Spheres

Spheres are also very efficiently simulated. The sphere has only one control point, which sets its radius.

Capsules

Capsules are also very efficiently simulated. The capsule has three control points; one for setting its radius and two for setting its height. With all else equal, the use of capsules is preferable to that of cylinders.

Cylinders

Cylinders are generally efficient, but less so when colliding with capsules or other cylinders. The cylinder has three control points; one for determining its radius and two for height.

Tubes

Tubes are constructed as an approximation from a large number of cubes.

Pyramids

Square-based pyramids have three control points: Two for setting the size of the base, and two for setting the height.

Ellipsoids

Ellipsoids are similar to spheres, but have three control points, allowing them to be stretched in several directions. However, ellipsoids are approximated by a triangle mesh. They are less efficient than spheres or capsules, so when all else is equal, avoid using ellipsoids.

Cones

Cones are presently the least efficient shape in physics simulation. When all else is equal, avoid using cones.

Object Center Points

For more information about how object center points work see the article on Grid mode.


Joints

Axle, Bearing, Hinge, Hydraulic, Ball-and-Socket, Universal Joint
Axle, Bearing, Hinge, Hydraulic, Ball-and-Socket, Universal Joint

Joints are used to make moving parts in Golems. There are four types: Axles, hinges, hydraulics, and ball-and-socket joints. Most joints (axles, bearings, hinges and hydraulics) can be turned into Motors in their properties menu.

Axles

Axles allow continuous 360-degree rotational motion, like a car wheel. In it's properties, you can change an axle to a bearing. There is a second rod on the other side, rigidly connected to the first.

Hinges

Hinges allow 180-degree rotational motion, like a door hinge. A continuous loop of hinges can be used to make a caterpillar track. The orientation of hinges can be adjusted by pressing alt.

Hydraulics

Hydraulics allow linear motion (forward and backward) within a defined range.

Ball-and-socket

Ball and socket joints allow rotation in all directions. In it's properties menu, you can change a ball-and-socket joint into a universal joint.


Motors

An axle's properties menu
An axle's properties menu

Joints can be driven by connecting a wire to the green (input) terminal. A powered joint is called a motor. Motors can be configured to work in several ways: Force control, velocity control, and position control. They also have a set maximum output force and a maximum velocity. These properties are set in the joint's properties menu.

Force control motors

When a force control motor receives a signal, it interprets that as the percentage of its maximum force to apply. For example, a motor set to a maximum force of 10 N receiving a signal of 50% will apply a force of 5 N. If a force-control motor reaches its maximum velocity, it ceases to apply any force. A force control motor receiving no input signal (or an input signal of zero) will hang loose.

Velocity control motors

Velocity control motors interpret a signal as the percentage of their maximum velocity at which they should move. The motor will attempt to reach that velocity by intelligently applying forces up to its maximum. If the load on the motor is too heavy, it may fail to reach its target velocity. A velocity control motor receiving no input signal (or an input signal of zero) will actively attempt to come to a stop.

Position control motors

Position control motors (also called servos) interpret a signal as the position to which it should move. The motor will attempt to reach that position by intelligently applying forces, up to its maximum force. If the load on the motor is too heavy, it may fail to reach its target position. A servo receiving no input signal (or an input signal of zero) will actively attempt to come to return to its starting position before the simulation was run.

Advanced Options

The advanced properties editor for motors
The advanced properties editor for motors

Position control motors have additional "advanced options", which allow you to tweak their behaviour. Checking off this box gives access to the three PID tuning constants: Proportional, integral, and derivative. By adjusting these values, the response time of the position control can be improved. For users unfamiliar with PID controls, it is recommended to leave these at the default values.

Proportional applies a force based on how far away the servo is from its desired position. Integral applies a force based on how much time it has spent away from its desired position. Derivative applies a force based on how quickly it's approaching its target position.

For example, let's say your hinge starts at position 0 and you want to move it to position 1.

Proportional (k_P) will say "the difference between 0 and 1 is 1, so apply a force of 1xk_P". Integral (k_I) will say "we've been waiting for 0 frames, so don't do anything yet". Derivative (k_D) will say "we are approaching the target value at a rate of 0, so apply a force of 0xk_D"

In the next frame, the hinge has moved halfway there and is moving at some fast speed.

k_P will say "the difference between 0.5 and 1 is 0.5, so apply a force of 0.5xk_P" k_I will say "We have spent 1 frame away from the target at a distance of 1, so apply a force of 1xk_I" k_D will say "We are approaching the target at a rate of 5 m/s, so apply a force of 5xk_D in reverse to slow us down"

So that's what they do. Basically, k_P gets you from where you are to the target. k_I will keep getting stronger and stronger as time goes on if you fail to reach the target. K_D slows you down if you're approaching too quickly, to keep from overshooting the target.


Wire Mode

Wire mode view of a complicated machine
Wire mode view of a complicated machine
Image:wire_view.gif

Wire mode is how machines are turned from ragdolls into robots. In wire mode, you are able to motorize joints, employ sensors, and program your machine. To access wire mode, press the Wire view button in the Tool menu. When in wire mode, all physical objects will appear in a transparent blue colour. Joints and functional components will appear with brightly-coloured terminals in two colours: yellow (output) and green (input).

You can leave wire view by clicking on the Single select icon in the Tool menu.

Wires and Signals

Wire mode is built around the idea of transmitting signals from yellow terminals to green ones. Signals always take on a value between -100% and 100%. By connecting a wire between two components, you are transmitting the signal from the output of one to the input of the other.

Wires are created by left-clicking on one terminal and dragging the mouse to the other. Wires are normally yellow, which means that they transmit the signal directly. But sometimes it is convenient to be able to change the polarity of a signal - for example, if the motor is spinning the wrong way when powered. The easiest way to do this is to use a red wire, created by holding the ‘alt’ key while creating a wire. A red wire flips the polarity (plus or minus) of its signal along the way.

If a wire is created between two terminals that are already connected, the new wire will replace the old one.

Wires can also be deleted. To delete a wire, select it with left-click and press the ‘delete’ key, just like any other object.

Batteries

Image:battery.gif

Batteries are a basic component of wire mode. The green battery button in the Tool menu creates a battery. This is a source of power for joints. Creating a battery takes you automatically to wire mode. The battery has one yellow output terminal, and a green switch. Batteries can be moved, rotated, copied, and deleted like any other object.

To power a joint, simply left-click on the output terminal of a battery and drag to the input terminal of the joint. Doing so creates a wire, in yellow, which indicates that there is a connection. The wire carries the signal from the battery to the joint, causing it to actively spin (for an axle or hinge) or push (for a hydraulic). A powered joint is referred to as a motor.

Motors can be configured to work in several ways: Force control, velocity control, and position control. They also have a set maximum output force and a maximum velocity. These properties are set in the joint's properties menu.

Each motor has an output terminal that generates a signal according to that motor's position, speed, or acceleration. This signal can be used to power another motor, just like a battery, or it can be passed to a function modifier.

Function modifiers

Function modifiers are the second basic component of wire mode. These allow you to perform operations on your signals, transforming them into a different signal based on a process that you define. Function modifiers can be used to create memory. They are very powerful programming tools!

Sensors

Sensors output information about your machine and its surroundings. You can use sensors to send signals that control motors such as hinges and axles to make 'self aware' machines which react to the environment.


Sensors

Four types of sensors viewed in wire mode. From top to bottom: Touch sensor, distance sensor, multimeters, oscilloscope.
Four types of sensors viewed in wire mode. From top to bottom: Touch sensor, distance sensor, multimeters, oscilloscope.

Sensors output information about the environment. The sensors in Golems are touch sensors, distance sensors, multimeters and oscilloscopes.

Touch sensors

Touch sensors have one output in wire mode. When an object collides with the sensor, it outputs a signal of '100%'; at all other times it outputs zero.

The output can be very brief, because collisions generally last a very short time. It is therefore often beneficial to connect the output to a decay circuit, or to a memory latch.

Distance Sensors

Distance sensors (formerly radar sensors) consist of two pieces: The physical 'sensor' (a pyramid), and its field of view (a transparent red object). The shape of the field of view can be customized in the properties menu for the sensor; by default it is a pyramid. Distance sensors have one output in wire mode. They output '100%' when an object is in contact with the field; at all other times they output zero.

The distance sensor's field is maintained at its location with respect to the sensor itself. Thus, if the distance sensor is moved around, its field will move too. The field is invisible until the sensor is selected.

Multimeters

Multimeters report information about themselves, and are very versatile. They can be set to many different modes (hence, 'multi'). For example, a multimeter can be set to report its position with respect to the origin, its velocity (in X, Y, and Z directions), and many other useful values.

When set to altitude, multimeters have one output node. Otherwise, they have three (one per direction). In most settings, an operating range must be specified. This is because signals need to be between -100% and 100%. When the sensor exceeds its operating range, its output signal saturates.

Position, velocity and acceleration outputs have the option to be reported "relative to the orientation of the component". The meaning of this is best illustrated by an example. If a velocity sensor is built into a cannonball and fired from a cannon, it can output its Z velocity with respect to its own Z axis or with respect to the editor's Z axis. With the box unchecked, it will report its velocity in the up-down direction; with the box checked, it will report its velocity in a direction that depends on how the sensor itself is rotated. In this case, it would probably be most useful to leave the box unchecked, because the cannonball will be spinning wildly.

Multimeters are an important component in inertial dampeners.

Oscilloscope

An example of an oscilloscope measuring altitude. (click image to enlarge)
An example of an oscilloscope measuring altitude. (click image to enlarge)

Oscilloscopes are a diagnostic sensor used to gauge outputs of any object that has an output terminal. They do not affect a signal, only measure it. These sensors can also be named in their properties box.


Special Objects

Gears

Gears are compound shapes composed of a cylinder and a number of teeth, made from cubes. In the gear's properties menu, the tooth height, width, and angle can be adjusted. The illustration below shows how these determine the gear's dimensions. The number of teeth is automatically set based on the gear's radius and the tooth dimensions.

The tooth angle (a) ranges between 0 and 90 degrees. An angle of 0 degrees corresponds to square teeth; this is a special case that is slightly more efficient for the physics engine than angled teeth. Tooth angles of 15-30 degrees are recommended for realism and smooth operation.

In general, gears with equal tooth dimensions should mesh regardless of their radii. If not, some minor adjustments to tooth width can sometimes help them to mesh.

The ideal relationship between two spinning gears of different sizes is as follows: (Speed A * Number of teeth A) = (Speed B * Number of teeth B)

For further details about the use of gears, see Wikipedia's article: Gear ratios


Rockets

An example of how rockets can be used to make a space ship with separating boosters.
An example of how rockets can be used to make a space ship with separating boosters.

Rockets are special objects that apply forces on themselves. The magnitude of the force depends on the signal received by the rocket, and on its maximum force setting (which can be adjusted in the properties menu). The default force is 10 N.

Unlike motors, rockets in Golems act in violation of Newton's Third Law ("every action has an equal and opposite reaction"). This makes them quite flexible and powerful tools, but also somewhat unrealistic.

Rockets can be combined with multimeters to make inertial dampeners.

Particle effects

Rockets can have particle effects, which are customizable from the rocket's properties menu.

  • The two colour bars denote the initial and final colour of the rocket particles. *For an attractive fade, it is recommended that the second colour be made mostly transparent.
  • Enabling luminescent trail means that dense clusters of particles will appear brighter, rather than darker.
  • The min and max angle define the spread in which the particles can travel. The particles are restricted to an area between the cones defined by the minimum and maximum angles.
  • Each particle will exist for a random time between the minimum and maximum lifetimes. The particles also spawn at random intervals between these times; therefore, if the min and max times are the same, the particles will be emitted in bursts.
  • The number of particles is the maximum number of particles from a particular that can exist at a given time. When the maximum number of particles has been reached, no more will spawn until some previous particles have reached their lifespan. A slow computer will struggle if many particles are on screen at a given time.
  • The initial velocity is the absolute speed at which the particles leave the rocket when they are created. It is not influenced by the speed at which the rocket is traveling.
  • Custom effects can be named and saved, to be added to the drop-down menu as favourites.
  • Effects can be disabled for a rocket by un-checking the Enable Effects box.


Cameras

A camera viewed in wire mode.
A camera viewed in wire mode.
Cameras are special objects that can be attached to a group in order to follow its motion during the simulation.

You can cycle between different camera views by using the page up and page down keys.

Cameras attached to objects will move with the object. A camera that is not attached to any object will remain place, unaffected by gravity or contact with other objects.

A camera can also "Lock Orientation," meaning the camera will not rotate relative to an object it's attached to. (The camera can still be rotated with Right Click)

Mode Menu

Mode menu (bottom right corner)
Mode menu (bottom right corner)

The mode menu is the set of buttons at the bottom right corner of the Golems workspace. They are used to toggle views and editing preferences.

Layer Mode

Layer menu options
Layer menu options

Layer mode is used to define groups of objects. You may name these layers for easier identification. You can also toggle layer visibility to isolate areas of machines.

Layer Options

  • New Layer - Create a new object layer.
  • Copy Layer - Copies selected layer.
  • Select Layer - Selects all objects in the currently selected layer.
  • Move to Layer - Moves all selected objects to a new selected layer.
  • Delete Layer - Deletes all objects within the selected layer.

Toggles

  • Lock -
  • Hide - Hides all objects of the current layer.

Axis Mode

Confines movement of an object or group selected of objects along one axis, instead of to its movement plane. This is useful when making fine adjustments to an object, such as a wheel on an axle, where grid mode would be too cumbersome or restrictive.

Axis mode can be activated by pressing the tab key, or by clicking on the "Axis" indicator in the bottom right corner of the screen.

Sensors Mode

Will toggle the visibility of all sensor fields in the machine.

Snap Mode

Will toggle grid mode off and on. When on, all objects will snap to the workspace grid when moved in edit mode.

Static Mode

Toggles whether static objects can be selected or not.


Personal tools