Sunday, January 26, 2014

Finally, a Creatures 2 Norn autopsy tool


So, we've just learnt how to extract various information from C2 History files, among which a list of concentrations for a Norn's bloodstream chemicals at time of death.

We've also learnt how to map a chemical's number to a readable chemical name.

We can finally get to perform autopsies of dead C2 Norns!

 

C1 autopsies

As you already might now, the ability to perform autopsies on dead creatures exists for C1, if you use cred32's autopsy feature.
Unfortunately, this not only requires that the Norn is still present in the world, but also it's chemicals level keep changing from natural decay, which can give us false results.

As far as I know, there's no tool allowing us to do the same thing for C2.
We're about to fix that! Moreover our tool won't suffer the same limitations, as in C2 the chemical concentrations at death are available for ever in the creature's history file.

Putting together a C2 autopsy tool

We will be simply building that on top of our previous work.
Let's pack the 2 required functionalities in two dedicated files: Historyfileparser.py and Chemicalsparser.py.

We can now reuse their data thanks to a single line statement.
From there, building a quick autopsy tool is as simple as :

import Historyfileparser
import Chemicalsparser

Norns=Historyfileparser.Norns
Chemicals=Chemicalsparser.Chemicals

print "Dead norns:"

for Norn in  Norns:
    if Norns[Norn]["State"]=="dead":
        print Norn +"("+Norns[Norn]["Genus"]+" "+Norns[Norn]["Lifestage"]+")",
       

who = raw_input("\nEnter a moniker: ").upper()
NornChems=Norns[who]["ChemicalsAtDeath"]

print "Diagnosing death of "+Norns[who]["Name"] + "("+Norns[who]["Moniker"]+"):" # He's not a moniker! In death, members of project CAOS do have a name.
print "Subject data: " + Norns[who]["Gender"] +" " + Norns[who]["Genus"] + "\t Dead as:" + Norns[who]["Lifestage"]
print "-"*50

if Norns[who]["Lifestage"]=="Kaputt":
    print "Creature most likely died of old age"

for num, chem in enumerate(NornChems):
    if Chemicals[num] !="" and Chemicals[num] !=" ":
        print (Chemicals[num] +":"+str(ord(chem))+"\t").expandtabs(20),
        if num % 5 ==0: # "if current chemical is a multiple of 5"
            print "" # then add newline
 


Not that hard was it ?

Testing it

Runnig the script produces following output :

Dead norns:
2TAV(Ettin Adolescent) 8CWN(Ettin Kaputt) 7TML(Ettin Kaputt) 8CIH(Grendel Child) 1JWF(Grendel Child) 5CHG(Grendel Baby) 0BLT(Grendel Old) 


Enter a moniker: 8cih

 
Diagnosing death of <No name>(8CIH):
Subject data: male Grendel     Dead as:Child
--------------------------------------------------
Pain:0               Need for Pleasure:241                    Hunger:255           Coldness:0           Hotness:40          
Tiredness:0          Sleepiness:255       Loneliness:7         Crowded:93           Fear:0              
Boredom:0            Anger:76             Sex Drive:0          Injury:0             Suffocation:0       
Thirst:0             Stress:0             Pain Increase:0      Need for Pleasure Increase:0             Hunger Increase:0   
Coldness Increase:0  Hotness Increase:0   Tiredness Increase:0                     Sleepiness Increase:0                    Loneliness Increase:0                   
Crowded Increase:0   Fear Increase:0      Boredom Increase:0   Anger Increase:0     Sex Drive Increase:0                    
Injury Increase:230  Suffocation Increase:0                   Thirst Increase:0    Stress Increase:0    Pain Decrease (Endorphin):0             
Need for Pleasure Decrease:0             Hunger Decrease (Saccharin):0            Coldness Decrease:0  Hotness Decrease:0   Tiredness Decrease:0                    
Sleepiness Decrease:0                    Loneliness Decrease:0                    Crowded Decrease:0   Fear Decrease:0      Boredom Decrease:0  
Anger Decrease:0     Sex Drive Decrease:0                     Injury Decrease:0    Suffocation Decrease:0                   Thirst Decrease:0   
Stress Decrease:0    Reward:18            Punishment:0         Reinforcement:0      ConASH:0            
DecASH1:0            Reward Echo:0        Punish Echo:0        DecASH2:0            Lactate:3            Pyruvate:3           Glucose:74          
Fatty Acid:1         Glycogen:194         Starch:0             Fat:0                Adipose Tissue:210  
Life:193             Muscle Tissue:142    Triglyceride:46      Protein:0            Amino Acid:8        
Dissolved carbon dioxide:6              
91:0                 Urea:0               Ammonia:0            Oxygen:244          
Air:9                Water:29             Energy:14            ATP:0                ADP:255             
myoglobin:0          oxymyoglobin:0       Bilin:0              Oestrogen:0         
Testosterone:0       Gonadotrophin:0      Progesterone:0       Inhibin:0            LH:0                
FSH:0                Steroidone:0         Cholesterol:149      Arousal Potential:0  Mating Pheramone:0  
Species Pheramone:0  Parent Pheramone:0   Child Pheramone:0    Sibling Pheramone:0  Opposite Sex Pheramone:0                
Norn Smell:0         grendel smell:0      ettin smell:0        Heavy Metals:5      
Cyanide:9            Belladonna:0         Geddonase:0          Glycotoxin:0        
Fullness:0           Vitamin E:0         
Vitamin C:0          Bile Acid:11         Insulin:0            Glycogen Synthetase:0                    Dehydrogenase:0     
Prostaglandin:0      EDTA:0               sodium thiosulphite:0                    Arnica:0             tyrosine:0           triptophan:0         Alcohol:0           
Dancing:0            Adrenaline:0         Hexokinase:0         Activase:0           Turnase:0           
Collapsase:0         downatrophin:0       upatrophin:0         Phosphoglycerokinase:0                   Protease:0          
Histamine A:0        Histamine B:0        Sleep toxin:0        Fever toxin:0       
unknown toxin:0      unknown toxin:0      unknown toxin:0      unknown toxin:0      Antibody 0:97       
Antibody 1:104       Antibody 2:0         Antibody 3:110       Antibody 4:97        Antibody 5:0        
Antibody 6:0         Antibody 7:0         Antigen 0:0          Antigen 1:0          Antigen 2:0         
Antigen 3:0          Antigen 4:0          Antigen 5:0          Antigen 6:0          Antigen 7:0 


Output is a bit messy as the chemicals names length varies wildly, but all required information is now there :).

Cause of death

I'd say the poor Grendel died of cyanide poisoning,inside the volcano where most of the Grendels end up and deathcap mushrooms grow abundantly.
Despite his very high hunger, he still had good glycogen reserves, but no way to use them (no glycogen synthetase) which seems to indicate brutally stopped organs and digestive process (coma).
Despite having contracted multiple illnesses, only residual antibodies and no antigens were present at death time (antigens have relatively slow decay rates, so if the Grendel was still ill at the time of death we would most likely have found at least some residual antigens.)
Energy is very low, and ATP is 0 which is a characteristic effect of cyanide poisoning.
We now that the slightest amount of it can be fatal especially on Grendels and Ettins that lack the ability to decay or eliminate it even given the right antidote.
Most likely, the cyanide intake ate away the Grendel's energy, putting it in the coma, stopping it's organs, which would explain why some of the digestive processes were stopped due to lack of appropriate chemicals while some nutrients were still available.Brain being critically sensitive to low energy levels probably shut off soon after, leading to the Grendel's demise.A sad yet pretty common case of Grendel death.

  • Hunger:255
  • Fullness:0
  • Starch:0 
  • Hotness:40
  • Cyanide:9
  • Energy:14   
  • Glycogen:194 
  • Glycogen Synthetase:0 
  • ATP:0,ADP:255   
  • Antibody 0:97 
  • Antibody 1:104 
  • Antibody 3:110 
  • Antibody 4:97  
 

Closing words


Once again, this was just a quickie to show you how easy it can be to write your own tools for when none are available or if you have special needs, this obvously isn't consumer grade code but merely a proof of concept.

If you really need such a tool for everyday use though, don't worry, as one should come out soon as a part of my Creatures Kontrol Center :).

Meanwhile, keep in mind that the data we're extracting are the chemicals right at time of death.
If the creature died of some kind of poisoning, there's a chance that by the time the Norn actually dies, the culprit chemical might be gone, and the creature dead from side effects of prolonged coma.You might have to correlate other factors to understand what actually happened (low glycogen levels but no hunger ? this might be a glytoxin poisoning case even if no more glytoxin remains in the Norns body)
But these are the quirks of the Norn autopsy art which is yours to hone from on now.

As some of you might get bored of all this strictly techie stuff, I'll try to take a small break from those gory implementation details for a few posts and show you some more Albian exploration in the upcoming ones :) .

Meanwhile (don't actually) enjoy messing around with dead pets !

No comments:

Post a Comment