Sunday, 26 June 2011

Digging into digging

Digging routine is probably the most complicated of actions. There are actions for variety of floor and wall types, but also for all game objects. However it's now quite easy to handle game objects, because Damage can be used to generate simple "pick-axe" damage to objects, much like kicking does. Floors and walls (terrain) can produce different results, because there isn't just one floor type (like in Nethack for example). You can do all sorts of special stuff like digging on ice and fall through in icy water.

With terrain tiles I had to create a test function that generates all terrain tiles and then just went on checking what happens when you dig each tile. That way I could clear the confusion caused by rather complicated data-driven approach... but I guess that's the best way to do things anyway: test everything you possibly can figure out.

Friday, 24 June 2011

LOC chart 2

When you start to add content it shows in LOC. Although the chart can look deceiving since there is only about 500 lines of code added. It could be more, because I'm in the process of moving old kicking and digging functionality into new data-driven code and then removing old commented out code. Both kicking and especially digging are full of content, because a lot of things can happen in those actions. The functionality shift from old code to new isn't easy, but I've managed to create a good flow with the current engine. The new code is already much better, because it's data-driven and if something is missing it's quite easy to fix later.

Wednesday, 22 June 2011

Damage challenge

It looks pretty good with Damage and Kick, which is using Damage. The only exception will be combat, because it has to be handled with higher detail. Kicking objects makes them break! Although there is some minor adjusting left in the amount of damage, because you can break anything with one kick. The amount of damage is too much, which in return brings a question about the HP or condition value of a object. What should I do with that? Maybe linking that value to the size of the object is a good choice, because it's obvious that bigger objects can take more damage before breaking. But how about monsters?

Monday, 20 June 2011

Kicking ass

Sometimes virtual functions can reveal their bad side which is repeating code. After all virtual functions are a lot like switch-case in traditional C. I noticed that when re-factoring kicking for objects. Each object type has virtual Kick function, but it's starting to look like the data-driven style is kicking back with generic code that looks like it could be placed in one function. Good thing is that such function already exists, I just never thought it could be more generic. It's of course Damage, a routine that has caused a lot of pain to program.

Sometimes I wonder why it took so long to "return" to this stage, where stuff begins to work like it should (for example kicking objects). Did I really spend six years refactoring the game engine?

Friday, 17 June 2011

Constructing constructs

Constructs are one of the object type that are man-made. They too are still in early stage. However I was able to write light routines for lamps pretty fast. I even made a video in Youtube where I'm testing a lamp:

Meanwhile Visual Studio and Opera started to act strange. There seems to be some trouble with menus which are aligned to left in the main level of menus:

I don't know what's the problem, but I think it came with Windows 7 SP1, I guess. Or maybe some setting has been changed somewhere. It's not a big deal, but these modern operating systems, you know.. They are so complicated that can't even keep setting like this.

I try to continue with constructs. Some graphic tiles need to be made and start to look at different actions like what happens if you kick 'em.

Sunday, 5 June 2011


Some good progress today. I managed to tweak a routine for messages that places messages in a list and displays them later. It might look like an obvious solution, but it wasn't that back then. However I was pretty glad that it didn't take too much refactoring, in fact both styles work at the same time. I guess it's going to take some testing to check out everything, but that's what the players are for;)

I've been adding missing features and today I was able to program the container creation for item containers (bag, backpack, etc.) and also container routines for them, but that was pretty easy, because I copied the code from movable container. It has virtual functions and in places like this virtuals are cool. No need to re-factor anything, just add virtual routines for the class and that's it.

Now that I have a youtube account (Kricex) I'm planning to create a video demo of Kaduria as soon as the gameplay looks like there is something playable there.