Realm Building

Sometimes you’re a victim of your own success. After spending a few week making my terrain able to support gently rolling hills along with giant mountains and deep valleys but be so huge you’d never realistically reach the edge of it I’ve managed to encounter a problem i didn’t foresee: getting lost in my own world.

I thought, ok I need to make the map feature now.  So here it is..


I’ve had to artifically boost the lighting a bit due to my sunset directional light. I guess I could change the directional light too but I like my sunset look. Anyway there’s the map top left. Unfortunately the small white dot in the middle is the player. Well sort of. Its a 4×4 white dot but 1 pixel represents 50m squared so not really THAT useful. To get the mud to line up with the first village was deeply annoying so I’m going to have to add a zoom feature. I maybe even allow the blend map of editing mud/grass/rock to be adjusted by clicking on the terrain. Yeah maybe I should do that..

Anyway my model guy is a bit busy so i’ve had to get some random medieval village models from CGTrader. I’ll replace them with higher quality versions where needed later but I just wanted to get on with making the game.

I have lots of private pages of notes that i’ve been coming up with the game designer too. For some reason we’ve focused on the crafting/gathering/hunting and exploring aspects so far but there’s a lot come up with. We’re not making the next Everquest/World of Warcraft so we’ll have to curb our enthusiasm somewhat to actually get it finished.

Anyway enough waffle from me. Getting make to Village 1 – great name for a village.

The featured image for this post is an aerial shot of where the player is standing. Just to give you an idea of just how huge this world is.

Guard Tower and Pebbles

Wow that’s not much of a blog post title is it? Oh well.. I’ll do better next time.

Anyway it’s been a week of improving and tweaking things – a lot of time was lost due to an instancing bug which was making the grass disappear when viewed from above. Deeply annoying. It was solved with the help of the great guys at GameDev and the solution was a simple bug in the end. As you can see theres pebbles mixed in with the grass. So I should now be able to mix in different type of grass and small objects dotted about the terrain to give it a more realistic look. These objects won’t cast shadows at this stage. I could add that ability and maybe make that an optional performance setting but it will certainly hurt performance to have every pebble and blade of grass casting shadows. Looks nice enough without anyway. Large shrubs and rocks will of course cast shadows.

I may well need to do some boring refactoring work again soon because the whole game engine is growing like a beast again.

As you can see there’s the beginnings of a medieval settlement starting to appear. I now how a great guy from America doing the actual 3d modelling for the generic things I can’t buy in.

I’m hoping to have a medieval settlement (well the walls of one) up and running very soon.


Color Maps and Shadows

Quick update about the new additions to the game.

The instance renderer can support multiple types of instanced geometry now. Ie now it can draw multiple copies of grass/pebbles or any other small simple thing i want in clumps or scattered all over. I can effectively switch the camera to an overhead view and spray the stuff everywhere. I also added the ability to pick an individual pebble or grass and rotate its yaw/pitch/roll, scale and how far its off the ground.

I spent way too much time fiddling with my shadows. I had a classic problem with a slight shimmering on my shadows. I fixed this to a more than acceptable level by adding a variable depth and normal bias on a per object basis. No real performance hit, it just means I need to select a bias that looks nice for each object (so objects self shadow nicely without “peter panning” as is its apparently called. Being the perfectionist I am i’ll go back and revist this at some point to make it perfect probably. I asked usually reliable guys at gamedev but unfortunately I didn’t get any answer that made any sense to me. Only 1 person answered. Wah.

I also added a bit of a “finishing touch” to the terrain which probably could have waited. Color maps. The landscape now has a map where to change it’s color. All this does is add a subtle tint to the lanscape which gives it a more random look. I like the effect anyway.

Did some general code tidying too since I found the sunlight direction was being set in about 4 places. Oops.

I’ll be buying in some medival walls and torches and possibly a hut or two if i can find a decent one or maybe just commission them on Fiverr or CGTrader if not.

It’s time to make the first village!


Realm of Rocks

Instanced Grass is parked for the minute. It works great and handles 500,000 clumps easily (start to run into memory problems after that just storing the transform for each). Anyway that’s far more than I’d ever need.

Moving on to rocks. These won’t actually use the instance renderer since I want to use that for things that don’t cast shadows and will be drawn in mega volume. I could enable shadows for it but obviously that would really slow things down.

So i’ll have large rocks that cast shadows and small fist-sized rocks that don’t which will be instanced.

I’ve got some nice rock models which only use a couple of hundred triangles.

I thought i’d add a video to give you the idea of how this all looks together.

You can add a comment here if you like or on youtube


End of the World

Today I’ve been working on making it possible to use the Isometric editor camera to adjust the blendmap. Here is an aerial view of the whole world (Realm).

It’s ridiculous large for a game area (to be loaded in at once anyway). This view is 50km square and takes the player model around 4 hours to run from one side to the other at a sprinting pace. Even if I hit my secret turbo key when I’m editing the game it takes a few minutes. This terrain uses a variation of the classic Quadtree which is what allows me to render huge quantities of triangles without killing the framerate. I’m not even using a top end card and it still easily runs at 60fps in normal game circumstances. In this aerial view it runs at 30-40fps rendering the whole world. By the time the game is finished technology will probably have moved on another generation anyway so I won’t worry too much about that for now.

The red and green represents where grass/rock or a blend of the two will be on the terrain. I can throw in blue later for something else like mud/gravel and I can use them to mean different things in different patches of the terrain (see Quadtree above) so, for example, red to mean grass in one terrain patch or snow in another.

Anyway here there aerial view coloured by the blend map:


Realm of Foliage

Man getting grass to look half decent and not completely kill your frame rate AND still be visible at a distance is a pain in the rear.

I’m fairly happy with the results although from above it doesn’t look at “clumpy”. Also i’m not very happy with how it blends into the terrain itself.

Anyway that aside it looks pretty good.

The engine has a nice editor for spraying instanced geometry all over the terrain in an isometric camera now too.

Hopefully i’ll stop fiddling with grass and move on to rocks and then add some buildings or something soon.

Who knows. Maybe i’ll spend another 6 weeks fiddling with getting the grass perfect. Does anyone really care about how amazing the grass looks? It looks pretty poor in No Man’s Sky (just basic billboarding with the odd weird rock thrown in) but I still love that game.

Anyway enough waffle from me for now.