Friday, 24 October 2014

It's Picture Friday Hurray

Rather than a protracted text blog, I thought I would make a picture blog as a Friday treat showing last night's and todays work. The first one is a nice shot of my running towards the rocket man for some AI testing.

This next one is an experiment I did last night to study the artifacts when only direct lighting is used. As you can see, there are numerous issues that go unnoticed when add ambience and textures on top of this.  The terrain is not consistently lit when compared to the buildings (or vice versa), the shadows on the building walls are 'odd', the sandbag and log in the foreground should not be black, and so forth.  Normal map on the weapon and character look great though!

Had a little fun with ragdoll earlier, and decided to snapshot this pose to remind me that we still need to look at ragdoll death sequences some more.  Looks like he died listening to some terrible music.

And finally, a shot that almost looks better than if it was textured, but also shows that the lighting could be balanced more when you compare the terrain and gun to the entities.  Just needs a few tweaks and then I can bring back the textures are spend a little time looking at the texture side of the coin (texture stretching, shrinking, artificial lighting, e.t.c).

Been a long week, with not too many hours of sleep to be found, but I am happy with the progress, and with the explosions now integrated I can move onto some new functionality next week. I also helped Ravey get his multiplayer prototype further integrated to the main engine, which means I can leave him to it now as he had everything he needs for the moment.

Until next week, enjoy your weekends and hope you all get some nice weather! No chance of that here in Wales, but there's always hope :)

Thursday, 23 October 2014

A Full Day Of Integration

Today was the big Multiplayer Integration chat day, in which I get educated how the multiplayer side is working and Ravey gets educated about how the single player resource engine works.  From this we can create an integration plan that reduces mistakes and increases productivity, resulting in a quick turnaround for seeing multiplayer in the main engine.

It took eight hours but we covered all the bases and the plan is now in place. We will be adding some new Multiplayer Start Markers to the IDE and the ability to load in 'bolt-on' entities for the Uber Character that we will need to represent the mutliplayer characters, which will need the ability to wield all weapons and be created dynamically when the game is initialized.

I was set to integrate the new explosion into the engine but the chat has thrown up three key tasks that I need to implement so that Raveys multiplayer engine can hit the ground running.  Hopefully it will not take the whole day which means there is a good chance of explosions before 4PM on Friday!

Simon continues a pace with the ConKit and integration has already begun, which should result in the buildings being consolidated on the spot, meaning a building that takes thousands of objects to represent turns into one object comprising just a few meshes and possibly a single texture set.

Also Rick did a critique of the latest Escape Demo level, and could only find two things to wine about so progress steady on that score!  Apparently the enemies are not aggressive enough so hopefully will find some time to turn up the volume on their hate-o-meter.  If the enemy AI does not present a great battle experience, we will suffer for it when the product gets released and we have the time to get it right, so we should make it a priority.

Wednesday, 22 October 2014

Visuals and Explosions

Spent the day on smaller tweaks to get the Escape Demo level further along to ensure the best bits remain and the worst bits improved.  It's looking much nicer now, plays faster and hopefully a few extra functions can be added before we're ready for the public beta release.

Also wanted to repeat something that was posted in the comments, and also to clarify that all the shots from the last few weeks have been on LOWEST settings only. That means no normal maps, no specular, no real-time shadows for entities and none of the extra finesse that can be spent with a high end shader. My goal was to get it playing fast and looking good at the lowest settings, and then I can re-introduce the higher end features as I move up the food chain. This way the visuals will remain consistent and use the same light balancing no matter which shader technique you choose.

Right now I am finishing off the integratable prototype for the new explosion system that is finally going in to replace the one we are currently using. The current explosion is a bit 'epic' right now, and probably needs scaling down but I can go that once it's in game and I can get a sense of scale. The new explosion is pretty cool though with two fire decals, two smoke decals and two debris effects based on physics particulates.  Looks good in the lab so should look great in game, with the only obstacle being the reduction in what we call the intersection issue (a flat camera facing plane cutting into another surface at an angle and creating a strong line contrasting the explosion decal and the scene).

I have also freed up and de-prioritized some task items to preserve the original functionality list I had a week ago, which include enemies inside buildings, material system and cleaning up the entity property fields so they are 100% relevant to the engine (a long time coming).  As much as performance and visuals was challenging and fun, it's nice to do other things now and again, as a change is as good as a rest!

Tuesday, 21 October 2014

Shot Of Latest The Escape Demo

Here is the latest shot to compare with one provided a few blog posts ago, but this time with the subtle bounce light from the ground lighting (notice the slightly green colour under the plank sticking out of the building).

More generally, having this extra bounce light in all the shaders (both sky and floor colour) is like having two extra lights on everything. It's subtle, but it does not only lift the scene but blends them altogether with a common colour theme, especially with the red, golden and darker skies!

Here are the settings I am using, but as with many things during beta development, if I change the shader levels all this could change again :)  Don't worry about the 34 fps, the whole software slows down when all the slider panels are on (something to do with drawing each slider bar bit by bit).

Currently tackling a rather fiendish problem resulting from the terrain system not producing super-accurate LOD0 mesh versions of it's segments, meaning my glass terrain geometry can sometimes be cut by the real terrain. Boo!  I have a few ideas along the lines of building my own glass terrain meshes from the height data, but first I am going to tinker with the built-in one first. It only happens when two segments meet, so that's my clue and my way in.

Currently riding high on the SLANT survey for "What are the best game engines for non-coders?". Why not check out the list and vote for your favorite here:

A question also came up and worth bouncing out there. We now have different weapons coming in, and they have different 'hand' models.  If you are doing a game which uses different weapon sources, do you care about the hands changing from 'gloved' to 'ungloved'?  If so, do you have any ideas how we could tackle this without making artists lives hell?  Food for thought.

Monday, 20 October 2014

Automagical Exposure And Spherical Super Fudge

Today and tomorrow my schedule budgeted in the time to work on some kind of tone mapping and also the addition of skybox ambience. After some researches over the weekend and a little this morning, it turns out for true tone mapping I need implement a whole HDR system and for skybox ambience I might have to add an extra cube-map texture read to all pixels!  The upshot will be to improve the visuals still further by defeating the over-bright scenario we have been seeing and also to improve the general lighting of a scene full of differently textured objects.

A typical unlit scene - the starting point for all rendering

Alas I am not prepared to delay the project further by implementing a whole HDR system as it would require a lot of texture and shader updating, and adding texture referencing in my shaders is the last thing I want to do after making such good strides in performance. The solution was to achieve everything I wanted but without using the above techniques. As at 2:30PM I have achieved these goals, and am ahead of schedule by a day :)

The solution to the tone mapper was what I am calling my auto-magical exposure feature, which is very similar to adaptive bloom and acts on the post process shader to ensure a scene compensates for being over bright. Added some code to use the time delta from the engine and it now adjusts at the same speed as the human iris which creates a nice subtle effect.  Look at the sky and your eyes adjust, look at something dark and the eyes adjust again, look back at the sky quickly and notice how the eyes adjust over 1-2 seconds.  Very cool!

The second solution was to dump reading the skybox (even a small 1x1 per side version of it), and simply pre-scan the colour of the sky and the colour of the floor, and load those directly into the shader as a constant. I then use a spherical harmonics trick to work out the contributions based on the surface normal presto, the ambience now has the visual effect of receiving bounced light.  It's not sophisticated, but it's completely free and super fast!

Notice how the ambience is taken from the sky and terrain colour

When combined with the remaining pixel shader it blends with the scene

Next on my list is to read an avalanche of links Rick has sent me on spherical harmonics (as there might be a test tomorrow). Then I fix the Rocket-man, who has been doing very silly things with his rocket and needs sorting.  If I can do all that and have a build for 4PM then I think that would be a good first day of the week!  I am eager to get past the performance and visual stuff this week as there is a big chunk of third pillar functionality such as the material system I want to get my teeth into.

Saturday, 18 October 2014

Android & AGKV2 - A Powerful Combination For Developers

It's the weekend, and I always like to give myself some freedom away from the 'day job' whenever possible, and today I decided to play around with a product we are due to release on Steam before the end of this year called AGK2. It's origins go back a few years now but the principal is simple, which is to allow anyone to create cross-platform applications easily and quickly.  Despite the ease with which you can create applications, it remains an extremely powerful and capable language that has been instrumental in producing chart topping apps on both Android and iOS.

This blog post was prompted by the arrival of a small box that was mailed to me, and within this package, my first quad core Android device! We have come a long way from the humble (and slow) origins of this almighty operating system and it's exciting to be part of the space that enables the next generation of Android software to thrive and flourish.

In it's brief and unassuming stint in the tools market, AGK has produced some excellent apps and also a few hits too. It's successor promises even more with it's all new IDE for Windows and Mac, significantly faster compiler and a host of new commands and features.

It is no surprise that as soon as I received this device I wanted to field test it with an AGK application and test the speed of the device. I was not disappointed, and the shader example which shows off the use of 3D rendering, ran at the full 60 fps on the Android tablet.

Rather than a protracted written description of the experience, I have committed by thoughts to video to better illustrate the new AGK and the Acer Iconia Tab 8, Quad Core Intel(r) Atom(tm) Processor 1Gb RAM, 16Gb Storage, Wi-Fi, 8 inch HD Tablet.  As AGK already supports x86 binaries, the application is able to run at native device speeds and take full advantage of the silicon.

As you can see the performance is first rate and it's exciting to know that we are now able to deploy to devices that can handle a LOT of 3D rendering, which will open the gates to a whole new wave of intense 3D experiences for portable computing.

For more information on AGK, you can visit the official website at WWW.APPGAMEKIT.COM and for news on the current developments of AGKV2 you can visit the forum thread here:

Friday, 17 October 2014

Improved Ray Cast Command

Spent most of the day improving a central command called INTERSECT ALL which is used by both enemies and the player. The old implementation was good enough, but given it's heavy use and it's tendency to create performance spikes, I decided to implement some better ways of doing the same thing.

The new system first collects all the collision boxes that are touched by the ray, and then sorts them by distance, and only then does it go through the polygons associated with each box.  This way I get very early exits when the ray does not pass through any boxes, and a minimal traversal of polygons when it does hit something. Thanks to the internal team for their ideas on this, and it definitely solved the performance spike issues.

I was set to do some work on explosion improvements, but the decision was taken to spend two more days on visuals next week, namely TONE MAPPING and AMBIANCE FROM SKYBOX which will combine to create a better light balance in the scene. My minor concern is that both of these might require a small performance hit so it will be interesting to see what the trade-off and benefits are when these techniques have been implemented.  The good news is that FPSC Classic had a sort of tone mapper shader, so I will be looking to dig that out as a starting point.