Ecoid Babys
So, we had a session on the Ecoids that were used across the south west to education school kids on the environment. This inspired me to find a new way to visualise the data.
So what occured to me is the fact that the Ecoids are collecting data that is constantly changing, as its picking up all the data from across the south west. So I started to develop this idea of having a small little creature that you have to look after, and its environment changes depending on the data from Ecoid. You would then be given various objects to look after this creature, such as food, medicine, some form of light and warmth, a way to build a shelter. Then school children would be able to use this as a tool to explain the environment and it could be tweaked to explain the impact the environment has on creatures.
I got this idea really from my own childhood, I used to have a tamagotchi, which was a little electronic device you carried with you, and you looked after the creature inside, and it would grow, and evolve as long as you looked after it, or it would die. This is where I drew my inspiration from.
So, my first thought was, what do you look after? A dog, a cat, a squirrel? I found looking after a real animal might cause some issues, or a prejudice, some people don’t like cats or dogs, and for the project, giving various options would have taken too much time. So I decided on something ambiguous.
So this was the final design I decided on, with a little cute factor added by Karla Anker, since she can make faces look insta-adorable and for some reason, I can’t.
So with an idea in mind, I took to Flash and began to code the thing.
The issues I had in the end, was that the Ecoid Data just wasn’t up to date, and it took me a long time to realise this. I spent all my time trying to sort out variables for the various situations, that I just didn’t have the time to implement everything I wanted.
So for now, the EcoidBaby gets sick if it starts to rain, it gets cold at a certain temperature, hot at a certain temp, and you can warm him up, provide light at night, and you can heal him with medicine. If I had more time, I would have put in a timer that would allow him to go hungry, a certain amount of time would be needed in the rain before he got sick, and I would have provided shelter for him. I was also contemplating a happiness meter, but time ran away with me. I spent so long trying to figure out how to import the RSS and get it working, that I lost a lot of time to that.
But to try and fully demonstrate everything I did, I created 2 versions. For reference, I did try this first in Flash Develop but kept having problems, so i eventually moved to Adobe Flash CS5.5
The first is the version direct from the ecoid:
And the code for this is:
stop();
var temp_in_C:Number;
var fire:int = 1;
var cold:int;
var night:int;
rain.alpha = 0;
var sick:int = 0;
var rainOn:int = 0;
cold = 0;
night = 0;
temp_in_C = 15;
trace(“Temperature level is ” + temp_in_C);
function RainClick(evt:MouseEvent):void
{
if (rainOn == 0)
{
rain.alpha = 100;
rainOn = 1;
}
else if (rainOn == 1)
{
rain.alpha = 0;
rainOn = 0;
}
Cond();
}
rain_btn.addEventListener(MouseEvent.CLICK,RainClick);
function dayClick(evt:MouseEvent):void
{
if (night == 0)
{
sky.gotoAndPlay(2);
night = 1;
}
else if (night == 1)
{
sky.gotoAndPlay(71);
night = 0;
}
Cond();
}
day_btn.addEventListener(MouseEvent.CLICK,dayClick);
function tempupClick(evt:MouseEvent):void
{
temp_in_C = temp_in_C + 1;
trace(temp_in_C);
Cond();
}
up_btn.addEventListener(MouseEvent.CLICK,tempupClick);
function tempdownClick(evt:MouseEvent):void
{
temp_in_C = temp_in_C – 1;
trace(temp_in_C);
Cond();
}
down_btn.addEventListener(MouseEvent.CLICK,tempdownClick);
function Cond():void
{
if (night == 1)
{
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
}
else if ( night == 0 )
{
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
}
if (temp_in_C <= 13)
{
if (fire == 1 && cold == 0)
{
fur.gotoAndPlay(2);
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
cold = 1;
}
}
else if (temp_in_C > 14 && cold == 1)
{
fur.gotoAndPlay(10);
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
cold = 0;
}
else if (temp_in_C > 23 && cold == 0)
{
fur.gotoAndPlay(21);
eyes.gotoAndPlay(1);
mouth.gotoAndStop(3);
}
if (rainOn == 1)
{
rain.alpha = 40;
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
if (temp_in_C < 20)
{
fur.gotoAndPlay(41);
sick = 1;
}
}
}
function fireClick(evt:MouseEvent):void
{
if (fire == 1)
{
fire_btn.gotoAndStop(2);
if (cold == 1 && sick == 0)
{
fur.gotoAndPlay(10);
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
}
if ( night == 1)
{
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
}
fire = 2;
}
else if (fire != 1)
{
fire_btn.gotoAndStop(1);
if (cold == 1 && sick == 0)
{
fur.gotoAndPlay(2);
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
}
if (night == 1)
{
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
}
fire = 1;
}
trace(fire);
}
fire_btn.addEventListener(MouseEvent.CLICK,fireClick);
function medClick(evt:MouseEvent):void
{
if (sick == 1)
{
if ( night == 1 && fire == 2 )
{
fur.gotoAndPlay(50);
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
}
else if (night == 1 && fire == 1 )
{
fur.gotoAndPlay(1);
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
}
else if (cold == 1 && fire == 1 )
{
fur.gotoAndPlay(2);
eyes.gotoAndPlay(111);
mouth.gotoAndStop(2);
}
else if ( night == 0 && cold == 0 )
{
fur.gotoAndPlay(50);
eyes.gotoAndPlay(1);
mouth.gotoAndStop(1);
}
sick = 0;
}
}
meds_btn.addEventListener(MouseEvent.CLICK,medClick);
The other one is merely a demonstration of it pulling the data from the Ecoid using this piece of code:
var ecoidID:Number = 6;
var feedLoader:URLLoader = new URLLoader();
feedLoader.addEventListener(Event.COMPLETE, loadingComplete);
feedLoader.load(new URLRequest(“http://www.eco-os.org/xbeeGet/?records=1&source=“+ecoidID));
function loadingComplete(e:Event):void
{
var document:XML = new XML(e.target.data);
var light:Number = document.child(“item”).child(“light”).valueOf();
trace(“Light level is ” + light);
var stretch:Number = document.child(“item”).child(“stretch”).valueOf();
trace(“Stretch level is ” + stretch);
}
There was a lot more that I wished to do with this, but due to problems with the RSS, I just didn’t have time to implement. Which is a shame, as I had high hopes for this.





































