TACStrike: weeks of July 27th - August 9th

Published on Monday, 10 August 2015 06:36
Written by snake5

After another two weeks of mostly doing various fixes for existing tech, it's time to report. Let's start with an image:


Solid glass that cracks on the first shot and, well, bleeds bullets on the next. It's rendered in two layers, one is for darkening and the other is for damage (stains, cracks).


Scripted item

It was time to finish up, so editor support for scripted items was implemented.


What was necessary:

  • A dynamically reloading set of subproperties to be used in scripted item initialization
  • Scripted item enumeration and picking
  • Realtime preview

Additionally, some fixes were done for the whole system:

  • Convex hull generation from meshes
  • Full rigid body support (creating a moving rigid body from a convex hull, applying forces)
  • Upgrading hit event to include force info (position, velocity)

All of this was successfully implemented so the last thing left is just making a game entity that holds a scripted item. It's expected to be done fairly soon as there's just not much to do.


Objective item UI

...is more or less done, after some redesign and some added functions


Designed to support mouse scrolling, clicks, up/down buttons and some keyboard shorcuts. Using the new multiline text rendering function that was ported from sgs-sdl library, which was in turn ported from whatever previous engine I was working on. Has basic UTF8 support, not that I need it yet, but it's nice to know it's there.


GFX (graphical effects)

Transparency, particles and decals.


Lots of things were done to make this look good.

  • Implemented decal system override for overlay (blood) decals on scripted items
  • Fixed decal lighting for scripted items
  • Fixed decal projection shader (using the depth fade texture) to avoid sharp edges
  • Particle collisions, with dynamics and event callbacks (example in first picture)
  • Implemented "multiply" blending mode for glass
  • ...and probably some more things I already forgot


Enemy AI

Facts, vision, hearing.


Enemy AI now is capable of storing bits of recent information about the state of the world. From that, it can partially extrapolate some other data, such as positions of other AI characters and the player.


Coming soon - lightmap upgrades

The reason for the delayed blog post.


Shadow generation was upgraded and optimized. Now high quality soft shadows are unbelievably cheap, thanks to the idea of using raymarching for soft shadows and some hard work on my part, implementing AABB trees for efficient distance sampling.

There's still some optimizations to be done so it might take a bit more time to appear in game screenshots. But I'm getting there.

I should mention that this was not initially the part of the plan, though. I was implementing AABB tree and two-level raycasting (mesh instances/triangles, previously there was one big triangle soup) for the option to disable specific mesh instances when certain samples are rendered (in case I wanted to fix lighting for samples inside meshes they're about to represent). But I do like the results and would like to have them in the game.


Some technical things

  • Asset compilation - needed a simple system for file transformation (texture packing, convex hull generation) that would generate all missing/outdated files with a single command
  • Load time optimization - used texture packing to avoid regenerating lightmaps all the time, (warm-start) load times for the test level are somewhere around ~0.5 seconds after the optimization


Since LD33 is coming soon, I'm inclined to participate (in the Jam this time, can't release the source yet, and hopefully by making a FPS). This means I have 1.5 weeks left to prepare for it. I have a quick checklist for things that I should really implement, starting from most important to least important, with the expected amount of time it could take.

  • Scripted item entity (1h) [done]
  • Basic enemy AI (3-8h)
  • Level transitions (3h, more with loading screens) [done]
  • Animation markers (2h) [done]
  • Weapon rendering (different depth range, same scene) (3h)
  • Incremental lightmap rendering (10h) [done, took ~30h]
  • Environment mapping (3-10h, depending on targeted feature set)
  • Ragdolls (10h)

Having about 40h of free time left, it should be possible to do all of this, if that's all I do and there are no issues to deal with on the way. Realistically, the last one or two tasks will probably not get done.

We'll find out how it goes soon enough.


Latest images