Saturday, December 28, 2013

CAOS snippets

Learning the CAOS language can be a painful experience.

When you look for command usage examples when debugging your very first CAOS console application, there's not much you can find :
  • The "inst,dde: getb cnam,endm" every single kit, app or example uses as a demo ( it shows current creature's name )
  • Some "cheat codes" to kill creatures, give them full life... always the same ones, and never any further documentation of how they work.
  • Raw CAOS documentation, with very few information on actual syntax, importance of spaces, commas or variables...
Putting it all together can be a tricky process, especially since the early Creatures games are very sensitive to the slightest CAOS script mistake and will mercilessly crash the whole game for a single missing space.

Just so you don't tear your hair out on your early CAOS experiments, here is a list of snippets that do some basic stuff, that you can just copy and paste in your CAOS console or custom app, without wondering if you should use lowercase, uppercase, commas, spaces brackets exactly as in the documentation or not.

Friday, December 27, 2013

The full "sys:cmnd" ID list for Creatures 1 & 2

Here's the full listing of ID's used with the sys:cmnd CAOS command in both Creatures 1 and Creatures 2.

As explained in this article, those were recovered using the "Resource hacker" program.
Feel free to imitate should those ID's not work for you.

Thursday, December 26, 2013

Recovering the lost "sys: cmnd" documentation

One of the aspects of the CAOS specification I got exited about when I first saw it mentioned in the C1 CAOS guide was the "sys: cmnd" command.
Quoting from the manual :

  
  SYS: menu commands 

CMND id# - issue an ID_XXX command message to the application. This
 allows macros to activate ANY menu command. Note that command
 will get executed LATER - fn doesn't wait before returning!
  id# is the decimal ID_XXX value - look these up in the resource
 file & list them for users

This sounds awesome ! The ability from our external application (or COBs) to execute any existing game command!
This will greatly help us, allowing us to add pause/play buttons to our custom applications, to run existing applets, export and import Norns...

All right, let's head to the mentioned "resource file" and try this command !
Err...yes...the ummm...resource file... Which one ?
Well...none it seems...

Where's this all going ?

We're in 2013. The original Creatures game was released in 1996.And it is still as awesome.
I've enjoyed the whole creatures series since then, regularly coming back at it.
It was enjoyable as an artificial life game as a kid, as a platform for developing cobs and addons later on, and lately, as a vast hacking playground.

I'm pretty sure this is a tasty plant!


It was also frustrating most of the time. Nearly every aspect of the game seemed to be crippled to some extent.C1 had no infinite scrolling, and only a very limited set of injections available, only 12 pieces of cheese for the whole game, no Norn picking...






Or maybe it's this one and  the other one is toxic?
C2 introduced many new aspects, most of which were poorly documented or done silently at the time. Once again, the various kits suffered from a crippling lack of usability : no way to make your own concoctions in the injections kit,painfully slow scrolling bars for locating chemicals for graphing or injecting, no explanation on what organs were, loads of new creatures, cobs , plants and food, and no reference about the exact effects of each thing...




And what on earth Albia does this do ?! It looks important!
It's obvious the Shee statue in C2 does something to Norns, but what exactly ? I won't even talk about the mixing drinkables machine...( Actually I will, but in a fully documented post ;)
Not to mention C3 with it's share of cool stuff (connectible agents !) but totally removing the use of kits.
Seriously, who wants to bring Norns from home to the nursery, load them in a bubble, and painfully click 40 times on a laggy button just to monitor a Norn's chemicals or perform an injection ?




Come on already ! I've been clicking that scrolling bar for ages !

When I recently came back to the game, I noticed both an increase in highly advanced quality material available ( check out the awesome Discover Albia blog to see what I mean ! ) and an alarming loss of many older websites, resources and downloads. This became evident as I began digging up the most technical game aspects, only to discover many documents were lacking, incomplete, or were simply never published.
Being so old and having such a generic name, many web searches are now also flooded with other totally unrelated stuff having "creatures" in the name.

But no complaining without bringing a constructive answer! So I began a journey on reconstructing that lost documentation and knowledge surrounding the game, with 17+ years of hacking now under the belt, trying to uncover every single undocumented or not understood aspect of the game.The time for of secrecy was over ! I wanted to fully discover and understand by myself any single obscure point that prevented me from fully enjoying the game. I would not only document all cobs effects, but also write my own tools to explore,manipulate and play the game the way ( I think ) it should have been done.

I've learnt and uncovered more stuff about the game series in the last month than I did the previous 17 years, also coming across some new stuff I never saw mentioned anywhere during my searches. I've decided to fully document my progression along the way, redacting a whole "Shee's lost knowledge" guide documenting every conceivable aspect of the game.

In the mean time, and just in case, this blog was set up to keep track of my progression, and keep publishing stuff along the way so the knowledge is not lost once again, even if the book never reaches my required standards for full publication.

So what will be going on there ?
We will be using programming and hacking skills and tools to manipulate, explore, enhance, extend and document the game.

The site will not only contain detailed tutorials on Norns inner workings, but also on deeper technical stuff about the engine, the game mechanics and how to interface with the game.

We will cover some basic stuff:
  • The CAOS language
  • Writing COBs
  • Norn Biochemistry
  • Genetics

We will cover some advanced stuff
  • Writing external programs that interface with the game
  • Reversing the game engine and the game file formats
  • Writing tools and libraries to manipulate Creatures files, and worlds.
  • Using our new tools to fully document the game: how does sleep work ? Is that thing edible or not ? What exactly happens inside my Norn if he eats that COB ?
  • Writing complete tutorials about making whole worlds or Norns breeds from scratch
  • Adding new Norn behaviours ( meditation, telekinesis, farting...)

We will cover some unique unpublished stuff:
  • Reversing the unpublished OLE specifications that will allow us to write new ingame kits for C1 and C2 ( Yes! there IS an OLE interface available in C1, we will learn how to investigate and understand that too ! )
  • Reversing the game to fully document the  "APP:", "TOOL" and "sys: cmnd" commands for which no complete documentation was ever published.
  • Discovering and activating some hidden game options, menus and dialogs
  • Using our new external tools to enhance the game : 
    • writing powerful monitoring programs
    • writing editors for ingame content ( teleporter management, room editor, script browser...)
    • using advanced visualisation tools to study norn genetics and genealogy
And much, much more !

I'll try to present most of this stuff as a series of tutorials so people can not only learn the facts but also the means by which the knowledge is gained and game is reversed so they can further build upon this work, and create their own applications or kits.

Seems Interesting ? Let's begin then !