diff --git a/CMakeLists.txt b/CMakeLists.txt index 762b774e..3f619a35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,8 @@ set(THRONES_SRC "src/prog/board.h" "src/prog/game.cpp" "src/prog/game.h" + "src/prog/guiGen.cpp" + "src/prog/guiGen.h" "src/prog/netcp.cpp" "src/prog/netcp.h" "src/prog/program.cpp" @@ -117,15 +119,17 @@ set(THRONES_SRC "src/prog/progs.h" "src/prog/types.cpp" "src/prog/types.h" - "src/server/common.h" "src/server/server.cpp" "src/server/server.h" + "src/utils/alias.h" "src/utils/context.cpp" "src/utils/context.h" "src/utils/layouts.cpp" "src/utils/layouts.h" "src/utils/objects.cpp" "src/utils/objects.h" + "src/utils/settings.cpp" + "src/utils/settings.h" "src/utils/text.cpp" "src/utils/text.h" "src/utils/utils.cpp" @@ -139,12 +143,12 @@ endif() list(APPEND THRONES_SRC ${ASSET_SHD}) set(SERVER_SRC - "src/server/common.h" "src/server/log.cpp" "src/server/log.h" "src/server/server.cpp" "src/server/server.h" "src/server/serverProg.cpp" + "src/utils/alias.h" "src/utils/text.cpp" "src/utils/text.h") if(CMAKE_SYSTEM_NAME STREQUAL "Windows") @@ -155,21 +159,14 @@ set(OVEN_SRC "src/oven/oven.cpp" "src/oven/oven.h" "src/oven/ovenProg.cpp" + "src/utils/alias.h" "src/utils/text.cpp" "src/utils/text.h") -set(TLIB_SRC - "src/oven/oven.cpp" - "src/oven/oven.h" - "src/server/common.h" - "src/server/server.cpp" - "src/server/server.h" - "src/utils/text.cpp" - "src/utils/text.h" - "src/utils/utils.cpp" - "src/utils/utils.h") - set(TESTS_SRC + "src/test/alias.cpp" + "src/test/fileSys.cpp" + "src/test/oven.cpp" "src/test/server.cpp" "src/test/tests.cpp" "src/test/tests.h" @@ -181,13 +178,16 @@ set(TESTS_SRC option(EXTERNAL "Save settings externally." OFF) option(OPENGLES "Build for OpenGL ES. (always on with Emscripten)" OFF) option(SERVICE "Build server without keyboard input." OFF) +if((CMAKE_SYSTEM_NAME STREQUAL "Windows") OR (CMAKE_SYSTEM_NAME STREQUAL "Linux")) + option(WEBUTILS "Build the client with curl." ON) +endif() set(VER_SDL "2.0.12" CACHE STRING "SDL2 version.") set(VER_IMG "2.0.5" CACHE STRING "SDL2_image version.") set(VER_TTF "2.0.15" CACHE STRING "SDL2_ttf version.") set(VER_GLEW "2.1.0" CACHE STRING "GLEW version.") set(VER_GLM "0.9.9.8" CACHE STRING "glm version.") -set(VER_CURL "7.71.1" CACHE STRING "libcurl version.") +set(VER_CURL "7.72.0" CACHE STRING "libcurl version.") set(DIR_LIB "${CMAKE_SOURCE_DIR}/lib") set(DIR_RSC "${CMAKE_SOURCE_DIR}/rsc") @@ -218,6 +218,15 @@ function(downloadLib URL DST LIBDIR) endif() endfunction() +function(compileLib URL DST LIBDIR CMD WDIR) + if(EXISTS "${LIBDIR}") + message(STATUS "Found ${LIBDIR}") + else() + downloadLib("${URL}" "${DST}" "${LIBDIR}") + execute_process(COMMAND ${CMD} WORKING_DIRECTORY "${WDIR}") + endif() +endfunction() + function(renameLibdir SRC DST) if(EXISTS "${SRC}") file(RENAME "${SRC}" "${DST}") @@ -251,7 +260,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") set(BIN_SDL "${DIR_SDL}/lib/${VMACHINE}") set(BIN_IMG "${DIR_IMG}/lib/${VMACHINE}") set(BIN_TTF "${DIR_TTF}/lib/${VMACHINE}") - set(BIN_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-winssl/bin") + set(BIN_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-schannel/bin") set(LIB_SDL "${BIN_SDL}") set(LIB_IMG "${BIN_IMG}") set(LIB_TTF "${BIN_TTF}") @@ -260,11 +269,11 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") else() set(LIB_GLEW "${DIR_GLEW}/lib/Release/Win32") endif() - set(LIB_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-winssl/lib") + set(LIB_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-schannel/lib") set(INC_SDL "${DIR_SDL}/include") set(INC_IMG "${DIR_IMG}/include") set(INC_TTF "${DIR_TTF}/include") - set(INC_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-winssl/include") + set(INC_CURL "${DIR_CURL}/builds/libcurl-vc-${VMACHINE}-release-dll-ipv6-sspi-schannel/include") set(URL_SDL "https://www.libsdl.org/release/SDL2-devel-${VER_SDL}-VC.zip") set(URL_IMG "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-${VER_IMG}-VC.zip") set(URL_TTF "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${VER_TTF}-VC.zip") @@ -312,17 +321,18 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") downloadLib("${URL_IMG}" "${DIR_LIB}" "${DIR_IMG}") downloadLib("${URL_TTF}" "${DIR_LIB}" "${DIR_TTF}") downloadLib("${URL_GLEW}" "${DIR_LIB}" "${DIR_GLEW}") - if(MSVC) - if(NOT EXISTS "${DIR_CURL}") + link_directories("${LIB_SDL}" "${LIB_IMG}" "${LIB_TTF}" "${LIB_GLEW}") + include_directories("${INC_SDL}" "${INC_IMG}" "${INC_TTF}" "${DIR_GLEW}/include") + + if(WEBUTILS) + if(MSVC) + compileLib("${URL_CURL}" "${DIR_LIB}" "${DIR_CURL}" "nmake;/f;Makefile.vc;mode=dll;MACHINE=${VMACHINE}" "${DIR_CURL}/winbuild") + else() downloadLib("${URL_CURL}" "${DIR_LIB}" "${DIR_CURL}") - execute_process(COMMAND nmake /f Makefile.vc mode=dll MACHINE=${VMACHINE} WORKING_DIRECTORY "${DIR_CURL}/winbuild") endif() - else() - downloadLib("${URL_CURL}" "${DIR_LIB}" "${DIR_CURL}") + link_directories("${LIB_CURL}") + include_directories("${INC_CURL}") endif() - - link_directories("${LIB_SDL}" "${LIB_IMG}" "${LIB_TTF}" "${LIB_GLEW}" "${LIB_CURL}") - include_directories("${INC_SDL}" "${INC_IMG}" "${INC_TTF}" "${DIR_GLEW}/include" "${INC_CURL}") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") downloadLib("https://www.libsdl.org/release/SDL2-${VER_SDL}.dmg" "${DIR_LIB}" "SDL2.framework") downloadLib("https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${VER_IMG}.dmg" "${DIR_LIB}" "SDL2_image.framework") @@ -332,12 +342,10 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") find_library(LIB_IMG "SDL2_image" HINTS "${DIR_LIB}") find_library(LIB_TTF "SDL2_ttf" HINTS "${DIR_LIB}") find_library(LIB_OPENGL "OpenGL") + include_directories("${LIB_SDL}/Headers") # XCode can't find the SDL2 headers elseif(NOT OPENGLES) set(DIR_GLEW "${DIR_LIB}/glew-${VER_GLEW}") - if(NOT EXISTS "${DIR_GLEW}") - downloadLib("https://sourceforge.net/projects/glew/files/glew/${VER_GLEW}/glew-${VER_GLEW}.tgz" "${DIR_LIB}" "${DIR_GLEW}") - execute_process(COMMAND make glew.lib.static WORKING_DIRECTORY "${DIR_GLEW}") - endif() + compileLib("https://sourceforge.net/projects/glew/files/glew/${VER_GLEW}/glew-${VER_GLEW}.tgz" "${DIR_LIB}" "${DIR_GLEW}" "make;glew.lib.static" "${DIR_GLEW}") link_directories("${DIR_GLEW}/lib") include_directories("${DIR_GLEW}/include") @@ -398,19 +406,15 @@ else() endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) - set(CXX_FLG_ANY "-Wall -Wextra -pedantic-errors -Wdouble-promotion -Wformat=2 -Wmissing-declarations -Wold-style-cast -Wshadow -Wunreachable-code -Wno-implicit-fallthrough -Wno-parentheses -Wno-switch") + set(CXX_FLG_ANY "-Wall -Wextra -pedantic-errors -Wdouble-promotion -Wformat=2 -Wmissing-declarations -Wold-style-cast -Wshadow -Wunreachable-code -Wno-implicit-fallthrough -Wno-switch") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CXX_FLG_ANY "${CXX_FLG_ANY} -Wcast-align=strict -Wduplicated-cond") else() set(CXX_FLG_ANY "${CXX_FLG_ANY} -Wcast-align -Wnull-dereference -Wover-aligned -Wshadow-all -Wno-unused-private-field") endif() - if(OPENGLES) set(CXX_FLG_ANY "${CXX_FLG_ANY} -Wno-unused-parameter") endif() - if(ARCH) - set(CXX_FLG_ANY "${CXX_FLG_ANY} -m${ARCH}") - endif() if(EMSCRIPTEN) set(CXX_FLG_ANY "${CXX_FLG_ANY} --preload-file ${CMAKE_BINARY_DIR}/data@/ -s TOTAL_MEMORY=536870912 -s WASM=1 -s USE_WEBGL2=1 -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"jpg\",\"png\"]' -s USE_SDL_TTF=2 -s FETCH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s DYNAMIC_EXECUTION=1 -lidbfs.js -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-parameter -Wno-unused-variable") @@ -494,23 +498,32 @@ else() target_link_libraries(${PROJECT_NAME} SDL2 SDL2_image SDL2_ttf) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - target_link_libraries(${PROJECT_NAME} glew32s opengl32 libcurl ws2_32) - elseif(OPENGLES) - target_link_libraries(${PROJECT_NAME} GLESv2 curl) + target_link_libraries(${PROJECT_NAME} glew32s opengl32 ws2_32) + if(WEBUTILS) + target_link_libraries(${PROJECT_NAME} libcurl) + add_definitions(-DWEBUTILS) + endif() else() - target_link_libraries(${PROJECT_NAME} GLEW GL curl) + if(OPENGLES) + target_link_libraries(${PROJECT_NAME} GLESv2) + else() + target_link_libraries(${PROJECT_NAME} GLEW GL) + endif() + if(WEBUTILS) + target_link_libraries(${PROJECT_NAME} curl) + add_definitions(-DWEBUTILS) + endif() endif() - add_definitions(-DWEBUTILS) setCommonTargetProperties(${PROJECT_NAME} "${EXE_DIR}") endif() # game data copier targets -function(addDataCopierTarget TARGET_NAME TEXTRA DST OPT_AUD OPT_SHD OPT_IMG SINGLE_FILES) +function(addDataCopierTarget TARGET_NAME TEXTRA DST OPT_SHD OPT_IMG SINGLE_FILES) add_custom_target(${TARGET_NAME} ${TEXTRA} SOURCES ${DATA_SRC} COMMAND "${CMAKE_COMMAND}" -E make_directory "${DST}" COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${SINGLE_FILES} "${DST}" - COMMAND "${EXE_DIR}/${OVEN_NAME}" ${OPT_AUD} "${DST}/audio.dat" ${ASSET_WAV} + COMMAND "${EXE_DIR}/${OVEN_NAME}" -a "${DST}/audio.dat" ${ASSET_WAV} COMMAND "${EXE_DIR}/${OVEN_NAME}" -m "${DST}/materials.dat" ${ASSET_MTL} COMMAND "${EXE_DIR}/${OVEN_NAME}" -o "${DST}/objects.dat" ${ASSET_OBJ} COMMAND "${EXE_DIR}/${OVEN_NAME}" ${OPT_SHD} "${DST}/shaders.dat" ${ASSET_SHD} @@ -520,11 +533,11 @@ function(addDataCopierTarget TARGET_NAME TEXTRA DST OPT_AUD OPT_SHD OPT_IMG SING endfunction() if(OPENGLES) - addDataCopierTarget(${DATA_NAME} "ALL" "${DATA_DIR}" "-A" "-S" "-T" "${ASSET_DAT}") + addDataCopierTarget(${DATA_NAME} "ALL" "${DATA_DIR}" "-S" "-T" "${ASSET_DAT}") else() - addDataCopierTarget(${DATA_NAME} "ALL" "${DATA_DIR}" "-a" "-s" "-t" "${ASSET_DAT}") + addDataCopierTarget(${DATA_NAME} "ALL" "${DATA_DIR}" "-s" "-t" "${ASSET_DAT}") endif() -addDataCopierTarget(${ADATA_NAME} "" "${DIR_PAND}/app/src/main/assets" "-A" "-S" "-T" "rsc/data/romanesque.ttf;rsc/data/merriweather.otf") +addDataCopierTarget(${ADATA_NAME} "" "${DIR_PAND}/app/src/main/assets" "-S" "-T" "rsc/data/romanesque.ttf;rsc/data/merriweather.otf") # server program target @@ -550,15 +563,19 @@ add_custom_command(TARGET ${OVEN_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_LIB}/glm/copying.txt" "${LICN_DIR}/COPYING.glm.txt") if(CMAKE_SYSTEM_NAME STREQUAL "Windows") add_custom_command(TARGET ${OVEN_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_SDL}/SDL2.dll" "${BIN_IMG}/SDL2_image.dll" "${BIN_TTF}/SDL2_ttf.dll" "${BIN_IMG}/libjpeg-9.dll" "${BIN_IMG}/libpng16-16.dll" "${BIN_TTF}/libfreetype-6.dll" "${BIN_TTF}/zlib1.dll" "${BIN_CURL}/libcurl.dll" "${EXE_DIR}" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_SDL}/SDL2.dll" "${BIN_IMG}/SDL2_image.dll" "${BIN_TTF}/SDL2_ttf.dll" "${BIN_IMG}/libjpeg-9.dll" "${BIN_IMG}/libpng16-16.dll" "${BIN_TTF}/libfreetype-6.dll" "${BIN_TTF}/zlib1.dll" "${EXE_DIR}" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_SDL}/COPYING.txt" "${LICN_DIR}/COPYING.SDL.txt" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_IMG}/COPYING.txt" "${LICN_DIR}/COPYING.SDL_image.txt" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_TTF}/COPYING.txt" "${LICN_DIR}/COPYING.SDL_ttf.txt" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_GLEW}/LICENSE.txt" "${LICN_DIR}/LICENSE.glew.txt" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_IMG}/LICENSE.png.txt" "${LICN_DIR}" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_TTF}/LICENSE.freetype.txt" "${LICN_DIR}" - COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_TTF}/LICENSE.zlib.txt" "${LICN_DIR}" - COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_CURL}/COPYING" "${LICN_DIR}/COPYING.curl.txt") + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_TTF}/LICENSE.zlib.txt" "${LICN_DIR}") + if(WEBUTILS) + add_custom_command(TARGET ${OVEN_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BIN_CURL}/libcurl.dll" "${EXE_DIR}" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DIR_CURL}/COPYING" "${LICN_DIR}/COPYING.curl.txt") + endif() elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") add_custom_command(TARGET ${OVEN_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory "${FRAM_DIR}/${FRAM_SDL}" "${FRAM_DIR}/${FRAM_TTF}" @@ -578,23 +595,21 @@ endif() # tests -add_library(${TLIB_NAME} STATIC EXCLUDE_FROM_ALL ${TLIB_SRC}) -target_compile_definitions(${TLIB_NAME} PUBLIC AS_LIBRARY) -target_link_libraries(${TLIB_NAME} SDL2) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_library(${TLIB_NAME} STATIC EXCLUDE_FROM_ALL ${THRONES_SRC}) + target_compile_definitions(${TLIB_NAME} PUBLIC IS_TEST_LIBRARY) + target_link_libraries(${TLIB_NAME} SDL2 SDL2_image SDL2_ttf GLEW GL curl) -enable_testing() -add_executable(${TESTS_NAME} EXCLUDE_FROM_ALL ${TESTS_SRC}) -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_libraries(${TESTS_NAME} ${TLIB_NAME} "${LIB_SDL}" "${LIB_IMG}") -else() - target_link_libraries(${TESTS_NAME} ${TLIB_NAME} SDL2 SDL2_image) + enable_testing() + add_executable(${TESTS_NAME} EXCLUDE_FROM_ALL ${TESTS_SRC}) + target_link_libraries(${TESTS_NAME} ${TLIB_NAME}) + add_dependencies(${TESTS_NAME} ${TLIB_NAME}) + add_test(NAME ${TESTS_NAME} COMMAND ${TESTS_NAME}) endif() -add_dependencies(${TESTS_NAME} ${TLIB_NAME}) -add_test(NAME ${TESTS_NAME} COMMAND ${TESTS_NAME}) # prettyfiers -set(ALL_SRC ${THRONES_SRC} ${DATA_SRC} ${SERVER_SRC} ${OVEN_SRC} ${TLIB_SRC} ${TESTS_SRC}) +set(ALL_SRC ${THRONES_SRC} ${DATA_SRC} ${SERVER_SRC} ${OVEN_SRC} ${TESTS_SRC}) foreach(FSRC IN LISTS ALL_SRC) get_filename_component(FGRP "${FSRC}" DIRECTORY) string(REPLACE "/" ";" FGRP "${FGRP}") diff --git a/README.md b/README.md index 9cc4d45a..49106511 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Used libraries are libcurl, GLEW, GLM, SDL2, SDL2_image, SDL2_ttf and by extensi The CMakeLists.txt is written for CMake 3.10.2 with Clang, GCC or MSVC which need to support C++17. CMake variables: -- ARCH : string = system default - - can be set to 32 or 64 for Clang or GCC - CMAKE_BUILD_TYPE : string = Release - can be set to "Debug" - EXTERNAL : bool = 0 @@ -19,7 +17,9 @@ CMake variables: - use OpenGL ES - SERVICE : bool = 0 - server program won't check keyboard input -- VER_CURL : string = 7.71.1 +- WEBUTILS : bool = 1 + - build the client with curl (only available for Linux and Windows) +- VER_CURL : string = 7.72.0 - libcurl version to download - VER_GLEW : string = 2.1.0 - GLEW version to download @@ -58,7 +58,4 @@ The only supported compiler is MSVC. MinGW might also work, but hasn't been test ## TODO -- in emscripten there's an exception thrown somewhere -- buttons on android are too small -- windows server doesn't send rejections properly - shadows aren't working properly on some systems diff --git a/android/app/build.gradle b/android/app/build.gradle index 1a3b7186..27b82e60 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -14,8 +14,8 @@ android { } minSdkVersion 19 targetSdkVersion 30 - versionCode 5 - versionName "0.5.1" + versionCode 6 + versionName "0.5.2" externalNativeBuild { ndkBuild { arguments "APP_PLATFORM=android-19" diff --git a/android/app/jni/src/Android.mk b/android/app/jni/src/Android.mk index bfc3ff76..511a46ab 100644 --- a/android/app/jni/src/Android.mk +++ b/android/app/jni/src/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := main SDL_PATH := ../SDL LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/../glm -LOCAL_SRC_FILES := engine/audioSys.cpp engine/inputSys.cpp engine/fileSys.cpp engine/scene.cpp engine/windowSys.cpp engine/world.cpp oven/oven.cpp prog/board.cpp prog/game.cpp prog/netcp.cpp prog/program.cpp prog/progs.cpp prog/types.cpp server/server.cpp utils/context.cpp utils/layouts.cpp utils/objects.cpp utils/text.cpp utils/utils.cpp utils/widgets.cpp +LOCAL_SRC_FILES := engine/audioSys.cpp engine/fileSys.cpp engine/inputSys.cpp engine/scene.cpp engine/windowSys.cpp engine/world.cpp oven/oven.cpp prog/board.cpp prog/game.cpp prog/guiGen.cpp prog/netcp.cpp prog/program.cpp prog/progs.cpp prog/types.cpp server/server.cpp utils/context.cpp utils/layouts.cpp utils/objects.cpp utils/settings.cpp utils/text.cpp utils/utils.cpp utils/widgets.cpp LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_ttf LOCAL_LDLIBS := -lGLESv3 -llog include $(BUILD_SHARED_LIBRARY) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index bd407233..4fe2b174 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ - + diff --git a/doc/docs.html b/doc/docs.html index 5f304caf..aabacbab 100644 --- a/doc/docs.html +++ b/doc/docs.html @@ -19,7 +19,6 @@

Index

1 Miscellaneous
1.1 Dependencies
1.2 UI
- 1.3 Bindings
2 Preferences
2.1 Settings
2.2 Configurations
@@ -47,9 +46,8 @@

Emscripten

Linux

  • Linux 3.2.0 64-bit
  • -
  • OpenGL 3.3 (x86) or OpenGL ES 3.0 (ARM)
  • +
  • OpenGL 3.3 (x86/x86-64) or OpenGL ES 3.0 (ARM)
  • FreeType
  • -
  • GLEW 2.1.0
  • libcurl
  • libjpeg (OpenGL ES)
  • libpng
  • @@ -70,305 +68,19 @@

    Windows

1.2 UI

-

Widgets that can be interacted with or have tooltips are highlighted when the user hovers the mouse cursor over them. The "Escape" or "Back" key always perform a given menu's "exit" action, while "Return" performs a popup's "confirm" action.

+

Widgets that can be interacted with or have tooltips are highlighted when the user hovers the mouse cursor over them. The "Escape" and "Back" keys always perform a given menu's "exit" action. "Return" and "Enter" perform a popup's or selection's "confirm" action.

Checkbox

Can be toggled with either the left or the right mouse button.

Scroll area

Can be scrolled with either a scroll bar on the right, the mouse wheel or by left click holding and dragging inside the area.

Slider

Most sliders' changes will be fully applied only once the dragging is done.

-

Text edit

-

Possible editing actions are:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Leftmove cursor one character to the left
Alt + Leftmove cursor to the start of a word
Ctrl + Leftmove cursor to the start
Rightmove cursor one character to the right
Alt + Leftmove cursor to the end of a word
Ctrl + Leftmove cursor to the end
Backspacedelete previous character
Alt + Backspacedelete to the start of a word
Ctrl + Backspacedelete to the start
Deletedelete current character
Alt + Deletedelete to the end of a word
Ctrl + Deletedelete to the end
Homemove cursor to the start
Endmove cursor to the end
Ctrl + Vinsert clipboard text at cursor's position
Ctrl + Ccopy entire text to clipboard
Ctrl + Xcut entire text to clipboard
Ctrl + Zset text to the original text
Return or Enterconfirm new text and stop editing
Escape or Tab or Backset text to the original text and stop editing
- -

1.3 Bindings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BindingKeyboardDirectInputXInputOther
General
ConfirmReturn2AMouse Left
CancelEscape1BMouse X1, Phone Back
Next MenuSpace0YMouse X2
UpArrow UpHat UpD-pad Up
DownArrow DownHat DownD-pad Down
LeftArrow LeftHat LeftD-pad Left
RightArrow RightHat RightD-pad Right
Rotate CameraLeft Alt + Mouse Move0, 1Left StickMouse Middle, Two Finger Drag
Center CameraC10LS
Frame CounterP11RS
ChatTab8Back
Scroll2, 3Right Stick
Setup
Select Tile/Piece1 - 04/6, 5/7LB/LT, RB/RTMouse Wheel
Place/Move Tile/PieceReturn2AMouse Left
Remove Tile/PieceX3XMouse Right
Next StageSpace0YMouse X2
Previous StageEscape1BMouse X1
Match
Move PieceReturn2AMouse Left
Attack/FireX3XMouse Right
Favor Hasten14LB
Favor Assault26RB
Favor Conspire35LT
Favor Deceive47RT
Destroy ForestD9Start
End TurnSpace0YMouse X2
SurrenderS12Guide

2 Preferences

All preferences are stored in INI files.
If the game was built for Android or with the "EXTERNAL" define, it'll default to saving preferences outside of the game's directory.
- The locations are: + These external locations are:

@@ -398,6 +110,10 @@

2 Preferences

+ + + +
macOS Thrones.app/Contents/Resources
WebIndexed DB /data

Either behavior can be explicitly set by running the game with the "-e 0|1" option:

@@ -412,7 +128,7 @@

2 Preferences

2.1 Settings

-

Game client settings are stored in "settings.ini" and can be edited in the main menu and in the "Settings" menu.

+

Game client settings are stored in "setting.ini" and can be edited in the "Settings" menu.

Address

The server's address to connect to when clicking "Connect".

Port

@@ -500,6 +216,194 @@

Resolve family

Regular font

The standard font is Romanesque and the alternative is Merriweather, which supports a larger character set.

+

Key bindings

+

A table of all key bindings. The first column lists keyboard bindings, the second lists joystick bindings and the third lists gamepad bindings. A binding can be edited by left clicking the field or deleted by right clicking it. The plus buttons on the right can be used to add new key bindings.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UpMove the selection/cursor up. When editing text, jump to the start.
DownMove the selection/cursor down. When editing text, it can be used in combination with Alt to jump to the next word end or with Ctrl to jump to the end.
LeftMove the selection/cursor left. When editing text, jump to the end.
RightMove the selection/cursor right. When editing text, it can be used in combination with Alt to jump to the previous word start or with Ctrl to jump to the start.
Text backspaceDelete the left character when editing text. It can be used in combination with Alt to delete to the left word start or with Ctrl to delete everything to the left.
Text deleteDelete the right character when editing text. It can be used in combination with Alt to delete to the right word end or with Ctrl to delete everything to the right.
Text homeMove the cursor to the start when editing text.
Text endMove the cursor to the end when editing text.
Text pastePaste text from the clipboard when editing text. Must be used in combination with Ctrl when using a keyboard.
Text copyCopy all to clipboard when editing text. Must be used in combination with Ctrl when using a keyboard.
Text cutCut all to clipboard when editing text. Must be used in combination with Ctrl when using a keyboard.
Text revertRevert to the original when editing text. Must be used in combination with Ctrl when using a keyboard.
ConfirmPerform the current confirm action.
CancelPerform the current abort action.
FinishUse the finish button.
HastenToggle the hasten icon.
AssaultToggle the assault icon.
ConspireToggle the conspire icon.
DeceiveToggle the deceive icon.
Move cameraToggle moving the camera with the mouse.
Reset cameraReset the camera position.
EngageToggle the engage button.
DeleteDelete a tile or piece.
Destroy holdTurn the destroy button on or off.
Destroy toggleToggle the destroy button.
SurrenderUse the surrender button.
ChatToggle the chat overlay.
Frame counterCycle through the frame counter overlay's modes. Those being frames per second, tick duration in ms and off.
Select nextSelect the next icon.
Select prevSelect the previous icon.
Select 0Select the first icon.
Select 1Select the second icon.
Select 2Select the third icon.
Select 3Select the fourth icon.
Select 4Select the fifth icon.
Select 5Select the sixth icon.
Select 6Select the seventh icon.
Select 7Select the eighth icon.
Select 8Select the ninth icon.
Select 9Select the tenth icon.
Camera upMove the camera up.
Camera downMove the camera down.
Camera leftMove the camera left.
Camera rightMove the camera right.
Scroll upScroll the current menu's main list up.
Scroll downScroll the current menu's main list down.

2.2 Configurations

Game configurations are stored in "game.ini" and can be edited in the "Host" menu or when hosting a room on a server.

@@ -517,7 +421,7 @@

Homeland size

- + @@ -527,13 +431,19 @@

Homeland size

Battle win chance

Probability of winning a battle.

Fate's favor maximum

-

Can be set to a value in the range of 0 to 255. Its effect is described by "Fate's favor total".

+

Can be set to a value in the range of 0 to 16383. Its effect is described by "Fate's favor total".

Fate's favor total

If enabled, "Favor maximum" will be the limit of how many times each player can use each type of fate's favor in one match. If disabled, "Favor maximum" will be the limit of how many of each type of fate's favor each player can stock up.

+

First turn engage

+

Controls whether players can attack or fire during their first turn.

+

Terrain rules

+

Controls whether to use terrain related rules. This setting doesn't affect the breaching of tiles or rules inherent to the pieces' movement range.

Dragon place late

If enabled, dragons don't have to be placed during setup and can be placed later on homeland fortresses during the match.

Dragon move straight

If enabled, a dragon can only move in a straight line. Otherwise one move's steps will be treated separately and the dragon will use the shortest path to a destination.

+

Capturers

+

A list of pieces which will be able to capture a fortress. If the list is empty, it'll be filled with all piece types.

Homeland tiles

A list of the amounts of each player's homeland tiles. The minimum amount for each tile type other than a fortress is the homeland height and the maximum of each is the number of remaining free tiles. Sliders' ranges are set accordingly. The amount of fortresses is set to the amount of the remaining free tiles on a homeland. The number of fortresses is limited to "homeland_height * 2 + board_width - 2" and when exceeded, other tile amounts will be increased with the priority being the order of the listed tile types.

Fortresses captured

@@ -544,12 +454,10 @@

Pieces

A list of the amounts of each piece type per player. The total amount of pieces is limited to the range of 1 to the homeland tile count. If there's 0 pieces, the amount of thrones will be set to 1. The sliders work like the tile amount sliders.

Thrones killed

The number of enemy thrones that need to be killed in order to win. This number is limited to the number of a player's thrones. If both winning conditions are set to 0, this one will be set to 1. If the amount of thrones is set to 0, it'll be incremented and if the piece limit has been reached, one other piece amount will be decremented in turn, the priority being the reverse order of the listed piece types.

-

Capturers

-

A list of piece names which will be able to capture a fortress. If the list is empty, it'll be filled with all piece types.

2.3 Setups

- Game setups are stored in "setup.ini" and can be edited, saved and loaded in the "Host -> Setup" menu or during the in-game setup phase. The offline editor works the same as setting up a game online, except any checks for proper tile placement and such will be ignored.
+ Game setups are stored in "setup.ini" and can be edited, saved and loaded in the "Host -> Setup" menu or during the in-game setup phase. The offline editor works the same as setting up a game online, except any checks for proper tile and piece placement will be ignored.
When loading a setup, it only overwrites the current tiles/pieces of each stage when the loaded setup's corresponding stages' tile/piece data is present.
The same setup can be loaded for different configurations, but some tiles and pieces may not get placed due to exceeding limits.

@@ -608,6 +516,10 @@

3.2 Server

+ + + +
widthIs equal to the number of tile columns of the board. The minimum is 5 because each row has to have at least one of each tile's type plus a possible fortress and the maximum is 101.Is equal to the number of tile columns of the board. The minimum is 5 and the maximum is 101.
height -l <directory> write output to log files in the specified directory
-m <number>set the maximum number of kept log files (default is 8)

4 Game

@@ -617,9 +529,9 @@

4.1 Setup

The setup stage is a sequence of three phases of placing homeland tiles, middle row tiles and pieces.
Tiles/pieces can be placed by selecting an icon in the bottom panel and left click holding on a free tile and optionally dragging the cursor across other occupied tiles to replace them. A type can be selected by pressing the icon, using the mouse wheel or pressing a number key.
- It's possible to drag a tile/piece with the left mouse button and place it somewhere else or switch places with another. Tiles/pieces can be removed by using the "Delete" button or right click holding on them and possibly dragging the cursor onto other ones.
- Fortress tiles will be places automatically, where no tiles were placed.
- After the setup the host program determines the first player, the middle row tiles will be rearranged if necessary and the match starts. + It's possible to drag a tile/piece with the left mouse button and place it somewhere else or switch places with another. Tiles/pieces can be removed by using the "Delete" button or right click holding on them and optionally dragging the cursor across other ones.
+ Fortress tiles will be placed automatically, where no tiles were placed.
+ After the setup the middle row tiles will be rearranged if necessary and the match starts.

Buttons

@@ -663,9 +575,9 @@

Buttons

4.2 Match

- Pieces can be moved by dragging them with the left mouse button and whether they'll move or switch depends on the destination.
- Pieces can attack of fire by dragging them with the right mouse button or using the "Engage" button.
- A turn ends by pressing the according button button or when the limit of actions has been reached.
+ Pieces can be moved by dragging them with the left mouse button.
+ Pieces can attack or fire by dragging them with the right mouse button or using the "Engage" button.
+ A turn ends by pressing the according button or when the limit of actions has been reached.

Buttons

@@ -674,7 +586,7 @@

Buttons

- + @@ -697,6 +609,18 @@

Buttons

+ + + + + + + + + + + + diff --git a/doc/rules.html b/doc/rules.html index 7c50977a..db28a696 100644 --- a/doc/rules.html +++ b/doc/rules.html @@ -94,7 +94,7 @@

Actions

Terrain

Each tile affects how a piece interacts with the battlefield and its opponents..

- +
  • Pieces cannot attack from Mountains.
  • Mountains cannot be fired over.
  • Mountains and Forests cannot be fired onto.
  • @@ -102,7 +102,7 @@

    Terrain

  • Forests cannot be attacked by Dragons.
  • Pieces cannot fire from Forests or Water.
  • Water cannot be attacked.
  • - +

Fortresses

A piece occupying a Fortress tile has high walls and battlements keeping it safe. The piece cannot be engaged (attacked or fired on) until the Fortress is breached.

@@ -119,8 +119,8 @@

Fortresses

Battle

Pieces engage in battle for Fortresses, and the fog of war makes its outcome fearfully unclear. The attacker flips a coin, rolls a die, or uses the #2 method from “Gameplay” to discover if it wins or loses.

    -
  • Win the Battle with an even number: the attack/firing succeeds.
  • -
  • Lose the Battle with an odd number: the piece cannot fire this turn.
  • +
  • Win the Battle with an even number: the attack/firing succeeds.
  • +
  • Lose the Battle with an odd number: the piece cannot fire this turn.

If the battle is lost during an attack, your opponent may move that piece to any adjacent tile. In either loss, the player can attack, fire, or move and/or switch other pieces to finish the turn, or attack the Fortress again, if there is a piece capable of it.

@@ -155,7 +155,7 @@

Victory Points

  • Two players set their homelands up normally, but are not provided Fortresses.
  • After setup, 3 Fortresses are placed in the middle row, equidistant from each other, or randomized, based on preference.
  • At the end of each turn, a player gets 1 Victory Point for each Fortress they occupy with an allied piece
  • -
  • A total of 3 VP's per turn, if all three Forts are occupied, can be earned; the first player to 21 wins.
  • +
  • A total of 3 VPs per turn, if all three Forts are occupied, can be earned; the first player to 21 wins.
  • Ports

    @@ -168,9 +168,9 @@

    Homefront

    Exit the game.
    QuitSurrender Surrender to the opponent. If playing on a multi-room server, this button will just finish the match, rather than abort it and exit the room.
    Finish End the turn. Disabled for the first action of a turn.
    EstablishEstablish a farm or city.
    RebuildRebuild a breached/destroyed fortress/farm.
    SpawnRespawn a piece on the according tile.
    Fate's favor icons An icon can be selected to start a fate's favor and deselected to abort or finish it.