diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d782334..0d50130 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Build without game data on: push: - branches: [main] + branches: [main, assist/codex-0.2-launcher] pull_request: workflow_dispatch: workflow_call: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c9ff24..39c9bb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,14 +27,23 @@ jobs: path: dist merge-multiple: true - name: Create draft for review + shell: python env: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ github.ref_name }} run: | - for package in dist/*.zip; do - case "$(basename "$package")" in - OpenBMH-${RELEASE_TAG#v}-*.zip) ;; - *) echo "Release tag and package version differ" >&2; exit 1 ;; - esac - done - gh release create "$RELEASE_TAG" dist/*.zip --draft --verify-tag --title "OpenBMH $RELEASE_TAG" --notes-file docs/release/0.1/RELEASE_NOTES.md + import os, pathlib, re, subprocess + tag = os.environ['RELEASE_TAG'] + match = re.fullmatch(r'v([0-9]+)\.([0-9]+)\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?', tag) + if not match: + raise SystemExit('Invalid release tag') + notes = pathlib.Path('docs/release') / (match[1] + '.' + match[2]) / 'RELEASE_NOTES.md' + packages = sorted(pathlib.Path('dist').glob('*.zip')) + expected = {'OpenBMH-' + tag[1:] + '-' + kind + '.zip' + for kind in ('windows-x64', 'linux-x64', 'macos-arm64', 'source')} + if {p.name for p in packages} != expected: + raise SystemExit('Missing, unexpected or mismatched release package') + if not notes.is_file(): + raise SystemExit('Release notes missing for ' + tag) + subprocess.run(['gh', 'release', 'create', tag, *map(str, packages), '--draft', + '--verify-tag', '--title', 'OpenBMH ' + tag, '--notes-file', str(notes)], check=True) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52f1439..e6560e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,11 @@ # SPDX-License-Identifier: GPL-3.0-only cmake_minimum_required(VERSION 3.24) -project(OpenBMH VERSION 0.1.2 LANGUAGES CXX C) +project(OpenBMH VERSION 0.2.0 LANGUAGES CXX C) +if(APPLE) + enable_language(OBJC OBJCXX) + set(CMAKE_OBJCXX_STANDARD 20) + set(CMAKE_OBJCXX_STANDARD_REQUIRED ON) +endif() # the one place of the version: --version of both programs and the window title (src/version.hpp) add_compile_definitions(OPENBMH_VERSION="${PROJECT_VERSION}") @@ -196,6 +201,10 @@ bmh_add_data_test(NAME highscore_tests REQUIRED_OPTIONS BMH_TEST_HIGHSCORE_TESTS # Engine core: file formats and game logic, no platform dependencies add_library(bmhcore STATIC src/formats/binary.cpp + src/formats/content.cpp + src/formats/native_state.cpp + src/formats/native_file.cpp + src/cli/json.cpp src/formats/palette.cpp src/formats/vga.cpp src/formats/font.cpp @@ -264,10 +273,10 @@ else() target_compile_options(bmhcore PRIVATE -Wall -Wextra) endif() -add_executable(openbmh src/main.cpp) -target_link_libraries(openbmh PRIVATE bmhcore ${BMH_SDL_TARGET}) +add_executable(openbmh_inspect src/main.cpp) +target_link_libraries(openbmh_inspect PRIVATE bmhcore ${BMH_SDL_TARGET}) if(MSVC) - target_compile_options(openbmh PRIVATE /utf-8) + target_compile_options(openbmh_inspect PRIVATE /utf-8) endif() # --- Game data launcher (src/launch): find, unpack and check the original game data --------- @@ -317,6 +326,7 @@ endif() add_subdirectory(src/ui) add_subdirectory(src/import) +target_link_libraries(bmhui PUBLIC bmh_content) add_executable(driver_barrier_tests tests/driver_barrier_tests.cpp) target_link_libraries(driver_barrier_tests PRIVATE bmhcore) add_test(NAME driver_barrier_tests COMMAND driver_barrier_tests) @@ -439,10 +449,15 @@ add_executable(openbmh_play src/app/main.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) -target_link_libraries(openbmh_play PRIVATE bmhui bmhlaunch_dialog openbmh_audio ${BMH_SDL_TARGET}) +target_link_libraries(openbmh_play PRIVATE bmhui bmh_launcher bmhlaunch_dialog openbmh_audio ${BMH_SDL_TARGET}) # a game without a console window on double-click (SDL2main provides WinMain); started from a # console it attaches to that one for --version, --help and start errors (src/app/main.cpp) -set_target_properties(openbmh_play PROPERTIES WIN32_EXECUTABLE TRUE) +set_target_properties(openbmh_play PROPERTIES WIN32_EXECUTABLE TRUE OUTPUT_NAME OpenBMH) +if(CMAKE_CONFIGURATION_TYPES) + add_custom_command(TARGET openbmh_play POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/assets/launcher" + "$/assets/launcher") +endif() if(MSVC) target_compile_options(openbmh_play PRIVATE /utf-8) # App sources also compile in headless tests/helpers without target /utf-8. @@ -622,7 +637,7 @@ add_executable(openbmh_cli src/cli/seat_hub.cpp src/cli/json.cpp ${BMH_APP_SESSION_SOURCE}) -target_link_libraries(openbmh_cli PRIVATE bmhui bmhlaunch) +target_link_libraries(openbmh_cli PRIVATE bmh_launcher bmhui bmhlaunch) if(WIN32) target_link_libraries(openbmh_cli PRIVATE ws2_32) # --listen (Winsock) endif() @@ -1097,8 +1112,10 @@ bmh_add_data_test(NAME english_fixture_table_data_tests DATA_DIR "${BMH_ENGLISH_ COMMAND fixture_table_tests "${BMH_ENGLISH_DATA}") # Private build paths are inputs to the source-package tool, never shipped in its manifest. +FetchContent_GetProperties(rmlui) +FetchContent_GetProperties(freetype) set(package_dependencies "{}") -foreach(dependency IN ITEMS SDL2 miniz lzma_sdk nfd) +foreach(dependency IN ITEMS SDL2 miniz lzma_sdk nfd rmlui freetype) string(REPLACE "\\" "/" dependency_path "${${dependency}_SOURCE_DIR}") if(dependency STREQUAL "SDL2" AND sdl2_SOURCE_DIR) set(dependency_path "${sdl2_SOURCE_DIR}") diff --git a/README.md b/README.md index 7c6004b..f6366af 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A modern and faithful open source rebuild of the *Bundesliga Manager Hattrick* e OpenBMH is a standalone C++20 engine with an SDL2 interface for *Bundesliga Manager Hattrick* (1994/95) and its English edition, *Football Limited*. The project develops a playable reconstruction alongside a platform for new rules, content and interfaces. Keeping the familiar game enjoyable and making it easier to extend are equally important goals. -The engine reads a game installation supplied by the player. Game data, artwork, music, manuals and the original executable are not distributed with OpenBMH. Its aim is recognisable behaviour and plausible results; documented compatibility decisions and safety fixes take precedence over reproducing every original fault. +Version 0.2 imports a game installation supplied by the player into a portable Classic mod. The running game reads the converted OBW content. Game data, artwork, music, manuals and the original executable are not distributed with OpenBMH. Its aim is recognisable behaviour and plausible results; documented compatibility decisions and safety fixes take precedence over reproducing every original fault. This is an independent community project, with no affiliation with or endorsement by the original rights holders, the DFL or the Bundesliga. It is an engine implementation, not an official source release or a remaster. @@ -12,18 +12,26 @@ This is an independent community project, with no affiliation with or endorsemen Check the [releases page](https://github.com/Weyoune/openbmh/releases) for available packages and their platform notes. A Windows package uses the name `OpenBMH--windows-x64.zip`. Availability and native validation are stated for each release; source build instructions do not establish platform support on their own. -1. Have your own supported game installation available. -2. Extract the OpenBMH package into a separate directory, or alongside the game files. -3. Start `openbmh_play` (`openbmh_play.exe` on Windows). Select the game directory or executable when prompted. A ZIP or 7z containing one game installation can also be selected. +These instructions describe **0.2**, whose release packages are prepared separately from 0.1.2. See the [0.2 release notes](docs/release/0.2/RELEASE_NOTES.md). -From a terminal: +1. Extract OpenBMH into a writable directory. +2. Start `OpenBMH.exe` on Windows, or `OpenBMH` on Linux/macOS. Its RmlUI launcher initially has an empty **Name | Art** list. The night-stadium design uses a small version label in the lower-right corner. +3. Choose **Add**, select your own BMH or Football Limited installation, and enter a unique mod name and starting display year. The default names are `BMH-classic` and `FTDL-classic` (the English format identifier is `FLTD-classic`). +4. Optionally transfer saved games and settings from the installation or another folder. The import reports files it could not migrate. +5. Select the resulting Classic mod and choose **Start**. After import, its original installation is no longer needed for play. + +Converted contents live in `mods//content.obw` next to the program. Saves (`.obs`), settings (`.obsettings`), desktop layouts (`.oblayout`) and high scores (`.obscore`) live separately in `userdata//`. **Delete** asks before removing a mod and retains personal data; importing identical contents reconnects them. **Rename** renames the mod directory. Externally modified Classic packages are rejected; import the installation again to repair them. Keep backups of the portable directory. + +For direct startup or the console: ```sh -openbmh_play --data "path/to/game" --save-directory "path/to/saves" -openbmh_cli --console --data "path/to/game" --saves "path/to/saves" +./OpenBMH --mod "mods/BMH-classic/content.obw" +./openbmh_cli --console --mod "mods/BMH-classic/content.obw" ``` -Use a writable save directory and keep backups of existing games. German editions are the primary compatibility target. **Football Limited / English data support is experimental**; original V2.20 save import and some edition-specific behaviour remain limited. See the [0.1 release notes](docs/release/0.1/RELEASE_NOTES.md). +Both frontends use native content and saves. Use **Add** to migrate older files rather than passing an original executable or `.FBM` to the running game. The starting year changes the Classic year display; original weekday and scheduling rules are preserved. Modern worlds are reserved for a later version. + +The launcher uses SDL2, RmlUI and OpenGL 3.3 (macOS: OpenGL 4.1); keep its `assets` directory next to the executable. Folder selection uses the operating system's dialog. See the [0.2 migration contract](docs/formats/obw/runtime-0.2.md) for compatibility and validation limits. Interactive Windows and macOS behaviour must be checked on their target platforms before a 0.2 release. ## Features and direction @@ -31,11 +39,11 @@ The graphical client and console share career management, matches, transfers, co Version 0.1 establishes the playable engine and development interfaces. Later milestones introduce an open data format and typed model, configurable rules, a scalable interface and independently distributable content. These are goals rather than delivery dates; the [roadmap](docs/ROADMAP.md) describes their dependencies. -The standalone [`openbmh_import` tool](docs/formats/obw/import.md) converts BMH and Football Limited installations into **BMH-classic** / **FLTD-classic** OBW worlds, including media and frozen player portrait recipes. The content targets the versioned Classic adapter planned for 0.2; the 0.1 game does not load OBW. Savegame conversion is separate future work. The importer is built from current source and included in subsequent CI packages; it is absent from the already published 0.1.2 packages. +The standalone [`openbmh_import` tool](docs/formats/obw/import.md) produces the same complete Classic content packages, including media and frozen player portrait recipes. A mod directory contains its sealed `content.obw`; legacy save migration is performed through the launcher. ## Build from source -The following recipes target v0.1.2. They require Git, CMake 3.24 or newer and a C++20 compiler. The first configure fetches pinned open-source dependencies. Native build and package results are documented for each release; these instructions do not claim an untested platform result. +The following recipes target version 0.2. They require Git, CMake 3.24 or newer and a C++20 compiler. The first configure fetches pinned open-source dependencies. Native build and package results are documented for each release; these instructions do not claim an untested platform result. Clone the public repository, then run the commands for your system: @@ -52,7 +60,7 @@ Install Visual Studio 2022 or its Build Tools with **Desktop development with C+ cmake -S . -B build-windows -G "Visual Studio 17 2022" -A x64 cmake --build build-windows --config Release ctest --test-dir build-windows -C Release --output-on-failure -.\build-windows\Release\openbmh_play.exe --data "path/to/game" --save-directory "path/to/saves" +.\build-windows\Release\OpenBMH.exe ``` ### Linux @@ -64,7 +72,7 @@ sudo apt install build-essential git cmake ninja-build pkg-config libgtk-3-dev l cmake -S . -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release cmake --build build-linux ctest --test-dir build-linux --output-on-failure -./build-linux/openbmh_play --data "path/to/game" --save-directory "path/to/saves" +./build-linux/OpenBMH ``` Use a newer CMake if your distribution ships a version older than 3.24. A Linux binary can still require system libraries such as GTK3; a ZIP is not a guarantee of portability across distributions. @@ -79,7 +87,7 @@ brew install cmake ninja cmake -S . -B build-macos -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 cmake --build build-macos ctest --test-dir build-macos --output-on-failure -./build-macos/openbmh_play --data "path/to/game" --save-directory "path/to/saves" +./build-macos/OpenBMH ``` On Intel Macs omit the arm64 setting or select `x86_64`. These commands build terminal executables; they do not create a signed application bundle. @@ -105,6 +113,6 @@ The implementation grew from study of file formats and behaviour of a legally ob OpenBMH's own code and documentation are licensed under **GNU GPL version 3 only**, SPDX **GPL-3.0-only**. [LICENSE](LICENSE) contains the unchanged GPLv3 text; the example wording in its appendix does not change this project's version choice. Game content has separate ownership and is not covered by this license. -Release source is identified by the matching version tag: [v0.1.2](https://github.com/Weyoune/openbmh/tree/v0.1.2) for this version. Binary releases must accompany or offer the corresponding source and build/relinking materials required by the applicable licenses. The tag identifies application source; it does not replace required materials for linked third-party components. +Release source is identified by the matching version tag: [v0.1.2](https://github.com/Weyoune/openbmh/tree/v0.1.2) for the published 0.1.2 version. This branch develops 0.2; it is not a published release. Binary releases must accompany or offer the corresponding source and build/relinking materials required by the applicable licenses. The tag identifies application source; it does not replace required materials for linked third-party components. Bundled components retain their own licenses, including Nuked OPL3 under LGPL-2.1-or-later. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and [ACKNOWLEDGEMENTS.md](ACKNOWLEDGEMENTS.md). diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 6014a32..2b479bc 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -10,9 +10,14 @@ OpenBMH's own code and documentation use GPL-3.0-only. This does not replace the | [miniz](https://github.com/richgel999/miniz/releases/tag/3.0.2) | 3.0.2 amalgamation | MIT; embedded public-domain notices remain in its source | [miniz.txt](docs/licenses/miniz.txt), [source notices](docs/licenses/miniz-source-notices.txt) | | [LZMA SDK decoder files](https://github.com/ip7z/7zip/tree/24.09/C) | Selected C files from 7-Zip 24.09 | Public domain, as marked in the selected files | [LZMA-SDK.txt](docs/licenses/LZMA-SDK.txt) | | [nativefiledialog-extended](https://github.com/btzy/nativefiledialog-extended/tree/v1.2.1) | 1.2.1 | zlib license | [nativefiledialog-extended.txt](docs/licenses/nativefiledialog-extended.txt) | +| [RmlUi](https://github.com/mikke89/RmlUi/tree/6.3) | 6.3, Core and SDL2/OpenGL backend | MIT | [RmlUi.txt](docs/licenses/RmlUi.txt), [containers](docs/licenses/RmlUi-containers.txt), [Khronos notice](docs/licenses/RmlUi-Khronos.txt) | +| [FreeType](https://github.com/freetype/freetype/tree/VER-2-13-3) | 2.13.3 | FreeType License (FTL) | [license choices](docs/licenses/FreeType.txt), [FTL](docs/licenses/FreeType-FTL.txt), [BDF](docs/licenses/FreeType-BDF.txt), [PCF](docs/licenses/FreeType-PCF.txt), [internal gzip/zlib](docs/licenses/FreeType-zlib.txt) | +| LatoLatin Regular and Bold | Unmodified fonts included with RmlUi 6.3 | SIL Open Font License 1.1 | [font notices](docs/licenses/RmlUi-fonts.txt) | | [Nuked OPL3](https://github.com/nukeykt/Nuked-OPL3/tree/765ec962e473aeb767e4cba74ffdc8f588ffbfe8) | Commit `765ec962e473aeb767e4cba74ffdc8f588ffbfe8` | LGPL-2.1-or-later | [LGPL-2.1.txt](docs/licenses/LGPL-2.1.txt), [copyright and source notice](docs/licenses/Nuked-OPL3-notices.txt) | -The miniz implementation provides a zlib-compatible API; it is not the zlib library. OpenBMH does not directly link a separate zlib dependency. SDL2 and nativefiledialog-extended use the **zlib license**, which is distinct from using zlib code. A system-library build or distributor's package can have additional runtime dependencies; its notices must match the libraries actually included. +The miniz implementation provides a zlib-compatible API; it is not the zlib library. FreeType's internal gzip module includes its bundled zlib code; an external zlib library is not linked by the pinned build. SDL2 and nativefiledialog-extended use the **zlib license**, which is distinct from using zlib code. A system-library build or distributor's package can have additional runtime dependencies; its notices must match the libraries actually included. + +Portions of this software are copyright © the FreeType Project (www.freetype.org). All rights reserved. The pinned build uses the FreeType License option, with the included module notices retained. RmlUi and FreeType are linked statically; their corresponding pinned source is included in the source package. Only the public-domain C decoding subset is taken from the 7-Zip source package. This statement does not describe all of 7-Zip: other parts of that upstream project have different licenses and are not included here. diff --git a/assets/launcher/launcher.rml b/assets/launcher/launcher.rml new file mode 100644 index 0000000..94671dd --- /dev/null +++ b/assets/launcher/launcher.rml @@ -0,0 +1,45 @@ + + + + OpenBMH + + + + +
+
+
+
OpenBMH
+
+
+
+

Deine Spiele

+
Bundesliga Manager Hattrick · Football Limited
+
+
NameArt
+
+
+
0 Mods
+
+
+ + + + + +
+
+
+
+