Pickle That Fungus

We know what you really want: An excruciatingly detailed fungus pickling simulator. And I’m going to show you how it’s done. “What, more logistics simulation?” you gasp, somewhat overwhelmed with emotions you can not identify, will not identify. Yes, I answer, because if I’m going to be forced to write this thing two weeks in a row it’s either this or more Bizarre Literary Experiments and we all know how that turns out. (Of course we could always mix the two – a bizarre literary industrial logistics simulation experiment, but then I might be treading on China Mieville’s turf and that guy could totally beat me up.)

Let’s call it a two-part series if that makes you feel better.  Remember that episode of TNG where Riker said “Fire!” and it cut to the end of the season? It’s like that but without the cliffhanger. Or Riker. But we’ll make it work because we’ve got fungus and the luminous mycelium interfacing with the base of our neck, suggesting that this is a good idea after all and why don’t we continue discussing the laudable qualities of fungi.

The elusive black cup fungus - a delicacy, I hear.

Shhh. See there? It is the elusive black cup fungus – a delicacy, I hear.

So let’s walk through the process of adding a harvestable resource to the game and go into a bit more detail about creating a production chain from start to finish. All meat free!

First, we have a set of three models with textures created by Mr. Hamilton — a large, medium, and small cluster of fungus. He makes the magic happen in Maya for 3d modeling plus 3d Coat and Photoshop for texturing. Out of this we get some .obj model files and some .png or .tga texture files. The *.obj must be turned into a *.upm for the game (I mean, duh) via the importer, seen here:

The most programmer UI ever. Try not to look directly at it.

The most programmer UI ever, plus maladjusted gamma settings in the viewport. (I’ve hidden the system & network info, but visible were computers named “RHOGOG”, “CASSILDA”, “FISHPEOPLE”, and “BUILD-LINUX”; all eldritch entities from Beyond Space.)

Now stop looking please.

The *.upm holds the model geometry, various rendering flags, paths to textures, and probably some other nonsense. This packaging process must be done for every model and animation in the game and that’s about what there is to it.

So we’ve got the models, how about putting some fungus on the game map? This requires two things: a game object definition, here:

We'll get to that output line in a sec.

A forageSource is a gameobject you can execute the “forage” command on; reharvestTime of -1 means the object is consumed upon harvest. We’ll get to the commodityOutput in a sec.

And putting said game object definition into the biome definitions so it’ll actually spawn some fungus:

There's a lot going on here.

There’s a lot going on in biome generation, a little of which has been discussed previously, and some inscrutable noise variables which have not. For now we only really care about the line that puts a forageSource into the contents of this “forest”.

We’re almost there, but I’m pretty sure the game will write some passive-aggressive console log lines if we attempt to harvest this stuff without defining that commodityOutput. Back to Mr. Hamilton, the importer, and some more Komodo Edit. Oh hey, and it needs an icon! Great. Forgot to even draw that thing, one sec, loading up Photoshop, copy-paste, paint a bit, there.

This is my life.

This is my life! (I didn’t even include the step where I run a lua script to write the icon & filter information to an xml file that the UI will actually read.)

Okay, we’re all set up!

Think we’re done? Nope! You can harvest these things, they can be eaten (because they’re type “food”), but they’re not being pickled and black cup fungus is best when pickled. Now last week Sean made some lovely models for berry preserves which you can see here:

See fungus anywhere? Neither do I. Let's fix that.

See fungus anywhere? Neither do I. Let’s fix that.

Hello!

Hello!

Let’s re-use the same models but change the texture to make some pickled fungus. Normally I’d make Sean do this but he’s in Portland drinking craft beer or getting a tattoo or whatever it is they do in Portland, so it’s up to me. Just need to modify a texture, slap it on a new copy of the model, put in a new food definition (and I’m skipping drawing the icon for now, so a placeholder that consists of my bloody, screaming head will have to suffice).

Just like grandma used to make.

Crates of Pickled Black Cup Fungus just like grandma used to make.

But that’s not all! We have the raw resource, we have the end product — now we need to workshop definition for this transformation of mere fungus into slimy quivering morsels of delicious homey nourishment. Ah, you say, we talked about workshop definitions last week! Excellent, I say, we can apply this to our current feature. Onward!

… Actually there are a few things I mentioned but didn’t show because I didn’t want to go into excruciating detail last week but have kinda walked into it this week. Let’s see ’em.

Workshop job definition for characters above, workshop  job definition for workshops below. Got it? Good. There will be a test.

Workshop job definition for characters above, workshop job definition for workshops below. Got it? Good. There will be a test. (There’s also one missing comma in that shot which I caught after my attempt to take a screenshot of the completed process utterly failed.)

Ouch, okay. Hurrying along here as best I can – we’ll make this cleaner and smarter later. It’ll need a requirement for glass bottles in which to pickle, but we’re going to be nice just for this one example. (And yes, we’re going to pickle the fungus by sticking it in the oven. JUST LIKE GRANDMA DID. And you really, really don’t want to see the contents of those FSM commands, though we’re going to have to clean them up to make the character interactions with the modules look more natural.)

Where does this get us?

Cooking all through the night.

Cooking all through the night.

Success!

Nestled between some logs and raw fungus, sweet success!

And I’m out.

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

26 Responses to “Pickle That Fungus”

  1. Andrew Ferguson says:

    I should rename the build machine; Suggestions?

    { reply }
  2. Siobhan says:

    Bertha! Lovely Bertha. Sometimes I think she’s a dream.

    { reply }
  3. Davud Porter says:

    Damn, the more I read the more I want this game! Stop taunting me!! Is there any news on a tentative release date? I remember a while back it was set for end of December or something, then mid-Febuary, any news on the new time window estimate?

    { reply }
    • SangerZonvolt says:

      Well the official game website still states “early 2014” as release date, which I think isn´realistic anymore, so maybe mid 2014?

      { reply }
      • Davud says:

        I can only hope it comes out sometime soonish x.x I die a little every day waiting for this to finally come out 🙁

        { reply }
  4. shMike says:

    How many people stopped to find the missing comma like I did?

    { reply }
  5. J23 says:

    I think this fascinating blog post leaves out one crucial question: who in their right mind would want to eat black fungus? Or spread it their toast? Does it give one superpowers?

    I think I’ll stick with the Queen’s Own Cherry Preserves, thank you very much.

    { reply }
    • Tyler says:

      Cherry preserves, you stahlmarkian terrorist, the moonfungus is a gift of the beneviolent cog, in his name must we eat them.

      { reply }
  6. dtanders says:

    So does the mushroom jam cause madness or what?

    { reply }
  7. Ratoslov says:

    Are the black cap mushrooms a cap mushroom with a white ring around the edges? Because in pictures it looks kind of like a lava tube or some other thing.

    { reply }
  8. Jabberwok says:

    I’ve never been so excited about fungus before. Or at least not in a long time.

    { reply }
  9. Wouter says:

    Why are you mixing of json and html? Unless you go into namespaces and other nasty advanced XML features, you can express more or less the same with both formats.

    And one of the sucks. And it’s not json

    { reply }
    • JC says:

      XML gives better error reports. Since you have the name of the closing tag, you can be more specific about “Unexpected end of NoodlyBucket on Line 406” while also having the ability to run one of a massive number of schema validators on all of your files to make sure they are formatted correctly ahead of time.

      If you have a similar error in a large JSON file, everything gets a little weird because you have just made malformed objects which might technically still be correct. So maybe one of those lua scripts converts the JSON to XML, so the human operator can write the nicer syntax but the error messages will be a lot more reasonable / localized?

      { reply }
      • AdminDavid Baumgart says:

        Ah, your speculation is charitable.

        We’re not using JSON; the non-xml you see above is a form of Lua read by … a custom interpreter I believe? Micah would know, as I believe he wrote it, and it’s related to our parallel processing Sorcery.

        XML is used, I believe, because there was code for reading it from Dredmor. I will concede that the error reports *are* better in XML generally, but that’s not why I have to pull some data out of Lua- it’s that the UI doesn’t read the Lua data, only XML. Which probably comes down to “do you work on the game or the tools”, and while arguably the tools allow the team to work on the game more efficiently, the question then is where the production bottleneck is. And for now it was easier overall to just hack it.

        Long story short: very small team, indie game, necessity. Somehow it works!

        { reply }
        • Wouter says:

          http://xkcd.com/1205/

          Thanks for the answer, makes quite some sense. To quote someone from pycon 2012: I hate source code and I want as little as possible of it in our product. Our customers pay for features, not for source code!

          And I admit json errors are annoying, although an editor with auto-indent will normally make them easy enough to spot. I guess what I like about it is mainly how trivial it is to handle json because it maps 1:1 onto language primitives in most languages, while DOM is about as clumsy an interface as it gets, and the whole ecosystem of XML+XMLS+XSLT+XQuery is just a horrible mess of convoluted code. Do I sound frustrated at all?

          { reply }
  10. Pertusaria says:

    Glad, but not surprised, to hear there’s a Gaslamp China Miéville fan club. See you at six.

    { reply }
  11. Regan says:

    Which Elder Thing do I need to make a sacrifice to in order to get this game?

    { reply }
  12. Cutter says:

    Why was Riker yelling “Fire!” because there was a fire on the ship? He was commanding Worf to shoot at something? Or he was just being a dink and trying to panic the ensigns on the bridge?

    P.S. These damn captchas are way to hard to read!

    { reply }

Leave a Reply

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