Wednesday, 30 April 2014

Wednesday Progress Update

Well another high octane day of development boxes being ticked. Rather than one of those nice blogs with pictures and things, here is a massive rant with lots of pearls buried inside.  We integrated the LUA and DarkAI modules today (or rather last night thanks to Ravey Night Owl) so that we have the basis of shifting all hard coded AI calls into the LUA script and making things MUCH more flexible. We briefly investigated the Channel 3 headphone sound issue, but was unable to find the cause so Simon has a mission to find more information before a fix can be made. We might have found a new character artist for our team, so more on that when we have tested the water and have something to show you. Added three new fields to the Player Start marker called 'Regenerate Rate, Regenerate Speed and Regenerate Delay', I will leave the purpose a secret but I can tell you it has something to do with health. Added a slider to the occlusion system so you can control how many polygons are chosen for the occluder render, which MASSIVELY improves performance as you dial it down to the scene you are working on. More optimizations possible but it's great to know we can leave this in and have you experiment with occlusion to get a good performance balance. We will be keen to learn your results from this in the next build. We replaced the redundant LAYER: status bar prompt with EDIT: which now tells you which IDE edit mode you are in, such as FULL or INSIDE, where INSIDE is a special new mode which lets you place smaller entities inside larger entities such as buildings. Added more flinch to enemy limbs when shot, we will see if this looks okay, or real bad. No more water sound when you die underwater and respawn at the checkpoint or start position. Shadows no longer disappear when objects are occluded from the cameras perspective. New models caused some new occlusion issues, but they where quickly solved. Created a new very small test script for the AI work to be used with a new Combat prototype which will allow the rapid development of the character AI, and even non-character entity logic AI too. 

Finally, we briefly looked at creating a PVS (potential visibility set) system from the occluder to remove all real-time occlusion calculations and gain even more run-time performance but it would have taken 100 hours to bake the PVS data, so we decided not to add that 'feature' for now :)


  1. Well the way I did those "pre-baked" calculations was quick to write code for, but obviously super-slow in performance. In reality, all that need be done is vector calculations based on the outline of the objects.

    If you're still using a grid/segments, an even quicker way is to "pre-bake" it on a grid level rather than an object level, show/hide all objects that intersect with a particular grid block/cube (each block has its own list of object pointers). The "pre-baking" would be done with static objects only. In runtime, only as a dynamic object moves, quickly determine which grid blocks it intersects and update those block's contents in the list. So you may be showing something that's blocked by dynamic objects, so what? This way is, I think, much more practical than the way I originally did it.

    1. Btw, when I said 'showing something' just there, I meant not occluding it.

    2. I just came up with an additional idea that I think would radically speed up the process even further. Pre-compute bounding boxes around all your static objects. Then replace the objects with those bounding boxes, then do your "pre-baking" phase. You'll get 90% of the results that way, in a tiny fraction of the time.

      Then for building a game for distribution, add a second pass to this that bases the calculations on the objects themselves instead of the bounding boxes. With 90% of the objects already occluded from the first pass, the second pass will go much faster to squeeze out a bit more run-time efficiency.

      You could also combine this with your imposters idea to multiply the frame-rate by yet another factor (although you're probably already doing that).

  2. All sounds good progress! Especially for us with lower end machines!

  3. I have a little question to you Lee. When are dynamic lights and the flashlight going to cast dynamic shadows? Maybe let the user decide for each light source whether it should cast shadows or not?

    For now the engine is looking pretty good, but that unfinished shadow thing disturbs me a little. Imagine you are walking into a building casting shadows on the terrain and it's not dark in there, but all the objects don't have any shadows! :)

    Sector49's TheK

    1. I am approaching the issue of more lighting wok with trepidation as it will almost certainly mean a reduction in performance. If anyone knows how to get extra lighting and shadows with NO performance cost, I am all ears. I have yet to decide the best way to proceed here, and I don't want to resort to baked light mapping which most games still use for interior spaces. It's a case of not having my cake to eat it. Ideas welcome, and no firm plans to solve this little beastie of a problem. Don't get me wrong, I have 10 ways to do it, some will look awesome, but they ALL cost performance or memory, or both!

    2. Since so many people want it, what about making it an option that the game maker can set (and the game player can override in the .ini file if they need to). People can decide for themselves, based on their own system, whether the performance cost is negligible or too significant.

      Keep in mind also that improvements in efficiency can be made in future versions. Also, people will still be using Reloaded in a few years when hardware is faster. So the performance cost will depreciate naturally over time.

      Improving performance in other areas (such as imposters, PVS, etc) will "buy" the dynamic shadows anyway. The idea here is if an important feature reduces performance, look to see where else performance can be raised. It doesn't necessarily have to be from the same place. Asking such questions might inspire some decisions and hence ideas that wouldn't have otherwise come. The power of Decision and Clear Vision.

      You could also be part of that hardware acceleration. Consider how many other companies and game creators have been at the same dilemmas, and for decades. Consider that there's a huge opportunity for a new profit-producing product: A math co-processor that specializes in matrix calculations and transformations, parallel processing calculations such as those done in Fourier transforms, ray-tracing, etc. Nothing designed for Windows or DirectX or OpenGL or MPEG. Nothing closed and limited by the shoot-self-in-the-foot greed of propriety. But something open and useful for all applications, including ones not thought of yet. Making it a hundred times more useful than the GPUs that are all limited by decades-old proprietary "technology" if you can even call it that. The more expansive and useful it is to "anything", the more people it will benefit, hence the more people will support your company (since it's providing much bigger value). Blow primitive dinosaurs like Microsoft, Intel, and nVidia out of the water! So many audio and graphics processing software utilize the same ~type~ of math, yet the hardware only supports it in pre-assumed, proprietary, highly limited (and very poorly designed) contexts. Break the mold and leave the so-called "competition" in the dust! :D

      My point is that with decision and clear vision, new opportunities are recognized and created. I guess I overstated it a bit :)

    3. Carried away much? Hehe :P

  4. All very interesting to those outsiders like myself reading and looking forward to seeing and utilising the feature/function progress being made in the next update release - or thereafter if all goes well of course.

    I am sure all are following the development now with some sense of real progress to come.

    Thank you everyone for all the obvious continued hard work and to all supporters, users and helpers too.


  5. I like this post. Lots of _stuff_ happening :)