Tuesday, 12 November 2013

Tuesday Treaker

Aha!

The sound of victory, perhaps, the sound of a small mystery uncovered, definitely. You will be disenchanted to learn I was not working on performance today. I was working on that annoying horrible vertex corruption we have been seeing in the gun and characters.  You will NEVER guess what I found inside my engine source code:

// sort into time ascending order at init stage
// very time consuming - so skip until see adverse affects!

//if ( pAnim ) SortAnimationDataByTime ( pAnim );

Amazing or what!  I must have been insanely tired or blind to comment this function out, not provide a date, to even think that I could get away with it and finally to lose all trace of every doing it and carrying on with my day.

I have not actually uncommented and compiled yet but I would bet a pint of Guinness that this is the bug. I vaguely remember removing this line to speed up character loading, madness!!

Other News

As yesterday's blog was a little small, I want to report on what happened on Monday in a little more detail. My PC decided to corrupt one file (just one) at the I/O level, which means a PHYSICAL hole in my data. All the usual suspects such as CHKSDK, Defrag, rename, remove and rebel where all in vain. I left the PC to do a full defrag overnight in the hopes it would move the offending file to some new sector which did not have a hole.  No joy.  First thing today I renamed my SVN repository, moved all the files over and left that one file in the old location locked and alone.  It's such a dangerous file that even if I cursor over it Windows File Explorer will crash!

As this is hardly a professional status quo, I have ordered a new replacement 128GB SSD drive and will have the miserable job of a full Windows re-install sometime this week. The good news is that the new drive is much faster than the old one and starting Windows a fresh always provides a nice fast OS (at least to begin with) to enjoy for a few months.  It arrives Wednesday, so that will probably be the day.

My Mission

I decided my mission for today was to either fix the vertex corruption or make the engine faster. Having tried reducing the shaders and noticing almost no performance improvement on my 650 Ti Boost (likely due to being CPU bound rather than GPU), and also failing to get the NSIGHT tool to do anything practical (after re-installing drivers, updating the tool, changing my WDD settings, fiddling with configurations and ultimately getting absolutely nothing from my attempt to profile my frames) I finally got to the line of code you saw above, which means in theory I have achieved something today!

Signing Off

A meeting was held today in other parts of TGC land, and it was agreed by all that performance and key bug fixes are to remain our top priority, and this attitude will continue until we have a solid and fast architecture.  I am the first to leap up and down when new features are busting to be coded, but I am also a realist, and I learn from my past mistakes, and unless we get the core of the engine correct there is little point in adding pretty tinsel over it.  

So today, we 'maybe' fix the animating corruption issue, tommorow I fix my HDD corruption issue and Thursday I dive headlong into shadow batching, which I can confidently predict will give me a 10fps speed up, which when you consider going from 26fps to 35fps, that's a substantial performance boost!

13 comments:

  1. (and unless we get the core of the engine correct there is little point in adding pretty tinsel over it. )
    I think everybody will agree with that Lee,glad to here you are managing to sort your comp out.

    ReplyDelete
  2. "adverse affects!" - well we are now seeing these affects! :-)

    ReplyDelete
  3. So you've got some weird black hole in your hard drive. :O

    Regardless, it made me smile to see something you forgotten about be found again. To think that little comment was hiding like that.

    ReplyDelete
  4. Which brand of SSD did you order Lee? You'll be pleased to know on my Samsung 830, the Windows 7 install only took 14 minutes so the tedious bit is a lot faster :)... Its then just putting all the software back on... Have fun... ;)

    ReplyDelete
    Replies
    1. 128GB Samsung 840 Pro Basic ;) Almost snap!

      Delete
    2. Good choice :)
      I've had the 830 for a while now - never had any issues with it at all. Best computer upgrade I've ever bought to date!

      Delete
  5. I got loads of features I'd love to start suggesting but, at the moment the core "features" should be looked into more and polished for performance as I'm having a multitude of issues on a standard desktop machine. I do really appreiate the effort into BETA 2 for performance I'm almost at the point where I can build a level and run around in it with lots objects around. Still a bit of lag though.


    A quiet suggestion lol:

    Make distant plants, trees like decals... single planes with image of the objects wiht alpha channel background; that always face the player. Makes poly count only like 4 per object! Something to consider :D

    ReplyDelete
  6. Lee: I highly recommend taking a look at Dark Imposters! Automatic imposterification! Massive speed increase with lots of trees/grass! But you sell the thing, so you should know about it...riiiight??

    Basically a super-easy solution to what Tyrone suggested :)

    Man I'm tired right now... -_-

    ReplyDelete
    Replies
    1. http://www.youtube.com/watch?v=AHf3Xgwvb6s

      just watched teh video
      it would for sure speed up alot and allow much more
      trees and grass to be placed in the scene without affecting the framerate

      Delete
  7. Why don't you make the grasses transparent? Lol I am not a coder myself nor know anything about coding but lowering the alpha channel of the grass could make it faster? If not it would make for a neat slider to add. ;)

    ReplyDelete
    Replies
    1. Haha no! ;) Lowering the alpha channel so grass it partially transparent would make it drastically slower to render. Transparency is slow to render, and with lots of transparent stuff like grass and leaves, the fastest way to render it is with "clip alpha". That just means that the alpha is either on or off, so if the alpha channel for a pixel is less than 128, the pixel is solid. If it's 128 or more, it's fully transparent.

      I suspect that slider will never exist because it would make it too slow.

      Delete
    2. Ah that's a shame, thanks for clearing that up though.

      Delete