Skip to content

Commit

Permalink
EngulfMode is disabled when a cell dies to stop cells from engulfing …
Browse files Browse the repository at this point in the history
…their own chunks.

All fully generated cells now start at least somewhat viable to stop immediate mass death
Chunk size and cunk amount has been lowered when cells die to prevent some silliness
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Mar 15, 2019
1 parent d6f9c16 commit 04e1d68
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/microbe_stage/configs.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const auto STARTING_SPAWN_DENSITY = 45000.0f;
const auto MAX_SPAWN_DENSITY = 20000.0f;
//Corpse info
const auto CORPSE_COMPOUND_COMPENSATION = 2.0f;
const auto CORPSE_CHUNK_DIVISER = 5.0f;
const auto CORPSE_CHUNK_DIVISER = 8.0f;
const auto CHUNK_ENGULF_COMPOUND_DIVISOR = 6.0f;

// Cell Spawn Variation
Expand Down
3 changes: 2 additions & 1 deletion scripts/microbe_stage/microbe_operations.as
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,8 @@ void kill(CellStageWorld@ world, ObjectID microbeEntity)
LOG_ERROR("Trying to kill a dead microbe");
return;
}

//diable engulf mode when a cell dies
microbeComponent.engulfMode = false;
// Releasing all the agents.
// To not completely deadlock in this there is a maximum of 5 of these created
const int maxAgentsToShoot = 5;
Expand Down
40 changes: 39 additions & 1 deletion scripts/microbe_stage/species_system.as
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,42 @@ class Species{
}

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

// 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))
{
case 0:
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);
}
break;
case 1:
energyGene = getOrganelleDefinition("metabolosome").gene;
break;
case 2:
energyGene = getOrganelleDefinition("rusticyanin").gene;
energyGene += getOrganelleDefinition("cytoplasm").gene;
break;
case 3:
energyGene = getOrganelleDefinition("mitochondrion").gene;
break;
}

const auto energyPadding = GetEngine().GetRandom().GetNumber(1, 5);
for(int i = 0; i < energyPadding; i++){
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
stringCode.length()), energyGene);
}

for(int i = 0; i < stringSize; i++){
this.stringCode += getRandomLetter(false);
}
Expand All @@ -338,8 +369,15 @@ class Species{
if (GetEngine().GetRandom().GetNumber(0, 100) <= 25)
{
for(int i = 0; i < cytoplasmPadding; i++){
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
if (GetEngine().GetRandom().GetNumber(0, 20)<= 10)
{
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
stringCode.length()), energyGene);
}
else {
this.stringCode.insert(GetEngine().GetRandom().GetNumber(2,
stringCode.length()), cytoplasmGene);
}
}
}

Expand Down

0 comments on commit 04e1d68

Please sign in to comment.