creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Why do critters die first?   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  1/19/2013

I've noticed in several critter/bug etc. timer scripts, dying is often the first thing that appears. At first glance, this seems a little confusing. [nquestion]

Could someone please explain to me why this is so?


My TCR Norns
 
Amaikokonut

Amaikokonut


 visit Amaikokonut's website: Naturing :: Nurturing
  1/19/2013  1

In most scripts it doesn't matter what order it's in, because it's all some structure of if-else statements. I guess death was just the first thing that came to mind when writing the code. If it checks and finds that the critter is flagged to die (due to low life force or other reasons), no point in running through the rest of the timer code, no reason to bother with the rest of the script like calculating where to move it to and animating and decreasing it's energy and so on, because hey, it's dead. But if it's not dead, it'll carry on as usual.

C3 critter scripts as a whole are mind-bogglingly confusing in just about every aspect anyway, if it makes you feel any better (sorry, it probably does not, at all). When doing GB conversions I had to spend hours thoroughly annotating critter code before making any edits, just to get an understanding of what was going on. If you need any more help with them feel free to bug me about it.


[Naturing :: Nurturing]
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  1/19/2013  1

Just trying to get myself to 'think like the code, be the code'. [ntongue] I'm sure you know how that goes. [nwink]

My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  1/21/2013

I agree with Amai... I've always done it for those reasons. Heaven forbid a starved-to-death critter takes another two steps and eats something when it's supposed to die already. :P


 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/3/2013

Just as a thought - it could also be a resource-saving best practice - if the thing should die, then there's no point wasting resources running the rest of the script.

My TCR Norns
 
Spykkie

Spykkie



  12/3/2013

It makes sense to me, 'living' things can be very complex to program. The first thing you want to check is to see if they are dead, because it's the only alternative to being alive, and it's the only thing that negates all of the "alive" codes.

dead check:
if dead( do nothing)
else (do all of the living things)
Loop

ah, the most basic artificial life. ;P


Twitt Stuff
Insta Arts

 


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
1 online
DaedalusR
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