Monday, 29 July 2013

Monday Extra Time

More Terrain Time

Today I get a few more days terrain time thanks to a postponed meeting, which was really supposed to be day one of my Physics work.  I just could not resist continuing to add the eye candy and get the demo 'just so' before moving too far off my present mark.

Monday I finished the water shader, water effects code and added a better sky box texture to give a high definition feel to the whole scene. I then must have spent two hours just moping about making terrain, cutting out little rivers, playing with my height and paint editing tools to see what kind of landscapes I could come up with. During my 'fun' my mind raced about more editing tools I could implement, more refinements to the shaders, optimizations that fit the way I did some things and a general need for more plants, rocks and bits of scenery detail.

I think the screen shot I have not is pretty darn good, but I am going to stick to Rick's guns and refrain from putting any 'suspicious' art out there :)  Only a few more days to wait, and I think we will be using a 'terrain shot' for the next TGC newsletter so there will be no doubt you will see all this soon enough.

Details Details

It might seem adding water and new sky was a relatively trivial affair, but the very subtle code I added attempted to best some of the tricks done in high rolling games.  Little things like a subtle fog effect, not to cull distant objects but to provide a misty sense of distance (and I mean VERY subtle).  

Another trick. courtesy of Evolved, is to use a water mask texture to describe the edges of a lake or body of water. This ensures the water does not look strange when bumping up against solid geometry and is a great substitute for a depth read.  I also had a few ideas where I could hijack the other channels of the water mask to describe depth, and use a nifty pixel shader calculation to shade the refraction map darker as the water gets deeper, like you would see in the real world.  Alas these are all what I call 'nice to have' B list items and should not get in the way of my goals on this occasion.

No Blooming

I was tempted to make the 'maybe awesome' demo use post processing effects such as bloom, depth of field and haze effects (for the desert heat) but again for the above reason refrained. These can be added later, and are not what we all agree are 'essential features' of the engine.  Hopefully my terrain demo now stands on it's own without the smudging effects of post processing.

Next Things

Now I feel the demo stands alone for a presentation, I can move onto more serious matters such as re-coding and cleaning the prototype to use a data structure and resource numbering set that can drop right into the main engine and map editor IDE.  A terrain editor is no use as a prototype!  Hopefully this task won't take too long, and the subsequent introduction to the IDE will go smoothly if I do this preliminary step correctly.

Once the above is done, I will be free to resurrect the Bullet Physics prototype I very quickly knocked up before my holiday. It attempts to operate a 'character controller' walking over a 'height map', which is actually quite ideal as I could drop it into the present terrain module.  From there, which is no small trick to get all that set up and running properly, is to then add a few dynamic and static objects to test performance and stability of the floor.

We don't want a repeat of FPSC Classic with enemy characters suddenly disappearing through the floor and into infinity!  I am hopeful the new Bullet physics system will provide many wonderful toys to Reloaded in time, and if I can get the basics working great, the rest will follow smoothly.

Signing Off

My schedule puts this week down as pure Physics coding, so the sooner I can get off terrain and onto physics, the sooner I can get them both integrated and start the inevitable tweaks to ensure they all play nicely.

I am quite looking forward to creating a sphere and rolling it down a terrain hill and watch it hit the water and start bobbing about, then cast some wind around and see it subtly shift position as it islands it's way around the pond.


  1. We will be changing how we go about constructing skys? Will they still be skyboxes?

  2. I have experienced the terrain system (found it in dropbox this morning). I am blown away! Lee is back to his best! :-)

    Video and screen shots will appear on Friday.

    Well done Lee, you da man!

  3. I will be sourcing some high resolution sky boxes 1024x1024 per side to reflect the different terrain genre styles you can choose from. As usual, more can be imported via sky packs or created yourself and specified during the level setup. There was an idea to use DarkCLOUDS module but I'm having difficulty getting the source code which I would have needed, and the general feeling from the last demo was that modern games simply use a super high resolution sky box, so what's good for the goose and all that :)

    Thanks for the praise Rick, very rare is that. I have asked Mark to double the texture detail to make it even more high def, and once we have things like rocks, cactus plants and bits of scenery thrown in, it should be ready to eat.

    1. One thing. You said before in the newsletter issue 125:

      "The clouds that you see here are no longer part of a sky box but are in fact real dynamically generated clouds using our DarkCLOUDS module from Dark Basic Pro. Not only is this module capable of producing clouds, but has day/night cycles, sun simulation and a whole host of settings to affect how many clouds you have and what they do. You can even accelerate or reverse time from within the command set. Very powerful, very fast and just the job. I had to mask out the old sky box, and in doing so realized I need some really high resolution mountains for the final product but I think the effect is really cool. You get foreground terrain, then background mountains and finally a realistic sky."

      I'm assuming that you used the DarkCLOUDS module in the "decent demo" video, because in the same newsletter it says that you have maked the "real cloud generation" along with "day and night cycles" available. The thing that i don't understand is that you now are saying that you can't get the souce code, but if you used the "real cloud generation" and "day and night cycles" from DarkCLOUDS you must then have the source code...right? I'm maybe wrong, and I'm not sure at all if you used it. It just came to my mind when i read your comment. Correct my if i'm wrong. Sorry for my terrible english grammar.

  4. The terrain editor sounds great! I wonder if you might consider allowing us to use our own brushes (if that is the terrain editing system you are using/planning to use.)?

  5. Hi Lee

    Are you still planning to take a look at deferred rendering and occlusion culling at some point?

    I wasn't sure if the new instance stamping technique combined with LOD has now mitigated the need for occlusion culling or if that is something you still need to revisit down the road.

    Shame about Dark Clouds but it would be nice if you could include a shader which allows skies or clouds to be scrolled to give the effect of a dynamic sky.

    On the new physics system I know Mark has produced some wonderful death animations but it would be nice to have the option of ragdolls for enemies as an alternative.

  6. It is a great shame about dark clouds. But some things were not meant to be. You never know though It may appear one year. I will wait with a wallet. But it sounds like a good engine already so I shall not moan or lay down the law like so many do on here. Ooh wowcher. Just kidding so no fiesty comments This is a wonderful blog and I feel lucky to read how it all works. How patient and open eared lee and rick are and the positive comments debates and see things new. Keep on rocking guy's

    1. Couldn't agree more. You guys are doing amazing things. Keep up the extremely good work :D

  7. I have the DarkCLOUDS you can buy for DBP right now, but I needed the source code that created the DC product so I could increase resolutions and remove some small artifacts I discovered while making the 'decent' demo.

    The good news is that the author has been in contact with me this morning and is sorting out GITHUB access for me, so DarkCLOUDS is back on the table :)

    NOTE: Also worth repeating that everything in this blog constitutes a casual conversation amongst coders, not iron clad promises you can beat me up with years from now :) Some features will be talked about, added, removed, basic developer soup!

    1. Alright. The news about DarkClOUDS is great, and i hope to see it in the "final" engine :D BTW thanks for the quick reply, it's so good that we here can contact you, and you actually listen to what we says and help us etc. Thank you once again :D

    2. Sounds good! By the way you should put a small disclaimer somewhere at the top so everyone can see. Otherwise you project yourself into imminent bombardment for every suggested feat. :)

    3. Alright! (If anyone's watched Corner Gas just picture Davis saying that) DarkCLOUDS awesomness!

  8. Replies
    1. Haha! :D An hour later your advice has taken effect :D

  9. Regarding the lip syncing thing, how is that going to be? i'm just curious :D I know this is not related to this blogpost but...
    sorry for posting so many questions.