…this is one of the most often spoken words while doing game development…
I was going to start working on a new player occlusion method, since I dislike the current solution (more on this later). I did half the code and ran the game, and I was greeted by this:

while running in OpenGL… Switching to D3D:

Still not correct (no decals anymore)… I tried going back on the changes, but the results were the same… Then I tried comparing the version I had with the version of the source control system (which worked), and after a lot of time, figured that the problem was a mismatch between the shaders (where I used a hard coded number for the pass control) and the logical number on the code (where I used a typedef)… So it was a stupid problem, but it took me forever to sort… :\ Oh well, maybe tomorrow it will go better!
Now listening to “Christ Illusion” by “Slayer”
Link of the Day: This one seemed to be one of the most interesting new IPs at E3… The mixture of post-apocalyptical with tribal concepts and the high tech of the creatures is quite nice:
Today I added one optimization that was on the list for ages now: camera culling…
Before you start shouting at me, there was already some camera culling being performed, mainly on the voxels (which is the biggest hit on the rendering), and I don’t believe in premature optimization…
Anyway, since this was on the list, decided to tackle it… So, take a typical game scene in a cave…
I had 63 objects being rendered, taking 12 ms for the full frame (including the ambient occlusion, effects, UI, etc).
So I added culling to the props and enemies… That took me down from 63 objects to 52 objects… Render time stayed on 12 ms, so there was no improvement… Bah… Well, maybe there’s too few objects, let me try it on a jungle scene… there’s a lot of trees there, each of them a prop!
First, I found a bug:

No trees being rendered on the bottom of the screen! But the problem wasn’t bottom of the screen or top, if I put the game in first person view, the same happens all over the place…
After some 10 minutes of debugging, I found the problem:
AABB aabb(-ml+_pos.x,_pos.y,-ml+_pos.z,ml+_pos.x,_pos.y+(_ground)?(1.0f):(_size.y),ml+_pos.z);
This computes the AABB of the sprite… See the highlighted part?
What I wanted was to add the Y position to the result of the following expression, which evaluates to “1” if the ground variable is true, and to the vertical size otherwise… But what happened instead, due to operator precedence was that the vertical position was being added to the ground variable (which is normally false, so it evaluates to 0), and if that result was non-null, the result was “1”, which was of course wrong in 99% of the cases!~
The correct expression would be:
AABB aabb(-ml+_pos.x,_pos.y,-ml+_pos.z,ml+_pos.x,_pos.y+((_ground)?(1.0f):(_size.y)),ml+_pos.z);
Which results in:

But I digress… So originally, without culling I was at 16 ms, with 855 objects!
With the culling, objects was now 252 (much better), but render time was still 16 ms…
So I thought, the effect of not rendering was being negated by the effect of checking if it needed to be rendered or not… So I plunged into the camera frustum clipping code, optimized a lot of stuff… End result: same thing…
I think that the setup part of the game is already very lean, so the actual render time is the part spent in the GPU (considering that swap buffers, which waits for VSync is about 9 ms, that means that the game is waiting for stuff to finish rendering)…
So, the good news is that the system is more efficient, but the bad news is that it doesn’t make a difference in the bottleneck!
Oh well… 
Now listening to “Host” by “Paradise Lost”
Link of the Day: I’m a newly converted to the franchise… Never cared much for the character or the games, but that started changing with “Tomb Raider: Legend”, and then with the “Tomb Raider” reboot… So this one caught my eye:
FMod is such a simple and effective API, I couldn’t resist in adding some environmental audio effects…
So now, on the caves, there’s a small echo effect, and on asteroid areas, we have some sound filtering, which mutes the high frequencies… It’s a small detail, and I think players would only really notice it if they transited between areas during gameplay (instead of going through the space ship). Still, I feel good making it! 

Now listening to “Heroes” by “Sabaton”
Link of the Day: Never played the predecessors of this one that much, but this looks amazing… From the gameplay footage, it really “feels” like Star Wars!
I hurt myself in the foot yesterday, which means I can’t sit on the desk to code or work on the game (without having the foot in a potential harmful way).
So I decided to hang my feet up and try playing the game a bit… The balancing is a bit better than in previous playtesting sessions, but I still feel it’s not “right”… Maybe it’s because I’m too close of it, or because I know how the enemies will behave, but I’m trying to keep the game accessible, so it has to feel “very easy” for me, I think.
Anyway, already added some bugs to the list (not many, which is awesome), some polish stuff I want to add, etc…

Now listening to “Hope” by “Swallow the Sun”
Link of the Day: E3 was last week, so next few days I’ll just post stuff that I generally liked, starting with a gameplay video of Uncharted 4… I liked the previous games well enough (although the last one felt too much set-piece oriented, like this one)… I think it’s an interesting tendency on this E3, the lack of CGI trailers, and more gameplay stuff…
Still working on the audio, mostly adjusting volumes to account for the 3d sound system…

It’s actually quite impressive the difference 3d sound makes to the game…
I’m also compiling a list of audio effects I still need to make for the game, and I’ll have to do that for the cutscenes as well… A lot of work missing on the audio still…
Now listening to “Swallow” by “Heavenhood”
Link of the Day: Almost feel the urge to go back to the game…
Today I got 3d audio working!
It wasn’t that complicated, to be honest, and it actually adds something to the game… Now I need to retune all the existing sound effects (the volumes now are all wrong), so this is mostly boring work for now! :\
Now listening to “Tage Mahal” by “Jon Oliva’s Pain”
Link of the Day: This is awesome – some screenshots of the early development of World of Warcraft, along with some interesting tidbits: https://storify.com/pikestaff/world-of-warcraft-development
Today I integrated the new audio engine with the rest of the game… It worked fine, except for some minor bugs…
I’m thinking of adding 3d sound, it’s a simple enough change, not sure if it’s actually a good one, since most of the audible elements are on screen at the same time and are at about the same distance from the camera…

Unfortunately, working on this made me painfully aware of how much audio effects I still need to work on!
Now listening to “Widow’s Weed” by “Tristania”
Link of the Day: I loved “Pixel Junk: Shooter“, so this PDF with some insight on how they did the fluid dynamics is quite neat: http://fumufumu.q-games.com/gdc2010/shooterGDC.pdf
As the title indicates, still working on the sound engine… It’s way better than the previous one (FMod is a way better API than 10 years ago), so I don’t expect much issues after this is done…

This is just test code so far, tomorrow I’m integrating this with the actual game…
Now listening to “A Deeper Kind of Slumber” by “Tiamat”
Working on the new sound engine for the game… For some years now, I’ve been using an old version of FMod, because it was free for non-commercial use and it did what I needed…
Now, for Gateway, I need a new engine that’s cross-platform, so I’m trying out FMod Studio… For one, I’m relatively familiar with its grandfather (although the API is way different), and it’s also free for non-commercial use and for one game per year…
So I spend most of today just reading documentation, oh yeah, so much fun!

Now listening to “Album of the Year” by “Faith No More”
I’m doing the final pre-music tweaks on the trailer, based on feedback from friends…
After I finish this, I’m sending this over to the musician so he can work his magic! He’s rather busy at the moment, doing recordings for his band’s new album, but he’ll get on it when he can! 

Not sure on what the next step in the development is… Maybe the upgrade on the audio library, or the input rework, to prepare it for the porting.
Now listening to “Nuclear Blast All Stars”