Editing the Realm

Well, loads to tell.

From the picture above you can see I “slung” together a basic terrain editor. This isn’t for reshaping mountains or making huge changes to the world (ie use my terrain generator for that). This is for tweeking the odd nasty pointy hill or overly sleep slope. It was rather complex in the end since it had to find the exact patch of terrain to edit then match up the height with the heightmap (the aerial view of the terrain that determines how height each square meter of the terrain is.

I’d been wanting to do that for a while but I thought it would be too much of a pain. Then I read some post somewhere about using SetData on the vertex buffer after adjusting the position of one of them. I always thought that would be too complex but since my world is centred on the player (0,0,0) it wasn’t so bad to work out. I won’t bore you further with the details.

Other things.

I imported a load more rocks and trees. I think I really do have enough of those now.

morerocks

So yeah those look nice I think (there’s some mossy ones around but i’ll probably show those in the video).

I’ve done a lot of work behind the scenes on the actual player class. He/she/it now has lots of data attached to them like their name, experience, level, health, power and I made a base skills class which initially just has a dagger skill. The thought being that each item can have a required skill attached to it (or multiple skills or none) for you to be able to use it or at least use it effectively.

That done I moved on to making a character screen, I combined the look of the Final Fantasy 14 one with the look of a more classic RPG. It will have tabs for your skills and stats, equipment and quests. I’m trying to avoid making windows open all over (ie like Everquest) and try and keep the interface as user friendly as possible.

Here is the initial layout, the tabs and data will go on the right.

characterscreen

I’m not 1005 happy with it yet at all but I’ll try not to get too bogged down with making it look perfect and get on with making it usable.

Well that’s it for now.

Until next time…

Man vs Rat

Ok sorry for the lack of updates, I’ve been on holiday/vacation. Didn’t stop me reading about shadows though. It’s such an annoyingly massive topic and although my shadows are just about acceptable there’s still an annoying amount of jiggle.

Alex who wrote Cascaded Shadow Maps With Soft Shadows has been helping me with this a quite a bit and has kindly donated some of his time to help me solve the jiggle. Unfortunately it’s not entirely gone but it’s much improved and I’ve learned a lot anyway so that’s always useful. I will have to come back to it or else I’ll end up with beautiful shadows in a few weeks/months/years and no game.

Anyway, enough about shadows! What have I been working on? Well… quite a bit. I have come to the point where I had to decide what I was doing about the stats of the players and enemies. What determines how hard they hit, how much they can avoid, how much power they have etc. Well for now I’ve gone with the classic D&D style stats of:

  • Strength: How hard you hit and how much you can carry
  • Dexterity: How hard ranged attacks hit and how far they can travel.
  • Intelligence: How hard your spells hit.
  • Wisdom: How much power you have and how much health you can heal.
  • Stamina: How much health you have.
  • Charisma: Affects prices from merchants and how much you can resist certain enemy spells(?).

Along with that I set some other basic stats like maximum health, current health, power and gold.

Both the player and all NPCs have these along with some other minor details like if they’re dead or not.

But that’s not all! (overly dramatic) NPC’s now roam around over the hills. I had to do some rather annoying math to get them to nicely follow the terrain. I don’t just mean their position above the terrain the have to tilt and roll to the angle of the terrain or they look ridiculous. That wasn’t THAT bad though and the effect is great. Very useful too. I need to add a button to my editor to make an object (a rock or a building etc) snap to rotate to the orientation of the terrain. I do that manually now so that would be great.

Also the hotbar how lots of shiny new icons (not made by me but bought and tweaked by mean). Nice aren’t they? Anyway not only can you now hit a targeted rat, it will turn to face you (rather abruptly for now) and it’s health will go down. And there’s even more! (Ok this is getting a little silly sounding now but I really have added a lot). The game now calculated the range from the player to the targeted enemy to make sure you’re close enough for the selected attack.

I’m aiming to have the whole combat cycle. Kill or be killed by next time so.. until then.

 

Terrain Following Rats and Death

A bit of a weird and overly dramatic sounding blog title but anyway..

Ok more stuff behind the scenes. I’ve added load more attributes to npcs and made them editable. I realised I’d need my enemies to be able to follow the terrain like the player does but I didn’t account for the fact the non-bipedal creature don’t stay upright (like giant rats for example) when they run up hills. I guess humans don’t entirely but it doesn’t look ridiculous if they do.

In the screenshot above I’ve targeted a rat and I’m about to hit it with something and as you can see both rats look sort of ok but they should really be tilted to the terrain they’re on. I’ll have that working by the next blog post and that a promise. If you’re interested it’s not actually THAT complicated. Using the usual algorithm for calculating the height at an exact point of a triangle (you can find that anywhere on Elgooglado – no one call it that btw), you find the front and back height of the model and calculate the diference between and then using that different the angle you need to rotate the model about it’s X and Z axis. Not my work, some maths genius somewhere worked that out already so no need for me to devote my life to it.

ratterrainfollowing

This screen shot shows all the new attributes (I’m going to need a scrollbar or 2nd page for them clearly) and the terrain following kinda working. The rat closest looks good but the far one needs to be rotated sideways a bit (rolled in Roll, Pitch, Yaw terms).

Ok well the game interface also detects mouse clicks over the hotbar icons and whether something is targeted so now to make some basic combat code.

I also played with a particle emitter for blood splats or magic sparkles or whatever when you actually DO hit something but that’s not ready for public consumption yet.

Oh and the reason for “Death” in the title, NPCs can now be attackable (or not) and be dead. Right now if they’re dead they’re just rotated on their side. Obviously once I switch the NPC class over to using the AnimatedModel class they’ll play their death animation and end at the final dramatic pose.

Ok until next week: “Beware of Merinsard!” said the dark figure and rode away into the gloom.

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..

The Blending of the Realm

Ok so lots of new stuff. Yay.

Firstly you can see there’s a working health and power bar. How power is used it’s entirely decided but it’s there and it works which is most important for now.

After all the behind the scenes stuff it was nice to just work on the game again. So now you can target other entities (NPC’s, animals etc) with the spinning targeting arrow. So there’s that.

I spend an annoying amount of time fiddling with the jiggly shadows problem which I promised I’d leave alone for now. It’s not THAT tough to fix I just haven’t figured it out yet. I will but I just don’t want to get too bogged down in a minor visual problem.

Talking of annoying problems, I wanted to get my peasant male/female models standing in a sensible rest position. I managed that eventually. I think I really need to leave SoftImage and learn 3DS though. SoftImage just doesn’t seem to like exporting FBXs that anything actually likes unless you do everything “just so” and even then you sometimes end up with a distorted mess.

Another big leap forward was the ability to be able to edit the texture of the ground using the editor (rather than the blend map in GIMP which just isn’t really practice in a 50km terrain). So this is exactly what I did, it’s not remotely perfect but I think you get the idea of the beginnings of it from the video capture below.

I’ll probably have to work out some kind of rudimentary combat soon. Kinda exciting.

Have a look at this:

Terrain Blend Map EditingĀ 

Seeya next week!