Tuesday, 25 March 2014

Re-Familirasing Myself with the CryENGINE - Back To Basics

With the bulk of larger assets, the track for example! being modeled in 3D Studio Max, most of them at least at the white box stage, I need to start importing things into my chosen game engine (Crytek's CryENGINE) and begin the layout of the level. 

I haven't gone near the engine for well over six months now, the last time being during the second year group project, and unfortunately, even then, I didn't spend much time with the engine as I was mainly tasked with concept work, modelling and texturing. One skill taken from that project in relation to the engine though, was that I was able to confidently prepare the assets in 3DS Max, ready for exporting to the CryENGINE, something which the other group members seemed to struggle with on occasion!

First things first was to download the latest engine, which was CryENGINE 3.5.6. After opening the editor I wanted to start by just spending a few hours learning the basics again. I began by creating a new level and editing the terrain, experimenting with the height map resolution and meters per unit and the painting the terrain.

I decided that for now I would just fill the whole map with a terrain at the same height so I basically had just a complete flat map to begin building the level. 

Once I had this in place I wanted to import the circuit diagram I had made. I think I could put the diagram itself on the actual terrain so that as I modified the terrain the actual diagram would stay in place which would probably make it easier to keep the layout most accurate, but, I decided to just import the plane from 3DS Max, which was already the right size to just have the diagram applied as a texture. I could then hide it when I was using the diagram.

Before I could export the plane needed for the diagram, as with building the assets in 3DS Max, I had to ensure that the scale was correct within the engine, especially as this is what the player would interact with, it's important that everything is the correct size. The unit size of 3DS Max and CryENGINE also had to match, other wise, an object that was the correct size in Max may appear really huge or tiny once exported to CryENGINE if the units didn't match. 

This appears simple at first, but as you may know if you work with any of these programs, things never are. Changing the units in 3DS Max I exported the track model as you can see below;

Errrmmm?... pick one?!

Okay so things haven't gone right straight away. As you can see from the image above, altering the unit size in 3DS Max drastically affects the size of the model after exporting it into CryENGINE. One of these has got to be the right size though? surely? 

Okay, so I cant just pick one and hope for the best. I want the circuit to be exactly the correct size, and either way, once the engine is in game mode and you're able to use the player to explore the level its going to be immediately noticeable. 

There was only one way to be sure that the unit set up in my 3DS Max file. I did this by modelling a 1x1x1 meter box inside 3DS Max and exporting it into CryENGINE. I also built a 1x1x1 meter box in CryENGINE using the solid designer tool. Once these boxes matched, I knew that the units were set up correct inside 3DS Max and all of my models would be to scale once exported to CryENGINE. 

You can see in the image below the two 1x1x1 meter boxes side by side. They match!

Phew! take a breath! 

As you can see from the image above I also played about with some of the other basic CryENGINE tools such as player spawn point.

All I had to do now was export the plane from Max and apply the track diagram in CryENGINE as a texture. Converting the diagram to a CryENGINE texture, known as a Cry Tiff was a simple process using the Photoshop plug-in. The plug-in was already installed from last years group project and I had gone through the process quite a few times during that project.

Once this was done, the texture was applied in CryENGINE!

Erm, no, hang on, that's not right is it?! 

Okay, so the texture's applied, its the right scale, but its a little pink. Its not ideal but its a start! I could probably get on like this to be honest, but I'll eventually come to a point where I need to start texturing the rest of the level and in all honesty, I don't want a pink Stretton. 

Oh yeah, one other thing, when I zoom into the diagram now, which I need to do for the placement some of the smaller assets, this happens;

Lots of tiny diagrams!

Okay CryENGINE, something's not right, again if your familiar with these programs, there's always something not right, always something that just doesn't work right away, always something that needs fixing. Ahh I'm getting tired of this! Only a few more weeks to go!

And then it finally clicked, (after opening the material editor again).

I remember we had this problem with the group project. An important file called 'resource compiler' was missing from the CryENGINE download so the engine wasn't able to process the materials properly. Looks like the file is still missing! get it sorted Crytek! you see, its this kind of thing that I'm tired of!

Anyway, lets bring this blog to an end. After downloading the 'resource compiler' or 'rc' folder it seemed to work. For now! 

The next stage is to begin exporting the white box assets into the engine and begin laying out the level. 

Tuesday, 18 March 2014

Full Track Reference

Before Christmas I was given the circuit all to myself to collect reference photographs! What a cool experience.

Unfortunately the conditions weren't perfect as it was begging to rain but thankfully it stayed off for the few hours I spent at the circuit. The fact that it was winter also wasn't ideal as the conditions weren't what I plan on re-creating in my level. My plan was to gather as much photographic reference as necessary to allow me to begin recreating the track accurately and with a good level of detail. I started by actually walking along the race track, armed with my camera and tripod to ensure that the photographs taken were always roughly at the same height. Starting at one point on the track and standing roughly in the center of the track I placed the tripod and took 5-6 photographs from left to right, i then walked approximately 10 steps forward and repeated the process until I had walked the whole track which took roughly 2 hours. I was happy that this process would give me enough reference images to ensure I would be able to reconstruct the circuit at home without having to return the the track unless absolutely necessary.

After photographing the track itself I then continued to photograph the rest of the complex from various angles as well as photographing the horizon from different locations to use as reference for distant objects within the level. Although some of the features of the complex would not be seen by the player within the level such as the rear of certain buildings I still want to include them for when I am taking shots and flythroughs for my portfolio.

All of this reference is invaluable, as this stage massively influences the final outcome of any project. The reference is used throughout the project from concepting, modelling, building the level and texturing the models, but more importantly for a project like mine where a real world location is being created, of course some artistic license can be used to ensure the environment is interesting and aesthetically pleasing for the player but you have to imagine that what the consumer is looking for is an accurate representation of the location.

In a few hours I'd taken just over 600 photographs which I'm sure will come in handy throughout the project and hopefully, strengthen the final outcome of the project. I'd just like to thank Nick at the Stretton Circuit as well as Stuart and Ruth, the circuit owners for giving me permission to walk the track and giving me the place all to myself. The project would be a much harder job without this opportunity.