Friday, 22 November 2013

Friday Foundations

Lee Stops Digging

After many days of performance tuning and investigating, I have finally got to bedrock on everything that spends GPU calls.

As you can see, when looking up at the sky there are only SEVEN draw calls now being made. Four of those are sky box surfaces (one for each 'side' of the sky being rendered), one for the post process quad to render the main camera to the screen, one for the dummy terrain object which is needed to regulate the terrain shader system and finally one for the world sized water plane.

I also discovered the cause of the 'super high drain' from the post processing which was caused by the lightray camera rendering everything, even if you switched it off in a previous session, now fixed.

After hacking my last few singular calls out, and noticed no performance gain beyond the high 300's mark, I decided to leave them be.  I am now curious what FPS scores users will get from a blank scene looking at the sky with everything switched off. I agree it's not the makings of the next killer game, but it will be very interesting to see how low-end systems handle this little experiment, and if they DO perform badly, then we can start to look elsewhere for the culprit such as the CPU, swap files or even the panel that displays the score in the first place :)

Further Ideas

There are one or two further ideas beyond this minimalist position, such as using the occlusion to detect if the water plane pixel(s) was rendered, and if not, hide until the occluder says it is visible once more.  The reason I am not pursuing at this time is that with the new front to back draw order, all of the underground water plane is Z-rejected instantly so does not hit performance except for the extremely minor call hit.

Moving On

Now I know every draw call personally, and can account for everything the GPU is doing, I can start to build things back up.  One of the first will be the True Imposter System which will create community textures for each Instance Stamp buffer and then GPU render objects into them to provide my quad textures.  It's a priority as right now I am using a place holder 'building' texture for the quads and allowing that to be in the next update would make all your screenshots from that version very odd indeed.

I also have it penciled in to add some more legacy support too, but more on that when I discover I have the time to do what I have planned. It should be a welcome addition if it all works out :)

Signing Off

Well I did say it was going to be all Performance, Performance, Performance and I think you will agree I have been rather single minded on this point. There is more performance to be had elsewhere such as faster physics for polygon style objects, faster AI by diving into the source code and seeing how I can save speed and of course going through each shader and seeing if I can write less-hungry ones that produce similar results as the top end ones. Hopefully before too long we'll get to the point where it 'just works' for most of you and we can start on the really exciting stuff like alternative camera views when editing, completion of the weapon systems and refinement of the character and AI behaviors.


Also, just backing up for the 'evening' and realized I was showing a debug release metric shot. Compiled in release mode and got a slightly better FPS for the sky-test ;) 

I also quickly loaded my 'run to the river' level, and originally I was getting 24fps fully loaded, and after later performance work I got 29fps on Wednesday. Just tried with this 'evenings' version and with everything switched on I am now getting 50fps!  This was one of my pet goals, to get this small level playable, and it certainly is now.  I still want to hit 60 fps, and once I look more into AI, Physics and Shader optimizations I am sure I will not only get this but exceed it.

A good week for me. Until Monday, have a good weekend! More to come next week when we start our live-quad adventures, and if we're lucky, our half a million trees test!


  1. (Hopefully before too long we'll get to the point where it 'just works' for most of you and we can start on the really exciting stuff like alternative camera views when editing, )
    I like the sound of that,nice work again Lee.I hope the other members of the team are working as hard as you.

  2. I thought the next thing-to-do after performance is the room blob system. Hello, how many FPSes set in the wilderness do you know?

    1. We are VERY early in the development stages. We've not gotten past performance yet. Its incredibly important to have that solid first before anything.

  3. Lee is working in the correct linear fashion developing Reloaded.

    1. World environment. e.g. A physical world enclosed by sky.
    2. Something to walk on. e.g. Terrain
    3. Physics. so things interact with others correctly
    4. Player. e.g player and weapon(s)
    5. Enemies. e.g enemies, weapons and AI

    Those are the 5 pre requisites for an fps shooter engine that have to be put in place in that order and stabilised and with regard to the performance as is being done.

    You cant skip getting those initial things in place bypassing issues with them and add other things and until thats done - as the current situation where Lee has had to stop to go back and try too improve performance has shown quite clearly.

    The Player and AI and the other things Lee has mentioned will have major implication on stability and performance so need to be looked at further too at this stage. Enemy AI itself is a serious contender for drain and performance issues and theres still a long way to go in that area to get to a stage where the dynamic AI's impact as a whole can be assessed.

    Room blobs and everything else is eye candy if the prior things don't work or work correctly.

    As this is a long development I am sure you will get Room Blogs soon enough and Lee may then again have to optimise also any stability and performance impact issues they and any other features added later throw into the works.

    Unfortunately thats the nature of the beast Lee has to work with.

    Full marks to TGC and Lee for stopping now and confronting the performance issues head on.

    1. (Full marks to TGC and Lee for stopping now and confronting the performance issues head on.)

      I agree.

    2. The room blob is not eye candy. It's as important as terrain, it belongs to 2. Something to walk on. All FPS I know about have indoor scenes, which are impossible to create in FPSCR as it is now.

    3. keep in mind we are still in Beta..........

  4. Great news on the speed front by the sounds! Also, nice to hear you will be sorting the editing view soon as well :) As for room blobs, well it's odd isn't it? I mean anyone who used the original FPSC, soon hankered for the ability to produce outdoor scenes. Now we have Reloaded in the works, and everyone is hankering to get interior bits going :) Although I must admit it would be nice to get to use some more model pack stuff! :) It would be nice to hear your thoughts on how you intend to implement the indoor bits of course out of curiosity!

  5. Lee has a design concept drawing and description for the room blob system in the main TGC letter a few issues back. You can find it at the main TGC site.


  6. This comment has been removed by the author.

  7. Lee is taking the right approach .... work the current design phase until it meets the desired result. I can't remember how many times I have slapped myself along side the head for charging forth on a project with out considering the future conflicts ahead.

    By the blog sign off times I see, his self imposed schedule is beyond .....believe.

  8. It's a tough schedule, but it's not too insane. I've slipped into night shift since the meeting on Thursday, and 5AM is about my clock off time. I spent most of Saturday playing FEAR 2 and soaking up all the clever lessons this game can teach one. It's simple stuff, but done so well.

  9. I'm very excited to hear that you were able to get 50 fps on a level which you originally got 24! Awesome work Lee!

  10. Ironcailly i was going to suggest many things from that very game, FEAR 2. Bloodsplats, damage direction detection... grenade warning directions... etc

  11. "Lee has a design concept drawing and description for the room blob system in the main TGC letter a few issues back. You can find it at the main TGC site."

    That sounds interesting, looked at the 2 FPS Newsletters with no luck and the latest main Newsletter. No luck yet, maybe the main one before? Probably read it already, I tend to read most newsletters through. Can't remember much about room segments, so may have missed it. Will hunt a bit further back!

  12. I found it in the October issue. Sounds good. Just need to play about with it now lol :) Don't think I had pledged then so probably glossed over it at the time :) I held back as long as I was able to see what I was getting for my cash :) I gave up in the end of course! I can't think of many TGC Products I haven't purchased over the years! Er, Dark AI is about the only one that springs to mind, I have pretty much most they have released. Perhaps I may finally get some use out of Dark Shader at last! If I ever suss it out properly :)