procedural modular

I am a big fan of procedural generation. All characters I work on are procedurally generated. When I start to work on a character, I first think about how it should function in the world. What should it do, how should it behave, what are unique abilities of that thing. Then I think about how it should look. And the look should fulfill two functions:

  1. It should be clear what can it do, if it is friend or foe.
  2. It should have a distinct look. Should be easily recognisable from any other character.

“What can it do” I achieve by having quite specific attachments, weapons, etc that should make it easy to player to at least identify if that can shoot or hit or strike with electricity, etc. “Friend or foe” I plan to address with different colours. I want to have a minimum set of colours that should be easy to learn, understand and use. Red is for enemies, green for usable stuff (switches, handles, etc).

How do I do it? The usual path is to have a concept artist to come up with looks, functions and so on. After everyone is happy with the concept, it goes to a character artist who creates mesh. Then come textures, then a skeleton for animations is created and character is rigged, then animated. And code and/or scripts are created.

But how do I do it? Well, I can’t draw that well and it turned out that when I pictured something in my mind, it might be easier for me to just work on the actual model than to draw it and then follow my drawings (although I do that sometimes too, sometimes for whole characters, and sometimes just for parts). I know what I want and I start to work on the model. Although my approach is completely different to what character artists do. They sculpt, they are artists, it resembles actual sculpting a bit. And I am a coder and… I code my model. I have sets of different functions that result in creating a character.

Downside to that approach is how it looks. I am not an artist. I also want characters to be generated on fly so I can do too many details. And even if I could, code for it could be huge and not so easy to understand. But – I want my life to be easier, so I tend to break characters into parts and reuse those parts, reuse portions of code, have some common functions and so on. And remember that everything is procedurally generated, I can easily replace just parts or modify parameters to have longer, shorter, thicker, thiner legs or even have more semgents. Or different feet or arms or attach something to the body. This really simplify the process and also allows me to have not just one specific character but whole family of very similar characters that are shorter, taller, have more or less eyes, some devices etc. And all of them are created with same code. And – when I improve look of a certain leg, all characters that use that leg will have it improved. Just like that.

And instead of creating skeleton later and rigging it I actually start with a skeleton and build a character around it. Then when I move bones around, whole character adjusts.

What about animations? I have none. All motion is procedurally generated. I specify how many legs character have, what are their trajectories, base positions, what gait should character use (and I have sets for bipeds, quadrupeds that make it really easy to add new characters). I also specify speed. I love to add small details to movement that’s why I have a set of additional controllers that allow characters to do specific things and in specific way. To lean, sway. And with few simple parameters I can also define if character should maybe slow down when turning or just stand and turn in place.

Working like this won’t give me the best looking and best animated characters. But they are good enough. And such animation system I have, makes it actually easier to ground them in the world. There are some certain issues I plan to address later but for time being it is good enough. And what’s most important, I do not have to add same set of animations for any new character. I just tell them few basic things and they walk, run, attack.

Today I started to work on a character that I named roamer. It has mesh mostly done, it walks nad has some effects. It doesn’t have own specific logic, behaviours but that I will do later. What’s important to me is that it took me around 90 minutes to have it in game:

Roamer WIP

And here’s version with sound and some variety of roamers

I know that some character artists could create such character in probably 10 minutes. But for me, having it done (using some already created parts and functions), animated, making sounds in 90 minutes is nothing I could ask more. Such approach should allow me to spit a character one after another. This should allow me to see how they fit into the game and choose the best ones.

But after this one, I want to focus more on surroundings. Have more types of level parts and do actual look for one of the levels.