Skip to content

Commit

Permalink
math now makes more sense (eg if a process needs more c02, it shoud o…
Browse files Browse the repository at this point in the history
…bviously be less productive when there is less c02)

fixed bug with environmental compounds

respiration now has more realistic process numbers, but also is balanced (and weaker then it used to be)

ran clang

exposed getDissolved to the scripts for UI.
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Jan 12, 2019
1 parent fefc0c6 commit f8e4013
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/SimulationParameters/MicrobeStage/BioProcesses.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},

"outputs": {
"atp": 14.0
"atp": 38.0
}
},

Expand Down Expand Up @@ -95,7 +95,7 @@
},

"outputs": {
"atp": 14.0
"atp": 38.0
}
},

Expand Down
13 changes: 8 additions & 5 deletions src/microbe_stage/process_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,20 @@ void

// do environmental modifier here, and save it for later
if(compoundData.isEnvironmental) {
environmentModifier = environmentModifier *
getDissolved(inputId) * input.second;
environmentModifier =
environmentModifier *
(getDissolved(inputId) / input.second);
inputRemoved = inputRemoved * environmentModifier;
}

// If not enough compound we can't do the process
// If the compound is environmental the cell doesnt actually
// contain it right now and theres no where to take it from
if(bag.compounds[inputId].amount < inputRemoved ||
environmentModifier == 0.0f) {
canDoProcess = false;
if(!compoundData.isEnvironmental) {
if(bag.compounds[inputId].amount < inputRemoved ||
environmentModifier == 0.0f) {
canDoProcess = false;
}
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/microbe_stage/process_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ class ProcessSystem
void
setProcessBiome(int biomeId);


protected:
double
getDissolved(CompoundId compoundData);


protected:
private:
int curBiomeId = 0;
static constexpr double TIME_SCALING_FACTOR = 1000;
Expand Down
6 changes: 6 additions & 0 deletions src/scripting/script_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,12 @@ bool
asMETHOD(ProcessSystem, setProcessBiome), asCALL_THISCALL) < 0) {
ANGELSCRIPT_REGISTERFAIL;
}

if(engine->RegisterObjectMethod("ProcessSystem",
"void getDissolved(CompoundId compoundData)",
asMETHOD(ProcessSystem, getDissolved), asCALL_THISCALL) < 0) {
ANGELSCRIPT_REGISTERFAIL;
}
// ------------------------------------ //
// CompoundCloudSystem
if(engine->RegisterObjectType(
Expand Down

0 comments on commit f8e4013

Please sign in to comment.