Skip to content

Commit

Permalink
Starting cell configurations are now even more viable and more variab…
Browse files Browse the repository at this point in the history
…le, cells with chemosythesziing organelles now start with some sulfide, luckily we will be able to get rid of this once all cells haveanm actual common ancestor so i dont think its that big of a deal but starting cells need to be able to survive at least a bit with the new balance changes.
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Mar 15, 2019
1 parent 04e1d68 commit 512cbfa
Showing 1 changed file with 77 additions and 4 deletions.
81 changes: 77 additions & 4 deletions scripts/microbe_stage/species_system.as
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const dictionary DEFAULT_INITIAL_COMPOUNDS =
{"iron", InitialCompound(0)}
};

// For iron phillic microbes
// For ferrophillic microbes
const dictionary DEFAULT_INITIAL_COMPOUNDS_IRON =
{
{"atp", InitialCompound(30,300)},
Expand All @@ -280,6 +280,18 @@ const dictionary DEFAULT_INITIAL_COMPOUNDS_IRON =
{"iron", InitialCompound(30,300)}
};

// For chemophillic microbes
const dictionary DEFAULT_INITIAL_COMPOUNDS_CHEMO =
{
{"atp", InitialCompound(30,300)},
{"glucose", InitialCompound(10,30)},
{"ammonia", InitialCompound(30,100)},
{"phosphates", InitialCompound(0)},
{"hydrogensulfide", InitialCompound(30,300)},
{"oxytoxy", InitialCompound(0)},
{"iron", InitialCompound(0)}
};

string randomSpeciesName()
{
return "Species_" + formatInt(GetEngine().GetRandom().GetNumber(0, 10000));
Expand Down Expand Up @@ -325,14 +337,14 @@ class Species{

const auto cytoplasmGene = getOrganelleDefinition("cytoplasm").gene;
string energyGene = cytoplasmGene;
const auto bonusPadding = GetEngine().GetRandom().GetNumber(1, 5);
const auto bonusPadding = GetEngine().GetRandom().GetNumber(1, 10);

// it should always have a nucleus and a cytoplasm.
stringCode = getOrganelleDefinition("nucleus").gene +
cytoplasmGene;

// generated cells need to be viable for now
switch (GetEngine().GetRandom().GetNumber(0, 3))
// generated cells need to be viable for now. so heres all possible survival strategies i can think of
switch (GetEngine().GetRandom().GetNumber(0, 15))
{
case 0:
energyGene = getOrganelleDefinition("cytoplasm").gene;
Expand All @@ -350,7 +362,62 @@ class Species{
energyGene += getOrganelleDefinition("cytoplasm").gene;
break;
case 3:
energyGene = getOrganelleDefinition("cytoplasm").gene;
//if cytoplasm you need a few more of them
for(int i = 0; i < bonusPadding; i++){
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
stringCode.length()), energyGene);
}
energyGene += getOrganelleDefinition("chemoSynthisizingProteins").gene;
break;
case 4:
energyGene = getOrganelleDefinition("mitochondrion").gene;
case 5:
energyGene = getOrganelleDefinition("chemoSynthisizingProteins").gene;
energyGene += getOrganelleDefinition("mitochondrion").gene;
case 6:
energyGene = getOrganelleDefinition("chloroplast").gene;
energyGene += getOrganelleDefinition("mitochondrion").gene;
case 7:
energyGene = getOrganelleDefinition("metabolosome").gene;
energyGene += getOrganelleDefinition("chemoSynthisizingProteins").gene;
break;
case 8:
energyGene = getOrganelleDefinition("metabolosome").gene;
energyGene += getOrganelleDefinition("chromatophors").gene;
case 9:
energyGene = getOrganelleDefinition("chromatophors").gene;
energyGene += getOrganelleDefinition("mitochondrion").gene;
break;
case 10:
energyGene = getOrganelleDefinition("chemoplast").gene;
energyGene += getOrganelleDefinition("mitochondrion").gene;
break;
case 11:
energyGene = getOrganelleDefinition("chemoplast").gene;
energyGene += getOrganelleDefinition("metabolosome").gene;
break;
case 12:
energyGene = getOrganelleDefinition("chromatophors").gene;
energyGene += getOrganelleDefinition("cytoplasm").gene;
break;
case 13:
energyGene = getOrganelleDefinition("chloroplast").gene;
energyGene += getOrganelleDefinition("cytoplasm").gene;
break;
case 14:

energyGene = getOrganelleDefinition("cytoplasm").gene;
//if cytoplasm you need a few more of them
for(int i = 0; i < bonusPadding; i++){
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
stringCode.length()), energyGene);
}
energyGene += getOrganelleDefinition("chemoplast").gene;
break;
case 15:
energyGene = getOrganelleDefinition("chloroplast").gene;
energyGene += getOrganelleDefinition("metabolosome").gene;
break;
}

Expand Down Expand Up @@ -566,6 +633,12 @@ class Species{
organelles, this.colour, this.isBacteria, this.speciesMembraneType,
DEFAULT_INITIAL_COMPOUNDS_IRON, this.aggression, this.fear, this.activity, this.focus, this.opportunism);
}
else if (stringCode.findFirst('C') >= 0 || stringCode.findFirst('c') >= 0)
{
templateEntity = Species::createSpecies(forWorld, this.name, this.genus, this.epithet,
organelles, this.colour, this.isBacteria, this.speciesMembraneType,
DEFAULT_INITIAL_COMPOUNDS_CHEMO, this.aggression, this.fear, this.activity, this.focus, this.opportunism);
}
else {
templateEntity = Species::createSpecies(forWorld, this.name, this.genus, this.epithet,
organelles, this.colour, this.isBacteria, this.speciesMembraneType,
Expand Down

0 comments on commit 512cbfa

Please sign in to comment.