Skip to content

Commit aadfa2f

Browse files
r4z396GAIGResearchmaichmuellerCommanderCero
authored
Added new GUI system + Support top down sprites+ Support different entity/tiles sprites + Added new object system + Added new game
* Fixed python reference * Enable by default STRATEGA_BUILD_BINDINGS * Disabled friendly fire by default * Added agents example to python folder * Disabled STRATEGA_BUILD_BINDINGS by default * Added workflows (Builds + Python wheels build)+ Fixed python references in docs + Added generation of python wheels and pypi publishing + Added release creation + Fixed errors in Mac and Linux + Downgraded code to make binary compatible with most Linux distros (#86) * Update README.md * setup * Fixed file paths errors in python + Setup pypi files * Reorganized folders and names * Updated necessary files to upload package to pypi * Updated classifiers * Create wheels.yml * Workflow test * Updated wheels file * Minimal example test * Removed ubuntu from actions * Removed mac * Updated wheels * Updated new wheels only windows * Fixed build dist * Fixed calling wrong job * Changed setup.py * Added ubuntu and mac builds * Removed incompatible builds with SFML + Added Linux dependencies * Added more libraries for Linux + Fixed error for Mac * Change Macos deployment target 10.14 * Disable pp37-win_amd64 build + Changed macos deployment target to 10.15 * Disabled pp37 in macos and linux builds * Fix wheels startup fail * Minimal wheels builts + setup cmake for linux * Added configure cmake for linux * Moved steps for Linux * Cleaned wheels * Try to fix macos find wheels error * Check Linux build with static sfml library * Moved step in linux under configuring cibuildwheels * Added more libraries for linux * Added more libraries * Added more libraries * Added -y to command * Added new linux config and reorganized linux libraries * Remove default linux cmake config and moved to cibw enviroment * Moved linux cmake options * Updated wheels * Changed CIBW_BEFORE_ALL_COMMON * Reorganized wheels * Updated wheels * Updated wheels * Fixed Linux error LevelDefinition * Changed linux target * Removed CIBW_BEFORE_ALL_COMMON * Fixed commands calls * Updated wheels * Updated wheels * Updated wheels * Added Linux configure and build test * Added <cmath> to solve Linux errors * set CMAKE_CXX_STANDARD_REQUIRED ON * Install gcc-10 g++-10 * Fixed command * Include memory and lower the amout of linux libraries * Updated wheels * Added more #include <memory> * Added #include <memory> in EntityPlacement * Removed install linux gcc and g++10 * Disable LTO for pybind * Added CFLAGS='-fPIC' CXXFLAGS='-fPIC' * Updated CMakeList * Added -fPIC to CMakeList * Install linux dependiencies in docker image * Updated wheels * Moved Before build to Before all * Updated wheels * Remove command sudo * Changed apt-get to yum * Changed manylinux docker image to 2014 * Changed to manylinus debian 9 based * Removed sudo error * Added all linux libraries * Changed libraries * Added library libfreetype6 debian 9 based * Added apt install gcc-10 g++-10 * Updated to Ubuntu 20.04 * Changed to manylinux2014 * Test mac and windows * Second test windows and mac * Third test windows and mac * Build mac and linux with Python 3.7, 3.8, 3.9 * Check if the last job finds the generated wheels * Fourth test windows and mac * Build mac and linux with Python 3.7, 3.8, 3.9 and 3.10 * Ubuntu test * Removed libraries * Removed more libraries * Removed libraries * Removed more libraries * Removed libraries * Removed all libraries * Added libraries and package index * Linux test installing libraries * Changed to before all * Added -y to linux build * Test all libraries * Install x11 libraries * Changed to debian 9 * Test running c++17 standard * Removed #include <variant> * set CMAKE_CXX_STANDARD_REQUIRED ON * Testing with centOS * New test * Test with optional_lite * Changed to debian 9 * Removed #include <optional> in timer * Test removing std::sample * Added delete to copy constructor ITreeNode * Try to remove ITreeNode error * Test without nodes * Downgraded to C++14 for manylinux compability * Changed insert_or_assign * Removed #include <filesystem> * Cleaned wheels * Test windows and mac * Test manylinux python 3.7 * Build cp37-manylinux_x86_64 * Test cmake change * Fixed setp and cmakelist * Fixed CmakeList * Check if linux fails due to the output python module * Test removing stratega extra args * Build Mac, Windows and Linux * Disabled STRATEGA_BUILD_DOCS and build Mac, Linux and Win * Enabling STRATEGA_BUILD_BINDINGS from wheels * Test passing -DSTRATEGA_BUILD_BINDING to second cmake * Removed last command and removed build linux cp3.6 * Test linux * Added both options * Change set to option * Changed wheels * Updated wheels * Testing Mac, Win and Linux builds * Testing Linux with bindings off * Pass through CIBW_ENVIRONMENT * Cleaned wheels * Added -DSTRATEGA_BUILD_BINDINGS * Updated wheels * Test Linux * Fixed Wheels * Clean wheels * Updated wheels * Removed if * Testing updating wheels * Updated wheels * Build Mac, Linux and Win * Test build with TreeNodes * Test with MCTS * Test including to agentfactory MCTS * Test added all agents * Test ITreeNode * Updated ITreeNode * Updated ITreeNode * Cleaned code * Added new build CI + Edited readme * Fixed CI * Updated CI * Added Linux flags * Updated readme + Create release * Cleaned code + removed warnings Co-authored-by: GAIGResearch <35296018+GAIGResearch@users.noreply.github.com> * Updated readme badge links * fixed files for ubuntu compile * big refactor * Fixed function parameter not being assigned * further refactoring and cmake cleanup/setup * renames * working cmake refactoring potential errors with yaml-cpp handling remain * add ci action * test workflow * test workflow * typo fix * test workflow * typo * debug workflow * debug wf * debug * debug * debug * debug * debug * debug * debug * debug * add dependencies to linux run * typo fix * more cmake fixes * small change in devtoolscmake * move targets to respective subfolder * rearrange gui target slightly * update wf * rm gcc11 from wf * rm ctest enabling * rm altera clang-tidy checks * move remaining options to top cmakelists level * Added CTest + Bunch of new test * Added test structure + Call test from CI * Run test in windows fixed * Added bunch of new test * Added more Arena and GameRunner test * Changed test directory * Added missing configuration * Changed configuration type depending on the matrix * Changed shell * Removed CMAKE_BUILD_TYPE * Fixed paths * Fixed ConfigurationTest loading wrong paths * Removed few test * Fixed Mac and Linux ctest * Cleaned test * Updated CI * Updated CI * Updated CI * Update CI * Update CI * Update CI * Removed error Dijkstra positions and Update CI * Updated ActionsTest * Updated yaml * Updated yaml and test * Updated ActionTest * Updated README * Cleaned README * readded enable_testing command * upgrade gtest to 1.11 * Fixed python errors + Added Game Renderer options * Moved assets to gameConfigs folder * Moved assets to new folder resources * Check if is local module resource or absolute * Load resources module path + Added manifest * Updated Manifest + Updated TBS games to new resources path * Cleaned main + Fixed BasicTBS errors with bad configuration * Added to RTS yamls the GameRenderer section + Updated rts yamls * Updated test resources paths * Refactored * deactivate warnings as errors in wf * fix test folder reorder * conan findable with conanpath var, changed yaml-cpp to v0.6.3 * Refactor the main structure and place dependency management into the hands of Conan * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * Updated docs references + yamls * Added assets * Removed old assets * Fixed Linux, MacOS, Windows warnings * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * W1 level fixed warnings * W2 level fixed warnings * W3 level fixed warnings + render error * Test warnings level w3 * Test warnings level w1 * Test * Test * Test * Testing * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * FIxed last windows errors w3 * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Cleaned code + Test wheels pybind enabled * Python wheel test * Test * Test * Test * Test * Test * Revert "Test" This reverts commit 2022a43. * Added buffs system + Added min, max and default definition of parameters + New KillTheKing with buffs game * Added buffs yaml structure * Add buff type and parse buffs from yaml * Finish basic buffs/debuffs * Apply buffs to player * Parse min, max and default parameters + Add min,max values to player and entities + Add modifyParameterEntity/Player to FM * Refactored buff system * Added new buff system to player and entities * Refactored FM * Removed substract and divide modifiers * Added new conditions * Restored KtK game + parameter read * Added KtK with buffs + Fixed parameter parsing * Refactored code + Added comments * Updated FM + Updated Effects * Merge branch 'dev' into feat_buffs * Test * Test * Test * Test * Test * Test * Test * Updated docs * Updated game configurations + Added new function parameter method + Fixed FM modify paramter methods * Enabled bindings * Fixed warnings * Test * Fixed warnings + Fixed main * Updated pypi version * Trigger github actions wheels on branches master and dev * Updated pypi version * Enabled wheels on push and on tag create * Updated parameter definition to min, default, max + Updated Games * Parse yaml nodes from different files * Cleaned files + Updated gitignore * Added yaml reference * Updated pypi version * Added gamestate parameters + Added OnAdvance trigger + Add PushThemAll, ConquerTheZone and CaptureTheFlag games * Added CaptureTheFlag base * Added new game CaptureTheFlag + Added parameters to GameState * Added new game ConquerTheZone + New conditions * Added PushThemAll + few effects and conditions * Added OnAdvanceEffect + Updated PushTheAll * Added Pusher Agent * Updated GameConfigs * Test * Update conquer the zone + Test * Test * Test * Test * Test * Test * Updated configs * Updated yaml referece + Added CaptureTheZone/CaptureTheFlag/PushThemAll docs * Updated yaml referece + Added CaptureTheZone/CaptureTheFlag/PushThemAll docs * Updated main * Isolate GUI files in headless mode + Added SGA_BUILD_HEADLESS option in CMakeList * Add headless compilation mode * Test * Test * Test * Test * Test * Test * Test * Copy the resource files in headless mode * Added new GUI system + Support top down sprites+ Support different entity/tiles sprites * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * W1 level fixed warnings * W2 level fixed warnings * W3 level fixed warnings + render error * Test warnings level w3 * Test warnings level w1 * Test * Test * Test * Testing * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * FIxed last windows errors w3 * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Add ResourceManager & TextureAtlas * Debug grid * Added NewTBSGameRender base * Added SGA Drwable + Widget definition + World definition * Setup working widget system and World render * Tile rendering + Grid layout working * Added MouseInformationWisget + WorldControllerWidget + Entity rendering * Added EntityInformation widget * Added ActionController Base * Fixed Entities render * Added Player Information + Added GameState Information Widget + Added Possible Actions Widget * Render available actions + Fixed available actions windows + TBS waiting position * Added gamestate interpolation + Basic animations(Move, Dissappear and Appear) * Added draw outline color entities * Highlight entity over mouse * Fixed Delta time errors + Added to widget Grid Info Tiles information * Reduced interpolate times * Fixed actions controller only selecting entities from the player + Fixed animation system (Binary flags) * Added animation system info in WorldWidget * Added FOW state + Added FOW controller widget + Fixed close window error + Fixed get entity error mouse info widget * Added RTS compatibility to new GUI * Removed old GUI code * Added tick limit to RTS games * Fixed player continuous actions error * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Added render config tile/sprite origin definition and isometric grid check + Updated all the game configs * Fixed different Tiles and Entity sprites * Test errors * Test errors Co-authored-by: Dominik Jeurissen <10519507+CommanderCero@users.noreply.github.com> * Fixed logs scopes * Added object system + New game OpenTheDoor * Added yaml object definition * Added basic object interation * Added Inventory conditions * Added Object and SlotObject action target and function parameter stuff +Few effects (Equip, UnEquipe obejct) and conditions(CanEquip) * Show GridInformationWidget while there is selected entities * Added slots information on GridInformationWidget + Added slots in used to condition CanEquip * Added OnTickActions to Objects * Added OnUseInventory, OnUseSlot, OnAddedInventory and OnEquip effects/conditions * Updated bread sprite + Updated GridInformation widget * Fixed World renderer not dissapearing objects * Added base OpenTheDoor * Fixed action target generation action space (Objects and SlotObject) * Refactored effects and conditions object * Added drop object effect * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Fixed OpenTheDoor game * Fixed bindings * Added Object bindings * Recovered original KtK game + Added key sprite + Fixed OpenTheDoor game + Fixed games without objects parsing error * Added OpenTheDoor to docs + Updated docs yaml reference + Updated Gamerenderer docs * Updated OpenTheDoor game config * Disabled ENABLE_BUILD_DOCS by default * Added new logging structure * Updated new logging structure * Updated docs Co-authored-by: GAIGResearch <35296018+GAIGResearch@users.noreply.github.com> Co-authored-by: der4twu <m.aichmueller@gmail.com> Co-authored-by: Dominik Jeurissen <10519507+CommanderCero@users.noreply.github.com>
1 parent 0120228 commit aadfa2f

File tree

153 files changed

+9201
-3073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+9201
-3073
lines changed

CMakeLists.txt

+33-15
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ option(ENABLE_STRATEGA_BINDINGS "Enable to build the bindings to other languages
4949
option(ENABLE_TESTING "Enable Test Builds" ON)
5050
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors (If ENABLE_STRATEGA_BINDINGS is enabled, this option will be disabled automatically)" ON)
5151

52+
option(SGA_BUILD_HEADLESS "Compile Stratega in headless mode" OFF)
53+
5254
#If CMAKE_NO_SYSTEM_FROM_IMPORTED is OFF, pybind11 should be treated as SYSTEM and it should not throw warnings
5355
#but it does for some reason that we dont know.
5456
#The temporal solution for this problem is to disable the warnings when we want to build the pyhton bindings
@@ -57,7 +59,7 @@ message("\nDeactivated warnings as errors.\n")
5759
set(WARNINGS_AS_ERRORS OFF)
5860
endif()
5961

60-
# print out a short summary of the compiler information
62+
# print out a short summary of the compiler inforMoved Arena and GUI filesmation
6163
message("C++ Compiler: ${CMAKE_CXX_COMPILER}")
6264
message("C++ Compiler Info: ${CMAKE_CXX_COMPILER_ID}, version ${CMAKE_CXX_COMPILER_VERSION}")
6365
message("Build type: ${CMAKE_BUILD_TYPE}")
@@ -114,35 +116,51 @@ enable_doxygen()
114116
include(${CMAKE_CONFIG_FOLDER}/settings/StaticAnalyzers.cmake)
115117

116118
# configure conan and fetch all dependencies
117-
if (CMAKE_SYSTEM_NAME MATCHES Linux)
119+
if(NOT SGA_BUILD_HEADLESS)
120+
if (CMAKE_SYSTEM_NAME MATCHES Linux)
118121
# on linux SFML is not (yet) available from conan due to a missing lib dependency in their recipe.
119122
# We will have to fetch it manually in this case and add it to our project.
120123
include(${CMAKE_CONFIG_FOLDER}/modules/FetchSFML.cmake)
121-
endif ()
122-
include(${CMAKE_CONFIG_FOLDER}/modules/FetchIMGUI-SFML.cmake)
124+
endif ()
125+
include(${CMAKE_CONFIG_FOLDER}/modules/FetchIMGUI-SFML.cmake)
126+
else()
127+
add_compile_definitions(BUILD_HEADLESS)
128+
set(ENABLE_STRATEGA_BINDINGS OFF)
129+
endif()
130+
123131
include(${CMAKE_CONFIG_FOLDER}/settings/Conan.cmake)
124132
run_conan()
125133
include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake)
126134
include(${PROJECT_BINARY_DIR}/conan_paths.cmake)
127135

128136

129137
# find the downloaded/installed packages
130-
131-
find_package(Threads)
132-
find_package(imgui REQUIRED)
133-
find_package(OpenGL REQUIRED)
134138
if (CMAKE_SYSTEM_NAME MATCHES Linux)
135-
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR} EXCLUDE_FROM_ALL)
136-
else ()
137-
find_package(SFML COMPONENTS system window graphics REQUIRED)
138-
endif ()
139+
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
140+
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
141+
endif ()
142+
find_package(Threads)
143+
144+
if(NOT SGA_BUILD_HEADLESS)
145+
find_package(imgui REQUIRED)
146+
find_package(OpenGL REQUIRED)
147+
if (CMAKE_SYSTEM_NAME MATCHES Linux)
148+
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR} EXCLUDE_FROM_ALL)
149+
else ()
150+
find_package(SFML COMPONENTS system window graphics REQUIRED)
151+
endif ()
152+
endif()
153+
139154
find_package(yaml-cpp REQUIRED)
140155
find_package(recastnavigation REQUIRED)
141156

142157

143158
# define the targets of the project
144-
include(${CMAKE_CONFIG_FOLDER}/targets/IMGUI.cmake)
145-
include(${CMAKE_CONFIG_FOLDER}/targets/GUI.cmake)
159+
if(NOT SGA_BUILD_HEADLESS)
160+
include(${CMAKE_CONFIG_FOLDER}/targets/IMGUI.cmake)
161+
include(${CMAKE_CONFIG_FOLDER}/targets/GUI.cmake)
162+
endif()
163+
146164
include(${CMAKE_CONFIG_FOLDER}/targets/Arena.cmake)
147165
include(${CMAKE_CONFIG_FOLDER}/targets/Stratega.cmake)
148166
if (ENABLE_STRATEGA_BINDINGS)
@@ -157,4 +175,4 @@ if (ENABLE_TESTING)
157175
enable_testing()
158176
message("\nTests enabled, configuring.\n")
159177
include(${CMAKE_CONFIG_FOLDER}/targets/Tests.cmake)
160-
endif ()
178+
endif ()

CMakeSettings.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x64-Debug",
5+
"generator": "Ninja",
6+
"configurationType": "Debug",
7+
"inheritEnvironments": [ "msvc_x64_x64" ],
8+
"buildRoot": "${projectDir}\\out\\build\\${name}",
9+
"installRoot": "${projectDir}\\out\\install\\${name}",
10+
"cmakeCommandArgs": "",
11+
"buildCommandArgs": "",
12+
"ctestCommandArgs": ""
13+
}
14+
]
15+
}

cmake/settings/Conan.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ macro(run_conan)
1212

1313
conan_add_remote(NAME bincrafters URL
1414
https://api.bintray.com/conan/bincrafters/public-conan)
15-
1615
conan_cmake_run(
1716
CONANFILE ${DEPENDENCY_DIR}/${CONANFILE}
1817
CONAN_COMMAND ${CONAN_PATH}

cmake/targets/GUI.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ target_link_libraries(gui
1919
"$<$<PLATFORM_ID:Linux>:sfml-graphics>"
2020
"$<$<PLATFORM_ID:Linux>:sfml-window>"
2121
)
22-
23-
#Copy Assets folder
24-
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
22+
2523

2624
set_target_properties(gui PROPERTIES
2725
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib

cmake/targets/Stratega.cmake

+51-16
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ set(STRATEGA_SOURCE_FILES
2222
Agent/RHEAAgent/RHEAGenome.cpp
2323
Agent/RHEAAgent/RHEAParameters.cpp
2424
Agent/RuleBasedAgents/CombatAgent.cpp
25+
Agent/RuleBasedAgents/PusherAgent.cpp
26+
Agent/RuleBasedAgents/Direction.cpp
2527
Agent/ScriptedAgent.cpp
2628
Agent/StateAbstraction/StateFactory.cpp
2729
Agent/TreeSearchAgents/ActionAbstractionMCTSAgent.cpp
@@ -50,14 +52,9 @@ set(STRATEGA_SOURCE_FILES
5052
Game/GameRunner.cpp
5153
Game/RTSGameRunner.cpp
5254
Game/TBSGameRunner.cpp
53-
GUI/AssetCache.cpp
54-
GUI/EntityRenderer.cpp
5555
GUI/GameRenderer.cpp
56-
GUI/RTSGameRenderer.cpp
57-
GUI/TBSGameRenderer.cpp
58-
GUI/TileMap.cpp
59-
GUI/Widgets/ActionsController.cpp
60-
GUI/Widgets/FogOfWarController.cpp
56+
57+
6158
Logging/FileLogger.cpp
6259
Logging/Log.cpp
6360
Logging/LoggingScope.cpp
@@ -69,15 +66,45 @@ set(STRATEGA_SOURCE_FILES
6966
Representation/GameState.cpp
7067
Representation/Player.cpp
7168
Representation/TechnologyTree.cpp
72-
Representation/Tile.cpp
69+
Representation/Tile.cpp
70+
)
71+
if(NOT SGA_BUILD_HEADLESS)
72+
list(APPEND STRATEGA_SOURCE_FILES
73+
GUI/AssetCache.cpp
74+
GUI/TextureAtlas.cpp
75+
NewGUI/GridLayout.cpp
76+
NewGUI/Widget.cpp
77+
NewGUI/World.cpp
78+
NewGUI/GridLayoutWidget.cpp
79+
NewGUI/MouseInformationWidget.cpp
80+
NewGUI/FOWControllerWidget.cpp
81+
NewGUI/PlayerInformationWidget.cpp
82+
NewGUI/GameStateInformationWidget.cpp
83+
NewGUI/ActionsWidget.cpp
84+
NewGUI/WorldControllerWidget.cpp
85+
NewGUI/SGARenderTarget.cpp
86+
NewGUI/SGADrawable.cpp
87+
88+
NewGUI/GenericGameRenderer.cpp
89+
NewGUI/SpriteData.cpp
90+
NewGUI/ResourceManager.cpp
7391
)
92+
message("Building GUI mode")
93+
else()
94+
message("Building HEADLESS mode")
95+
endif()
96+
97+
#Copy Assets folder
98+
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
99+
74100

75101
list(TRANSFORM STRATEGA_SOURCE_FILES PREPEND "${SUBPROJ_STRATEGA_SRC_DIR}/")
76102

77103
add_library(Stratega STATIC ${STRATEGA_SOURCE_FILES})
78104

79105
target_include_directories(Stratega PUBLIC ${SUBPROJ_STRATEGA_INCLUDE_DIR})
80106

107+
81108
function(target_link_libraries_system target)
82109
set(libs ${ARGN})
83110
foreach(lib ${libs})
@@ -90,15 +117,23 @@ endfunction(target_link_libraries_system)
90117

91118
target_link_libraries_system(Stratega CONAN_PKG::yaml-cpp)
92119
target_link_libraries_system(Stratega CONAN_PKG::recastnavigation)
93-
target_link_libraries_system(Stratega CONAN_PKG::imgui)
94-
target_link_libraries_system(Stratega imgui)
95120

96-
if(UNIX AND NOT APPLE)
97-
target_link_libraries_system(Stratega sfml-system)
98-
target_link_libraries_system(Stratega sfml-graphics)
99-
target_link_libraries_system(Stratega sfml-window)
100-
else()
101-
target_link_libraries_system(Stratega CONAN_PKG::sfml)
121+
122+
if(CMAKE_SYSTEM_NAME MATCHES Linux)
123+
target_link_libraries(Stratega Threads::Threads)
124+
endif()
125+
126+
if(NOT SGA_BUILD_HEADLESS)
127+
target_link_libraries_system(Stratega CONAN_PKG::imgui)
128+
target_link_libraries_system(Stratega imgui)
129+
130+
if(UNIX AND NOT APPLE)
131+
target_link_libraries_system(Stratega sfml-system)
132+
target_link_libraries_system(Stratega sfml-graphics)
133+
target_link_libraries_system(Stratega sfml-window)
134+
else()
135+
target_link_libraries_system(Stratega CONAN_PKG::sfml)
136+
endif()
102137
endif()
103138

104139
install(TARGETS

docs/extraInformation/faq/index.rst

-26
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
Frequently asked questions
22
##########################
33

4-
How to change the GUI resolution
5-
================================
6-
7-
The GUI can be executed in any resolution you want. To change it, simply pass the desire resolution to the game runner.
8-
The implementation between c++ and python is slighly different.
9-
10-
.. tabs::
11-
12-
.. code-tab:: c++
13-
:caption: Note that this code is based in the cpp file GUI/main.cpp.
14-
15-
16-
auto resolution = SGA::Vector2f(1200, 800);
17-
...
18-
auto runner = SGA::createGameRunner(*gameConfig);
19-
runner->play(agents.begin(), agents.end(), resolution);
20-
21-
.. code-tab:: py
22-
23-
resolution=stratega.Vector2f(1920,1080)
24-
...
25-
runner = stratega.create_runner(config)
26-
config_agents = stratega.generate_agents(config)
27-
28-
runner.play(config_agents, resolution, 0)
29-
304
Disable fog of war
315
==================
326

0 commit comments

Comments
 (0)