Friday 1 August 2014

Adding Collision

(One of the models with a simple collision box)

Just a short entry about adding collision to the models to make sure people can't walk through walls.  I'm still not sure if this will be a necessary stage, as I'm not likely to be able to get any gameplay in at this stage (I'll be unable to work on this project past tomorrow evening due to other commitments).

Ideally collision is added to the mesh before it's exported to engine.  In 3DS Max it's added as standard geometry that's given an appropriate name and parented to the render mesh (the model you see in engine).  This is done in the Schematic View as seen in the image below.  It's probably worth pointing out that the pivot point for the collision should have the same coordinates as the object it's parented to.

(Schematic View in 3D Studio Max used to parent objects)

The rest of the process is done in the Material Editor in Max.  Models use a material with multiple sub-materials (dependant on how many material ID's you are using), one of which is for the physics proxy.

(Material Editor set-up to turn geometry into collision in engine)

On the Crytek Shader settings (in the sub-material) it needs to be set to 'Physics Proxy (No Draw)', and the 'Physicalize' box ticked.  The diffuse sub-materials also need to use the Crytek Shader but don't need to be set to the same settings.

No comments:

Post a Comment