Friday 19 April 2013

Creating automatic doors (using custom geometry) in CryEngine 3 [Game Dev]

This is something that I have been working on for a project and couldn't find very much documentation on, and even though it is quite an easy thing to do, I had some problems doing.

First thing to mention is that I wanted to use my own models for the door. The basic set up that I have is a door at the end of a corridor. The door is made up of three parts. Firstly, the door frame and surrounding wall, which connects to the rest of the corridor, and 2 doors (left and right) which have slightly different geometry. The frame and wall geometry is in the level as a brush and the doors as door entities (door entities are found in the Rollup Bar under the entities menu


I have placed two of these (one for each door) and change a few of the properties of the entities. First if you are using custom geometry, or just want to use something other than the default mesh, the model can be changed in the entity properties. As I want the doors to slide open I have zeroed out the rotation values and set the range of the slide to 1.5 and -1.5 to make the doors slide in opposite directions. The axis may also need to be set if the model is not already in the correct axis. The other important thing to mention is to set the UseDistance to 0 so that you do not get the Open Door prompt on screen when you approach the doors.


To make the doors open automatically they need to be connected to a trigger. I have placed a proximity trigger (found in the Rollup Bar under Entities > Triggers) in the middle of the two doors and set the DimY value to 8. This works with the default acceleration of the door entities if you sprint to the door, but these may need to be changed depending on the feel desired.

The last thing to do is to set up the functionality in the flow graph to connect the trigger to the door entities. With the trigger selected, at the bottom of the Rollup Bar, click Create under the Flow Graph heading. Click New and type and name for the action. Something meaningful like opendoors.


With the flow graph open and the trigger sleceted, right click in the center of the main work area and chose Add Selected Entitiy. Do the same for the door(s). Now to actually connect the nodes drag from Enter on the trigger node to Open on the door nodes and from Leave on the trigger to Close on the door nodes.


Now jump in the level and when you get with in 4 meters of the doors (half of the Dim Y value as that this a radius from the center of the node) they will open.




7 comments:

  1. I opened and closed only once (

    ReplyDelete
  2. Great article. The concept The secret to creating magnetic, high-traffic blog contentreally is well explained and has helped me a lot. thank you for submitting this article. Automatic Swing Doors

    ReplyDelete
  3. very nice content. love to visit your blog again and again. Thanks author for such a wonderful content. For the best automatic door repair services in Tower Hamlets, contact the ADV Contractors. We have a range of uniquely and creatively designed automatic doors.

    ReplyDelete
  4. Thanks for posting the useful information to my vision. This is excellent information.
    Automatic Garage Doors Repairing

    ReplyDelete
  5. Structure Tents for Sale.Kenten provides 50m Big Structure Tent For Large Exhibitions in China and abroad 40,000 square meters Structure Tents for Sale are erected for the 2nd World Robotics.

    ReplyDelete
  6. Structure Tents for Sale.Kenten provides 50m Big Structure Tent For Large Exhibitions in China and abroad 40,000 square meters Structure Tents for Sale are erected for the 2nd World Robotics.

    ReplyDelete
  7. Thanks for sharing such an informative post. Please keep it up the great work and surely come back for more information. Please visit Us Here as well to learn more about automatic doors.

    ReplyDelete