Kill 10 Rats

It’s really picking up speed towards being a vaguely playable game now. I’ll just make a quick list of what’s been added:

  • NPC/Enemies now have shadows.
  • Shiny fonts
  • Loot dialog box
  • Quest dialog box
  • Enemies hit back
  • Enemies can die
  • Enemies can drop a treasure chest

Most of this is rather crude and I’m not 100% happy with any of it really (except the shadows).

The font is annoyingly spaced out and the look doesn’t quite fit but it’s better than TTF Arial. I don’t really like my dialog boxes either but they’ll do for now.

The enemies die ridiculously (just flip on the their side).

The treasure chest is just the same model moved just in front of the player.

There’s no way of actually putting the loot from chest into your bag.

But DESPITE all that I’m really really happy with how it’s going. I mean you can actually walk somewhere near an enemy, target it and go into basic combat with it and kill it (and maybe get some loot). That’s huge. It’s basically the flow of the game finally working.

Some refactoring and general neatening up is needed and also I get to do a really fun bit – add a particle effect for when you get hit or when you hit an ememy. Looking forward to that.

Hopefully I’ll get another update in before Christmas..

Oh I made a new video of the combat and loot etc. Even in it’s crude state I’m pretty happy with the result.

 

Back in the Rat Race

I’m not obsessed with rats, honestly.

Ok right well after completely taking everything apart to finally get to the bottom of my shadow jiggling problem I decided that the best solution was to make my player the centre of the known universe. This was simple enough and didn’t require me rewriting my shaders or making TOO many changes. I won’t bore you with more waffle about shadows but in a nutshell the problem was that shadows worked perfect the closer to position 0,0,0 I was in the world. So therefore position 0,0,0 is now where ever the player is standing (and everything is drawn from that perspective. Sorted.

Moving on and back to the game finally..

Ok so now you can actually assign an ability to a hotbar position. There’s only 6 abilities for now, melee attacks (short and ranged), Magic attacks (short and long range), a self heal and a monster defencSe reducer. These all worked great straight away since I designed a nice ability object to which should cover quite a few different abilities, combat and otherwise,

I made a little video which demonstrates the new stable shadows (there’s a small wipe effect between the cascades but I really don’t care about that for now, there are many ways to hide that). It also demonstrates the basic combat with me against a huge and medium sized rat. They still don’t hit back so it’s a bit one sided.

So, next up:

  • Make the rats turn to face me more realistically
  • Make the rats follow me
  • Rats need shadows! (all well all monsters do)
  • Monsters need to hit back
  • Combat effects (started that but there’s nothing nice to see yet)
  • Monsters need to die – they just do.

Going Off on a Tangent

Oh dear I appear to have gone off on tangent.

This had to be done at some point but I’ve been fiddling with shadows again. You see, there’s this annoying little jiggly effect that happens on the shadow edges of objects with sharp edges (like the building above).

There I was adding in the hotbar abilties to make a ranged magic attack and melee attack (being able to set the damage, check the range etc, add in a self heal/cure) when I decided to fix the annoying shadow problem.

There are huge volumes on real time shadow rendering and I can see why. After some more reading I tried various technique for getting rid or reducing the “shimmer/jiggle”. Most people seem to call it shimmering, mine looks more like a jiggle which I think should have been a clue.

Anyway I used a technique called Texel Snapping which I seemed to have used correctly and it made pretty much no difference. I contacted a couple of people on GameDev and various game development blog and no one could see anything wrong with my code. The ighty MJP from GameDev suggested the problem lies elsewhere (elsewhere to how I’m generating the shadow maps) and it seems he was right.

I found an old test problem I originally wrote to test my models in a little world with lighting and shadows and slung in my new “anti jiggle/shimmer” code. Boom! Perfect shadows. Even if I i deliberately stretch them out so they’re poor quality they still don’t jiggle or shimmer.

Well so where does that leave me. Amazing shadows in my game? No. Amazing shadows in my test harness and I’ve learned loads of techniques for making them soft etc using DX11. None of which fixes my Jiggle.

So now I have 2 versions of my lighting/shadow engine (both in Monogame – I had to convert the old test harness from XNA first). 1 jiggles, 1 doesn’t.

I need to find the difference. It’s there somewhere. My engine is kind of huge unfortunately.

Hopefully I’ll be back to actually writing the game again soon.

Another 2-3 weeks on shadows. Argh!

Roads of the Realm

Sorry no update last week but I’ve been hard at work (at work too unfortunately).

The realm now has double blend maps so I can have grassy road or roady grass (whatever that means) or snow or whatever else really..

If you’re interested I’ll show you how it’s done. There’s basically a map of where the grass/rock/other should be that’s red for say grass, blue for rock and, green for mud. These can be blended together too. The more red the more grass, the more green the more mud etc.

Oh.. here.. a picture (or two) tell’s a thousand words..

blend1

So that’s blend map 1. Currently used for grass, rock, mud. And blend map 2..

blend2

Which is currently used for cobbled road and snow and something undecided. maybe another type of rock or gravel. We’ll see.

The end result in the screenshot at the top of this post.

I’ve also been deep in the bowels of the game code making the NPCs (non-player characters) which are, in this case, giant rats have attributes so they can be involved in combat of some kind.

I made a crude but effective editor for this too.

npcstats

See? I’ve been hard at work since my last post.

I need to get my rats to follow the slope of the terrain properly since that doesn’t work and I still haven’t fixed the jiggly shadow bug for medium quality shadows. The NPCs need to generate shadows too.

Really trying to keep focused on getting an actual game that people can really play rather than small details like that though.

I’m thinking of switching out the log walled town walls for something in stone since i’m not sure they fit well with the more modern buildings. Some historian could probably tell me. The town needs a name.

Comments and suggestions welcome!

Till next time..