Information alert. Everyone copy this to your notes:
// Transparency Modes
// 0 - first-phase no alpha
// 1 - first-phase with alpha masking
// 2 and 3 - second-phase which overlaps solid geometry
// 4 - alpha test (only render beyond 0x000000CF alpha values)
// 5 - water line object (seperates depth sort automatically)
// 6 - combination of 3 and 4 (second phase render with alpha blend AND alpha test, used for fading LOD leaves)
// 7 - very early draw phase no alpha
rem forcesimpleobstacle
rem -1 : absolutely no obstacle
rem 0 : default
rem 1 : box
rem 2 : contour
rem 3 : full poly scan
Collison modes:
Customising the FPE - Collision Modes
Depending on the type of item, the way in which collisions are handled can be specified by use of the COLLISIONMODE field.
If you have a basic model that does not require precise collision such as a crate, step or wall, then a BOX collision would be a good option. This is the fastest collision method available. This is achieved by entering:
collisionmode = 0
If you have a more complicated model that is not as angular such as a vaulted arch, rock formation or is otherwise unusually shaped; POLYGON collision would be a good option. This is the slowest collision method available but offers a greater degree of accuracy. This is achieved by entering:
collisionmode = 1
You may have objects that you simply do not want to collide with anything. Background items that having collision detection would be impractical. Objects such as ground plants, debris or wires on the floor - there only to add colour to the scene but not to hinder the player. Collision for these types of items can be turned off completely by entering:
collisionmode = 11
For very complicated items, you may only wish to have partial collision. A Tree for example. POLYGON collision would be very slow due to the volume of the leaves and BOX collision would be too imprecise as the player would not be able to get close to the tree. For these types of items, limb collision can be used.
collisionmode=21
Use this when you want an entity to repel the player to beyond a 40 unit radius around the entity from the player. Great for characters and custom characters and avoids using expensive physics if not required.
collisionmode = 100x
Replacing x with the limb number will cause that limb only to receive BOX collision and the rest of the object will have no collision at all. Following the above example this allows the trunk of the tree to have collision allowing the player to walk right up to it without colliding with the leaves.
For unusual or curved objects such as bent trees or collapsed pylons for example, POLYGON collision can be achieved by using:
collisionmode = 200x
Tree Collisions
The 'collisionmode' attribute in your entity FPE file can be used to define a highly efficient collision cylinder for trees. Since players will largely be colliding with the trunk, leaves and upper branches may not necessarily need to be used for collision. In these circumstances the tree collision modes may be useful. The collision cylinder has the added benefit of allowing the player to smoothly slide around the tree.
The collision cylinder is vertically aligned, as tall as the entire model, and is calculated automatically from the vertex data of the model. The modes map directly to vertex data locations and the system will use this small selection of vertices to calculate the cylinder.
The modes are the following:
•collisionmode 51 - Uses all vertices in the lower half of the model to calculate the radius of the cylinder. Ideal for averaging trunk width in simple trees.
•collsionmode 52..59 - Uses a 1/16th portion of the lower half of the model to calculate the radius. 52 is the uppermost portion and 59 is the lowermost portion. This is useful to exclude low branches or roots from the cylinder calculation.
E.g. If a model was 16 units high:
•collisionmode 52 would include vertices between 7 and 8 units high
•collisionmode 53 would include vertices between 6 and 7 units high
•collisionmode 54 would include vertices between 5 and 6 units high
•...
•...
•collisionmode 59 would include vertices between 0 and 1 units high
If a cylinder cannot be calculate from the vertex data, the collision cylinder will not be made and the tree will have no collision data. If you cannot find a mode which suits the geometry, collsionmode 1 (full polygon collision) should be selected.
Animation Note:
The system does not support models with animation in which the animation significantly scales the model. For the collision cylinder to be calculated correctly, the exported model animation must not have a scaling factor which makes it larger/smaller than the original non animated mesh.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit