Saturday, June 6, 2015

Making a C1 and C2 Tricorder (knowing exactly what any cob does at a glance)

Creatures 2 could easily have become my favorite game in the series.
But as has already been pretty well explained, it was way to frustrating on many levels.

One of the major reasons I never really got into the game was the overwhelming quantity of new game items, plants and foods .
No guide existed at the time to explain their effects, and even today the few that exist lack in completeness or precision.And without any reference it was a very frustrating experience not to know what could or could not be eaten.I'll admit it, many of my C2 Norns never ate anything beyond cheese carrots or nuts by fear of the unknown.

Writing such a guide might be an option, but what about the various additional cobs one might not be aware of , or all future additions?
Can we be a little more clever about that?
What if we got a tool that simply told us what a cob does by hovering the mouse over it ?
That would be a creatures Tricorder of sorts, that we will learn to build together in this article.

Some of you may feel that many of the articles I published so far were pretty technical and maybe not that interesting for the common player.
I agree with you.

The reasoning behind that is that I'm trying to share knowledge about the various game mechanics so anybody can make their own tools suited to whatever needs might arise.
There is a lot of things to cover, and I realize I spent a lot of time on the baby steps and didn't even show you most of the "good stuff" yet.

Let's try to correct this and make a tool that can automatically show you the effects of any cob you point your mouse at.
This is the single most important tool I really would have liked to get with the Creatures 2 game, and one of the reasons I spent so much time on technical details so far.

Putting stuff together

So what do we need to build such a tool ?

As I've shown recently, it's pretty easy to make a tool that spits out the classifier for any object you hover your mouse over.

Let's build on top of that.

We've got a way to get the classifier for the object under the cursor.
As shown in the C1 scriptorium article, this enables us to recover any script for this object family by using the " dde: scrp X Y Z N" command , where X Y and Z are the classifier, and N an "event number".

The events we would be interested in are the" activate 1" and 2 actions (script number 0 and 1) for C1.
In C2, we also have the number 12 script that corresponds to the eating action.
(Remember that in C1 creatures "activate" food as any other item, while in C2 there are distinct actions for activation and eating)

Modifying the tool to spit out the activation or eating script instead of the classifier is then trivial, but let's do more.

As Jessica recently showed by documenting the C1 carrot cob inner workings, the main CAOS command behind the "effects" of any cob is the "stim writ" command. 

This command not only injects the Norn with the needed chemicals, but also "fires" it's associated brain cells so the creature can trigger the learning process for this object (and later remember that eating food when hungry is a good thing, or that eating a bad plant is not a good idea).

Let's take the "stim writ" command used by the Activate1 script for carrots :

stim writ from 10 255 0 0 35 100 34 70 57 100 0 0 

The structure of this command is identical for C1 and C2, and the numbers are interpreted as such:

stim writ # The command itself
from # The object to which the stimulus must be applied."from" is the entity that lead to the script being executed.
10  #Significance of the event.This tunes the impact of this action on the Norn's learning process.
255 # Sensory lobe Neuron Number: defines if this stimulus should fire a specific neuron
0 # Intensity: the amount by which the corresponding Neuron will be activated
0 # Features: I'm not sure what this field does yet.
35 100 # Chemical1 number to inject to the target, and it's amount
34 70 #Chemical2 number to inject to the target, and it's amount
57 100 #Chemica3 number to inject to the target, and it's amount
0 0 #Chemical4 number to inject to the target, and it's amount
We can safely discard the 6 first elements unless we're studying the brain specifically.

Making sense of which chemical is which is easy, as I've shown in the C1 and C2 chemicals definitions acquiring articles.

Don't forget that C2 also has a couple "stm#" commands.
Those don't have a specific target, but rather are sent to all nearby norns depending on the used variation : All nearby Norns, all touching Norns, all Norns within hearing range...
This is useful to generate "zone" effects such as those of music or contamination.

Now we've got everything we need to make a simple yet very powerful tool:

- Grab the Classifier for the object under the cursor
- Get the Activate or Eat script for this classifier
- Only keep the "stim writ" line
- Split that line into 4 chemical injection entries, and figure out which chemical is which by referring to the chemicals list obtained by parsing the game files.

We now can now know what a given object does by just pointing our mouse at it!

So this herb is the good one...

... and this is one is the bad.

Exploring some stuff

Now we've finally got such a tool, we can quickly go over a couple of the most ambiguous items in the C2 world, for science:

First, let's answer a question I raised in my very first post as I started this blog, and figure out which side of the bridge is the safe one :

The left side berries are the safe ones, and have healing properties

While the right side of the bridge bears the toxic variety.

And while we're at it, let's have a look at more lookalikes.

The blue berries are tasty,refreshing, and cure cyanide poisoning...

... and should probably not be confused with the red ones from the same bush.

Small shrooms are mostly ok.

And I guess you already knew about the big ones

Those not only hurt but are also toxic ! Now I know how my norns get ill so close to the nursery!

And it works on objects too :)

And as always, exploring Albia might lead to a couple interesting surprises:

C1 Norns seem to be claustrophobic

C2 ones are also to some extent.


Some objects do what you would expect from them...

...while other are unexpected source of danger.

Who'd have guessed that music gives courage to Norns too ?


I hope that's enough to have you interested in that tool.
You can grab it here.

And just like the couple preceding tools, you will need to have the VB6 runtime library installed for it to work.


  1. This sounds amazing! I just tested out the Class ID tool, which works wonderfully. I think the permissions may need to be updated for the download of this one: It gives me the option to request permission to view the file, rather than going to the download. I'll be very interested to test this one out, too: Seems like a really useful way for anyone to figure out what something does in C1 and C2. Going through the CAOS "stim writ" commands is pretty tedious, especially when you have to reference the chemical list to find out what each number means. Great work! I look forward to trying this out when the download is all set!

    1. Oops, you're right, I didn't set the file to public before sharing the link.
      This should be fixed now.

      I've made some minor bug fixes since the initial release.
      I'll push the new version this evening and let you know when it's available.

    2. Awesome! I'm looking forward to the updated version... Or is that what the download is? I'm excited to try this one out: Seems like it will be a really handy tool for all types of players and developers. Thanks!

    3. I uptated the tool that same day.
      It's the new version that is available now.
      Have fun with it !

    4. Awesome! I just tested it out, and it works beautifully. Probably going to make a video one of these days showing off some of your tools in action, because they're really wonderful. Can't wait to see what you come up with next!

    5. That would be nice.
      But maybe you should wait a bit.
      I still have a couple of the oldest tools to convert to usable versions (The C2 autopsy tool for example) and at least one additional tool to write about before releasing the whole toolbox pack.

  2. This comment has been removed by the author.

  3. I can't seem to get it to work. I've installed the VB6 Runtime Library, but it still gives me an error saying that the dll couldn't be found.

    1. What is the exact error message you get ?

    2. "The language DLL 'VB6FR.DLL' could not be found."

    3. Weird, have you rebooted at least once since the install ?
      What is your exact operating system and version ? (32-64 bit ?)
      The easiest way will be to google for that specific dll and copy it manually next to the executable or directly into the appropriate system path.

    4. I've done all of that, but it still gives me the same error.
      My operating system is Windows 7 64-bit.

      (sorry for the delayed reply)

  4. I downloaded the file, and the values show up, but not what they mean. Am I missing a file?

  5. The names of the values appear if I copy the tool into the installation directly. Sorry if you had already specified that.
    Great Tool!

  6. Hi, I am having the same problem as the previous poster, the values show up but not the names. I have tried the executable in every directory I can think of. Please could you offer some advice.