Wednesday, 26 February 2014


Further on terrain shadows: they don't work.

I have travelled internets for hours. Apparently terrain shadows are turned off by default because they're unstable and buggy. I had to find a different way of having my alley dark. First I tried to put VisArea. I knew it's only meant for interiors but no one ever said I shouldn't have it outside. It soon turned out the option affects brushes only. I wasn't able to place it properly. I crashed the engine couple of times. I dropped the idea, but since I already learnt how to use VisArea, I placed it around my cave/house and it worked out really nice.

As for the alley, I built a set of cliffs in Max and decided to blend them in with my environment. I have my shadows and I also have more detail and control over how I want everything to look like.

Cliffs still need some adjusting. I need to lower and flatten the terrain above them. Also add grass and the rest of textures (normal and specular maps).

*   *   *

I decided to make the house wonky and of irregular shape. 

It's big enough and fits almost perfectly with the terrain. I think I may need to adjust the size later on. 

Thanks to VisArea I am able to change the colour of ambient shadows inside. Without this volume everything would be somehow affected by the sun. Cryengine isn't very good with interiors. 

Monday, 24 February 2014

FMP: Problems. Problems everywhere

I decided to move to defining the area around the house. 
My initial plan was to build a cave out of terrain. I would have an opportunity to edit the shape whenever I want rather than having to export and import every time. Unfortunately this option has been disabled in Cryengine 3.5. which I am using at the moment. But apparently it was quite buggy and unstable. 

I considered making the part of environment in 3Ds Max and blend it in Cryengine. 

 I applied a dark plywood texture just to see how everything works together. I thought it stands out a little bit too much. I would have to keep adjusting the shape, which means exporting and importing a lot which seems like a waste of time. Also the vegetation would have to be placed in Max rather than Cryengine, as the 'BuildOnBrushes' option doesn't quite work. 

My next try was to cut a hole in the terrain and cover it up by the entrance. 

The brush tool's shape is a bit awkward and it kept making a diamond instead of square shape. I managed to do it in the end. 

I put a simple box behind the entrance. Now I just need to adjust the terrain around it to hide the box.

*   *   *

 Although I promised myself I would not touch terrain for now, I needed to shorten the alley and make it a little bit more claustrophobic. Since I start by the lake which is a very spacious area, it would be good to make it gradually smaller. It would also help to build up the atmosphere by taming the lighting with trees and high narrow terrain. 

 I realize it's not that narrow at the moment but adding more vegetation will make it a lot smaller.

*   *   *

Another problem I encountered last week was a lack of terrain shadow. I would just see a bunch of 'levitating' trees on my cliff wall.

I did find a console command for it which almost fixes my problem. I've been also told to access system.cgf file in Notepad and drop the command there to make it load by default every time I open my level. 

The shadow is not perfect. There is clearly a squarish shape to it which doesn't represent my terrain at all but I figure I'll just cover it up by vegetation. The other problem is, shadow disappears when I get closer to it. I am looking into it now and hopefully I'll have it fixed real soon. 

*   *   *

Problem #5993: Camera collision. 

Since I'm planning on having 3rd person camera view, I have to make sure it doesn't intersect the environment when I rotate around the character. 

It's not a priority but I would like to have it done. 

There is a script on Crydev which, apart from adjusting the view, adds a collision to your camera. Again, I'm not sure if it'll work in my version but it's worth a try. There isn't much about it on the internet. 

Tuesday, 18 February 2014

FMP: Environment 2

I feel like I'm spending the entire time on fixing Cryengine issues. Nothing works how would want it to, but then again I was prepared for this. I knew there would be blood, sweat and teeth grinding.

I finally decided to put the vegetation inside the level.

It is slimy, foggy and dark but visible at the same time - just as I hoped it would look like. I want people to think 'Damn, this looks mysterious and tempting but there's no way I'm going in between those woods'. Did I get there? Not yet. Although originally I wanted a dark sky and an environment illuminated just by the moon, I like it better during daylight. There is this contrast between deep ambient occlusion and mid-grey sky. I know I can't go too dark though - the player has to see clearly what's around him.

 I am still not sure if I should deeper the saturation. Hopefully these colour variations will help me decide. Top left cyan seems most suitable, doesn't it?

I applied those variations to my screenshots and painted over them slightly. 
There is my red hooded protagonist with an oil lantern. There's a broken wooden carriage floating in the lake. Why is a carriage in the lake?

I recently watched this short animated movie and I adored the use of colours and the contrast between light and dark. This is exactly what I want to achieve.

I love how blues and greens clash with oranges and yellows.

Tuesday, 11 February 2014

FMP: Vegetation

It seems like I haven't posted in ages although it's been just a week. I had to take weekend off because of the flu and an absolute inability to think or concentrate.
 I am still working on terrain but I got some nice progress I think. I decided to set the scale as small as possible while keeping a good quality. I ended importing a 1024 x 1024 height map, which I thought would be a considerate scale for a medium sized terrain. In reality it was very very big. Although I love all the paths and mountains that I have created in World Machine, I will only have to use about a quarter of the imported level (at least for the first scene). I cannot drag the player through the entire level of repeated environment for 15 minutes. I blocked it off to about 1-2 minutes of walking through woods - enough to show off the environment and keep the player interested.

I really hoped that layer painting on terrain would improve since last year's version. It did not. It still doesn't blend good enough. I made some tests but it's clearly visible where one texture ends and the other starts. What I've decided was to cover the entire surface with a single ground texture and let the vegetation do the job.

I made 8 bunches of smaller vegetation which I previously baked in 3Ds Max.

I will also put decals and rocks and other assets that would fill out the environment. Since it's all about the vegetation during the first trip through the level, I let myself fiddle with it for a few days. Apart from having a few types of grass and weeds, I wanted them to interact with the player. It seems quite important considering I will have a third person protagonist. The smaller vegetation will respond to wind and to players touch - it will bend underneath his feet when he moves about. To do that I had to apply both detail bending (which gives more natural movements while receiving wind) and touch bending (responds to player).

Setting up detail bending meant I had to vertex paint all the grass, weeds and fern. It always sounded so scary but once you know how to do it, it's fairly easy.

I put three Vertex Paint modifiers onto my rendermesh in 3Ds Max - each of them responsible for a different RGB colour (blue, red and green). Each of them determined a different aspect of animation.

For the touch bending I had to specify how the leaves would bend. Fortunately there was an example scene on Crydev website.

 I had to insert a little dummy for each bending point. It worked as a UV instance. If I put 4 dummies on one leaf, every other leaf that shares the same texture space would follow the same settings. In order for Cryengine to detect this 'skeleton' the dummies have to be named properly.
Touch bending also requires two special proxies. One that would define bending range and the other to obstruct AI's view. I am not going to have any AI in my level but for some reason the bending will not work without that proxy.

It took me all day to set up both touch and detail bending but it did work in the end.

I doubt you can see any of the bending on these screenshots above. I need to get a recording software real soon.

Tuesday, 4 February 2014

FMP: World Machine

I decided to approach terrain differently this time and use World Machine to create a terrain layout and then generate various maps out of it. I found a series of tutorials on You Tube, each of them over 1h long. Hopefully it'll be worth the time. I am past the process of building the terrain itself.

I will get a height map, diffuse, cavity, AO and 3 masks for 3 colour variations used in the scene (one for grass, rock and water).

The difficult part is when you have to fiddle with it to make it look even nicer. This requires sculpting the surface manually using Mudbox. I really don't like learning new programs in such a short amount of time but it's quite essential if I want to make my environment look good. Mudbox can automatically sculpt the surface based on imported height map.

It also allows you to preview real time AO, Cavity and Normal map (which in this case is kind of pointless but it surely will be useful for other projects).

Importing terrain into Cryengine didn't seem that easy at all. I had to make sure all the resolutions are correct etc.

I kept having this problem where my entire terrain would just go up in spikes. It turns out that I accidently exported flow map instead of height map.

I merged all maps I got from World Machine in Photoshop. I also baked an additional Ambient Occlusion in Xnormal.

So at the moment it's awfully bright and I still need to get rid of the checker pattern. But at least I managed to export and import it. Mission partially accomplished.

Monday, 3 February 2014

FMP: Modelling vegetation

Creating vegetation is probably the most enjoyable thing I have done for this project so far. I can allow myself for a little bit more since Cryengine is a powerful tool and can handle much more drawcalls than, let's say, UDK.

Instead of making a grass texture out of a photo I thought it would be better to just create my own and bake it down.

I used Twist, Bend and FFD modifiers to change shape of individual blades.

I rendered them as a 2048 x 2048 sheet and the only thing left was to change the hue of each bunch to give it a bit of variety. The good thing about this technique is that you instantly, together with diffuse render, get an alpha image. Therefore I didn't have to waste time to mask it out manually in Photoshop.

There is so much space left in this texture sheet; I will probably add some weeds later on.

*   *   *

The rest of vegetation is still in progress but I'm quite pleased with how it's turning out.