Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Mar 17, 2024
2 parents 5d8430c + 1e72f49 commit 511ca68
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libgl1-mesa-dev libglu-dev
- uses: Jimver/[email protected].10
- uses: Jimver/[email protected].14
id: cuda-toolkit
with:
cuda: '11.7.1'
Expand Down
8 changes: 8 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release notes

## [4.8.1] - 2024-03-16
### Changed
- engine: the dying state of cells can spread to cells under construction even if they belong to other an other creature

### Fixed
- engine: construction with infinite repetitions fixed
- gui: selection of large sections in edit mode fixed

## [4.8.0] - 2024-02-25
### Added
- gui/simulation view: borderless rendering (world is rendered periodically) + parameter to (de)activate
Expand Down
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.8.0";
std::string const ProgramVersion = "4.8.1";
std::string const DiscordLink = "https://discord.gg/7bjyZdXXQ2";

std::string const BasePath = "resources/";
Expand Down
2 changes: 2 additions & 0 deletions source/EngineGpuKernels/CellProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ __inline__ __device__ void CellProcessor::livingStateTransition(SimulationData&
auto const& connectedCell = cell->connections[i].cell;
if (connectedCell->creatureId == cell->creatureId) {
atomicExch(&connectedCell->livingState, LivingState_Dying);
} else {
atomicCAS(&connectedCell->livingState, LivingState_UnderConstruction, LivingState_Dying);
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions source/EngineGpuKernels/ConstructorProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,14 @@ __inline__ __device__ ConstructorProcessor::ConstructionData ConstructorProcesso

ConstructionData result;
result.genomeHeader = GenomeDecoder::readGenomeHeader(constructor);
result.lastConstructionCell = getLastConstructedCell(cell);
if (!result.lastConstructionCell) {
result.hasInfiniteRepetitions = GenomeDecoder::hasInfiniteRepetitions(constructor);
if (!GenomeDecoder::hasInfiniteRepetitions(constructor) && constructor.genomeCurrentNodeIndex == 0 && constructor.genomeCurrentRepetition == 0) {
result.lastConstructionCell = nullptr;
} else {
result.lastConstructionCell = getLastConstructedCell(cell);
}

if (!result.lastConstructionCell) {
//finished => reset indices
constructor.genomeCurrentNodeIndex = 0;
constructor.genomeCurrentRepetition = 0;
Expand All @@ -209,7 +214,6 @@ __inline__ __device__ ConstructorProcessor::ConstructionData ConstructorProcesso
result.genomeCurrentBytePosition = GenomeDecoder::getNodeAddress(constructor.genome, constructor.genomeSize, constructor.genomeCurrentNodeIndex);
result.isLastNode = GenomeDecoder::isLastNode(constructor);
result.isLastNodeOfLastRepetition = result.isLastNode && GenomeDecoder::isLastRepetition(constructor);
result.hasInfiniteRepetitions = GenomeDecoder::hasInfiniteRepetitions(constructor);

CudaShapeGenerator shapeGenerator;
auto shape = result.genomeHeader.shape % ConstructionShape_Count;
Expand Down Expand Up @@ -300,9 +304,6 @@ ConstructorProcessor::tryConstructCell(SimulationData& data, SimulationStatistic
__inline__ __device__ Cell* ConstructorProcessor::getLastConstructedCell(Cell* hostCell)
{
auto const& constructor = hostCell->cellFunctionData.constructor;
if (constructor.genomeCurrentNodeIndex == 0) {
return nullptr;
}
if (constructor.lastConstructedCellId != 0) {
for (int i = 0; i < hostCell->numConnections; ++i) {
auto const& connectedCell = hostCell->connections[i].cell;
Expand Down
3 changes: 3 additions & 0 deletions source/EngineGpuKernels/Math.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ __inline__ __device__ void Math::angleCorrection(int &angle)

__inline__ __device__ bool Math::isInBetweenModulo(float value1, float value2, float candidate, float size)
{
if (value2 - value1 >= size) {
return true;
}
auto valueMod1 = modulo(value1, size);
auto valueMod2 = modulo(value2, size);
auto candidateMod = modulo(candidate, size);
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/TemporalControlWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void _TemporalControlWindow::processStepForwardButton()
void _TemporalControlWindow::processCreateFlashbackButton()
{
auto result = AlienImGui::ToolbarButton(ICON_FA_CAMERA);
AlienImGui::Tooltip("Create flashback");
AlienImGui::Tooltip("Create flashback: It saves the content of the current world to the memory.");
if (result) {
delayedExecution([this] { onSnapshot(); });

Expand All @@ -181,7 +181,7 @@ void _TemporalControlWindow::processLoadFlashbackButton()
{
ImGui::BeginDisabled(!_snapshot);
auto result = AlienImGui::ToolbarButton(ICON_FA_UNDO);
AlienImGui::Tooltip("Load flashback");
AlienImGui::Tooltip("Load flashback: It loads the saved world from the memory.");
if (result) {
delayedExecution([this] { applySnapshot(*_snapshot); });
_simController->removeSelection();
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alien",
"version": "4.8.0",
"version": "4.8.1",
"dependencies": [
{
"name": "glew",
Expand Down

0 comments on commit 511ca68

Please sign in to comment.