Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Dec 16, 2023
2 parents a9a5a49 + 357289e commit ff086fe
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 64 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Further information and artwork:
An Nvidia graphics card with compute capability 6.0 or higher is needed. Please check [https://en.wikipedia.org/wiki/CUDA#GPUs_supported](https://en.wikipedia.org/wiki/CUDA#GPUs_supported).

# 💽 Installer
Installer for Windows: [alien-installer.msi](https://alien-project.org/media/files/alien-installer.msi) (Updated: 2023-11-29)
Installer for Windows: [alien-installer.msi](https://alien-project.org/media/files/alien-installer.msi) (Updated: 2023-12-10)

In the case that the program crashes for an unknown reason, please refer to the troubleshooting section in [alien-project.org/downloads.html](https://alien-project.org/downloads.html).

Expand Down
22 changes: 17 additions & 5 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
# Release notes

## [4.5.1] - 2023-12-16
### Added
- new simulation parameters to reduce energy particle absorption for cells with fewer connections
- new simulation parameters to configure the decay probability of dying cells
- validation of normal and minimal cell energy parameters in the simulation parameter window

### Changed
- parameter 'Genome size bonus' only takes into account the non-separating parts of the genome

### Fixed
- layout problems with the display of color matrices fixed

## [4.5.0] - 2023-12-09
### Added
- engine, gui: entire statistics history are saved along with a simulation
- engine, gui: entire statistical history are saved along with a simulation
- gui/statistics: configurable plot heights
- gui/statistics: collapse specific plots
- gui/browser: statistics history are up/downloaded along with a simulation
- gui/browser: statistical history are up/downloaded along with a simulation
- gui/sim view: draw boundaries of the world
- Python script `FindFurtunateTimeline`: constantly monitors populations in a simulation and resort to savepoints in case of extinction

### Changed
- gui/statistics: widgets for real time and time horizon parameter are aligned with the other widgets

### Removed
- export statistics function

### Fixed
- in simulation runs via CLI, certain simulation parameters are adjusted as in the GUI (e.g. if the max age balancer is switched on, external energy consumption)
- wrong color conversion HSV -> RGB fixed (relevant for mutation and genome size coloring)

### Removed
- export statistics function

## [4.4.3] - 2023-11-29
### Added
- show text background when rendering is disabled
Expand Down
2 changes: 1 addition & 1 deletion resources/autosave.settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"general": {
"time step": "85540",
"time step": "0",
"zoom": "1.16543949",
"center": {
"x": "918.00494385",
Expand Down
2 changes: 2 additions & 0 deletions resources/autosave.statistics.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Time step, Cells (color 0), Cells (color 1), Cells (color 2), Cells (color 3), Cells (color 4), Cells (color 5), Cells (color 6), Cells (accumulated), Self-replicators (color 0), Self-replicators (color 1), Self-replicators (color 2), Self-replicators (color 3), Self-replicators (color 4), Self-replicators (color 5), Self-replicators (color 6), Self-replicators (accumulated), Viruses (color 0), Viruses (color 1), Viruses (color 2), Viruses (color 3), Viruses (color 4), Viruses (color 5), Viruses (color 6), Viruses (accumulated), Cell connections (color 0), Cell connections (color 1), Cell connections (color 2), Cell connections (color 3), Cell connections (color 4), Cell connections (color 5), Cell connections (color 6), Cell connections (accumulated), Energy particles (color 0), Energy particles (color 1), Energy particles (color 2), Energy particles (color 3), Energy particles (color 4), Energy particles (color 5), Energy particles (color 6), Energy particles (accumulated), Average genome cells (color 0), Average genome cells (color 1), Average genome cells (color 2), Average genome cells (color 3), Average genome cells (color 4), Average genome cells (color 5), Average genome cells (color 6), Average genome cells (accumulated), Total energy (color 0), Total energy (color 1), Total energy (color 2), Total energy (color 3), Total energy (color 4), Total energy (color 5), Total energy (color 6), Total energy (accumulated), Created cells (color 0), Created cells (color 1), Created cells (color 2), Created cells (color 3), Created cells (color 4), Created cells (color 5), Created cells (color 6), Created cells (accumulated), Attacks (color 0), Attacks (color 1), Attacks (color 2), Attacks (color 3), Attacks (color 4), Attacks (color 5), Attacks (color 6), Attacks (accumulated), Muscle activities (color 0), Muscle activities (color 1), Muscle activities (color 2), Muscle activities (color 3), Muscle activities (color 4), Muscle activities (color 5), Muscle activities (color 6), Muscle activities (accumulated), Transmitter activities (color 0), Transmitter activities (color 1), Transmitter activities (color 2), Transmitter activities (color 3), Transmitter activities (color 4), Transmitter activities (color 5), Transmitter activities (color 6), Transmitter activities (accumulated), Defender activities (color 0), Defender activities (color 1), Defender activities (color 2), Defender activities (color 3), Defender activities (color 4), Defender activities (color 5), Defender activities (color 6), Defender activities (accumulated), Injection activities (color 0), Injection activities (color 1), Injection activities (color 2), Injection activities (color 3), Injection activities (color 4), Injection activities (color 5), Injection activities (color 6), Injection activities (accumulated), Completed injections (color 0), Completed injections (color 1), Completed injections (color 2), Completed injections (color 3), Completed injections (color 4), Completed injections (color 5), Completed injections (color 6), Completed injections (accumulated), Nerve pulses (color 0), Nerve pulses (color 1), Nerve pulses (color 2), Nerve pulses (color 3), Nerve pulses (color 4), Nerve pulses (color 5), Nerve pulses (color 6), Nerve pulses (accumulated), Neuron activities (color 0), Neuron activities (color 1), Neuron activities (color 2), Neuron activities (color 3), Neuron activities (color 4), Neuron activities (color 5), Neuron activities (color 6), Neuron activities (accumulated), Sensor activities (color 0), Sensor activities (color 1), Sensor activities (color 2), Sensor activities (color 3), Sensor activities (color 4), Sensor activities (color 5), Sensor activities (color 6), Sensor activities (accumulated), Sensor matches (color 0), Sensor matches (color 1), Sensor matches (color 2), Sensor matches (color 3), Sensor matches (color 4), Sensor matches (color 5), Sensor matches (color 6), Sensor matches (accumulated), Reconnector creations (color 0), Reconnector creations (color 1), Reconnector creations (color 2), Reconnector creations (color 3), Reconnector creations (color 4), Reconnector creations (color 5), Reconnector creations (color 6), Reconnector creations (accumulated), Reconnector deletions (color 0), Reconnector deletions (color 1), Reconnector deletions (color 2), Reconnector deletions (color 3), Reconnector deletions (color 4), Reconnector deletions (color 5), Reconnector deletions (color 6), Reconnector deletions (accumulated), Detonations (color 0), Detonations (color 1), Detonations (color 2), Detonations (color 3), Detonations (color 4), Detonations (color 5), Detonations (color 6), Detonations (accumulated)
0.000000000,11655.000000000,20641.000000000,57811.000000000,7556.000000000,3508.000000000,0.000000000,0.000000000,101171.000000000,1467.000000000,1043.000000000,3606.000000000,0.000000000,0.000000000,0.000000000,0.000000000,6116.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,16917.000000000,38353.000000000,51978.000000000,8126.000000000,4775.000000000,0.000000000,0.000000000,120149.000000000,2939.000000000,8374.000000000,23402.000000000,2919.000000000,1425.000000000,0.000000000,0.000000000,39059.000000000,133.693933197,13.286673058,133.345535219,0.000000000,0.000000000,0.000000000,0.000000000,112.954708960,2048700.250000000,2464868.000000000,6648960.000000000,733101.937500000,430252.406250000,0.000000000,0.000000000,12325882.593750000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000,0.000000000
2 changes: 1 addition & 1 deletion source/Base/Resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Const
{
std::string const ProgramVersion = "4.5.0";
std::string const ProgramVersion = "4.5.1";
std::string const DiscordLink = "https://discord.gg/7bjyZdXXQ2";

std::string const BasePath = "resources/";
Expand Down
6 changes: 2 additions & 4 deletions source/EngineGpuKernels/CellProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -745,16 +745,14 @@ __inline__ __device__ void CellProcessor::decay(SimulationData& data)

auto cellMaxAge = cudaSimulationParameters.cellMaxAge[cell->color];
if (cellMaxAge > 0 && cell->age > cellMaxAge) {
if (data.timestep % 20 == index % 20) { //slow down destruction process to avoid too many deletion jobs
cellDestruction = true;
}
cellDestruction = true;
}

if (cellDestruction) {
if (cudaSimulationParameters.clusterDecay) {
cell->livingState = LivingState_Dying;
} else {
if (data.timestep % 20 == index % 20) { //slow down destruction process to avoid too many deletion jobs
if (data.numberGen1.random() < cudaSimulationParameters.clusterDecayProb[cell->color]) {
CellConnectionProcessor::scheduleDeleteCell(data, index);
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/EngineGpuKernels/ConstructorProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ __inline__ __device__ void ConstructorProcessor::completenessCheck(SimulationDat
{
auto& constructor = cell->cellFunctionData.constructor;
if (!GenomeDecoder::isFirstNode(constructor)) {
return;
return;
}
auto activity = CellFunctionProcessor::calcInputActivity(cell);
if (!isConstructionTriggered(data, cell, activity)) {
Expand Down Expand Up @@ -365,7 +365,7 @@ ConstructorProcessor::startNewConstruction(SimulationData& data, SimulationStati

if (GenomeDecoder::containsSelfReplication(constructor)) {
constructor.offspringCreatureId = 1 + data.numberGen1.random(65535);
hostCell->genomeNumNodes = GenomeDecoder::getNumNodesRecursively(constructor.genome, toInt(constructor.genomeSize), true);
hostCell->genomeNumNodes = GenomeDecoder::getNumNodesRecursively(constructor.genome, toInt(constructor.genomeSize), true, false);
} else {
constructor.offspringCreatureId = hostCell->creatureId;
}
Expand Down
39 changes: 23 additions & 16 deletions source/EngineGpuKernels/GenomeDecoder.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public:
template <typename Func>
__inline__ __device__ static void executeForEachNode(uint8_t* genome, int genomeSize, Func func);
template <typename Func>
__inline__ __device__ static void executeForEachNodeRecursively(uint8_t* genome, int genomeSize, Func func);
__inline__ __device__ static void executeForEachNodeRecursively(uint8_t* genome, int genomeSize, bool includedSeparatedParts, Func func);
__inline__ __device__ static GenomeHeader readGenomeHeader(ConstructorFunction const& constructor);
__inline__ __device__ static int getGenomeDepth(uint8_t* genome, int genomeSize);
__inline__ __device__ static int getNumNodesRecursively(uint8_t* genome, int genomeSize, bool includeRepetitions);
__inline__ __device__ static int getNumNodesRecursively(uint8_t* genome, int genomeSize, bool includeRepetitions, bool includedSeparatedParts);
__inline__ __device__ static int getRandomGenomeNodeAddress(
SimulationData& data,
uint8_t* genome,
Expand Down Expand Up @@ -106,7 +106,7 @@ __inline__ __device__ void GenomeDecoder::executeForEachNode(uint8_t* genome, in
}

template <typename Func>
__inline__ __device__ void GenomeDecoder::executeForEachNodeRecursively(uint8_t* genome, int genomeSize, Func func)
__inline__ __device__ void GenomeDecoder::executeForEachNodeRecursively(uint8_t* genome, int genomeSize, bool includedSeparatedParts, Func func)
{
CHECK(genomeSize >= Const::GenomeHeaderSize)

Expand All @@ -123,14 +123,19 @@ __inline__ __device__ void GenomeDecoder::executeForEachNodeRecursively(uint8_t*
auto cellFunctionFixedBytes = cellFunction == CellFunction_Constructor ? Const::ConstructorFixedBytes : Const::InjectorFixedBytes;
auto makeSelfCopy = GenomeDecoder::convertByteToBool(genome[nodeAddress + Const::CellBasicBytes + cellFunctionFixedBytes]);
if (!makeSelfCopy) {
auto subGenomeSize = GenomeDecoder::getNextSubGenomeSize(genome, genomeSize, nodeAddress);
nodeAddress += Const::CellBasicBytes + cellFunctionFixedBytes + 3;
subGenomeEndAddresses[depth++] = nodeAddress + subGenomeSize;

auto repetitions = getNumRepetitions(genome + nodeAddress, true);
subGenomeNumRepetitions[depth] = subGenomeNumRepetitions[depth - 1] * repetitions;
nodeAddress += Const::GenomeHeaderSize;
goToNextSibling = false;
auto deltaSubGenomeStartPos = Const::CellBasicBytes + cellFunctionFixedBytes + 3;
if (!includedSeparatedParts && GenomeDecoder::isSeparating(genome + nodeAddress + deltaSubGenomeStartPos)) {
//skip scanning sub-genome
} else {
auto subGenomeSize = GenomeDecoder::getNextSubGenomeSize(genome, genomeSize, nodeAddress);
nodeAddress += deltaSubGenomeStartPos;
subGenomeEndAddresses[depth++] = nodeAddress + subGenomeSize;

auto repetitions = GenomeDecoder::getNumRepetitions(genome + nodeAddress, true);
subGenomeNumRepetitions[depth] = subGenomeNumRepetitions[depth - 1] * repetitions;
nodeAddress += Const::GenomeHeaderSize;
goToNextSibling = false;
}
}
}
if (goToNextSibling) {
Expand All @@ -151,17 +156,19 @@ __inline__ __device__ void GenomeDecoder::executeForEachNodeRecursively(uint8_t*
__inline__ __device__ int GenomeDecoder::getGenomeDepth(uint8_t* genome, int genomeSize)
{
auto result = 0;
executeForEachNodeRecursively(genome, genomeSize, [&result](int depth, int nodeAddress, int repetition) { result = max(result, depth); });
executeForEachNodeRecursively(genome, genomeSize, true, [&result](int depth, int nodeAddress, int repetition) { result = max(result, depth); });
return result;
}

__inline__ __device__ int GenomeDecoder::getNumNodesRecursively(uint8_t* genome, int genomeSize, bool includeRepetitions)
__inline__ __device__ int GenomeDecoder::getNumNodesRecursively(uint8_t* genome, int genomeSize, bool includeRepetitions, bool includedSeparatedParts)
{
auto result = 0;
if (!includeRepetitions) {
executeForEachNodeRecursively(genome, genomeSize, [&result](int depth, int nodeAddress, int repetitions) { ++result; });
executeForEachNodeRecursively(
genome, genomeSize, includedSeparatedParts, [&result](int depth, int nodeAddress, int repetitions) { ++result; });
} else {
executeForEachNodeRecursively(genome, genomeSize, [&result](int depth, int nodeAddress, int repetitions) { result += repetitions; });
executeForEachNodeRecursively(
genome, genomeSize, includedSeparatedParts, [&result](int depth, int nodeAddress, int repetitions) { result += repetitions; });
}
return result;
}
Expand Down Expand Up @@ -614,7 +621,7 @@ __inline__ __device__ void GenomeDecoder::setNextConstructionAngle2(uint8_t* gen

__inline__ __device__ void GenomeDecoder::setNextConstructorSeparation(uint8_t* genome, int nodeAddress, bool separation)
{
genome[nodeAddress + Const::CellBasicBytes + Const::ConstructorFixedBytes + 3 + Const::ConstructorSeparation] = convertBoolToByte(separation);
genome[nodeAddress + Const::CellBasicBytes + Const::ConstructorFixedBytes + 3 + Const::GenomeHeaderSeparationPos] = convertBoolToByte(separation);
}

__inline__ __device__ int GenomeDecoder::getNextSubGenomeSize(uint8_t* genome, int genomeSize, int nodeAddress)
Expand Down
Loading

0 comments on commit ff086fe

Please sign in to comment.