creatures caves
welcome, guest 

downloads   gallery   dev   community   creatchi   forum   mycaves
ccsf | links | advice | chat | polls | resources | post
 

  

Creating a Metaroom - Part 6: Music & CA   Development   Malkin | 5/23/2013  log in to like post

updated5/23/2013
Part 6 of 7 from the Creation of a Metaroom: From Inception to Release series by Liam, covers music and CA - smells.

Part 6 of 7 from the Creation of a Metaroom: From Inception to Release series of articles.

For some, a large part of the immersion and enjoyment of Creatures is the beautiful music which plays whilst you care for your norns. Though it is not a necessary part of a room, it can add originality and interest- in this part of the tutorial, I?ll teach you how to make a simple loop using GreenReaper's 'MNGTools'.

Cellular Automata are, some would say, what makes the Creatures world go round. Norns, Ettins and Grendels all navigate by use of Cellular Automata (or CA), which roughly equate to real world 'smells'. CA encompass heat, light, moisture and more as well as what we would usually consider to be a 'smell' - this is how norns find water, food, heat sources etc. We?ll be looking at how to set up a CA system within your metaroom with help from Sine coding genius fuzzie.

Introduction

For some, a large part of the immersion and enjoyment of Creatures is the beautiful music which plays whilst you care for your norns. Though it is not a necessary part of a room, it can add originality and interest- in this part of the tutorial, I'll teach you how to make a simple loop using GreenReaper's 'MNGTools'.

Cellular Automata are, some would say, what makes the Creatures world go round. Norns, Ettins and Grendels all navigate by use of Cellular Automata (or CA), which roughly equate to real world 'smells'. CA encompass heat, light, moisture and more as well as what we would usually consider to be a 'smell' - this is how norns find water, food, heat sources etc. We'll be looking at how to set up a CA system within your metaroom with help from Sine coding genius fuzzie.

Music

Music is, as I mentioned, an optional thing in a metaroom - if you have the ability, time and motivation to create music for your room, fantastic. But if you don't, a room can be just as brilliant without it. This section of the tutorial would not have been possible if it weren't for GreenReaper's fantastic work on dissecting the .MNG file format, discovering its inner workings and writing programs to edit the existing music or even create your own music for Creatures. Some of the tutorial is based on the information available on the Wiki - there is a far more comprehensive guide to .MNG files there, so if you are interested in properly following the subject up, the article on the CWiki would be a good place to start.

For this segment, I'll introduce you to GreenReaper's 'MNG Tools', something which is absolutely necessary in the creation of Creatures Music files (.MNG or MuNGe files). Firstly, you will need to download and install these two tools - the MNGPad and the MNGPlayer. Both require the Microsoft .Net framework version 1.1, so if you do not have that installed, you will need to download it from the Microsoft website.

Download the MNGTools
Go to Microsoft Windows Update
Framework download

I am not an expert in the field of .MNG (hereafter referred to as 'Munge' files) music files, so bear with me as I attempt to give you an explanation of exactly what a Munge file is, what it does, how it works, and a vague idea of how you can create your own Munge music files.

Munge files store Waves (or .WAV files), small samples of sound which play in the order or way you script them to. The basic unit of music is a Track, which can be played when an event happens - such as the birth or death of a norn, or simply for a particular metaroom. Even a specific part of a metaroom can have its own special Track, as many C2 areas do.

An example of a very simple track is:

Track(UpperTemple)
{
FadeIn(5)
FadeOut(5)

LoopLayer(HighBreath)
{
Variable(counter,0.0)
Variable(temp,0.0)
UpdateRate(0.1)
Wave(HighBreathG)
}


AleotoricLayer(BendyEcho)
{
Volume(0.4)
Effect(PingPong160)
Interval(4)
Voice
{
Wave(Bnd0)
Interval ( Random( 4.0, 9.4) )
}
Voice
{
Wave(Bnd1)
Interval ( Random( 4.0, 9.4) )
}
}
}

Looks complicated, doesn't it? Hopefully soon you'll be able to write scripts like this of your own - it really isn't that hard once you get used to it!

Lets break it down...


Track(UpperTemple)
{
FadeIn(5)
FadeOut(5)

Fairly simple - just the beginning of our script. It will fade in at the beginning for 5 beats, and fade out at the end for 5 beats.


LoopLayer(HighBreath)
{
UpdateRate(0.1)
Wave(HighBreathG)
}

This 'Layer' we are looking at is a LoopLayer - as the name suggests, it is a layer which loops constantly according to the value of UpdateRate.

First, the script is opened - 'LoopLayer(HighBreath)', and UpdateRate is set. It will play the Wave 'HighBreathG' every 0.1 beats.

Simple, no?


AleotoricLayer(BendyEcho)
{
Volume(0.4)
Effect(PingPong160)
Interval(4)

The next layer is an 'Aleotoric Layer', which plays a series of 'Voices' which are played sequentially. The first part is fairly obvious - the script is opened, the volume is set, the Effect is set, and finally the interval between voices is set.

You can create your own effects, but that is something which isn't going to be handled in this tutorial - check GreenReaper's tutorial in the MNGTools documentation for more information on that.


Voice
{
Wave(Bnd0)
Interval ( Random( 4.0, 9.4) )
}

Voices are the core of Aleotoric Layers - in a voice you can have one wave or more, depending on how you want it to sound. The chime sounds from C3 were done by using Aleotoric Layers with quite a few voices in quick succession, to show you the kind of thing you can do.


Voice
{
Wave(Bnd1)
Interval ( Random( 4.0, 9.4) )
}
}
}

And another voice, and the Layer is closed. Is it starting to make a bit more sense now? I hope so. If it isn't, then I can only direct you towards GreenReaper's documentation included in the MNGTools download - I am not by any stretch of the imagination an authority on Munge files, and if you spot something wrong with this section please do tell me!

The best way to learn about Munge files is to delve into them yourself - using MNGPad and MNGPlayer you can easily browse and listen to the C2, C3 and DS music files and discover how they work for yourself. Good luck!

The CWiki Entry on .MNG Files.


Cellular Automata

Without a doubt, to your norns the most important thing in any room are Cellular Automata. Without them, your norns, ettins, and grendels would have no way to know where anything was, or where to go next.

Unfortunately, the CL Map Editor does not automatically add CA to your metaroom - you have to do this yourself. Don't worry! It is possibly one of the simplest steps in the creation of a metaroom - I'm no expert, so I'll hand you over to fuzzie, who knows a lot more about it than I do.



Introduction - by fuzzie

CAs are an important part of most metarooms - as you should already know, as well as providing environmental information like heat, light and moisture, they also provide the information to allow norns to navigate around well.




Rooms

CAs are a good thing to take into consideration when doing initial world design - to make CAs work well, you generally want to have your rooms be similarly sized, without any absurdly wide or high rooms just because they 'fit' - split them up! This allows CAs to travel more realistically around the world and helps the creature navigation to work properly.

Room types are the next thing to think about when dealing with CAs in a room - the room type of a room defines how well it absorbs CAs from agents in the room, how fast CAs disappear from that room and how well they transfer between rooms.
You can customise the properties of room types using the map editor, but these properties are per-game and so you won't want to do this in C3/DS, you'll want to use the existing room types and settings.

For instance, an atmospheric room doesn't travel let elements like nutrients travel through at all - it's the atmosphere! - while heat and light travel through happily, while concrete areas are fairly restrictive to all environmental elements.

Another important thing to remember is that CAs only travel between rooms which are linked together by doors, as is covered by the room editor tutorial on the CDN - if you close the doors between rooms, then CAs don't travel between them at all. It's also useful to take into account the permiability (openness) of doors - a number from 1 to 100, it defines how well CAs travel through that door.




Links

The CDN tutorial also discusses the existance of links - if you want the CAs in your metaroom to travel between metarooms of the ship (useful if you want to introduce Home navigational smells and have norns navigate there), you'll need to use the LINK command to join rooms from.

The LINK command is also useful for joining - for CA purposes - two rooms which aren't physically connected together, such as the top and bottom of a liftshaft.

You'll have to code links manually in CAOS - the syntax is simple, simply 'LINK', the id of the first room, the id of the second room, and the permiability of the link between them (a number from 1 to 100 which defines how well CAs move between them, the same as doors). Bear in mind that you'll want to be sure to remove them before removing the metaroom, because the engine really doesn't like such links disappearing out from under it.




Emitters

While random agents often use and produce CAs themselves, such as nutrients, the most important CAs of a metaroom are generally produced using emitter agents, which are simply hidden agents which do nothing but emit a CA constantly into the room.

These are, for instance, used in Creatures 3 and Docking Station to produce light, heat and navigation elements from the appropriate spots.

One important thing to bear in mind is that a single agent can only emit a single CA - so you need a separate emitter for every CA you want to emit from a certain spot.

Example code for an emitter is given below:

new: simp 3 5 1 "blnk" 2 0 0
attr 18
mvto 8242 9281
emit 15 0.02


You should hopefully be familiar with CAOS at this point, so you'll know that we're creating an agent here and moving it into place - and then using the 'emit' command on it. The 'emit' command tells the agent to constantly emit a CA - here we're telling it to emit CA number 15 - the 'norn home' smell, the location to which norns return home. In DS, this is in the incubator area of the norn meso, and in C3, there's one emitter near the nursery and one near the tree house.

We're telling it to emit 0.02 of this smell every game engine 'tick', which is quite a low amount of CA which will slowly spread in small amounts throughout the ship without overpowering other norn home smells.

You'll be more likely to create an emitter producing light, heat or water - you can find the numbers for each of these in ChemicalNames.catalogue in your Catalogue directory, search for 'CA smell' and you'll find results such as 'CA smell 1 (light)'. You'll often want to make these emitters far stronger - for instance, the DS light and heat emitters output values of 1.0 and 0.95 respectively.

It's also important to consider where you place the emitters - generally it's a good idea to place them so that every room has an emitter within 5 or so rooms of it, with the emitters obviously placed where you want the light or heat to be concentrated.


Originally published as part of the Creatures Community Spirit Festival 2006.

 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
2 online
Dragoler
KyAnn
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki