Posts Tagged dwarf fortress

Material System

I got sidetracked.

I was working on tying volumes to bones in order to calculate mass from volume and density, when I suddenly realised I was going to have to get density from somewhere. I was this close to following the original plan and adding a simple constant “creature density” value to the game… but…

Well, quite frankly, I’m tired of making placeholders and putting the interesting stuff off until I’ve finished the boring stuff. So I decided not to, and dived headfirst into the new material system. I wonder how many of these I can fit in? Any preferences?

My initial thought was to take a leaf out of Dwarf Fortress’ book, and define materials generically, to amplify the possibility of weird, interesting and utterly horrific combinations. The problem with this, though, is that they need to texture differently depending on how they’re applied, especially for things like fur and claws. So it’s more likely we’ll need to split them up based on how they’re applied…

• Skin
    – The furry/feathery/skinny/slimy surface covering. Has a strong influence on friction and insulation. Mass determined by Surface Area * Thickness * Density. Immediately visually apparent by virtue of body texture, obviously.
• Flesh
    – The goo and meat and muscle inside the creatures body. Influences the creatures strength and flexibility, as well as their optimal operating temperature and how endothermic they are. Mass determined by Volume * Density. Visual markers are mouth-textures and corpse meat textures.
• Hard Tissue
    – Skeleton and weapons (I’ll probably split these into two seperate items, so a creature can have different claw and bone material). Density and compressive/shear strength will be the most influential settings for the skeleton, while density and sharpness will be important for weapons and chewing. Visible on hands and feet, teeth and in corpse bone textures.

These three categories will make up the outer covering (fur, feathers, skin), inner covering/organs (fibrous, porous, fatty) and skeleton/claws/teeth (keratin, chitin, osseous tissue, enamel), respectively. Each item will have its own texture/spritesheet, and a position in the mutation map.

I will likely have to have duplicates so as to allow, for example, chitin to be used as either endoskeleton or exoskeleton. One idea I’m leaning towards is storing materials as three texture objects in the same asset folder, so chitin could be a single Material asset but still be applied as Skin, Flesh or Hard Tissue. I imagine making your internal organs and muscles out of chitin wouldn’t end well, but why should we stop creatures from trying?

And as a bonus, this means creatures can have body coverings and flesh made entirely out of materials I hadn’t considered before now, like fibrous muscle, or bone tissue, or eyeball fluid or retina cords!

Wow. I am a horrible person.

This material system will likely become one of the sources of tangential learning for Species. Much the same as how playing Dwarf Fortress is an extremely effective way to drill into you what Magnetite, Hematite and Limonite are, Species will happily throw a bunch of terms I’ve stolen from Wikipedia at you until you bloody well remember what Osseous Tissue is, damn it.

The system will also have a few additional per-material values. Most of these will be placeholders until their appropriate systems are in place, but it doesn’t hurt in the long run to define them early. So far ‘m thinking these ones look good:

Density,
Compressive, Tensile and Shear Strength,
YieldRatio (a simpler way to represent Compressive, Tensile and Shear Yield Strength),
Coefficient Of Friction,
IgnitionTemperature, BurningEmission (that is, the amount of heat this material will emit while burning),
Melting and Boiling Point,
Thermal Capacity and Conductivity,
OperatingTemperature (flesh and muscle specific: determines the optimal body temperature for this creature),
HeatOutput (per unit of mass. This will be what establishes Endotherminess!),
and AcousticalAbsorption.

Of course, finding values some of these numbers is gonna be all sorts of fun. “What’s the compression strength of fibrous muscle? What’s the melting point of eyeball fluid?” It won’t be easy, but there’s plenty of dogs and cats in the area.

Or, y’know, I could just ask The Google. But where’s the fun in that?

FOR SCIENCE!!
Qu

 

 

(Edit) Oh wow. I think I promised to let somebody kick me if I did exactly what I’m doing right now.

https://speciesdevblog.wordpress.com/2012/06/13/plans-for-the-next-version/#comment-673

Yep. Yep I did. Who wants to do the honours?

Advertisements

, , , ,

7 Comments

Back on Task!

I return, full of vip, vim, vigour and vampire babies!

 

Image

Spoiler Warning for Twilight Book 4

Source

 

I’m pretty sure my return to the lands of the self-motivated was prompted by a visit to the Tvtropes page for Dwarf Fortress. It’s strange how inspiring reading about Dwarf Fortress can be, especially given that I’ve never been able to actually play it for more than a few hours before giving up. Maybe it’s just my inferiority complex kicking in: I always feel like Species is an order of magnitude too shallow after reading about all the things DF does, which compels me to work faster to get the game to a state I’m actually satisfied with.

        

Work is still centred around getting the skeleton to fit the creatures exactly: I’ve got the rotations, but I’m having a basketload of trouble getting the lengths of animated bones. You’d think that’d be easy, but I’m having trouble working out what aspects of the bone matrices refer to what physical attributes.

 

(Edit) worked out the problem. I was multiplying the bones in the wrong order. Note to future self: multiply from the leaf bones first.

        

I’ve revised the plan for the skeleton heirachy in a way that, unexpectedly, is more radial than symettrical.

        

Image

Dem Bonez

        

This should be a lot easier to code: force propogation becomes a one way street from the limbs to the stomach, and I don’t need to try and work out how the limb forces interact along the spine: I can just apply them directly to the hub and work out the equilibrium from there.

        

As you can probably guess, it’s also a step towards more versatile body plans. Necks, tails and limbs are still predefined objects, but as their base class absorbs more of their functionality, it will be much easier to turn them into a more generic “link” class that can be attached anywhere.

        

* * * * * *

 

With the skeleton finalised, it’s time to start working on the forces.

 

Image

OH MY GOD TOO MUCH COMPLEX WHAT IS HAPENING ARRRGH

 

Heh. Comedic overreactions aside, it’s not that complicated. Most of the black arrows are bones, while the others are coloured by which bone they are acting upon. The first of each coloured arrows are mass forces. There are second arrows of some colours: these are Apparent Forces, or the forces *other* bones apply on their parent bones (for example, the disembodied yellow arrow is the force the limbs are applying on the shoulder bone). The three large vertical black arrows are not bones: they’re simply Apparent forces on the root bone, which is black and located in the center of the stomach.

 

Okay, maybe it is that complicated, but I swear it makes sense.

 

Oh, and I still need to add reaction forces at the ends of the limbs.

 

* * * * * *

 

The next step will be converting these raw forces into relevant ones: namely, compressive strength for each bone, and torque for each joint. In theory this is already done, but I haven’t visualised it yet, so I can’t confirm if it works.

        

With those in place, the game will finally have a framework by which to establish whether a creature is balanced or not. And if it’s not, it will have to expend energy or health maintaining its implausible body plan, which will encourage creatures to obey the laws of physics to avoid paying this price. I’m really looking forward to seeing that: practical restrictions should make the game feel much more physical and viscerally accurate, rather than the anything-goes abstract weirdness we have at the moment.

        

Cheers!

Qu

, , , ,

4 Comments