Procedurally generated creature models?

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
So at this point I must be stark-raving mad even considering something this insane - but during the usual lunch-time game dev talk session with Stuart the topic of defining creature anatomy came up again, along with related topics. Somehow we got to talking about generating graphics - might have started with a half-joke about procedurally generating graphical engravings on walls akin to how in Dwarf Fortress you get textual descriptions of every single engraved object anywhere. DF has the huge advantage of being pure text so there's no need to do models, actual engravings, etc, just describe them. Same thing makes combat work with the anatomy-level details and individual finger nails getting chopped off.

I'm eager to do anatomy-based combat over boring ole hit points, but even if we develop a neat and easily reusable way of defining anatomy (which is useful in several systems, more than just taking damage - what equipment can you wear, how would you analyze your experience with specific vulnerabilities of certain monsters, what special abilities might something have, etc), we still have the challenge of graphical models that DF nicely sidesteps by being pure text. Even if we have a system where you can chop the arm off a zombie to disarm it (heh), would we still have a basic model showing both arms intact? Could a mutant of something show up with three arms rather than the usual two?

I'm not exactly thinking Spore or anything here, again just a fundamental system we could extend with more details over time (maybe just detachable arms and legs to start). But this is a field I'm fairly unfamiliar with, like most graphics - any ideas just how doable something like that would be? Would still involve textures and what not, and we'd have all the anatomy definitions up front. But instead of making a full model to start with, generate x appropriate shapes and attach them together somehow, mapping the textures on the different pieces.

Heck I'm not even sure how a zombie in Minecraft moves its arms and legs, so I don't know what it entails to be able to dynamically remove or add said arms or legs. I still don't think I've seen a slime in all its glory (want to do it right, thus the "slime gun" tool quest). Do we have a particular strategy for the graphical representation of creatures yet? I'm sure Stuart could figure out what would make them tick (and spawn, and socialize, and what not), but models to my code-centric mind are more tricky.

I've got to be crazy here, right? Even if it really boils down to instead of one model for a zombie, we have 6 pieces that are attached together instead (head, torso, 2 legs, 2 arms) for starters, maybe with the ability to add an extra arm by tweaking the anatomy definitions and having it actually show up...
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Adding a little more here - don't mind the non-graphics guy trying to visualize how stuff like this might work. I might be way off, but hey :)

Thinking about the object of an "arm" as an example, in the context of a zombie from Minecraft just to make it easy to picture. Lots of things have arms. Arms may vary in sizes, texture, and with damage possible whether present or not. It probably also will tend to have points at which it attaches to things, like a shoulder or a weapon. Internally an arm has more details, but not all of them have a graphical representation. I'm figuring for starters we'll just have a cylindrical or square shape representing said arm, like for the MC zombie, with no differentiation between left or right, and with no visible fingers or elbow joint.

Behind the scenes I picture defining an arm in code or config, or a combination of both. I'm leaning towards defining the structure and how it interacts with the world in Java and its exact stats loaded via Groovy - that way you can write a "humanoid" class structure in Java and allow users to put stats in a Groovy plugin to make a new humanoid creature without even having to crack open the Java.

Internally the stats an arm has could be numerous with only a few impacting the graphical representation. We could add to this over time as long as the foundation is good, most of it without any need to make changes to the graphics code. Some examples:

* Exterior dimensions
* Texture
* Presence and strength of bones (can break in combat)
* Muscle stats
* Max strength (maybe calculated from bone, muscles, etc?) - how much the arm can hold or handle (potentially modified by the strength of the attached torso, can't carry a tree as a midget even if you really worked out your arm)
* Details on fingers (visible or not) - this one is interesting as there are multiple, yet we don't want to bother defining individual stats. However, we may have to track individual status values due to combat damage. Maybe "Finger" is also a Java class with its own subset of Groovy-defined stats, and you just indicate that you want "x standard fingers"

Most/all the variables would have default values stored in the generic Java class, which groovy then can override or load over with specific stats on initializing a "Zombie" creature. As something happens the values are modified in memory and potentially persisted in a DB.

The fun part comes when you're defining a new creature. Just assign values and a new texture and you have another similar humanoid. Tweak the number of arms and you have a quite different creature, but you didn't have to define a new distinct model - if somehow we have behavior modeled for how two Arms would attach to a Torso

Likewise an attack could be judged against the anatomy details, and if via assorted calculations an arm gets chopped off the Arm object is made independent of the Torso, perhaps even physics enabled, and then flops to the floor. The Zombie in the meantime has its functional combat capacity reduced somewhat. A held weapon might likewise go independent and drop to the floor.

Now how to animate that mess I'm totally clueless on :(
 

begla

Project Founder and Lead Developer
Contributor
Architecture
Logistics
Sounds very interesting to me (but somehow a bit crazy indeed :p). I wonder if this could be done modifying fractal approaches like L-systems. Constructing monsters and NPCs from different pieces is not that hard. Just a collection transformations of the sole pieces and the corresponding render function calls in the right order (simply put).

I'll give this some more thought for sure!

EDIT: Holy hell where did this text suddenly come from. :D
 
Top