Make Game Development Child’s Play
Figure 1: Crytek CryENGINE 3 feature screenshot
If you’ve ever wanted to explore game development there is no better time than now. The advances in Autodesk® 3ds Max® and free game engines such as CryENGINE ®3 Sandbox ™ provide the opportunity for us to dive into the world of game development and begin creating environments of our own in an extremely short amount of time. I had the opportunity to do just that and in this article I’ll exhibit how quick and simple it is to export Max PC game assets to CryENGINE 3 using a model provided by CG Artist Truong (https://www.facebook.com/truongcgartist). To follow the tutorial I recommend you download one of Truong’s models located online at http://www.turbosquid.com/Search/Artists/cvbtruong.
Figure 2: “Demon” created by Truong
Installation and Setup
In order to begin you’ll need to download and extract the CryENGINE 3 Sandbox SDK (Software Development Kit) from Crytek by visiting: http://www.crytek.com/cryengine. CryTek developed tools specific for use with Max that makes asset development and exporting simple. Once extracted, you’ll need to run the SettingsMgr.Exe file located in the Tools folder under the CryENGINE 3 root directory. The Settings Manager will open and there you’ll need to change the Engine Tab’s root directory to the correct path on your hard drive. 3ds Max will use this path during startup. If the Manager locates the RC.EXE (Resource Compiler.exe) file in the root directory, it will say so and turn the Engine State light green.
Figure 3: CryENGINE settings manager
Installing the Plug-Ins
The CryENGINE 3 plug-ins are specifically designed to help export source assets in an optimized format. Located in the Tools folder in the CryENGINE 3 directory you’ll find several CryExport**.dlu files. You’ll want to select the appropriate plug-in for your version of 3ds Max and copy the file into your Max Plug-ins directory (ensure Max is closed). Versions are listed below:
CryExport10.dlu = 3ds Max 2008
CryExport11.dlu = 3ds Max 2009
CryExport 12.dlu = 3ds Max 2010
CryExport13.dlu = 3ds Max 2011
CryExport14.dlu = 3ds Max 2012
CryExport15.dlu = 3ds Max 2013
I’ve found that CryExport15.dlu appears to work sufficiently for Max 2014. If you are running a 64-bit operation, you’ll want to use the plug-ins suffixed with “_64.” The developers at Crytek also have provided scripts to assist with development in the typical Maxscript format that can be located in the Tools/CryMaxTools/ folder. To install them, users simply need to copy the LoadCryMaxTools.ms file into their Max scripts/Startup folder. To remove them, simply remove the file.
CryENGINE 3 Sandbox has a specific directory structure that allows the user to update assets on the fly. For your first asset, you’ll need to create a subfolder called “Objects” (case sensitive) located inside the Game folder in the CryENGINE 3 Root directory. Inside that newly created subfolder, you’ll want to create another folder called “MyFirstObject.” This is where you’ll want to store your Max file.
CryENGINE Exporter Tab
Once the settings manager has been updated with the appropriate path and the plug-in file is copied into the 3ds Max plug-ins folder, you can start up 3ds Max. You’ll notice that the CryENGINE 3 Settings Manager will launch with each new session of 3ds Max. Simply select save and it will close. We’ll need to add the CryExport tools to your button sets to continue. Navigate to the Utilities tab in the Command panel, and select the Configure Button Sets. Increase your total buttons to one more than you currently have (10 if you haven’t modified them before), locate the Crytek Tools CryENGINE 3 Exporter utility in the combo box, and drag it to your new blank button. Select Okay and you’ll now have the CryENGINE 3 Exporter tools with your utilities. You’ll also notice that the Crytek plug-in installed a new menu on top of your screen called CryMaxTools. We won’t be covering those features in this session.
Preparing the Model
Choose one of your own Max models, download one from Truong, or use any other model you have at your disposal. For your first asset, though, I recommend a simple editable poly to ensure maximum ease and stability. Once you select and open or import a model, save your Max file in the MyFirstObject folder you created in the CryENGINE 3 root directory (if you haven’t done so already).
At this point users can create materials and export it using the CryENGINE 3 Material Exporter tool in 3ds Max. To simplify this first tutorial I’ll skip material exporting and head straight to exporting our asset. I also won’t be covering LODs (Level of Details), but recommend that you learn more about them if you are interested in diving deeper into game development.
A very simple 3ds Max scene for CryENGINE 3 export contains three items. A dummy helper (which you should place at 0,0,0 and not scale or rotate after inserted), a mesh (aka RenderMesh, or our model), and a proxy object that will simulate collision—known to gamers as the “hit box,” this is what the software uses to calculate whether something collides with it or not and how to act appropriately. I recommend you use a simple editable poly to minimize the amount of calculations the software has to run during game play. The mesh, of course, is the actual model. Figure 4 exhibits the objects I described (although my proxy object is rudimentary for my specific mesh).
Figure 4: Basic scene for CryENGINE Exporter
In order for CryENGINE 3 to identify that the proxy object will have collision, we’ll need to assign it a specific name: “$physics_proxy_0”. You’ll also want to add to the object properties (by right-clicking on the object) and type in “box” to insure CryENGINE 3 calculates collisions based on box geometry (although using complicated geometry is an option). A more comprehensive overview of User Defined Properties utilized can be located in the CryENGINE 3 tutorial and help files.
Finally, we’ll want to name the dummy helper. This is the name you’ll see in CryENGINE 3. For my example, I called it “MyDemonDummy.” I recommend you call it something simple and unique to ensure it remains easy to find as you continue to develop more assets for your library. We’ll then need to select both the proxy and the mesh, and reset xform on both objects. Reset Xform is located on the Utilities tab in the Command panel. Next, link your mesh to your dummy, and then your proxy to your mesh. If you open your scene explorer, it should look similar to Figure 5.
Figure 5: Scene Explorer showing parent/child relationship
Next you’ll want to ensure the pivot for your proxy and mesh is located at your dummy helper at coordinates 0,0,0. You can move your pivot by selecting both the proxy and the mesh, navigate to the Command panel, select the Hierarchy tab, and choose “affect Pivot only.”
Once everything is named appropriately and linked properly, you can proceed to export. To export, select the dummy helper only, navigate to the CryENGINE 3 Exporter button located under Utilities in the Command panel, select “add selected,” and check “Export File Per Node” in the Geometry Export Options. Finally, select the “Export Nodes” button and 3ds Max will export the file to the MyFirstObject folder in which we stored it.
Importing the 3ds Max Model
Importing your model into CryENGINE 3 is simple. After you start CryENGINE 3 select the default level “Forest.” When opened, select the Objects tab on the right of your screen, then select Brush. Here you should see your “MyFirstObject” folder and inside the folder you’ll find your newly created asset. Simply drag and drop it into the forest level. You may need to scale it using the tools available in CryENGINE 3.
Tip 1: To learn more about CryENGINE 3, I recommend EAT 3D’s Volumes 1-3 covering almost every aspect of level creation and the CryENGINE 3 CookBook by Dan Tracy and Sean Tracy.
Tip 2: The Crytek plug-in for 3ds Max comes with a ToolBox under the CryMaxTools menu that provides an automatic proxy mesh generator to create the child/parent link necessary for export.
Tip 3: If you’d like to apply materials/textures to your objects in CryENGINE 3, refer to the tutorial and help files provided with the SDK. To open CryENGINE 3’s material editor, type “M” where you can select a material and apply it to your object.
Tip 4: CryENGINE 3 is set up for Metric scale. You’ll get the best results if you set 3ds Max Display Unit Scale to Metric and System Unit Scale to 1 Unit = 1 Centimeter.
Tip 5: Assets typically have polygon “budgets.” Keep in mind that the silhouette is more important than a high tessellation of flat areas. Visit CryDev.Net for additional asset guidelines.
Figure 6: Truong’s “Demon” in CryENGINE 3