The Meat Tree & Fitting Pipes Together

I’ve been volunteered to write a development post, so here I stand begrudgingly, not unlike bauxite which eternally begrudges its treasure: sweet aluminum that bright and tawdry metal it is. And me? I bear only concept art for the Meat Tree as a sort of consolation for a lack of thematic unity herein. But wait- there are unifying elements to what I’ve been doing the past week that aren’t immediately apparent from “implementing and improving a ton of random tiny things to make a better overall game experience” and “going slowly, thoroughly mad”. We’ll get to it. First, that meat tree:

Why does the vegan draw so much meat?

Why does the vegan draw so much meat?

How does it grow? I’m not saying. What do you get if you cut it down? Meat, obviously.


 

Now that I’ve reeled you in on a highway littered with the sodden giblets of the Meat Tree’s broken promise, let’s make this post, as threatened, about the importance of animation timing or, more properly, all the complex moving parts that revolve around them. And if fit together just right they form something very much greater than the whole. Like Voltron.

Take the case of a soldier firing a musket at a menacing fishperson. (A shudder courses through my coffee-withered body; Komodo Edit flashes searing white light etched in courier new a record of torment.)

A soldier is a “citizen”* type gameobject. A fishperson is a “fishperson” type gameobject. Each will, if not otherwise occupied, query a global blackboard of jobs to find something appropriate to do based on a variety of conditions, then carry that job out. If hostilities exist between human and fishperson then one attacking each other is a valid job that each will attempt carry out (though only a citizen tagged “military” is allowed to execute attacks at this point). With the attack job acquired, a soldier will rush to grab a firearm if they’re not already carrying one, then will move until they’re in range of a target fishperson and open fire.

It's good to have a sergeant to watch your back.

It’s good to have a sergeant that watches your back – Fishpeople are everywhere!

(* Every time the word “citizen” is mentioned I will put forward my argument that the people of the Clockwork Empires are more properly labeled subjects because, if we are being Historically Accurate about this (and we are), that although the topic concerns citizenship, British subjects became allowed to be referred to as  “Commonwealth citizens” only with the passage of the British Nationality Act of 1948. So by Jove, all this “citizen” talk sounds like the work of La République Mécanique agitators seeking to undermine the monarchy or, worse, Communist infiltrators carrying out the diktats of their Novyrusian masters!)

Let’s break down how the moment of firing works.

Every “job” a character can carry out is broken down into FSMs – finite state machines – which execute a series of operations in a given order. If you get shot while, say, attempting to chug a bottle of whisky, your job’s FSM sequence can execute an “abort” call which could (say) cause the bottle of whisky to be dropped. Here’s the FSM sequence for shooting a fishperson (or other malevolent eldritch entity):

  1. <attack_ranged input=”entity” name=”run”/>

Yeah, that’s it. The attack_ranged FSM probably holds more logic than it needs inside of itself, everything for moving into range of a target, repositioning oneself if the target moves, and finally entering the firing sequence if both the subject and target are in the range that the firearm being held by the subject says it has.

Phew. Let’s look at the firing animation:

Don't be alarmed by what appears to happen to the soldier running to the left -- this is from the same video the above shot was captured from!

Don’t be alarmed by what appears to happen to the soldier running to the left with the splash of blood and all– this is from the same video the above shot was captured from, so that’s totally fish blood spraying all over.

The particles (by Mr. Triolo) and a lovely sound effect (by Mr. Steele) are attached to the appropriate frames of the animation (by Mr. Triolo) running on the NCO model (by Mr. Nejat). With all of that work done and packaged by all those guys, back on the scripting side of things we just have to concern ourselves with running the animation and triggering scripts at appropriate points. The sequence is essentially this:

  1. Load & execute pistol firing animation on to character
  2. Wait X gameticks until the point in the animation where the pistol has appeared to fire, then send the target a “damageMessage”.
  3. When firing animation length in gameticks is hit, load & execute the default do-nothing animation and find a new “job”=

Anyhow, the next character job is probably going to be “shoot the fishperson” again unless the soldier’s morale breaks or they’re set on fire or something, so the system works pretty well. The timing and functioning at stage 2 is the tricky part – sending information to objects being interacted with. Aesthetically the value of X here is interesting because if it’s off by just a little, the entire interaction of each animated character, sound effects, and particles will intuitively feel wrong. So let’s get it right.

So that’s great and the timing is visceral and lovely, but how about that “damageMessage”? This is a collection of information that the FSM pulls from the character’s item about what type and amount of damage it does which is sent over to the receiver of the damage to decide how they’re going to take it. A Steam Knight for instance will shrug off most damage types and simply play a metallic “ping” sound. A fishperson, however, is soft and fleshy and will shoot out blood (triggered via a script command) and take injuries (via decrementing hitpoint integers and possibly adding special afflictions).

At that point, you say, shouldn’t we play a “get hurt” animation? Why yes! But this is where it gets more complex: We’re in a position where one game object is pushing animations, usually covered by the “job” system, onto another game object. What if the target of attack is in the middle of walking between tiles? What if they’re having a conversation? Everyone needs to know how to abort properly, what to do next, and figure out at what point they’re allowed to query their status to figure out what job they should be doing next. I’ve been considering the idea of animation interrupts detached from the job/FSM system, but anything inspired by one of the more confusing Magic: The Gathering mechanics is probably not a good idea. Maybe I’ll pass this to Nicholas to figure out. [Note: We know how to solve this and just had a big talk which ending up with all the partners agreeing that this was relevant to the discussion.]

I've got an icon for this.

I’ve got an icon for this.

(Related: we have a “Run Because I Am On Fire” job which becomes unbearably important to execute if you have the “on_fire” tag, but I talked about that already.)

In conclusion, there are lots of little pieces of art and code that need to fit very cleanly together to allow systems (ie. a character) and their meta-systems (ie. a workcrew), and their meta-meta-systems (ie. a colony) to execute in a technically smooth and aesthetically pleasing manner. They also need to interrupt each other in similarly pleasing manners when things go terribly wrong in your colony and characters rather impolitely interrupt one another.

This is where, as I’ll always insist, it gets complex.

Posted in Clockwork Empires | Tagged , , , , , , , , , , , , , , ,
21 Comments

21 Responses to “The Meat Tree & Fitting Pipes Together”

  1. Davud says:

    Will there be special particles if you get say, cursed weapons or something? And wow now I really can’t wait for CE to come out!! Meat tree’s have always been my weakness…

    { reply }
  2. Germz says:

    That is most definitely a tree made out of meat.

    I feel compelled to have a taste, but fear the results it might have on my immediate health. (That is to say, I expect my sanity to gush from my orifices in the form of blood and pus, which my insurance does not cover)

    { reply }
    • Bluerps says:

      My theory is that the meat from the meat tree can be eaten without bad side-effects, like any other meat. The problem lies in how you get the meat tree to grow in the first place, meaning that if you find a meat tree anywhere, you should probably check if a bunch of your citizens/subjects/characters are missing.

      It’s also possible that eating from the meat tree causes the growing desire to either feed the meat tree, or to become part of it.

      { reply }
  3. thechosenkitty says:

    “the first couple drawings of the meat tree looked like they were bristling with phalluses and were therefore canned”

    I’m not entirely sure that “canned” is the word to use there. Or maybe it is the perfect word.

    { reply }
  4. Headjack says:

    Do folks mind or acknowledge eating the treemeat or are they stoic-cum-ignorant?

    { reply }
  5. Davud says:

    If the meat comes from a tree, is it considered vegan?

    { reply }
  6. Ghin says:

    I noticed how much the hard work is wearing on you guys and I wanted to say how much I love your games. Clockwork Empires is the kind of game I’ve wanted to play with since I was a small child. Keep up the good work. It means a lot to me.

    { reply }
    • AdminDavid Baumgart says:

      (Thanks, I do appreciate it. It’s weird- we talk up all of our crazy ideas then it’s like, oh crap, people took us seriously and now we have to make it all work! And we’re naive enough to actually do it. But hey, it’s really rewarding when it all starts working together better and better, and we’re definitely seeing substantial improvement with each week of development.)

      { reply }
      • Jac says:

        I will second this sentiment. Hope you guys don’t feel any external pressure in getting this out to the salivating masses – I will gladly wait to play this and would like you guys to stay somewhat sane!

        { reply }
  7. Rhadamante says:

    I’ve got a serious dilemma here : I really want to enjoy Cockwork Empires, I do.

    But as a Frenchman, I couldn’t help to fall in love with La République Mécanique the first time it was mentionned and thus, every time I read it in one of your articles, I suddenly find myself hating the guts out of that Queen of yours.

    “Let them eat meat from the meat tree” she said.

    Until I adjust, I fear all my citizens ‘subjects’ will suffer from that. Greatly.

    { reply }
    • Ghostwoods says:

      Cockwork? Great Scott! I think you’ll find that’s a very different game. You French chappies are a bit too liberated, if you ask me.

      🙂

      { reply }
  8. Jabberwok says:

    I would love to see what’s on the job list for the fishperson game object.

    { reply }
  9. Ghostwoods says:

    I say, old chap. Not sure about this citizen malarkey. All sounds a bit… continental. Next thing you know, they’ll all be lounging around outside drinking confusing coffees, and smoking tiny cigarettes that stink of tar. It just isn’t cricket, what?

    Also, can’t help wondering what happened to the Meat Tree’s skin. Flaying can’t be good for a fellow, even when that fellow is a bally tree. Lets the microbes in. Nasty business, microbes.

    { reply }
    • AdminDavid Baumgart says:

      Lord Palmerstoke has never held with these notions of “microbes” as his deductions from first principles clearly support the Miasmatic Theory of Pestilence. Why, if we accept the existence of these so-called “animolecules” then what next – shall we ask our barber-surgeons to wash their hands like some effete poet? Shall we brace the mettle of patients with /other/ than a pull of the strongest gin? The Royal Society would never accept such an upending of Tradition so long as Lord Palmerstoke presides.

      { reply }
  10. BlackDaze says:

    Hmm, I wonder if you can put a fire near the meat tree and setup a Brazilian bbq. I’m sure after the initial shock of wondering where it came from, everyone will be happy. I’m sure the papers will provide interesting headlines too, “Meat trees were discovered and will end hunger in the empire! God save the Cog!” If they had a booze laden hot spring crop up right next to it, it’d do wonders for morale too!

    { reply }
  11. Cutter says:

    “I wonder where that fish did go. A fish, a fish, a fishy, oh!”

    { reply }
  12. DrQuackzalver says:

    Ooh, will there be diseases causing more afflictions? And horrible unspeakable Ways to keep a body going, racking up little red hearts like a diseased jaguar warrior conquering independent provinces?

    { reply }
  13. Mikael Kerensky says:

    The meat trees just want to be loved too! I hereby declare the Fish Meat Alliance! (now significantly less messy since the phalluses have been canned, presumably to be shipped as a new commodity to the bearded novyrus for the greater profit of the empire) In a slightly related note i fear the madness is spreading. Having discovered this game three days ago (and methodically reading through every blog post) I felt the nightmarish glee that is Clockwork empires wrap it’s tenacled miasma through my brain. All hail Quag’garroth! The fishpeople are your friends! The empire is a lie! The ocean beckons! ::walks calmly into the ocean never to be heard from again::

    { reply }
  14. niks says:

    That was funny 🙂

    { reply }
    • Mikael Kerensky says:

      Thank you! 🙂 I wanted my first post to this community to be memorable. This truly may be the game of my dreams… Or nightmares.

      { reply }

Leave a Reply to Jac { cancel }

Your email address will not be published. Required fields are marked *