Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Sep 19, 2023
2 parents 318ffc0 + ae5dc1b commit 58fe14c
Show file tree
Hide file tree
Showing 24 changed files with 199 additions and 766 deletions.
702 changes: 28 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

74 changes: 42 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ An important goal is to make the simulator user-friendly through a modern user i
Please join our <a href="https://discord.gg/7bjyZdXXQ2" target="_blank">Discord server</a> as a place for discussions, new developments and feedback around ALIEN and artificial life in general.
</p>

# Main features
# Main features
### Physics and graphics engine
- Particles for simulating soft and rigid body mechanics, fluids, heat dissipation, damage, adhesion etc.
- Real-time user interactions with running simulations
Expand Down Expand Up @@ -47,16 +47,15 @@ https://user-images.githubusercontent.com/73127001/229569056-0db6562b-0147-43c8-
- Download and upload simulation files
- Upvote simulations by giving stars

# But for what is this useful?
# But for what is this useful
- A first attempt to answer: Feed your curiosity by watching evolution at work! As soon as self-replicating machines come into play and mutations are turned on, the simulation itself does everything.
- Perhaps the most honest answer: Fun! It is almost like a game with a pretty fast and realistic physics engine. You can make hundreds of thousands of machines accelerate and destroy with the mouse cursor. It feels like playing god in your own universe with your own rules. Different render styles and a visual editor offer fascinating insights into the events. There are a lot of videos on the [YouTube channel](https://youtube.com/channel/UCtotfE3yvG0wwAZ4bDfPGYw) for illustration.
- A more academic answer: A tool to tackle fundamental questions of how complexity or life-like structure may arise from simple components. How do entire ecosystems adapt to environmental changes and find a new equilibrium? How to find conditions that allow open-ended evolution?
- A tool for generative art: Evolution is a creative force that leads to ever new forms and behaviors.

# Documentation
# 📘 Documentation
A documentation for the previous major version, which introduces the reader to the simulator with tutorial-like articles, can be found at [alien-project.gitbook.io/docs](https://alien-project.gitbook.io/docs). Please notice that many of the information therein are no longer up to date.

A new documentation is currently under construction. However a lot of useful information is provided in the program itself via help windows and tooltips.
The latest version includes a brief documentation and user guidance in the program itself via help windows and tooltips.

Further information and artwork:
* [Website](https://alien-project.org)
Expand All @@ -65,15 +64,15 @@ Further information and artwork:
* [Reddit](https://www.reddit.com/r/AlienProject)
* [Discord](https://discord.gg/7bjyZdXXQ2)

# Minimal system requirements
# 🖥️ Minimal system requirements
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
An installer for Windows: [download link](https://alien-project.org/media/files/alien-installer.zip) (Updated: 2023-09-07)
# 💽 Installer
Installer for Windows: [alien-installer.msi](https://alien-project.org/media/files/alien-installer.msi) (Updated: 2023-09-14)

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).

# How to build the sources
# 🔨 How to build the sources
The build process is mostly automated using the cross-platform CMake build system and the vcpkg package manager, which is included as a Git submodule.

### Getting the sources
Expand All @@ -95,7 +94,26 @@ cmake --build . --config Release -j8
```
If everything goes well, the ALIEN executable can be found under the build directory in `./alien` or `.\Release\alien.exe` depending on the used toolchain and platform.

# Contributing to the project
# 🌌 Screenshots
#### Different plant-like populations around a radiation source
![Screenshot1](https://user-images.githubusercontent.com/73127001/229311601-839649a6-c60c-4723-99b3-26086e3e4340.jpg)

<h1 align="center"></h1>

#### Close-up of different types of organisms so that their cell networks can be seen
![Screenshot2](https://user-images.githubusercontent.com/73127001/229311604-3ee433d4-7dd8-46e2-b3e6-489eaffbda7b.jpg)

<h1 align="center"></h1>

#### Different swarms attacking an ecosystem
![Screenshot3](https://user-images.githubusercontent.com/73127001/229311606-2f590bfb-71a8-4f71-8ff7-7013de9d7496.jpg)

<h1 align="center"></h1>

#### Genome editor
![Screenshot3b](https://user-images.githubusercontent.com/73127001/229313813-c9ce70e2-d61f-4745-b64f-ada0b6758901.jpg)

# 🧩 Contributing to the project
Contributions to the project are very welcome. The most convenient way is to communicate via [GitHub Issues](https://github.com/chrxh/alien/issues), [Pull requests](https://github.com/chrxh/alien/pulls) or the [Discussion forum](https://github.com/chrxh/alien/discussions) depending on the subject. For example, it could be
- Providing new content (simulation or genome files)
- Producing or sharing media files
Expand All @@ -105,7 +123,14 @@ Contributions to the project are very welcome. The most convenient way is to com

A short architectural overview of the source code can be found in the [documentation](https://alien-project.gitbook.io/docs/under-the-hood).

# Dependency list
# 💎 Credits and dependencies

ALIEN has been initiated, mainly developed and maintained by [Christian Heinemann](mailto:[email protected]). Thanks to all the others who contributed to this repository:
- [tlemo](https://github.com/tlemo)
- [mpersano](https://github.com/mpersano)
- [dguerizec](https://github.com/dguerizec)

The following external libraries are used:
- [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit)
- [Dear ImGui](https://github.com/ocornut/imgui)
- [ImPlot](https://github.com/epezent/implot)
Expand All @@ -120,29 +145,14 @@ A short architectural overview of the source code can be found in the [documenta
- [zstr](https://github.com/mateidavid/zstr)
- [OpenSSL](https://github.com/openssl/openssl)
- [cpp-httplib](https://github.com/yhirose/cpp-httplib)
- [IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders)
- [googletest](https://github.com/google/googletest)
- [vcpkg](https://vcpkg.io/en/index.html)
- [WinReg](https://github.com/GiovanniDicanio/WinReg)

# Screenshots
#### Different plant-like populations around a radiation source
![Screenshot1](https://user-images.githubusercontent.com/73127001/229311601-839649a6-c60c-4723-99b3-26086e3e4340.jpg)

<h1 align="center"></h1>

#### Close-up of different types of organisms so that their cell networks can be seen
![Screenshot2](https://user-images.githubusercontent.com/73127001/229311604-3ee433d4-7dd8-46e2-b3e6-489eaffbda7b.jpg)

<h1 align="center"></h1>

#### Different swarms attacking an ecosystem
![Screenshot3](https://user-images.githubusercontent.com/73127001/229311606-2f590bfb-71a8-4f71-8ff7-7013de9d7496.jpg)

<h1 align="center"></h1>

#### Genome editor
![Screenshot3b](https://user-images.githubusercontent.com/73127001/229313813-c9ce70e2-d61f-4745-b64f-ada0b6758901.jpg)
Free icons and icon font:
- [IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders)
- [Iconduck](https://iconduck.com) (Noto Emoji by Google, [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt))
- [Iconfinder](https://www.iconfinder.com) (Bogdan Rosu Creative, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0))

# License
ALIEN is licensed under the [GPLv3](LICENSE).
# 🧾 License
ALIEN is licensed under the [BSD 3-Clause](LICENSE) license.
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release notes

## [4.1.1] - 2023-09-16
### Added
- show confirmation dialog for deleting a simulation

### Changed
- hide trash icon for simulations from other users

## [4.1.0] - 2023-09-07
### Added
- gui/browser: user can open an emoji window in order to react with various emoji types
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.1.0";
std::string const ProgramVersion = "4.1.1";

std::string const BasePath = "resources/";

Expand Down
4 changes: 2 additions & 2 deletions source/EngineInterface/SimulationController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class _SimulationController
virtual std::string getGpuName() const = 0;

/**
* Draws section of simulation to registered texture.
* If the GPU is busy for specific time, the texture will not be updated.
* Draws a section of simulation to a registered texture.
* If the GPU is busy for a specified duration, the texture will not be updated.
*/
virtual void tryDrawVectorGraphics(RealVector2D const& rectUpperLeft, RealVector2D const& rectLowerRight, IntVector2D const& imageSize, double zoom) = 0;
virtual std::optional<OverlayDescription>
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/ActivateUserDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ void _ActivateUserDialog::onActivateUser()
result |= _networkController->login(errorCode, _userName, _password, _userInfo);
}
if (!result) {
MessageDialog::getInstance().show("Error", "An error occurred on the server. Your entered code may be incorrect.\nPlease try to register again.");
MessageDialog::getInstance().information("Error", "An error occurred on the server. Your entered code may be incorrect.\nPlease try to register again.");
} else {
MessageDialog::getInstance().show(
MessageDialog::getInstance().information(
"Information",
"The user '" + _userName
+ "' has been successfully created.\nYou are logged in and are now able to upload your own simulations\nor upvote others by likes.");
Expand Down
47 changes: 23 additions & 24 deletions source/Gui/BrowserWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ void _BrowserWindow::refreshIntern(bool withRetry)

if (!success) {
if (withRetry) {
MessageDialog::getInstance().show("Error", "Failed to retrieve browser data. Please try again.");
MessageDialog::getInstance().information("Error", "Failed to retrieve browser data. Please try again.");
}
}
calcFilteredSimulationDatas();

if (_networkController->getLoggedInUserName()) {
if (!_networkController->getEmojiTypeBySimId(_ownEmojiTypeBySimId)) {
MessageDialog::getInstance().show("Error", "Failed to retrieve browser data. Please try again.");
MessageDialog::getInstance().information("Error", "Failed to retrieve browser data. Please try again.");
}
} else {
_ownEmojiTypeBySimId.clear();
Expand All @@ -113,7 +113,7 @@ void _BrowserWindow::refreshIntern(bool withRetry)
sortUserList();
} catch (std::exception const& e) {
if (withRetry) {
MessageDialog::getInstance().show("Error", e.what());
MessageDialog::getInstance().information("Error", e.what());
}
}
}
Expand Down Expand Up @@ -307,15 +307,15 @@ void _BrowserWindow::processSimulationTable()
ImGui::SameLine();

//delete color
ImGui::BeginDisabled(item->userName != _networkController->getLoggedInUserName().value_or(""));
ImGui::PushStyleColor(ImGuiCol_Text, (ImU32)Const::DeleteButtonTextColor);
auto deleteButtonResult = processActionButton(ICON_FA_TRASH);
ImGui::PopStyleColor();
if (deleteButtonResult) {
onDeleteSimulation(item);
if (item->userName == _networkController->getLoggedInUserName().value_or("")) {
ImGui::PushStyleColor(ImGuiCol_Text, (ImU32)Const::DeleteButtonTextColor);
auto deleteButtonResult = processActionButton(ICON_FA_TRASH);
ImGui::PopStyleColor();
if (deleteButtonResult) {
onDeleteSimulation(item);
}
AlienImGui::Tooltip("Delete");
}
ImGui::EndDisabled();
AlienImGui::Tooltip("Delete");

ImGui::TableNextColumn();

Expand Down Expand Up @@ -507,11 +507,8 @@ void _BrowserWindow::processEmojiWindow()
}
processEmojiButton(i);
}
// ImGui::SameLine();

ImGui::SetCursorPosY(ImGui::GetCursorPosY() + scale(8.0f));

// if (AlienImGui::ToolbarButton(ICON_FA_PLUS)) {
if (AlienImGui::Button("More", ImGui::GetContentRegionAvailWidth())) {
_showAllEmojis = true;
}
Expand Down Expand Up @@ -695,13 +692,13 @@ void _BrowserWindow::onDownloadSimulation(RemoteSimulationData* sim)
delayedExecution([=, this] {
SerializedSimulation serializedSim;
if (!_networkController->downloadSimulation(serializedSim.mainData, serializedSim.auxiliaryData, sim->id)) {
MessageDialog::getInstance().show("Error", "Failed to download simulation.");
MessageDialog::getInstance().information("Error", "Failed to download simulation.");
return;
}

DeserializedSimulation deserializedSim;
if (!Serializer::deserializeSimulationFromStrings(deserializedSim, serializedSim)) {
MessageDialog::getInstance().show("Error", "Failed to load simulation. Your program version may not match.");
MessageDialog::getInstance().information("Error", "Failed to load simulation. Your program version may not match.");
return;
}

Expand Down Expand Up @@ -731,7 +728,7 @@ void _BrowserWindow::onDownloadSimulation(RemoteSimulationData* sim)
_temporalControlWindow->onSnapshot();

if (VersionChecker::isVersionNewer(sim->version)) {
MessageDialog::getInstance().show(
MessageDialog::getInstance().information(
"Warning",
"The download was successful but the simulation was generated using a more recent\n"
"version of ALIEN. Consequently, the simulation might not function as expected.\n"
Expand All @@ -742,14 +739,16 @@ void _BrowserWindow::onDownloadSimulation(RemoteSimulationData* sim)

void _BrowserWindow::onDeleteSimulation(RemoteSimulationData* sim)
{
printOverlayMessage("Deleting ...");
MessageDialog::getInstance().yesNo("Delete simulation", "Do you really want to delete the simulation?", [sim, this]() {
printOverlayMessage("Deleting ...");

delayedExecution([remoteData = sim, this] {
if (!_networkController->deleteSimulation(remoteData->id)) {
MessageDialog::getInstance().show("Error", "Failed to delete simulation. Please try again later.");
return;
}
_scheduleRefresh = true;
delayedExecution([remoteData = sim, this] {
if (!_networkController->deleteSimulation(remoteData->id)) {
MessageDialog::getInstance().information("Error", "Failed to delete simulation. Please try again later.");
return;
}
_scheduleRefresh = true;
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion source/Gui/CreateUserDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void _CreateUserDialog::onCreateUser()
if (_networkController->createUser(_userName, _password, _email)) {
_activateUserDialog->open(_userName, _password, _userInfo);
} else {
MessageDialog::getInstance().show(
MessageDialog::getInstance().information(
"Error",
"An error occurred on the server. This could be related to the fact that\n" ICON_FA_CARET_RIGHT
" your user name or email address is already in use,\n" ICON_FA_CARET_RIGHT " or your user "
Expand Down
6 changes: 3 additions & 3 deletions source/Gui/DeleteUserDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void _DeleteUserDialog::processIntern()
if (_reenteredPassword == *_networkController->getPassword()) {
onDelete();
} else {
MessageDialog::getInstance().show("Error", "The password does not match.");
MessageDialog::getInstance().information("Error", "The password does not match.");
}
_reenteredPassword.clear();
}
Expand All @@ -50,8 +50,8 @@ void _DeleteUserDialog::onDelete()
auto userName = *_networkController->getLoggedInUserName();
if (_networkController->deleteUser()) {
_browserWindow->onRefresh();
MessageDialog::getInstance().show("Information", "The user '" + userName + "' has been deleted.\nYou are logged out.");
MessageDialog::getInstance().information("Information", "The user '" + userName + "' has been deleted.\nYou are logged out.");
} else {
MessageDialog::getInstance().show("Error", "An error occurred on the server.");
MessageDialog::getInstance().information("Error", "An error occurred on the server.");
}
}
4 changes: 2 additions & 2 deletions source/Gui/GenomeEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ void _GenomeEditorWindow::onOpenGenome()

std::vector<uint8_t> genomeData;
if (!Serializer::deserializeGenomeFromFile(genomeData, firstFilename.string())) {
MessageDialog::getInstance().show("Open genome", "The selected file could not be opened.");
MessageDialog::getInstance().information("Open genome", "The selected file could not be opened.");
} else {
openTab(GenomeDescriptionConverter::convertBytesToDescription(genomeData));
}
Expand All @@ -787,7 +787,7 @@ void _GenomeEditorWindow::onSaveGenome()
auto const& selectedTab = _tabDatas.at(_selectedTabIndex);
auto genomeData = GenomeDescriptionConverter::convertDescriptionToBytes(selectedTab.genome);
if (!Serializer::serializeGenomeToFile(firstFilename.string(), genomeData)) {
MessageDialog::getInstance().show("Save genome", "The selected file could not be saved.");
MessageDialog::getInstance().information("Save genome", "The selected file could not be saved.");
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/LoginDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _LoginDialog::_LoginDialog(
LoginErrorCode errorCode;
if (!_networkController->login(errorCode, _userName, _password, getUserInfo())) {
if (errorCode != LoginErrorCode_UnconfirmedUser) {
MessageDialog::getInstance().show("Error", "Login failed.");
MessageDialog::getInstance().information("Error", "Login failed.");
}
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ void _LoginDialog::onLogin()
_activateUserDialog->open(_userName, _password, userInfo);
} break;
default: {
MessageDialog::getInstance().show("Error", "Login failed.");
MessageDialog::getInstance().information("Error", "Login failed.");
} break;
}
return;
Expand Down
2 changes: 1 addition & 1 deletion source/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ void _MainWindow::onSaveSimulation()
sim.mainData = _simController->getClusteredSimulationData();

if (!Serializer::serializeSimulationToFiles(firstFilename.string(), sim)) {
MessageDialog::getInstance().show("Save simulation", "The simulation could not be saved to the specified file.");
MessageDialog::getInstance().information("Save simulation", "The simulation could not be saved to the specified file.");
}
});
});
Expand Down
Loading

0 comments on commit 58fe14c

Please sign in to comment.