Saturday 28 September 2013

Get it right the first time, that's the main thing

I've been quiet around here recently for this reason: I've had not much to report. Not much of interest anyway. As ever, I've been re-writing my old mistakes for the sake of future ease of continued development. Here's the thing I was redoing: ALL BEHAVIOURS.

It's been a pain since every interaction between every object is handled with a variety of behaviours. This is the third re-writing and the most comprehensive. It doesn't just work better than it did before, it works a whole different way.

The obviousness of the need to go from the old trait system to the new behaviour object system made itself apparent when I started writing the code for combat. Combat between two objects using weapons. The weapons are procedurally generated meaning that their properties are chosen at random (but kind of "channeled random" so that they kinda make sense e.g. no fire AND ice damage) and then these properties need to be read from the weapon and "applied" to the victim of the attack. This was a tricky thing to do but then the more the method for doing it cleanly evolved, the more it resembled a better way to handle every interaction in the whole engine!

Consider this: how is an interaction between two combatants any different to the interaction between any other two objects? Only that in combat, an object is kind of surrogating the interaction on behalf of its owner.

Wait, I think I've reached the point of this not being at all interesting.

I'll tell you this and leave: The re-writing of behaviour is nearly finished which means the behaviour of complex, procedurally generated weapons is almost finished which means combat is about to be actually interesting!

Oh hold on, need a screenshot...just let me grab something...


This is kind of interesting and new. Sort of. The weapons along that wall are all procedurally generated. There are separate algorithms for creating swords or axes / hammers and within that they have a bunch of rules (e.g. if the sword has a guard over the hilt like the sword second from the left, a small defence bonus will be added). More on these algorithms as they evolve!

No comments:

Post a Comment