Thursday, 30 October 2014

Custom Characters and AI Meet

Just finished the new system which externalizes the animation frames used in the AI system, so now third party and official character packs can use different animation sets with the central AI system.  A typical example is the Zombie character which in the old version (an aborted build) would not follow paths, but the new one has all the power of the AI system but keeps the custom animations it had:

animmax       = 1
anim0         = 2552,2603
playanimineditor = 1

;AIAnims (Classic + Zombie)
csi_relaxed1 = 2552,2603
csi_relaxed2 = 2608,2659
csi_relaxedmovefore = 2500,2519
csi_cautious = 2552,2603
csi_cautiousmovefore = 2500,2519
csi_unarmed1 = 2664,2715
csi_unarmed2 = 2720,2771
csi_unarmedconversation = 3046,3094
csi_unarmedexplain = 3105,3155
csi_unarmedmovefore = 2500,2519
csi_unarmedmoverun = 2500,2519
csi_unarmeddeath = 3380,3439
csi_unarmedimpactfore = 3245,3300
csi_unarmedimpactback = 3159,3234
csi_unarmedimpactleft = 3310,3370
csi_unarmedimpactright = 3380,3439
csi_stoodstartled = 2861,2904
csi_stoodpunch = 2775,2848
csi_stoodkick = 2916,2969
csi_stoodtoss = 2981,3034

As you can see, custom character models will NOT have all the animations the AI system requires, but I will be tweaking the system so it can skip an action if the corresponding animation is unavailable.  It's another way for artists and content creators to shape the behavior of the enemies from with the FPE file :)

The current character model has a little trouble holding the pistol in V1.0085 so we have improved it for V1.009. It's not PERFECT yet but it's a little better than the floaty version it replaces.

Ending on a lighter note, during my work on replacing the hacked internal animation values, my enemy decided to do a swan dive for me.  Thought it was quite amusing, and quite an unexpected attack from my enemy!

Friday sees the work begin on the terrain blending and ramping, which has been a long requested feature and so I am looking forward to seeing what I can do. Watch this space for some terrain magic :)

Wednesday, 29 October 2014

What A Day

Spent half the day on what I term an 'Epic Fail' task, which was to solve the issue of an X file loading in but having an animation issue. When I see this from my own art, I often ask the artist to correct the issue, but the engine will need to handle MOST types of X file which means solving this one. Alas after four hours it remains a mystery, so I decided to continue my main list and sort out custom animations for the AI system.

This also turned out to be a pig as I had to manually extract ALL the hacked in animation frames and create a new way to store them externally, and ensure the system did not break in the process. As at 5PM I am half way through this but at least the end is in sight and viable, unlike this mornings coding pain.

Once I have the custom animation frames externalized, I can then bring out the Zombies, Elephants and Robot Waiters to test the functionality, which is basically allowing ANY custom character to follow waypoints and obey the clever systems built into the DarkAI module.  Hopefully Thursday will see it in a form that I can test and refine.  Until then...

Tuesday, 28 October 2014

Material System Done

With visuals, performance and AI for the moment sorted, my task for today was to get the material system up and running. It's now just gone 3PM and it's done. We can now shoot different materials and get different decal animations and sounds, when you walk on wood, metal, stone or other material the correct footfall is heard. Now when you walk on the roof, no more grass sounds!

I gave myself a day and did it in just over half a day, so I am moving swiftly onto my next task which is getting Zombies working with the AI system. By this I mean have a new look-up table of animations that the AI system will use as part of the 'main' character system. Not only will this breath new death into the Zombies but it also means custom characters can use the path finding and LUA logic treats of the full character system, so no need to script 'everything'.

This next one could take an hour or a day, but I have budgeted a day to ensure it also works with the wider requirement of custom characters, which means digging a few of the custom characters sent to me out the folder and ensuring they work fine.  Still, happy report a good day done with a few hours to spare!

Monday, 27 October 2014

More Aggressive, More Speed, More Damage, More Fun

Finally worked out why the AI was so 'distracted', and put it right. The latest Escape demo is now populated with mean sons of guns who like nothing better than to hound you into extinction. 

I also spent my Sunday on the project as well, with improvements in what I am calling the light balance of the scene. Now all element such as static entities, dynamic entities, terrain, characters and other bits use the same calculation for both ambience and direct sun lighting.

As you can see, with ambience only you get a general coverage which all elements in the scene agree with, plus the shadows which are factored in.

In this direct lighting shot, all ambience has been removed so you can see the surfaces that have a direct line of sight to the sun (again, shadows factored in as they work in a slightly different way).

The final composite which adds the two together is the white matt surface on which the texture colour is eventually applied.  The weapon is deliberately brighter as the textures on the guns are a little darker and has additional visual effects such as cube mapping applied and tends to lower the overall luminescence of the weapon models.

I also discovered that some SSAO coding in the bloom shader was not actually doing anything, so I removed this and gained an FPS boost from 84 fps to 90 fps which was nice. I have lost the subtle blurring I got from the NINE texture reference samples, which might introduce some anti-alias effects, but I am sure there is a new technique I can try which does not cost that much more than the standard bloom shader.  I am not ruling out a screen space ambient occlusion trick in the future, but right now I am all for performance and more honest visuals, and removing it felt like a step in the right direction.

With the great victory of new faster, more FUN enemy AI, I am now moving onto one of my pet peeves which is the ability for characters to enter and logically track a player through a building.  That is, a single entity which is subdivided into walls and other vertical obstructions. Making a building out of individual wall entities already works fine, but most single entity buildings currently act like a huge obstacle that the enemy must run around. Nice effect when you want them outside, surrounding you, but for the most part you want to be able to run inside a building and be chased inside!  It could be an hour or a day, but today is the day this task gets my undivided attention!

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!