https://wiki.vcmi.eu/api.php?action=feedcontributions&user=Kambala&feedformat=atomVCMI Project Wiki - User contributions [en]2024-03-29T14:09:56ZUser contributionsMediaWiki 1.28.2https://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3612Installation on iOS2023-08-09T20:04:14Z<p>Kambala: /* Game controls */</p>
<hr />
<div>You can run VCMI on iOS 12.0 and later, all devices are supported. If you wish to run on iOS 10 or 11, you should build from source, see [[How to build VCMI (iOS)]].<br />
<br />
== Download and install VCMI ==<br />
<br />
The latest release (recommended): https://github.com/vcmi/vcmi/releases/latest<br />
<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* ''[Easiest way]'' [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* if you're on iOS 14.0-15.4.1, you can try https://github.com/opa334/TrollStore<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/tugger-code-signing Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
<br />
''Note: if you don't need in-game videos, you can omit downloading/copying file VIDEO.VID from data folder - it will save your time and space. The same applies to the Mp3 directory.''<br />
<br />
=== Installing data files with Finder or Windows explorer ===<br />
<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
=== Installing data files using iOS device only ===<br />
<br />
If you have data somewhere on device or in shared folder or you have downloaded it, you can copy it directly on your iPhone/iPad using Files application.<br />
<br />
Just move/copy '''Data''', '''Maps''' and '''Mp3''' folders into vcmi application - it will be visible in Files along with other applications' folders.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select your device<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* before v1.3: Pinch with 2 fingers = spacebar (visit current object)<br />
* Tap in the bottom area (status bar) to activate chat/console in the game<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3547Installation on iOS2023-03-08T07:11:12Z<p>Kambala: update link to cross-platform signing tool</p>
<hr />
<div>You can run VCMI on iOS 12.0 and later, all devices are supported. If you wish to run on iOS 10 or 11, you should build from source, see [[How to build VCMI (iOS)]].<br />
<br />
== Download and install VCMI ==<br />
<br />
The latest release (recommended): https://github.com/vcmi/vcmi/releases/latest<br />
<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* ''[Easiest way]'' [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* if you're on iOS 14.0-15.4.1, you can try https://github.com/opa334/TrollStore<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/tugger-code-signing Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
<br />
''Note: if you don't need in-game videos, you can omit downloading/copying file VIDEO.VID from data folder - it will save your time and space. The same applies to the Mp3 directory.''<br />
<br />
=== Installing data files with Finder or Windows explorer ===<br />
<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
=== Installing data files using iOS device only ===<br />
<br />
If you have data somewhere on device or in shared folder or you have downloaded it, you can copy it directly on your iPhone/iPad using Files application.<br />
<br />
Just move/copy '''Data''', '''Maps''' and '''Mp3''' folders into vcmi application - it will be visible in Files along with other applications' folders.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select your device<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = spacebar (visit current object)<br />
* Tap in the bottom area (status bar) to activate chat/console in the game<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Linux/MinGW)&diff=3544How to build VCMI (Linux/MinGW)2023-03-02T19:14:54Z<p>Kambala: Created page with "We use Conan package manager to cross-build from Linux to Windows, find detailed usage instructions with example [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md here]..."</p>
<hr />
<div>We use Conan package manager to cross-build from Linux to Windows, find detailed usage instructions with example [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md here].<br />
<br />
Old manual how to use MXE: [[How_to_build_VCMI_(Linux/Cmake/MXE)]]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Main_Page&diff=3543Main Page2023-03-02T19:12:21Z<p>Kambala: </p>
<hr />
<div>__NOTOC__<br />
= Welcome to VCMI Project Wiki =<br />
<br />
[[VCMI]] is an open-source project aiming to reimplement HMM3:WoG and SoD game engines, giving it new and extended possibilities.<br />
<br />
== Latest release ==<br />
As of 23th of December 2022, we released [https://github.com/vcmi/vcmi/releases/tag/1.1.0 VCMI 1.1.0]. Now we plan to have releases 1-2 times per year. Daily builds are still available at [https://builds.vcmi.download/branch/develop/ builds.vcmi.download] but they are not guaranteed to be stable. So we encourage everybody to use them and report found bugs so that we can fix them.<br/><br />
Loading saves made with different version of VCMI is usually not supported, so you may want to finish your ongoing games before updating.<br/><br />
Please see corresponding "installation on" articles for details for your platform.<br/><br />
<br />
== Documentation and guidelines for users ==<br />
* [[VCMI | General information about VCMI Project]]<br />
* [[Frequently asked questions]]<br />
* [[Engine features]]<br />
* [[Game mechanics]]<br />
* [[Bug reporting guidelines]]<br />
* [[Mod list]]<br />
* [[Cheat codes]]<br />
* [[Installation]] guides:<br />
** [[Installation on Windows|Windows]]<br />
** [[Installation on macOS|macOS]]<br />
** [[Installation on Linux|Linux]]<br />
** [[Installation on Android|Android]]<br />
** [[Installation on iOS|iOS]]<br />
<br />
== Documentation and guidelines for modders ==<br />
* [[Modding guidelines]]<br />
* [[Mods repository]]<br />
* Formats:<br />
** [[Mod file Format]]<br />
** [[Town Format]]<br />
** [[Hero Classes Format]]<br />
** [[Hero Format]]<br />
** [[Creature Format]]<br />
** [[Artifact Format]]<br />
** [[Animation Format]]<br />
** [[Bonus Format]]<br />
** [[Object Format]]<br />
** [[Spell Format]]<br />
** [[Skill Format]]<br />
<br />
* [[User:AVS/Scripting|Upcoming scripting support]]<br />
<br />
== Documentation and guidelines for developers ==<br />
* How to build using CMake:<br />
** [[How_to_build_VCMI_(Linux)|Linux]]<br />
** [[How_to_build_VCMI_(Linux/MinGW)|Linux/MinGW (for Windows)]]<br />
** [[How_to_build_VCMI_(macOS)|macOS]]<br />
** [[How_to_build_VCMI_(Windows/Vcpkg)|Windows]]<br />
** [[How to build VCMI (iOS)|iOS]]<br />
** [[How to build VCMI (Android)| Android]]<br />
* Unsupported build instructions:<br />
** [[How_to_build_VCMI_(Windows/Visual_Studio_2015)|Windows/MSVS (Visual Studio 2015)]]<br />
* [[Coding guidelines]]<br />
* [[Code structure]]<br />
* [[Logging API]]<br />
* [[Bug tracker usage]]<br />
* [[TODO list]]<br />
* [[Project status]]<br />
* Development environment guides:<br />
** [[Development with Qt Creator]]<br />
<br />
== VCMI Places ==<br />
* [https://vcmi.eu/ Website]<br />
* [https://forum.vcmi.eu/ Forum]<br />
* [https://bugs.vcmi.eu/ Bugtracker]<br />
* [https://slack.vcmi.eu/ Slack invite page]<br />
* [https://github.com/vcmi/vcmi GitHub repository]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Main_Page&diff=3542Main Page2023-03-02T18:09:33Z<p>Kambala: added Android page</p>
<hr />
<div>__NOTOC__<br />
= Welcome to VCMI Project Wiki =<br />
<br />
[[VCMI]] is an open-source project aiming to reimplement HMM3:WoG and SoD game engines, giving it new and extended possibilities.<br />
<br />
== Latest release ==<br />
As of 23th of December 2022, we released [https://github.com/vcmi/vcmi/releases/tag/1.1.0 VCMI 1.1.0]. Now we plan to have releases 1-2 times per year. Daily builds are still available at [https://builds.vcmi.download/branch/develop/ builds.vcmi.download] but they are not guaranteed to be stable. So we encourage everybody to use them and report found bugs so that we can fix them.<br/><br />
Loading saves made with different version of VCMI is usually not supported, so you may want to finish your ongoing games before updating.<br/><br />
Please see corresponding "installation on" articles for details for your platform.<br/><br />
<br />
== Documentation and guidelines for users ==<br />
* [[VCMI | General information about VCMI Project]]<br />
* [[Frequently asked questions]]<br />
* [[Engine features]]<br />
* [[Game mechanics]]<br />
* [[Bug reporting guidelines]]<br />
* [[Mod list]]<br />
* [[Cheat codes]]<br />
* [[Installation]] guides:<br />
** [[Installation on Windows|Windows]]<br />
** [[Installation on macOS|macOS]]<br />
** [[Installation on Linux|Linux]]<br />
** [[Installation on Android|Android]]<br />
** [[Installation on iOS|iOS]]<br />
<br />
== Documentation and guidelines for modders ==<br />
* [[Modding guidelines]]<br />
* [[Mods repository]]<br />
* Formats:<br />
** [[Mod file Format]]<br />
** [[Town Format]]<br />
** [[Hero Classes Format]]<br />
** [[Hero Format]]<br />
** [[Creature Format]]<br />
** [[Artifact Format]]<br />
** [[Animation Format]]<br />
** [[Bonus Format]]<br />
** [[Object Format]]<br />
** [[Spell Format]]<br />
** [[Skill Format]]<br />
<br />
* [[User:AVS/Scripting|Upcoming scripting support]]<br />
<br />
== Documentation and guidelines for developers ==<br />
* How to build using CMake:<br />
** [[How_to_build_VCMI_(Linux)|Linux]]<br />
** [[How_to_build_VCMI_(Linux/Cmake/MXE)|Linux/MXE (for Windows)]]<br />
** [[How_to_build_VCMI_(macOS)|macOS]]<br />
** [[How_to_build_VCMI_(Windows/Vcpkg)|Windows]]<br />
** [[How to build VCMI (iOS)|iOS]]<br />
** [[How to build VCMI (Android)| Android]]<br />
* Unsupported build instructions:<br />
** [[How_to_build_VCMI_(Windows/Visual_Studio_2015)|Windows/MSVS (Visual Studio 2015)]]<br />
* [[Coding guidelines]]<br />
* [[Code structure]]<br />
* [[Logging API]]<br />
* [[Bug tracker usage]]<br />
* [[TODO list]]<br />
* [[Project status]]<br />
* Development environment guides:<br />
** [[Development with Qt Creator]]<br />
<br />
== VCMI Places ==<br />
* [https://vcmi.eu/ Website]<br />
* [https://forum.vcmi.eu/ Forum]<br />
* [https://bugs.vcmi.eu/ Bugtracker]<br />
* [https://slack.vcmi.eu/ Slack invite page]<br />
* [https://github.com/vcmi/vcmi GitHub repository]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Android)&diff=3541How to build VCMI (Android)2023-03-02T18:08:36Z<p>Kambala: </p>
<hr />
<div>The following instructions apply to '''v1.2 and later'''. For earlier versions the best documentation is https://github.com/vcmi/vcmi-android/blob/master/building.txt (and reading scripts in that repo), however very limited to no support will be provided from our side if you wish to go down that rabbit hole.<br />
<br />
''Note'': building has been tested only on Linux and macOS. It may or may not work on Windows out of the box.<br />
<br />
== Requirements ==<br />
# CMake 3.20+: download from your package manager or from https://cmake.org/download/<br />
# JDK 11, not necessarily from Oracle<br />
# Android command line tools or Android Studio for your OS: https://developer.android.com/studio/<br />
# Android NDK version '''r25c (25.2.9519653)''', there're multiple ways to obtain it:<br />
#* install with Android Studio<br />
#* install with <code>sdkmanager</code> command line tool<br />
#* download from https://developer.android.com/ndk/downloads<br />
#* download with Conan, see [[#NDK and Conan]]<br />
# (optional) Ninja: download from your package manager or from https://github.com/ninja-build/ninja/releases<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
We use Conan package manager to build/consume dependencies, find detailed usage instructions [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md here]. Note that the link points to the cutting-edge state in <code>develop</code> branch, for the latest release check the same document in the [https://github.com/vcmi/vcmi/tree/master/docs/conan.md master branch].<br />
<br />
On the step where you need to replace '''PROFILE''', choose:<br />
* <code>android-32</code> to build for 32-bit architecture (armeabi-v7a)<br />
* <code>android-64</code> to build for 64-bit architecture (aarch64-v8a)<br />
<br />
=== NDK and Conan ===<br />
Conan must be aware of the NDK location when you execute <code>conan install</code>. There're multiple ways to achieve that as written in the [https://docs.conan.io/1/integrations/cross_platform/android.html Conan docs]:<br />
* the easiest is to download NDK from Conan (option 1 in the docs), then all the magic happens automatically. You need to create your own Conan profile that imports our Android profile and adds 2 new lines (you can of course just copy everything from our profile into yours without including) and then pass this new profile to <code>conan install</code>:<br />
<nowiki>include(/path/to/vcmi/CI/conan/android-64)<br />
[tool_requires]<br />
android-ndk/r25c</nowiki><br />
* to use an already installed NDK, you can simply pass it on the command line to <code>conan install</code>:<br />
<nowiki>conan install -c tools.android:ndk_path=/path/to/ndk ...</nowiki><br />
<br />
== Build process ==<br />
Building for Android is a 2-step process. First, native C++ code is compiled to a shared library (unlike executable on other platforms), then Java code is compiled to an actual executable which will be loading the native shared library at runtime.<br />
<br />
=== C++ code ===<br />
This is a traditional CMake project, you can build it from command line or some IDE. You're not required to pass any custom options (except Conan toolchain file), defaults are already good. If you wish to use your own CMake presets, inherit them from our <code>build-with-conan</code> preset. Example:<br />
<br />
<nowiki>cmake -S . -B ../build -G Ninja -D CMAKE_BUILD_TYPE=Debug --toolchain ...<br />
cmake --build ../build</nowiki><br />
<br />
You can also see a more detailed walkthrough on CMake configuration at [[How to build VCMI (macOS)#Configuring project for building]].<br />
<br />
=== Java code ===<br />
After the C++ part is built, native shared libraries are copied to the appropriate location of the Java project (they will be packaged in the APK). You can either open the Java project located in <code>android</code> directory of the repo in Android studio and work with it as with any Android project or build from command line.<br />
<br />
Example how to build from command line in Bash shell, assumes that current working directory is VCMI repository:<br />
<nowiki># the following environment variables must be set<br />
export JAVA_HOME=/path/to/jdk11<br />
export ANDROID_HOME=/path/to/android/sdk<br />
<br />
cd android<br />
./gradlew assembleDebug</nowiki><br />
<br />
APK will appear in <code>android/vcmi-app/build/outputs/apk/debug</code> directory which you can then install to your device with <code>adb install -r /path/to/apk</code> (adb command is from Android command line tools).<br />
<br />
If you wish to build and install to your device in single action, use <code>installDebug</code> instead of <code>assembleDebug</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Android)&diff=3540How to build VCMI (Android)2023-03-02T18:07:40Z<p>Kambala: </p>
<hr />
<div>The following instructions apply to '''v1.2 and later'''. For earlier versions the best documentation is https://github.com/vcmi/vcmi-android/blob/master/building.txt (and reading scripts in that repo), however very limited to no support will be provided from our side if you wish to go down that rabbit hole.<br />
<br />
''Note'': building has been tested only on Linux and macOS. It may or may not work on Windows out of the box.<br />
<br />
== Requirements ==<br />
# CMake 3.20+: download from your package manager or from https://cmake.org/download/<br />
# Android command line tools or Android Studio for your OS: https://developer.android.com/studio/<br />
# JDK 11, not necessarily from Oracle<br />
# Android NDK version '''r25c (25.2.9519653)''', there're multiple ways to obtain it:<br />
#* install with Android Studio<br />
#* install with <code>sdkmanager</code> command line tool<br />
#* download from https://developer.android.com/ndk/downloads<br />
#* download with Conan, see [[#NDK and Conan]]<br />
# (optional) Ninja: download from your package manager or from https://github.com/ninja-build/ninja/releases<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
We use Conan package manager to build/consume dependencies, find detailed usage instructions [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md here]. Note that the link points to the cutting-edge state in <code>develop</code> branch, for the latest release check the same document in the [https://github.com/vcmi/vcmi/tree/master/docs/conan.md master branch].<br />
<br />
On the step where you need to replace '''PROFILE''', choose:<br />
* <code>android-32</code> to build for 32-bit architecture (armeabi-v7a)<br />
* <code>android-64</code> to build for 64-bit architecture (aarch64-v8a)<br />
<br />
=== NDK and Conan ===<br />
Conan must be aware of the NDK location when you execute <code>conan install</code>. There're multiple ways to achieve that as written in the [https://docs.conan.io/1/integrations/cross_platform/android.html Conan docs]:<br />
* the easiest is to download NDK from Conan (option 1 in the docs), then all the magic happens automatically. You need to create your own Conan profile that imports our Android profile and adds 2 new lines (you can of course just copy everything from our profile into yours without including) and then pass this new profile to <code>conan install</code>:<br />
<nowiki>include(/path/to/vcmi/CI/conan/android-64)<br />
[tool_requires]<br />
android-ndk/r25c</nowiki><br />
* to use an already installed NDK, you can simply pass it on the command line to <code>conan install</code>:<br />
<nowiki>conan install -c tools.android:ndk_path=/path/to/ndk ...</nowiki><br />
<br />
== Build process ==<br />
Building for Android is a 2-step process. First, native C++ code is compiled to a shared library (unlike executable on other platforms), then Java code is compiled to an actual executable which will be loading the native shared library at runtime.<br />
<br />
=== C++ code ===<br />
This is a traditional CMake project, you can build it from command line or some IDE. You're not required to pass any custom options (except Conan toolchain file), defaults are already good. If you wish to use your own CMake presets, inherit them from our <code>build-with-conan</code> preset. Example:<br />
<br />
<nowiki>cmake -S . -B ../build -G Ninja -D CMAKE_BUILD_TYPE=Debug --toolchain ...<br />
cmake --build ../build</nowiki><br />
<br />
You can also see a more detailed walkthrough on CMake configuration at [[How to build VCMI (macOS)#Configuring project for building]].<br />
<br />
=== Java code ===<br />
After the C++ part is built, native shared libraries are copied to the appropriate location of the Java project (they will be packaged in the APK). You can either open the Java project located in <code>android</code> directory of the repo in Android studio and work with it as with any Android project or build from command line.<br />
<br />
Example how to build from command line in Bash shell, assumes that current working directory is VCMI repository:<br />
<nowiki># the following environment variables must be set<br />
export JAVA_HOME=/path/to/jdk11<br />
export ANDROID_HOME=/path/to/android/sdk<br />
<br />
cd android<br />
./gradlew assembleDebug</nowiki><br />
<br />
APK will appear in <code>android/vcmi-app/build/outputs/apk/debug</code> directory which you can then install to your device with <code>adb install -r /path/to/apk</code> (adb command is from Android command line tools).<br />
<br />
If you wish to build and install to your device in single action, use <code>installDebug</code> instead of <code>assembleDebug</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Android)&diff=3539How to build VCMI (Android)2023-02-28T07:26:45Z<p>Kambala: Created page with "TODO"</p>
<hr />
<div>TODO</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3533How to build VCMI (iOS)2023-02-08T17:43:30Z<p>Kambala: note about cpack output extension</p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
There're 2 ways to get prebuilt dependencies:<br />
<br />
* [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md Conan package manager] - recommended. Note that the link points to the cutting-edge state in <code>develop</code> branch, for the latest release check the same document in the [https://github.com/vcmi/vcmi/tree/master/docs/conan.md master branch].<br />
* [https://github.com/vcmi/vcmi-ios-deps legacy manually built libraries] - can be used if you have Xcode 11/12 or to build for simulator / armv7 device<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* (if using legacy dependencies) <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're a few [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device (Conan and legacy dependencies) and for simulator, named <code>ios-device-conan</code>, <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device with Conan:<br />
<nowiki>cmake --preset ios-device-conan \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device-conan</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release-conan</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate file with extension '''ipa''' if you use CMake 3.25+ and '''zip''' otherwise (simply change extension to ipa).</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3532Installation on iOS2023-02-08T16:39:35Z<p>Kambala: </p>
<hr />
<div>You can run VCMI on iOS 12.0 and later, all devices are supported. If you wish to run on iOS 10 or 11, you should build from source, see [[How to build VCMI (iOS)]].<br />
<br />
== Download and install VCMI ==<br />
<br />
The latest release (recommended): https://github.com/vcmi/vcmi/releases/latest<br />
<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* ''[Easiest way]'' [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* if you're on iOS 14.0-15.4.1, you can try https://github.com/opa334/TrollStore<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
<br />
''Note: if you don't need in-game videos, you can omit downloading/copying file VIDEO.VID from data folder - it will save your time and space. The same applies to the Mp3 directory.''<br />
<br />
=== Installing data files with Finder or Windows explorer ===<br />
<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
=== Installing data files using iOS device only ===<br />
<br />
If you have data somewhere on device or in shared folder or you have downloaded it, you can copy it directly on your iPhone/iPad using Files application.<br />
<br />
Just move/copy '''Data''', '''Maps''' and '''Mp3''' folders into vcmi application - it will be visible in Files along with other applications' folders.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select your device<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = spacebar (visit current object)<br />
* Tap in the bottom area (status bar) to activate chat/console in the game<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Windows/Vcpkg)&diff=3520How to build VCMI (Windows/Vcpkg)2023-01-03T15:03:26Z<p>Kambala: [VCMI_DIR] -> %VCMI_DIR%</p>
<hr />
<div>= Prerequisites =<br />
* Windows Vista or newer.<br />
* Microsoft Visual Studio [https://www.visualstudio.com/vs/older-downloads/ 2017] or [http://www.visualstudio.com/downloads/download-visual-studio-vs 2019]<br />
* CI use VS2019, so you are going to have less problems with it.<br />
* Git or git GUI, for example, SourceTree [http://www.sourcetreeapp.com/download download]<br />
* CMake [https://cmake.org/download/ download]. During install after accepting license agreement make sure to check "Add CMake to the system PATH for all users".<br />
* To unpack pre-build Vcpkg: [http://www.7-zip.org/download.html 7-zip]<br />
* To create installer: [http://nsis.sourceforge.net/Main_Page NSIS]<br />
<br />
= Choose directory =<br />
<br />
Create a directory for VCMI development, eg. '''C:\VCMI'''<br />
We will call this directory '''%VCMI_DIR%'''<br />
<br />
'''Warning!''' Replace '''%VCMI_DIR%''' with path you chosen in following commands of this instruction.<br />
<br />
== How to choose good directory ==<br />
<br />
It is recommended to avoid non-ascii characters in the path to your working folders. The folder should not be write-protected by system. <br />
Good location:<br />
* '''C:\VCMI'''<br />
Bad locations:<br />
* '''C:\Users\Michał\VCMI''' (non-ascii character)<br />
* '''C:\Program Files (x86)\VCMI''' (write protection)<br />
<br />
= Install dependencies =<br />
<br />
You have two options: to use pre-built libraries or build your own. We strongly recommend start with using pre-built ones.<br />
<br />
== Option A. Use pre-built Vcpkg ==<br />
So you decide to start using Vcpkg packages pre-built by VCMI team.<br />
<br />
Package guaranteed to work since they tested with every commit by [https://github.com/vcmi/vcmi/actions GitHub Actions]. <br />
=== Download and unpack archive ===<br />
<br />
Archives are available from GitHub: https://github.com/vcmi/vcmi-deps-windows/releases<br />
<br />
Only download latest version available.<br />
<br />
* vcpkg-export-'''x86'''-windows-v140.7z to build for 32-bit no debug, 3 times smaller file size<br />
* vcpkg-export-'''x64'''-windows-v140.7z to build for 64-bit no debug, 3 times smaller file size<br />
* vcpkg-export-'''x86'''-windows-v140-debug.7z to build for 32-bit with debug configuration available<br />
* vcpkg-export-'''x64'''-windows-v140-debug.7z to build for 64-bit with debug configuration available<br />
<br />
Extract archive by right clicking on it and choosing "7-zip -> Extract Here".<br />
<br />
=== Move dependencies to target directory ===<br />
<br />
Once extracted "vcpkg" directory will appear with "installed" and "scripts" inside it.<br />
<br />
Move extracted "vcpkg" directory into your '''%VCMI_DIR%'''.<br />
<br />
== Option B. Build Vcpkg on your own ==<br />
Please be aware that if you're running 32-bit Windows version, then this is impossible due to https://github.com/microsoft/vcpkg/issues/26036<br />
<br />
Be aware that building Vcpkg might take a lot of time depend on your CPU model and 10-20GB of disk space.<br />
=== Create initial directory ===<br />
<br />
=== Clone vcpkg ===<br />
<br />
# open SourceTree<br />
# File -> Clone<br />
# select '''https://github.com/microsoft/vcpkg/''' as source<br />
# select '''%VCMI_DIR%/vcpkg''' as destination<br />
# click '''Clone'''<br />
<br />
From command line use:<br />
<pre><br />
git clone https://github.com/microsoft/vcpkg.git %VCMI_DIR%/vcpkg<br />
</pre><br />
<br />
=== Build vcpkg ===<br />
* Run <br />
<pre><br />
%VCMI_DIR%/vcpkg/bootstrap-vcpkg.bat<br />
</pre><br />
<br />
=== Build dependencies ===<br />
* For 32-bit build run:<br />
<pre><br />
%VCMI_DIR%/vcpkg/vcpkg.exe install tbb:x64-windows fuzzylite:x64-windows sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer[mpg123]:x64-windows boost:x64-windows qt5-base:x64-windows ffmpeg:x64-windows luajit:x64-windows<br />
</pre><br />
* For 64-bit build run<br />
<pre><br />
%VCMI_DIR%/vcpkg/vcpkg.exe install install tbb:x86-windows fuzzylite:x86-windows sdl2:x86-windows sdl2-image:x86-windows sdl2-ttf:x86-windows sdl2-mixer[mpg123]:x86-windows boost:x86-windows qt5-base:x86-windows ffmpeg:x86-windows luajit:x86-windows<br />
</pre><br />
<br />
For the list of the packages used you can also consult [https://github.com/vcmi/vcmi-deps-windows vcmi-deps-windows readme] in case this article gets outdated a bit.<br />
<br />
= Build VCMI =<br />
<br />
== Clone VCMI ==<br />
# open SourceTree<br />
# File -> Clone<br />
# select '''https://github.com/vcmi/vcmi/''' as source<br />
# select '''%VCMI_DIR%/source''' as destination<br />
# expand Advanced Options and change Checkout Branch to "develop"<br />
# tick Recursive submodules<br />
# click '''Clone'''<br />
<br />
or From command line use:<br />
<pre><br />
git clone --recursive https://github.com/vcmi/vcmi.git %VCMI_DIR%/source<br />
</pre><br />
<br />
== Generate solution for VCMI ==<br />
# create '''%VCMI_DIR%/build''' folder<br />
# open '''%VCMI_DIR%/build''' in command line:<br />
## Run Command Prompt or Power Shell.<br />
## Execute: cd %VCMI_DIR%/build<br />
# execute one of following commands to generate project<br />
<br />
'''Visual Studio 2017 - 32-bit build'''<br />
<pre><br />
cmake %VCMI_DIR%/source -DCMAKE_TOOLCHAIN_FILE=%VCMI_DIR%/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017"<br />
</pre><br />
<br />
'''Visual Studio 2017 - 64-bit build'''<br />
<pre><br />
cmake %VCMI_DIR%/source -DCMAKE_TOOLCHAIN_FILE=%VCMI_DIR%/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"<br />
</pre><br />
<br />
'''Visual Studio 2019 - 32-bit build'''<br />
<pre><br />
cmake %VCMI_DIR%/source -DCMAKE_TOOLCHAIN_FILE=%VCMI_DIR%/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A Win32<br />
</pre><br />
<br />
'''Visual Studio 2019 - 64-bit build'''<br />
<pre><br />
cmake %VCMI_DIR%/source -DCMAKE_TOOLCHAIN_FILE=%VCMI_DIR%/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A x64<br />
</pre><br />
<br />
== Compile VCMI with Visual Studio ==<br />
# open '''%VCMI_DIR%/build/VCMI.sln''' in Visual Studio<br />
# select "Release" build type in combobox<br />
# right click on '''BUILD_ALL''' project - build project. This BUILD_ALL project should be in "CMakePredefinedTargets" tree in Solution Explorer.<br />
# grab VCMI in '''%VCMI_DIR%/build/bin''' folder!<br />
<br />
== Compile VCMI from command line ==<br />
<br />
'''For release build'''<br />
<pre><br />
cmake --build %VCMI_DIR%/build --config Release<br />
</pre><br />
<br />
'''For debug build'''<br />
<pre><br />
cmake --build %VCMI_DIR%/build --config Debug<br />
</pre><br />
Debug will be used by default even "--config" if not specified.<br />
<br />
= Create VCMI installer =<br />
Make sure NSIS is installed to default directory or have registry entry so CMake can find it.<br />
<br />
After you build VCMI execute following commands from '''%VCMI_DIR%/build'''.<br />
=== Execute following if you built for Release: ===<br />
<pre><br />
cpack<br />
</pre><br />
=== If you built for Debug: ===<br />
<pre><br />
cpack -C Debug<br />
</pre><br />
<br />
= Troubleshooting and workarounds =<br />
Vcpkg might be very unstable due to limited popularity and fact of using bleeding edge packages (such as most recent Boost). Using latest version of dependencies could also expose both problems in VCMI code or library interface changes that developers not checked yet. So if you're built Vcpkg yourself and can't get it working please try to use binary package.<br />
<br />
Pre-built version we provide is always manually tested with all supported versions of MSVC for both Release and Debug builds and all known quirks are listed below.<br />
<br />
=== VCMI won't run since some library is missing ===<br />
<br />
'''If you open solution using vcmi.sln'''<br />
Try to build INSTALL target and see if its output works as expected. Copy missing libraries or even all libraries from there to your build directory. Or run cpack and use produced installer and see if you can get libs from there. cpack -V will give more info. If cpack complains that it can not find dumpbin try Visual Studio Command Prompt (special version of cmd provided with Visual Studio with additional PATH) or modify PATH to have this tool available. Another alternative if you use prebuilt vcpkg package is to download latest msvc build, install it and copy missing/all libraries from there.<br />
<br />
=== Debug build is very slow ===<br />
<br />
Debug builds with MSVC are generally extremely slow since it's not just VCMI binaries are built as debug, but every single dependency too and this usually means no optimizations at all. Debug information that available for release builds is often sufficient so just avoid full debug builds unless absolutely necessary. Instead use RelWithDebInfo configuration. Also Debug configuration might have some compilation issues because it is not checked via CI for now.<br />
<br />
=== I got crash within library XYZ.dll ===<br />
<br />
VCPKG generated projects quite often have both debug and regular libs available to linker so it can select wrong lib. For stable RelWithDebInfo build you may try to remove debug folder from VCPKG/installed/x64-windows. Same is done on CI. Also it reduces package size at least twice.<br />
<br />
=== Some outdated problems ===<br />
<br />
All problems of such kind should be solved with proper cmake INSTALL code.<br />
<br />
'''Build is successful but can not start new game'''<br />
<br />
Check that all non-VCMI dlls in AI and Scripting (vcmilua.dll and vcmierm.dll) folders are also copied to the parent folder so that they are available for vcmi_clent.exe. These are tbb.dll fuzzylite.dll lua51.dll. Also there should be as well folder scripts (lua scripts for ERM). If scripting folder is absent please build vcmiLua and vcmiErm projects. There is no direct dependency between them and vcmi_client for now (2021-08-28)</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3515Installation on macOS2022-12-27T10:33:07Z<p>Kambala: removed obsolete section about deleting quarantine attribute</p>
<hr />
<div>'''For iOS installation look here: https://wiki.vcmi.eu/Installation_on_iOS'''<br />
<br />
= Download and install VCMI =<br />
<br />
* The latest release (recommended): https://github.com/vcmi/vcmi/releases/latest<br />
* Daily builds (might be unstable)<br />
** Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
** Apple Silicon (arm64) builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
If the app doesn't open, right-click the app bundle - select ''Open'' menu item - press ''Open'' button.<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
# Find a way to unpack Windows Heroes III or GOG installer. For example, use <code>vcmibuilder</code> script inside app bundle or install the game with [https://www.codeweavers.com/crossover CrossOver] / [https://github.com/Gcenx/WineskinServer Wineskin].<br />
# Copy (or symlink) '''Data''', '''Maps''' and '''Mp3''' directories from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre><br />
<br />
= Connect to the mod repository (optional) =<br />
* If that's your first installation, connection to the mod repository will be configured automatically, you'll see mods available to install from VCMI launcher<br />
** We recommend you to install VCMI extras to support different screen resolutions and active various helpful UI tools<br />
** If you don't see mods available to install, go to settings tab of the launcher and make sure that you have correct link in "repositories" text field:<br />
*** https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_Apple&diff=3505Installation on Apple2022-12-23T18:48:32Z<p>Kambala: </p>
<hr />
<div>VCMI supports macOS and iOS.<br />
See proper installation guide:<br />
<br />
* [[Installation on macOS]]<br />
* [[Installation on iOS]]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Linux/Cmake/MXE)&diff=3501How to build VCMI (Linux/Cmake/MXE)2022-12-23T09:02:59Z<p>Kambala: remove explicit tests disabling - they're off by default</p>
<hr />
<div>= Compiling VCMI for Windows on Linux =<br />
Some developers may want to make Windows builds without dealing with dependencies as it may be headache when you're on Windows. It's possible to setup own cross-compiler toolkit that use MinGW, but that take time and skill. Fortunately there is project called [http://mxe.cc/ MXE (M cross environment)] that make cross compilation easy and work out of box for our engine.<br />
<br />
= Precompiled build from CI =<br />
In order to speed up MXE compilation time on CI we use precompiled MXE packages. Assuming that MXE is already installed.<br />
<br />
<pre><br />
# Install nsis for cpack<br />
sudo apt-get install nsis<br />
<br />
#we might need this a bit outdated version of ssl<br />
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb<br />
sudo apt install ./libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb<br />
<br />
# Clone VCMI repository with submodules<br />
git clone --depth 1 --recursive https://github.com/vcmi/vcmi.git<br />
<br />
mkdir build<br />
cd build<br />
<br />
# MXE repository was too slow for Travis far too often<br />
wget -nv https://github.com/vcmi/vcmi-deps-mxe/releases/download/2021-02-20/mxe-i686-w64-mingw32.shared-2021-01-22.tar<br />
tar -xvf mxe-i686-w64-mingw32.shared-2021-01-22.tar<br />
sudo dpkg -i mxe-*.deb<br />
sudo apt-get install -f --yes<br />
<br />
# build<br />
sudo apt-get install ninja-build<br />
<br />
/usr/lib/mxe/usr/bin/mxe-i686-w64-mingw32.shared-cmake -G Ninja ../vcmi -DCMAKE_BUILD_TYPE=Release<br />
ninja<br />
<br />
# pack an installer, on CI works with regular cmake's cpack.<br />
cpack -C Release -D CPACK_NSIS_EXECUTABLE=`which makensis`<br />
</pre><br />
<br />
The full actual list of used MXE packages could be found [https://github.com/vcmi/vcmi-deps-mxe/blob/master/mirror-mxe.sh here]<br />
<br />
= Setting up a MXE cross compiler =<br />
Make sure cmake and git is installed on your system as well as all libraries and utils [http://mxe.cc/#requirements listed under requirements]. MXE website have commands that will let install everything needed for almost every distribution.<br />
<br />
Once it done [http://mxe.cc/#download clone MXE repository using git].<br />
<br />
<pre>git clone https://github.com/mxe/mxe.git</pre><br />
<br />
Now just run make once to generate "settings.mk" file and then cancel build immediately with Ctrl+C:<br />
<br />
<pre>make</pre><br />
<br />
Then you need to edit "settings.mk" file:<br />
<pre># "settings.mk" not exist by default<br />
# You can create it by running "make" and then aborting it by Ctrl+C<br />
#<br />
# Uncomment "MXE_TARGETS" and make it look like that:<br />
MXE_TARGETS := i686-w64-mingw32.shared<br />
<br />
# You can add this line to plugins if you want MXE to use GCC6<br />
# This is currently break NSIS though<br />
#override MXE_PLUGIN_DIRS += plugins/gcc6<br />
<br />
# And you can add following packages list<br />
LOCAL_PKG_LIST := gcc boost zlib sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf ffmpeg minizip qtbase qt intel-tbb nsis # but also we need mxe-i686-w64-mingw32.static-luajit for ERM support<br />
# Make sure to uncomment two lines under the list<br />
.DEFAULT_GOAL := local-pkg-list<br />
local-pkg-list: $(LOCAL_PKG_LIST)<br />
</pre><br />
<br />
Then you can compile it:<br />
<pre>make -j 9</pre><br />
Depend on your hardware that may take from 20 minutes to more than hour.<br />
<br />
= Compiling VCMI using MXE =<br />
First of all create two directories: one for CMake (vcmi-cmake) and other for result build (vcmi-build). Now build would looks like that:<br />
<pre># Clone VCMI repository with submodules<br />
git clone --depth 1 --recursive https://github.com/vcmi/vcmi.git<br />
<br />
# Create CMake directory and cd into it<br />
mkdir vcmi-cmake && cd vcmi-cmake<br />
<br />
# To configure build with launcher:<br />
/home/test/mxe/usr/bin/i686-w64-mingw32.shared-cmake ../vcmi<br />
<br />
# Compile<br />
/home/test/mxe/usr/bin/i686-w64-mingw32.shared-cmake --build . -- -j 9<br />
<br />
# To create installer<br />
# MXE have own patched CPack that allow to pass path to makensis as option.<br />
/home/test/mxe/usr/bin/i686-w64-mingw32.shared-cpack -D CPACK_NSIS_EXECUTABLE=/home/test/mxe/usr/bin/i686-w64-mingw32.shared-makensis<br />
</pre><br />
<br />
= Script for automatic builds =<br />
If you want to have automatic build you can grab script that automatically compile and upload builds using MXE.<br />
<br />
*[https://gist.github.com/ArseniyShestakov/39261e5d268cd7c021b0 Download it from Github Gist].</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Linux)&diff=3500How to build VCMI (Linux)2022-12-23T09:00:59Z<p>Kambala: update for 1.1</p>
<hr />
<div>= Compiling VCMI =<br />
* Current baseline requirement for building is Ubuntu 14.04<br />
* Supported C++ compilers for UNIX-like systems are GCC 4.8+ and Clang 3.4+<br />
<br />
Older distributions and compilers might work, but they aren't tested by [https://travis-ci.org/vcmi/vcmi/ Travis CI]<br />
<br />
= Installing dependencies =<br />
<br />
== Prerequisites ==<br />
<br />
To compile, the following packages (and their development counterparts) are needed to build:<br />
* CMake 3.10 or newer<br />
* SDL2 with devel packages: mixer, image, ttf<br />
* zlib and zlib-devel<br />
* Optional, if you want to build launcher: Qt 5, widget and network modules<br />
* Optional FFmpeg libraries, if you want to watch in-game videos: libavformat and libswscale. Their name could be libavformat-devel and libswscale-devel, or ffmpeg-libs-devel or similar names.<br />
* Boost C++ libraries v1.48+: program-options, filesystem, system, thread, locale<br />
* Optional, if you want to build scripting modules: LuaJIT<br />
<br />
== On Debian-based systems (e.g. Ubuntu) ==<br />
<br />
For Ubuntu 22.04 (jammy) or newer you need to install this list of packages, including '''libtbb2-dev''':<br />
<pre><br />
sudo apt-get install cmake g++ libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-locale-dev qtbase5-dev libtbb2-dev libluajit-5.1-dev<br />
</pre><br />
<br />
For Ubuntu 21.10 (impish) or older and all versions of Debian (9 stretch - 11 bullseye) you need to install this list of packages, including '''libtbb-dev''':<br />
<pre><br />
sudo apt-get install cmake g++ libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-locale-dev qtbase5-dev libtbb-dev libluajit-5.1-dev<br />
</pre><br />
<br />
Alternatively if you have VCMI installed from repository or PPA you can use:<br />
<pre><br />
sudo apt-get build-dep vcmi<br />
</pre><br />
<br />
== On RPM-based distributions (e.g. Fedora) ==<br />
<br />
<pre><br />
sudo yum install cmake gcc-c++ SDL2-devel SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs qt5-qtbase-devel tbb-devel luajit-devel<br />
</pre><br />
<br />
NOTE:<br />
<br />
The ffmpeg-devel 4.2.2-5 on Fedora 32 installs headers under /usr/include/ffmpeg/. Therefore the compiler would not be able to pick up correct headers unless they are put under /usr/include. To workaround this issue, simply create soft links to require headers:<br />
<br />
<pre><br />
sudo mkdir -p /usr/include/libavformat/<br />
sudo ln -sf /usr/include/ffmpeg/libavformat/* /usr/include/libavformat/<br />
sudo mkdir -p /usr/include/libavcodec/<br />
sudo ln -sf /usr/include/ffmpeg/libavcodec/* /usr/include/libavcodec/<br />
sudo mkdir -p /usr/include/libavutil<br />
sudo ln -sf /usr/include/ffmpeg/libavutil/* /usr/include/libavutil<br />
sudo mkdir -p /usr/include/libswscale<br />
sudo ln -sf /usr/include/ffmpeg/libswscale/* /usr/include/libswscale/<br />
</pre><br />
<br />
There is PR https://github.com/vcmi/vcmi/pull/635 to address this issue. Once merged, the workaround is no needed anymore.<br />
<br />
== On Arch-based distributions ==<br />
On Arch-based distributions, there is a development package available for VCMI on the AUR.<br />
<br />
It can be found at: https://aur.archlinux.org/packages/vcmi-git/<br />
<br />
Information about building packages from the Arch User Repository (AUR) can be found at the Arch wiki.<br />
<br />
== Manual Installation ==<br />
<br />
For older OS versions the latest prerequisite packages may not be readily available via the system installer. Some brief instructions for manual install are given below (tested on Ubuntu 14.04, update version numbers as desired).<br />
<br />
* CMake (see also https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line/865294)<br />
<pre><br />
wget https://cmake.org/files/v3.11/cmake-3.11.0.tar.gz<br />
tar xfz cmake-3.11.0.tar.gz<br />
cd cmake-3.11.0<br />
./bootstrap<br />
make -j2<br />
sudo checkinstall --pkgname cmake --pkgversion 3.11.0 -y<br />
</pre><br />
Note: Will only be visible in new terminals. Test with cmake --version.<br />
<br />
* Boost (see also https://ubuntuforums.org/showthread.php?t=1180792)<br />
<pre><br />
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz<br />
tar xfz boost_1_66_0.tar.gz<br />
cd boost_1_66_0<br />
./bootstrap.sh --with-libraries=program-options,filesystem,system,thread,locale<br />
./b2<br />
sudo ./b2 install<br />
</pre><br />
Note: Boost 1.66.0 produces a bug in asio.hpp when used with old gcc versions (see https://svn.boost.org/trac10/ticket/13368).<br />
<br />
* GCC (for Ubuntu - compile from source is lengthy)<br />
<pre><br />
sudo add-apt-repository ppa:ubuntu-toolchain-r/test<br />
sudo apt-get update<br />
sudo apt-get install gcc-7 g++-7<br />
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7<br />
</pre><br />
Note: Test with gcc --version (and g++ --version).<br />
<br />
* Clang (for Ubuntu 14.04 - for later versions first line is not needed, and 'trusty' should be replaced with version name)<br />
<pre><br />
sudo add-apt-repository ppa:ubuntu-toolchain-r/test<br />
sudo add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main"<br />
sudo apt-get update<br />
sudo apt-get install clang-6.0<br />
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-6.0<br />
</pre><br />
Note: Test with clang --version (and clang++ --version).<br />
<br />
= Getting the sources = <br />
<br />
VCMI is still in development. We recommend the following initial directory structure:<br />
<pre><br />
.<br />
├── vcmi -> contains sources and is under git control<br />
└── build -> contains build output, makefiles, object files,...<br />
</pre><br />
<br />
You can get latest sources with:<br />
<pre><br />
git clone -b develop --depth 1 --recursive https://github.com/vcmi/vcmi.git<br />
</pre><br />
<br />
= Compilation =<br />
<br />
== Configuring Makefiles ==<br />
<pre><br />
mkdir build && cd build<br />
cmake ../vcmi<br />
<br />
# Additional options that you may want to use:<br />
## To enable debugging:<br />
cmake ../vcmi -DCMAKE_BUILD_TYPE=Debug<br />
</pre><br />
'''Notice''':<br />
The ../vcmi/ is not a typo, it will place makefile scripts into the build dir as the build dir is your working dir when calling CMake.<br />
<br />
== Trigger build ==<br />
<pre><br />
cmake --build . -- -j2<br />
# -j2 = compile with 2 threads, you can specify any value<br />
</pre><br />
That will generate vcmiclient, vcmiserver, vcmilauncher as well as 4 .so libraries in '''build/bin/''' directory.<br />
<br />
= Package building =<br />
<br />
== RPM package ==<br />
<br />
The first step is to prepare a RPM build environment. On Fedora systems you can follow this guide: http://fedoraproject.org/wiki/How_to_create_an_RPM_package#SPEC_file_overview<br />
<br />
1. Download the file rpm/vcmi.spec from any tagged VCMI release for which you wish to build a RPM package via the SVN Browser trac at this URL for example(which is for VCMI 0.9): http://sourceforge.net/apps/trac/vcmi/browser/tags/0.9/rpm/vcmi.spec<br />
<br />
2. Copy the file to ~/rpmbuild/SPECS<br />
<br />
3. Follow instructions in the vcmi.spec. You have to export the corresponding SVN tag, compress it to a g-zipped archive and copy it to ~/rpmbuild/SOURCES. Instructions are written as comments and you can copy/paste commands into terminal.<br />
<br />
4. Go to ~/rpmbuild/SPECS and open terminal in this folder and type: <pre>rpmbuild -ba vcmi.spec (this will build rpm and source rpm)</pre><br />
<br />
5. Generated RPM is in folder ~/rpmbuild/RPMS<br />
<br />
If you want to package the generated RPM above for different processor architectures and operating systems you can use the tool mock. Moreover, it is necessary to install mock-rpmfusion_free due to the packages ffmpeg-devel and ffmpeg-libs which aren't available in the standard RPM repositories(at least for Fedora). Go to ~/rpmbuild/SRPMS in terminal and type:<br />
<pre>mock -r fedora-17-i386-rpmfusion_free path_to_source_RPM<br />
mock -r fedora-17-x86_64-rpmfusion_free path_to_source_RPM</pre><br />
<br />
Available root environments and their names are listed in /etc/mock.<br />
== Debian/Ubuntu ==<br />
1. Install debhelper and devscripts packages<br />
<br />
2. Run dpkg-buildpackage command from vcmi source directory<br />
<pre><br />
sudo apt-get install debhelper devscripts<br />
cd /path/to/source<br />
dpkg-buildpackage<br />
</pre><br />
To generate packages for different architectures see "-a" flag of dpkg-buildpackage command<br />
<br />
== Documentation ==<br />
<br />
To compile using Doxygen, the UseDoxygen CMake module must be installed. It can be fetched from: http://tobias.rautenkranz.ch/cmake/doxygen/<br />
<br />
Once UseDoxygen is installed, run:<br />
<pre><br />
cmake .<br />
make doc<br />
</pre><br />
<br />
The built documentation will be available from ./doc</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3499How to build VCMI (iOS)2022-12-23T08:35:46Z<p>Kambala: update for 1.1</p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
There're 2 ways to get prebuilt dependencies:<br />
<br />
* [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md Conan package manager] - recommended. Note that the link points to the cutting-edge state in <code>develop</code> branch, for the latest release check the same document in the [https://github.com/vcmi/vcmi/tree/master/docs/conan.md master branch].<br />
* [https://github.com/vcmi/vcmi-ios-deps legacy manually built libraries] - can be used if you have Xcode 11/12 or to build for simulator / armv7 device<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* (if using legacy dependencies) <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're a few [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device (Conan and legacy dependencies) and for simulator, named <code>ios-device-conan</code>, <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device with Conan:<br />
<nowiki>cmake --preset ios-device-conan \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device-conan</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release-conan</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3498How to build VCMI (macOS)2022-12-23T08:25:58Z<p>Kambala: update for 1.1</p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools (aka CLT): <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
Please find detailed instructions in [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md VCMI repository]. Note that the link points to the cutting-edge state in <code>develop</code> branch, for the latest release check the same document in the [https://github.com/vcmi/vcmi/tree/master/docs/conan.md master branch].<br />
<br />
On the step where you need to replace '''PROFILE''', choose:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an Apple Silicon Mac: <code>macos-arm</code><br />
<br />
Note: if you wish to build 1.0 release in non-<code>Release</code> configuration, you should define <code>USE_CONAN_WITH_ALL_CONFIGS=1</code> environment variable when executing <code>conan install</code>.<br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# If you want to watch in-game videos, also install FFmpeg: <code>brew install ffmpeg@4</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, '''don't press Return'''<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your directory choice<br />
#* Homebrew: if you installed FFmpeg or Qt 5, you need to pass <code>-D "CMAKE_PREFIX_PATH="</code> variable. See below what you can insert after <code>=</code> (but '''before the closing quote'''), multiple values must be separated with <code>;</code> (semicolon):<br />
#** if you installed FFmpeg, insert <code>$(brew --prefix ffmpeg@4)</code><br />
#** if you installed Qt 5 from Homebrew, insert: <code>$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, insert your path to Qt directory, for example: <code>/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example for FFmpeg + Qt 5: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory></code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
If you use Conan, it's expected that you use '''conan-generated''' directory at step 4 of [[#Conan package manager]].<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=VCMI&diff=3479VCMI2022-10-22T10:19:43Z<p>Kambala: added 1.0 release</p>
<hr />
<div>== About VCMI ==<br />
The purpose of VCMI project is to rewrite the entire HOMM 3: SoD and WoG engines from scratch, giving it new and extended possibilities. We hope to support mods and new towns already made by fans but abandoned because of game code limitations.<br />
<br />
VCMI is a fan-made [https://github.com/vcmi/vcmi open-source] project in progress. We already allow support for maps of any sizes, higher resolutions and extended engine limits. Currently the game is playable, especially in single player mode, but there are still some bugs and missing features. <br />
<br />
VCMI is not yet a standalone program, it uses files and graphics from the original game. You need to have a version of Heroes 3 to [[Installation|install]] the files from ([https://www.gog.com/game/heroes_of_might_and_magic_3_complete_edition such as the one provided by GoG]).<br />
<br />
== What VCMI is NOT ==<br />
VCMI is <em>not</em> another mod.<br />
It does not aim to add new content or modify original mechanics. However, in the future it will be a base for other projects which do so.<br />
<br />
== Progress ==<br />
Below are listed major features that are implemented, not implemented or original to VCMI. For an exact list of implemented objects, artifacts, spells and so on, please check [http://spreadsheets.google.com/ccc?key=pRhYM0YkAF9lIpLe4raNAWA the VCMI Item Implementation Status spreadsheet].<br />
<br />
=== What is done ===<br />
<ul><br />
<li> Support for HoMM 3 graphics and maps</li><br />
<li> Choosing scenario options</li><br />
<li> Adventure map and interactions with all objects</li><br />
<li> Support for non-standard screen resolutions</li><br />
<li> Complete Town interface</li><br />
<li> Hero and Hero Meeting windows</li><br />
<li> Kingdom overview window</li><br />
<li> Battle interface (handling most spells)</li><br />
<li> Basic battle AI</li><br />
<li> Basic adventure AI</li><br />
<li> Campaigns</li><br />
<li> Hot-seat mode</li><br />
<li> Victory and loss conditions</li><br />
<li> Alliances</li><br />
<li> Stack Experience, Commanders</li><br />
<li> Mod support (including new towns, creatures and artifacts)</li><br />
<li> Random map generators</li><br />
<li> Network game (largely untested but two-players should work)</li><br />
</ul><br />
<br />
=== What is still missing (see [[TODO list]]) ===<br />
<ul><br />
<li> Possibly cheat-proof multiplayer mode</li><br />
<li> Many of [[WoG]] features, like Mithril</li><br />
<li> Scripting engine</li><br />
<li> Lots of minor features</li><br />
<li> AI town defense<ref>https://bugs.vcmi.eu/view.php?id=2987#c7611</ref></li><br />
</ul><br />
<br />
=== New engine features ===<br />
<ul><br />
<li> <strong>Higher resolutions</strong> (1024x600, 1024x768, 1280x800, 1280x960, 1280x1024, 1366x768, 1440x900, 1600x1200, 1680x1080 and 1920x1080): resolution can be selected from the launcher.</li><br />
<li> <strong>Stack turn order queue</strong>: queue of stacks similar to Heroes V (although it doesn't follow its initiative mechanism). To toggle it on/off just press Q while in battle.</li><br />
</ul><br />
<br />
== Timeline ==<br />
* May 2007 - Project started<br />
* Jun 08 2007 - VCMI 0.1 released<br />
* Aug 06 2007 - VCMI 0.2 released<br />
* Oct 24 2007 - VCMI 0.3 released<br />
* Dec 29 2007 - VCMI 0.4 released<br />
* Feb 01 2008 - VCMI forum set up<br />
* Feb 02 2008 - VCMI 0.5 released<br />
* Feb 23 2008 - Project has been publicly announced, VCMI 0.54 released<br />
* Jun 01 2008 - VCMI 0.6 released<br />
* Feb 01 2009 - Project becomes open-source, VCMI 0.7 released<br />
* Oct 01 2009 - VCMI bugtracker set up<br />
* Mar 01 2010 - VCMI 0.8 released<br />
* Apr 01 2010 - VCMI wiki opened<br />
* Oct 01 2012 - VCMI 0.9 released<br />
* Nov 01 2014 - VCMI 0.97 released<br />
* Apr 01 2015 - VCMI 0.98 released<br />
* Nov 01 2016 - VCMI 0.99 released<br />
* 2016 - 2021 Further development and bugfixing, there are daily builds available after every new feature or fix<br />
* Sep 11 2022 - VCMI 1.0 released<br />
<br />
== References ==<br />
<references/></div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3478Installation on iOS2022-10-19T10:14:54Z<p>Kambala: </p>
<hr />
<div>You can run VCMI on iOS 12.0 and later, all devices are supported. If you wish to run on iOS 10 or 11, you should build from source, see [[How to build VCMI (iOS)]].<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select your device<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3477Installation on macOS2022-10-19T10:02:30Z<p>Kambala: </p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* The latest release (recommended): https://github.com/vcmi/vcmi/releases/latest<br />
* Daily builds (might be unstable)<br />
** Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
** Apple Silicon (arm64) builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
If the app doesn't open:<br />
* if error message says something like ''VCMI is damaged and must be moved to Trash'', then open Terminal, paste the following command and press Return (note that you might have other path than ''/Applications/VCMI.app''):<br />
<nowiki>xattr -d com.apple.quarantine /Applications/VCMI.app</nowiki><br />
* otherwise, right-click the app bundle - select ''Open'' menu item - press ''Open'' button<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
# Find a way to unpack Windows Heroes III or GOG installer. For example, use <code>vcmibuilder</code> script inside app bundle or install the game with [https://www.codeweavers.com/crossover CrossOver] / [https://github.com/Gcenx/WineskinServer Wineskin].<br />
# Copy (or symlink) '''Data''', '''Maps''' and '''Mp3''' directories from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre><br />
<br />
= Connect to the mod repository (optional) =<br />
* If that's your first installation, connection to the mod repository will be configured automatically, you'll see mods available to install from VCMI launcher<br />
** We recommend you to install VCMI extras to support different screen resolutions and active various helpful UI tools<br />
** If you don't see mods available to install, go to settings tab of the launcher and make sure that you have correct link in "repositories" text field:<br />
*** https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3475How to build VCMI (iOS)2022-10-17T11:47:48Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
There're 2 ways to get prebuilt dependencies:<br />
<br />
* [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md Conan package manager] - recommended<br />
* [https://github.com/vcmi/vcmi-ios-deps legacy manually built libraries] - can be used if you have Xcode 11/12 or to build for simulator / armv7 device<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* (if using legacy dependencies) <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're a few [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device (Conan and legacy dependencies) and for simulator, named <code>ios-device-conan</code>, <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device with Conan:<br />
<nowiki>cmake --preset ios-device-conan \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device-conan</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release-conan</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3474How to build VCMI (macOS)2022-10-17T11:46:29Z<p>Kambala: point to Conan docs in the repo</p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools (aka CLT): <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
Please find detailed instructions in [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md VCMI repository].<br />
<br />
On the step where you need to replace '''PROFILE''', choose:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an Apple Silicon Mac: <code>macos-arm</code><br />
<br />
Note: if you wish to build 1.0 release in non-<code>Release</code> configuration, you should define <code>USE_CONAN_WITH_ALL_CONFIGS=1</code> environment variable when executing <code>conan install</code>.<br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, '''don't press Return'''<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your directory choice<br />
#** (only if building 1.0 release) If you're on an Apple Silicon Mac, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory></code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
If you use Conan, it's expected that you use '''conan-generated''' directory at step 4 of [[#Conan package manager]].<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3473How to build VCMI (iOS)2022-10-17T11:15:55Z<p>Kambala: added info about Conan</p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
There're 2 ways to get prebuilt dependencies:<br />
<br />
* [https://github.com/vcmi/vcmi/tree/develop/docs/conan.md Conan package manager] - recommended<br />
* [https://github.com/vcmi/vcmi-ios-deps legacy manually built libraries] - can be used to build for armv7 device or for simulator<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* (if using legacy dependencies) <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're a few [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device (Conan and legacy dependencies) and for simulator, named <code>ios-device-conan</code>, <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device with Conan:<br />
<nowiki>cmake --preset ios-device-conan \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device-conan</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release-conan</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3468Installation on iOS2022-09-30T06:06:16Z<p>Kambala: updated info about minimum iOS version</p>
<hr />
<div>You can run VCMI on iOS 12.0 and later, all devices are supported. If you wish to run on iOS 10 or 11, you should build from source, see [[How to build VCMI (iOS)]].<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
Note: currently iOS doesn't support music in mp3 format. If you want to listen to game music, convert mp3 to ogg, e.g. with FFmpeg. Place the ogg files in the "Mp3" directory.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select your device<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Code_structure&diff=3467Code structure2022-09-26T15:28:41Z<p>Kambala: document wrapped namespace used in single-process approach</p>
<hr />
<div>The code of VCMI is divided into several main parts: client, server, lib and AIs, each one in a separate binary file.<br />
<br />
= The big picture =<br />
<br />
[[File:Architektura.png|center]]<br />
<br />
VCMI contains three core projects: VCMI_lib (dll / so), VCMI_client (executable) and VCMI_server (executable). <br />
[[Server]] handles all [[game mechanics]] and events. [[Client]] presents [[game state]] and events to player and collects input from him.<br />
<br />
During the game, we have one (and only one) server and one or more (one for each player computer) clients. <br />
<br />
Important: State of the game and its mechanics are synchronized between clients and server. All changes to the game state or mechanics must be done by server which will send appropriate notices to clients.<br />
<br />
== Game state ==<br />
It's basically CGameState class object and everything that's accessible from it: map (with objects), player statuses, game options, etc.<br />
<br />
== Bonus system ==<br />
One of the more important pieces of VCMI is the [[bonus system]]. It's described in a separate article.<br />
<br />
== Configuration ==<br />
<br />
Most of VCMI configuration files uses Json format and located in "config" directory<br />
<br />
=== [[Json parser and writer]] ===<br />
<br />
= Client =<br />
<br />
== Main purposes of client ==<br />
<br />
[[Client]] is responsible for:<br />
* displaying state of game to human player<br />
* capturing player's actions and sending requests to server<br />
* displaying changes in state of game indicated by server<br />
<br />
== Rendering of graphics ==<br />
<br />
Rendering of graphics relies heavily on SDL. Currently we do not have any wrapper for SDL internal structures and most of rendering is about blitting surfaces using SDL_BlitSurface. We have a few function that make rendering easier or make specific parts of rendering (like printing text). They are places in client/SDL_Extensions and client/SDL_Framerate (the second one contains code responsible for keeping appropriate framerate, it should work more smart than just SDL_Delay(miliseconds)). In rendering, Interface object system is quite helpful. Its base is CIntObject class that is basically a base class for our library of GUI components and other objects.<br />
<br />
=== Video player ===<br />
<br />
Located in client/VideoHandler.cpp/.h, have several platform-specific versions:<br />
* For 32-bit Windows - using original 32-bit libraries (binkw32.dll, smackw32.dll)<br />
* For *nix systems - using ffmpeg libraries.<br />
* Empty player for 64-bit Windows<br />
<br />
=== [[Primitive controls]] ===<br />
<br />
== [[Adventure map interface]] ==<br />
<br />
TBD<br />
<br />
== [[Town interface]] ==<br />
<br />
TBD<br />
<br />
== [[Battle interface]] ==<br />
<br />
= Server =<br />
<br />
== Main purposes of server ==<br />
<br />
[[Server]] is responsible for:<br />
* maintaining state of the game<br />
* handling requests from all clients participating in game<br />
* informing all clients about changes in state of the game that are visible to them<br />
<br />
= Lib =<br />
<br />
== Main purposes of lib ==<br />
VCMI_Lib is a library that contains code common to server and client, so we avoid it's duplication.<br />
Important: the library code is common for client and server and used by them, but the library instance (in opposition to the library as file) is not shared by them! Both client and server create their own "copies" of lib with all its class instances.<br />
<br />
iOS platform pioneered single process build, where server is a static library and not a dedicated executable. For that to work, the lib had to be wrapped into special namespace that is defined by client and server targets on iOS, so that single process is able to contain 2 versions of the library. To make it more convenient, a few macros were introduced that can be found in [https://github.com/vcmi/vcmi/blob/develop/Global.h Global.h]. The most important ones are <code>VCMI_LIB_NAMESPACE_BEGIN</code> and <code>VCMI_LIB_NAMESPACE_END</code> which must be used anywhere a symbol from the lib is needed, otherwise building iOS (or any other platform that would use single process approach) fails. See [[#Wrapped namespace examples]].<br />
<br />
[[Lib]] contains code responsible for:<br />
* handling most of Heroes III files (.lod, .txt setting files)<br />
* storing information common to server and client like state of the game<br />
* managing armies, buildings, artifacts, spells, bonuses and other game objects<br />
* handling general game mechanics and related actions (only adventure map objects; it's an unwanted remnant of past development - all game mechanics should be handled by the server)<br />
* networking and serialization<br />
<br />
=== [[Serialization]] ===<br />
The serialization framework can serialize basic types, several standard containers among smart pointers and custom objects. Its design is based on the [http://www.boost.org/doc/libs/1_52_0/libs/serialization/doc/index.html boost serialization libraries]. In addition to the basic functionality it provides light-weight transfer of CGObjectInstance objects by sending only the index/id. <br />
<br />
See the [[Serialization]] page for all the details.<br />
<br />
=== Wrapped namespace examples ===<br />
<br />
==== Inside the lib ====<br />
Both header and implementation of a new class inside the lib should have the following structure:<br />
<nowiki><includes><br />
VCMI_LIB_NAMESPACE_BEGIN<br />
<code><br />
VCMI_LIB_NAMESPACE_END</nowiki><br />
<br />
Example: [https://github.com/vcmi/vcmi/blob/develop/lib/CBuildingHandler.h header] and [https://github.com/vcmi/vcmi/blob/develop/lib/CBuildingHandler.cpp implementation]<br />
<br />
==== Headers outside the lib ====<br />
Forward declarations of the lib in headers of other parts of the project need to be wrapped in the macros:<br />
<nowiki><includes><br />
VCMI_LIB_NAMESPACE_BEGIN<br />
<lib forward declarations><br />
VCMI_LIB_NAMESPACE_END<br />
<other forward declarations><br />
<classes></nowiki><br />
<br />
Example: https://github.com/vcmi/vcmi/blob/develop/server/CGameHandler.h<br />
<br />
==== New project part ====<br />
If you're creating new project part, place <code>VCMI_LIB_USING_NAMESPACE</code> in its <code>StdInc.h</code> to be able to use lib classes without explicit namespace in implementation files. Example: https://github.com/vcmi/vcmi/blob/develop/launcher/StdInc.h<br />
<br />
= [[Artificial Intelligence]] (AI)=<br />
<br />
== [[StupidAI]] ==<br />
<br />
Stupid AI is recent and used battle AI.<br />
<br />
== [[Adventure AI]] ==<br />
<br />
VCAI module is currently developed agent-based system driven by goals and heroes.<br />
<br />
== [[Programming challenge]] ==<br />
<br />
== [[Fuzzy logic]] ==<br />
<br />
VCMI includes [http://code.google.com/p/fuzzy-lite/ FuzzyLite] library to make use of fuzzy rule-based algorithms. They are useful to handle uncertanity and resemble human behaviour who takes decisions based on rough observations.<br />
FuzzyLite is linked as separate static library in AI/FuzzyLite.lib file.<br />
<br />
= [[Utilities]] =<br />
==[[Launcher]]==<br />
==[[Duels]]==<br />
<br />
[[Mod system proposal]]<br />
<br />
== [[ERM parser]] ==</div>Kambalahttps://wiki.vcmi.eu/index.php?title=TODO_list&diff=3465TODO list2022-09-26T14:43:41Z<p>Kambala: remove link to iOS TODOs</p>
<hr />
<div>The list of all essential, optional and requested features alongside with the team members interested in them.<br />
= Heroes III =<br />
[https://trello.com/b/68e5rAAl/vcmi-missing-features-only Missing features at Trello]<br />
=== Most important bugfixes ===<br />
* merge scripting branch<br />
* fort recruitment crash bug, this is a build tools problem https://bugs.vcmi.eu/view.php?id=3080<br />
* right click in campaign crash bug https://bugs.vcmi.eu/view.php?id=2958<br />
* daily build contains broken vcmi essential package (ticket is for linux but same problem on Windows also) https://bugs.vcmi.eu/view.php?id=2986<br />
* desync in multiplayer cross-platform https://bugs.vcmi.eu/view.php?id=2583<br />
<br />
<br />
=== Establish release process ===<br />
In January 2021 there was a proposition on Slack to make 3 branches: develop, beta and stable.<br />
develop is where people make their changes when they are ready, people can test it but its not for normal players<br />
beta could be for players who agree to be testers. stable could be for players who want stable version.<br />
Hovewer there were no decision made<br />
<br />
=== HD mod/quality of life ===<br />
contact MikeLodz if you have questions about this section<br />
<br />
These are necessary, as although they werent present back in 1999, they are standard today.<br />
* quick transfer of artifacts and armies between heroes, started here https://github.com/vcmi/vcmi/pull/636<br />
* adventure map: movements points preview and cost<br />
* move artifacts between visiting town and garrison heroes<br />
* hero list preview on the "start map" screen.<br />
etc<br />
see here for full list of enhancements: https://sites.google.com/site/heroes3hd/eng/description/extended-ui<br />
<br />
* some walking creatures need to move faster during battles, as its a complete waste of time (we need a so called "turbo" mode)<br />
<br />
* this one not sure if its a bug or missing hd mod feature: it should be possible to preview hero screen when choosing a skill on levelup.<br />
<br />
=== Hota rebalances? ===<br />
contact MikeLodz about this section<br />
* what is our stance on Hota rebalances ? we should discuss them at least and decide which to adopt, and which to ignore *<br />
<br />
<br />
=== Random map generator ===<br />
Dydzio said about it on Slack:<br />
finish https://github.com/dydzio0614/vcmi/tree/rmgtemplates (random map generator template pick,<br />
better selection lists for random map generator template - two versions<br />
(two bitmaps provided)<br />
also one more thing - for random map template pick my vision was to create more generic select list component and make town portal select component derive from it <br />
<br />
<br />
=== [[Adventure AI]] ===<br />
* More functionality<br />
** Adventure map spells support<br />
** Survival instinct - AI defending towns, escaping etc.<br />
** Handling of all adventure map objects<br />
* Evaluating game objects<br />
** priority for visited objects over others sharing similiar function<br />
** Support for new objects possible to add via mods - use abstract interface to determine rewards etc.<br />
* Advanced strategy<br />
** Battle preparation (constructing suitable army & strategy)<br />
** Expert system for Bonuses ([http://forum.vcmi.eu/profile.php?mode=viewprofile&u=130 Warmonger])<br />
<br />
=== Main menu ===<br />
* Hall of Fame<br />
<br />
= Modding =<br />
* Possibility for creatures to cast arbitrary spells, as in H4/H5<br />
=== Scripting system ===<br />
* Language support<br />
* Synchronising scripts in multiplayer<br />
=== Mod system ===<br />
* Adding new content<br />
** Adventure map objects<br />
** Battlefields<br />
[http://forum.vcmi.eu/viewtopic.php?t=471&postdays=0&postorder=asc&start=0 Forum thread]<br />
<br />
=== Wog features ===<br />
* Mithril<br />
* ERM handling (Tow, Tow Dragon)<br />
<br />
= New features =<br />
* Support for other languages files ([http://forum.vcmi.eu/profile.php?mode=viewprofile&u=336 Ivan])<br />
* Support for multiple map levels<br />
* [http://forum.vcmi.eu/viewtopic.php?t=1139 New map editor]<br />
* Installer<br />
=== Online game ===<br />
* Simultaneous turns<br />
* Spectator mode<br />
* Dedicated server mode<br />
* [http://forum.vcmi.eu/viewtopic.php?t=264 Replays]<br />
=== Other platforms ===<br />
* Linux (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=112 forum thread])<br />
* Mac OS (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=439 forum thread])<br />
* Android (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=850 forum thread])<br />
* iOS (<span style="color:green">'''Supported'''</span>, [https://forum.vcmi.eu/t/ios-port/820 forum thread])<br />
* Haiku (<span style="color:yellow">'''Status unknown'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=310 forum thread])<br />
* Maemo (<span style="color:yellow">'''Status unknown'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=328 forum thread])<br />
* FreeBSD (<span style="color:yellow">'''Status unknown'''</span>)<br />
<br />
= New graphics =<br />
=== New menus project and graphics ===<br />
* New stack experience menu ([http://forum.vcmi.eu/viewtopic.php?t=376&start=0 forum thread])<br />
* New stack artifact dialog<br />
=== Improved support for high resolutions ===<br />
* Auto-adjust resolution<br />
* Moddable menus<br />
=== New players ===<br />
* More player color graphics<br />
* New menus<br />
=== 32-bit graphics ===<br />
=== 800 x 480 resolution ===<br />
Experimental version posted on our forum is available [http://forum.vcmi.eu/viewtopic.php?t=273 here].</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3464Installation on iOS2022-09-25T07:32:48Z<p>Kambala: Undo revision 3463 by Kambala (talk)</p>
<hr />
<div>You can run VCMI on iOS 10.0 and later, all devices are supported.<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
Note: currently iOS doesn't support music in mp3 format. If you want to listen to game music, convert mp3 to ogg, e.g. with FFmpeg. Place the ogg files in the "Mp3" directory.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3463Installation on iOS2022-09-25T07:15:02Z<p>Kambala: change daily builds URL to GitHub</p>
<hr />
<div>You can run VCMI on iOS 10.0 and later, all devices are supported.<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://github.com/vcmi/vcmi/actions?query=branch%3Adevelop<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
Note: currently iOS doesn't support music in mp3 format. If you want to listen to game music, convert mp3 to ogg, e.g. with FFmpeg. Place the ogg files in the "Mp3" directory.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3462Installation on iOS2022-09-24T18:38:06Z<p>Kambala: changed repo URL</p>
<hr />
<div>You can run VCMI on iOS 10.0 and later, all devices are supported.<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
Note: currently iOS doesn't support music in mp3 format. If you want to listen to game music, convert mp3 to ogg, e.g. with FFmpeg. Place the ogg files in the "Mp3" directory.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/vcmi/vcmi/issues GitHub] with '''iOS''' label</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Main_Page&diff=3457Main Page2022-09-24T08:29:27Z<p>Kambala: fix year of 1.0.0 release</p>
<hr />
<div>__NOTOC__<br />
= Welcome to VCMI Project Wiki =<br />
<br />
[[VCMI]] is an open-source project aiming to reimplement HMM3:WoG and SoD game engines, giving it new and extended possibilities.<br />
<br />
== Latest release ==<br />
As of 11th of September 2022, we released [https://github.com/vcmi/vcmi/releases/tag/1.0.0 VCMI 1.0.0]. Now we plan to have releases 1-2 times per year. Daily builds are still available at [https://builds.vcmi.download/branch/develop/ builds.vcmi.download] but they are not guaranteed to be stable. So we encourage everybody to use them and report found bugs so that we can fix them.<br/><br />
We try not to break savegame files compatibility, when possible but implementing it for release 1.0.0 was too complicated so older saves will not work there. The latest 0.99 build is 10th of September<br/><br />
Please see corresponding "installation on" articles for details for your platform.<br/><br />
<br />
== Documentation and guidelines for users ==<br />
* [[VCMI | General information about VCMI Project]]<br />
* [[Frequently asked questions]]<br />
* [[Engine features]]<br />
* [[Game mechanics]]<br />
* [[Bug reporting guidelines]]<br />
* [[Mod list]]<br />
* [[Cheat codes]]<br />
* [[Installation]] guides:<br />
** [[Installation on Windows|Windows]]<br />
** [[Installation on macOS|macOS]]<br />
** [[Installation on Linux|Linux]]<br />
** [[Installation on Android|Android]]<br />
** [[Installation on iOS|iOS]]<br />
<br />
== Documentation and guidelines for modders ==<br />
* [[Modding guidelines]]<br />
* [[Mods repository]]<br />
* Formats:<br />
** [[Mod file Format]]<br />
** [[Town Format]]<br />
** [[Hero Classes Format]]<br />
** [[Hero Format]]<br />
** [[Creature Format]]<br />
** [[Artifact Format]]<br />
** [[Animation Format]]<br />
** [[Bonus Format]]<br />
** [[Object Format]]<br />
** [[Spell Format]]<br />
** [[Skill Format]]<br />
<br />
* [[User:AVS/Scripting|Upcoming scripting support]]<br />
<br />
== Documentation and guidelines for developers ==<br />
* How to build using CMake:<br />
** [[How_to_build_VCMI_(Linux)|Linux]]<br />
** [[How_to_build_VCMI_(Linux/Cmake/MXE)|Linux/MXE (for Windows)]]<br />
** [[How_to_build_VCMI_(macOS)|macOS]]<br />
** [[How_to_build_VCMI_(Windows/Vcpkg)|Windows]]<br />
** [[How to build VCMI (iOS)|iOS]]<br />
* Unsupported build instructions:<br />
** [[How_to_build_VCMI_(Windows/Visual_Studio_2015)|Windows/MSVS (Visual Studio 2015)]]<br />
* [[Coding guidelines]]<br />
* [[Code structure]]<br />
* [[Logging API]]<br />
* [[Bug tracker usage]]<br />
* [[TODO list]]<br />
* [[Project status]]<br />
* Development environment guides:<br />
** [[Development with Qt Creator]]<br />
<br />
== VCMI Places ==<br />
* [https://vcmi.eu/ Website]<br />
* [https://forum.vcmi.eu/ Forum]<br />
* [https://bugs.vcmi.eu/ Bugtracker]<br />
* [https://slack.vcmi.eu/ Slack invite page]<br />
* [https://github.com/vcmi/vcmi GitHub repository]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3453How to build VCMI (macOS)2022-09-20T13:55:07Z<p>Kambala: /* Configuring project for building */</p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools: <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
That's what our CI uses.<br />
<br />
# [https://docs.conan.io/en/latest/installation.html Install Conan]<br />
# Execute in Terminal: <code>conan profile new default --detect</code><br />
# Download prebuilt libraries from [https://github.com/vcmi/vcmi-deps-macos/releases GitHub Releases]:<br />
#* if you're on an Intel Mac, download file '''intel.txz''' and unpack it to <code>~/.conan</code> directory.<br />
#* if you're on an ARM Mac, download file '''intel-cross-arm.txz''' and unpack it to <code>~/.conan</code> directory. Then follow [https://github.com/vcmi/vcmi-ios-deps#note-for-arm-macs instructions how to build Qt host tools for ARM], on step 3 copy them to <code>~/.conan/data/qt/5.15.5/_/_/package/SOME_HASH/bin</code>.<br />
# In Terminal <code>cd</code> to the source code directory and run:<br />
<blockquote>USE_CONAN_WITH_ALL_CONFIGS=1 conan install . --install-folder='''conan-generated''' --no-imports --build=never --profile:build=default --profile:host=CI/conan/'''PROFILE'''</blockquote><br />
where '''conan-generated''' can be any directory you like (Conan helper files will appear there) and '''PROFILE''' must be replaced with:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an ARM Mac: <code>macos-arm</code><br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, '''don't press Return'''<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your name choice at step 4 of [[#Conan package manager]]<br />
#** If you're on an ARM Mac, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory></code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
If you use Conan, it's expected that you use '''conan-generated''' directory at step 4 of [[#Conan package manager]].<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3452How to build VCMI (macOS)2022-09-20T08:02:09Z<p>Kambala: state expected Conan directory name</p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools: <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
That's what our CI uses.<br />
<br />
# [https://docs.conan.io/en/latest/installation.html Install Conan]<br />
# Execute in Terminal: <code>conan profile new default --detect</code><br />
# Download prebuilt libraries from [https://github.com/vcmi/vcmi-deps-macos/releases GitHub Releases]:<br />
#* if you're on an Intel Mac, download file '''intel.txz''' and unpack it to <code>~/.conan</code> directory.<br />
#* if you're on an ARM Mac, download file '''intel-cross-arm.txz''' and unpack it to <code>~/.conan</code> directory. Then follow [https://github.com/vcmi/vcmi-ios-deps#note-for-arm-macs instructions how to build Qt host tools for ARM], on step 3 copy them to <code>~/.conan/data/qt/5.15.5/_/_/package/SOME_HASH/bin</code>.<br />
# In Terminal <code>cd</code> to the source code directory and run:<br />
<blockquote>USE_CONAN_WITH_ALL_CONFIGS=1 conan install . --install-folder='''conan-generated''' --no-imports --build=never --profile:build=default --profile:host=CI/conan/'''PROFILE'''</blockquote><br />
where '''conan-generated''' can be any directory you like (Conan helper files will appear there) and '''PROFILE''' must be replaced with:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an ARM Mac: <code>macos-arm</code><br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, don't press Return<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your name choice at step 4 of [[#Conan package manager]]<br />
#** If you're on an ARM Mac, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory></code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
If you use Conan, it's expected that you use '''conan-generated''' directory at step 4 of [[#Conan package manager]].<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Cheat_codes&diff=3451Cheat codes2022-09-18T09:35:42Z<p>Kambala: fixed amount of gold in vcmiformenos</p>
<hr />
<div>Following cheat codes have been implemented in VCMI and must be used within in-game chat:<br />
<br />
* '''vcmiistari''' - gives all spells and 999 mana to currently selected hero<br />
* '''vcmiainur''' - gives 5 Archangels to every empty slot of currently selected hero<br />
* '''vcmiangband''' - gives 10 black knight into each slot<br />
* '''vcmiglaurung''' - gives 5000 crystal dragons into each slot<br />
* '''vcmiarmenelos''' - build all buildings in currently selected town<br />
* '''vcminoldor''' - all war machines<br />
* '''vcminahar''' - 1000000 movement points<br />
* '''vcmiformenos''' - give resources (100 wood, ore and rare resources and 100000 gold)<br />
* '''vcmieagles''' - reveals FoW<br />
* '''vcmiungoliant''' - conceal FoW<br />
* '''vcmiglorfindel''' - advances currently selected hero to the next level<br />
* '''vcmisilmaril''' - player wins<br />
* '''vcmimelkor''' - player loses<br />
* '''vcmiforgeofnoldorking''' - Hero gets all artifacts except spell book, spell scrolls and war machines. This includes artifacts added via mods.<br />
<br />
All cheat codes can be applied for specific players or all of them:<br />
<br />
* '''vcmieagles ai''' - Will reveal FoW only for AI players.<br />
* '''vcmieagles all''' - Will reveal FoW for all players on map.<br />
* '''vcmieagles blue''' - Will reveal FoW only for blue player.<br />
* '''vcminahar ai''' - give 1000000 movement points to each hero of every AI player<br />
<br />
Some cheats can also be used with certain ObjectInstanceID:<br />
<br />
* '''vcminahar 123''' - give 1000000 movement points to hero with id of 123<br />
* '''vcmiarmenelos 123''' - build all buildings in town with id of 123<br />
<br />
=Console commands=<br />
<br />
Following commands must be used in vcmiclient console (CMD on Windows or terminal on Linux / Mac):<br />
<br />
* '''autoskip''' - Toggles autoskip mode on and off. In this mode, player turns are automatically skipped and only AI moves. However, GUI is still present and allows to observe AI moves. After this option is activated, you need to end first turn manually. Press [Shift] before your turn starts to not skip it.<br />
* '''onlyai''' - When typed in pregame, it completely removes human players and GUI from game. Use console and bugtracker to test AI quickly. Additionally, game cna be launched with --onlyAI parameter to enable this mode by default.<br />
* '''crash''' - force game crash. It is sometimes useful to generate memory dump file in certain situations, for example game freeze.<br />
* '''set <command> <on/off>''' - toggle one of debug options on or off. Possible commands:<br />
** '''autoskip''' - identical to "autoskip" option<br />
** '''showGrid''' - displays grid on adventure map<br />
** '''showBlock''' - shows blocked tiles on map. Requires image '''data/blocked.bmp''' present.<br />
** '''showVisit''' - shows visitable tiles on map. Requires image '''data/visitable.bmp''' present.<br />
** '''hideSystemMessages''' - supress server messages in chat.<br />
* '''gosolo''' - AI take control over human players and vice versa<br />
* '''controlai''' - give control of one (if color specified) or all AIs to player</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3446Installation on macOS2022-09-16T17:53:21Z<p>Kambala: recommend using vcmibuilder</p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* Release 1.0.0 (recommended): https://github.com/vcmi/vcmi/releases/tag/1.0.0<br />
* Daily builds (might be unstable)<br />
** Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
** ARM builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
If the app doesn't open:<br />
* if error message says ''VCMI is damaged and must be moved to Trash'', then open Terminal, paste the following command and press Return (note that you might have other path than ''/Applications/VCMI.app''):<br />
<nowiki>xattr -d com.apple.quarantine /Applications/VCMI.app</nowiki><br />
* otherwise, right-click the app bundle - select ''Open'' menu item - press ''Open'' button<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
# Find a way to unpack Windows Heroes III or GOG installer. For example, use <code>vcmibuilder</code> script inside app bundle or install the game with [https://www.codeweavers.com/crossover CrossOver] / [https://github.com/Gcenx/WineskinServer Wineskin].<br />
# Copy "Data", "Maps" and "Mp3" from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre><br />
<br />
= Connect to the mod repository (optional) =<br />
* If that's your first installation, connection to the mod repository will be configured automatically, you'll see mods available to install from VCMI launcher<br />
** We recommend you to install VCMI extras to support different screen resolutions and active various helpful UI tools<br />
** If you don't see mods available to install, go to settings tab of the launcher and make sure that you have correct link in "repositories" text field:<br />
*** https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3433How to build VCMI (macOS)2022-09-15T15:17:45Z<p>Kambala: </p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools: <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
That's what our CI uses.<br />
<br />
# [https://docs.conan.io/en/latest/installation.html Install Conan]<br />
# Execute in Terminal: <code>conan profile new default --detect</code><br />
# Download prebuilt libraries from [https://github.com/vcmi/vcmi-deps-macos/releases GitHub Releases]:<br />
#* if you're on an Intel Mac, download file '''intel.txz''' and unpack it to <code>~/.conan</code> directory.<br />
#* if you're on an ARM Mac, download file '''intel-cross-arm.txz''' and unpack it to <code>~/.conan</code> directory. Then follow [https://github.com/vcmi/vcmi-ios-deps#note-for-arm-macs instructions how to build Qt host tools for ARM], on step 3 copy them to <code>~/.conan/data/qt/5.15.5/_/_/package/SOME_HASH/bin</code>.<br />
# In Terminal <code>cd</code> to the source code directory and run:<br />
<blockquote>USE_CONAN_WITH_ALL_CONFIGS=1 conan install . --install-folder='''conan-generated''' --no-imports --build=never --profile:build=default --profile:host=CI/conan/'''PROFILE'''</blockquote><br />
where '''conan-generated''' can be any directory you like (Conan helper files will appear there) and '''PROFILE''' must be replaced with:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an ARM Mac: <code>macos-arm</code><br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, don't press Return<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your name choice at step 4 of [[#Conan package manager]]<br />
#** If you're on an ARM Mac, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory></code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3432How to build VCMI (macOS)2022-09-15T15:16:47Z<p>Kambala: </p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools: <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
That's what our CI uses.<br />
<br />
# [https://docs.conan.io/en/latest/installation.html Install Conan]<br />
# Execute in Terminal: <code>conan profile new default --detect</code><br />
# Download prebuilt libraries from [https://github.com/vcmi/vcmi-deps-macos/releases GitHub Releases]:<br />
#* if you're on an Intel Mac, download file '''intel.txz''' and unpack it to <code>~/.conan</code> directory.<br />
#* if you're on an ARM Mac, download file '''intel-cross-arm.txz''' and unpack it to <code>~/.conan</code> directory. Then follow [https://github.com/vcmi/vcmi-ios-deps#note-for-arm-macs instructions how to build Qt host tools for ARM], on step 3 copy them to <code>~/.conan/data/qt/5.15.5/_/_/package/SOME_HASH/bin</code>.<br />
# In Terminal <code>cd</code> to the source code directory and run:<br />
<blockquote>USE_CONAN_WITH_ALL_CONFIGS=1 conan install . --install-folder='''conan-generated''' --no-imports --build=never --profile:build=default --profile:host=CI/conan/'''PROFILE'''</blockquote><br />
where '''conan-generated''' can be any directory you like (Conan helper files will appear there) and '''PROFILE''' must be replaced with:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an ARM Mac: <code>macos-arm</code><br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, don't press Return<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your name choice at step 4 of [[#Conan package manager]]<br />
#** If you're on an ARM Mac, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory> --target vcmiclient</code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(macOS)&diff=3431How to build VCMI (macOS)2022-09-15T15:12:38Z<p>Kambala: completely reworked instructions</p>
<hr />
<div>= Requirements =<br />
# C++ toolchain, either of:<br />
#* Xcode Command Line Tools: <code>sudo xcode-select --install</code><br />
#* Xcode IDE: https://developer.apple.com/xcode/<br />
#* (not tested) other C++ compilers, e.g. gcc/clang from [https://brew.sh/ Homebrew]<br />
# CMake: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
# (optional) Ninja: <code>brew install ninja</code> or get from https://github.com/ninja-build/ninja/releases<br />
<br />
= Obtaining source code =<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
= Obtaining dependencies =<br />
There're 2 ways to get dependencies automatically.<br />
<br />
== Conan package manager ==<br />
That's what our CI uses.<br />
<br />
# [https://docs.conan.io/en/latest/installation.html Install Conan]<br />
# Execute in Terminal: <code>conan profile new default --detect</code><br />
# Download prebuilt libraries from [https://github.com/vcmi/vcmi-deps-macos/releases GitHub Releases]:<br />
#* if you're on an Intel Mac, download file '''intel.txz''' and unpack it to <code>~/.conan</code> directory.<br />
#* if you're on an ARM Mac, download file '''intel-cross-arm.txz''' and unpack it to <code>~/.conan</code> directory. Then follow [https://github.com/vcmi/vcmi-ios-deps#note-for-arm-macs instructions how to build Qt host tools for ARM], on step 3 copy them to <code>~/.conan/data/qt/5.15.5/_/_/package/SOME_HASH/bin</code>.<br />
# In Terminal <code>cd</code> to the source code directory and run:<br />
<blockquote>USE_CONAN_WITH_ALL_CONFIGS=1 conan install . --install-folder='''conan-generated''' --no-imports --build=never --profile:build=default --profile:host=CI/conan/'''PROFILE'''</blockquote><br />
where '''conan-generated''' can be any directory you like (Conan helper files will appear there) and '''PROFILE''' must be replaced with:<br />
* if you're on an Intel Mac: <code>macos-intel</code><br />
* if you're on an ARM Mac: <code>macos-arm</code><br />
<br />
== Homebrew ==<br />
# [https://brew.sh/ Install Homebrew]<br />
# Install dependencies: <code>brew install boost ffmpeg@4 luajit minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb</code><br />
# Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):<br />
#* <code>brew install qt@5</code> for Qt 5 or <code>brew install qt</code> for Qt 6<br />
#* using [https://www.qt.io/download Qt Online Installer] - choose '''Go open source'''<br />
<br />
= Preparing build environment =<br />
This applies only to Xcode-based toolchain. If <code>xcrun -f clang</code> prints errors, then use either of the following ways:<br />
* select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools<br />
* use <code>xcode-select</code> utility to set Xcode or Xcode Command Line Tools path: for example, <code>sudo xcode-select -s /Library/Developer/CommandLineTools</code><br />
* set <code>DEVELOPER_DIR</code> environment variable pointing to Xcode or Xcode Command Line Tools path: for example, <code>export DEVELOPER_DIR=/Applications/Xcode.app</code><br />
<br />
= Configuring project for building =<br />
Note that if you wish to use Qt Creator IDE, you should skip this step and configure respective variables inside the IDE.<br />
<br />
# In Terminal <code>cd</code> to the source code directory<br />
# Start assembling CMake invocation: type <code>cmake -S . -B BUILD_DIR</code> where ''BUILD_DIR'' can be any path, don't press Return<br />
# Decide which CMake generator you want to use:<br />
#* Makefiles: no extra option needed or pass <code>-G 'Unix Makefiles'</code><br />
#* Ninja (if you have installed it): pass <code>-G Ninja</code><br />
#* Xcode IDE (if you have installed it): pass <code>-G Xcode</code><br />
# If you picked Makefiles or Ninja, pick desired ''build type'' - either of Debug / RelWithDebInfo / Release / MinSizeRel - and pass it in <code>CMAKE_BUILD_TYPE</code> option, for example: <code>-D CMAKE_BUILD_TYPE=Release</code>. If you don't pass this option, <code>RelWithDebInfo</code> will be used.<br />
# If you don't want to run tests, pass <code>-D ENABLE_TEST=OFF</code><br />
# If you don't want to build Launcher, pass <code>-D ENABLE_LAUNCHER=OFF</code><br />
# You can also pass <code>-Wno-dev</code> if you're not interested in CMake developer warnings<br />
# Next step depends on the dependency manager you have picked:<br />
#* Conan: pass <code>-D CMAKE_TOOLCHAIN_FILE=conan-generated/conan_toolchain.cmake</code> where '''conan-generated''' must be replaced with your name choice at step 4 of [[#Conan package manager]]<br />
#* Homebrew: pass <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4)"</code><br />
#** if you installed Qt 5 from Homebrew, '''append''' to the above option but '''before the closing quote''': <code>;$(brew --prefix qt@5)</code><br />
#** if you installed Qt from Online Installer, '''append''' to the above option but '''before the closing quote''' your path to Qt directory, for example: <code>;/Users/kambala/dev/Qt-libs/5.15.2/Clang64</code><br />
#** example of what you should pass in the first case: <code>-D "CMAKE_PREFIX_PATH=$(brew --prefix ffmpeg@4);$(brew --prefix qt@5)"</code><br />
# If you're on an ARM Mac and using Conan, also pass: <code>-D ENABLE_ERM=OFF -D ENABLE_LUA=OFF</code><br />
# now press Return<br />
<br />
= Building project =<br />
<br />
You must also install game files to be able to run the built version, see [[Installation on macOS]].<br />
<br />
== From Xcode IDE ==<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme and hit Run (Cmd+R). To build Launcher, select <code>vcmilauncher</code> scheme instead.<br />
<br />
== From command line ==<br />
<code>cmake --build <path to build directory> --target vcmiclient</code><br />
<br />
* If using Makefiles generator, you'd want to utilize all your CPU cores by appending <code>-- -j$(sysctl -n hw.ncpu)</code> to the above<br />
* If using Xcode generator, you can also choose which configuration to build by appending <code>--config <configuration name></code> to the above, for example: <code>--config Debug</code><br />
<br />
= Packaging project into DMG file =<br />
After building, run <code>cpack</code> from the build directory. If using Xcode generator, also pass <code>-C <configuration name></code> with the same configuration that you used to build the project.<br />
<br />
= Running VCMI =<br />
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.<br />
<br />
Alternatively you can run binaries directly from "bin" directory:<br />
<pre><br />
BUILD_DIR/bin/vcmilauncher<br />
BUILD_DIR/bin/vcmiclient<br />
BUILD_DIR/bin/vcmiserver<br />
</pre><br />
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.<br />
<br />
= Some useful debugging tips =<br />
Anyone who might want to debug builds, but new to macOS could find following commands useful:<br />
<pre><br />
# To attach DMG file from command line use<br />
hdiutil attach vcmi-1.0.dmg<br />
# Detach volume:<br />
hdiutil detach /Volumes/vcmi-1.0<br />
# To view dependency paths<br />
otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
# To display load commands such as LC_RPATH <br />
otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient<br />
</pre><br />
<br />
= Troubleshooting =<br />
In case of troubles you can always consult our CI build scripts or contact the dev team via slack</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3430How to build VCMI (iOS)2022-09-14T15:58:05Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining source code ==<br />
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:<br />
<nowiki>git clone --recurse-submodules https://github.com/vcmi/vcmi.git</nowiki><br />
<br />
== Obtaining dependencies ==<br />
Follow instructions at https://github.com/vcmi/vcmi-ios-deps<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're two [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device and for simulator, named <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device:<br />
<nowiki>cmake --preset ios-device \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME \<br />
-D CMAKE_PREFIX_PATH=~/Downloads/vcmi-ios-depends/build/iphoneos</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3427Installation on macOS2022-09-13T12:01:39Z<p>Kambala: changed list type</p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* Release 1.0.0 (recommended): https://github.com/vcmi/vcmi/releases/tag/1.0.0<br />
* Daily builds (might be unstable)<br />
** Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
** ARM builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
If the app doesn't open:<br />
* if error message says ''VCMI is damaged and must be moved to Trash'', then open Terminal, paste the following command and press Return (note that you might have other path than ''/Applications/VCMI.app''):<br />
<nowiki>xattr -d com.apple.quarantine /Applications/VCMI.app</nowiki><br />
* otherwise, right-click the app bundle - select ''Open'' menu item - press ''Open'' button<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
# Find a way to unpack Windows Heroes III or GOG installer. For example, install the game with [https://www.codeweavers.com/crossover CrossOver] or [https://github.com/Gcenx/WineskinServer Wineskin].<br />
# Copy "Data", "Maps" and "Mp3" from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre><br />
<br />
= Connect to the mod repository (optional) =<br />
* If that's your first installation, connection to the mod repository will be configured automatically, you'll see mods available to install from VCMI launcher<br />
** We recommend you to install VCMI extras to support different screen resolutions and active various helpful UI tools<br />
** If you don't see mods available to install, go to settings tab of the launcher and make sure that you have correct link in "repositories" text field:<br />
*** https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3426Installation on macOS2022-09-13T12:00:19Z<p>Kambala: add instructions how to open app that doesn't work</p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* Release 1.0.0 (recommended): https://github.com/vcmi/vcmi/releases/tag/1.0.0<br />
* Daily builds (might be unstable)<br />
** Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
** ARM builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
If the app doesn't open:<br />
* if error message says ''VCMI is damaged and must be moved to Trash'', then open Terminal, paste the following command and press Return (note that you might have other path than ''/Applications/VCMI.app''):<br />
<nowiki>xattr -d com.apple.quarantine /Applications/VCMI.app</nowiki><br />
* otherwise, right-click the app bundle - select ''Open'' menu item - press ''Open'' button<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
* Find a way to unpack Windows Heroes III or GOG installer. For example, install the game with [https://www.codeweavers.com/crossover CrossOver] or [https://github.com/Gcenx/WineskinServer Wineskin].<br />
<br />
* Copy "Data", "Maps" and "Mp3" from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre><br />
<br />
= Connect to the mod repository (optional) =<br />
* If that's your first installation, connection to the mod repository will be configured automatically, you'll see mods available to install from VCMI launcher<br />
** We recommend you to install VCMI extras to support different screen resolutions and active various helpful UI tools<br />
** If you don't see mods available to install, go to settings tab of the launcher and make sure that you have correct link in "repositories" text field:<br />
*** https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3417Installation on macOS2022-09-10T10:18:56Z<p>Kambala: suggest using Wine to install the original game</p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
* ARM builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
* Find a way to unpack Windows Heroes III or GOG installer. For example, install the game with [https://www.codeweavers.com/crossover CrossOver] or [https://github.com/Gcenx/WineskinServer Wineskin].<br />
<br />
* Copy "Data", "Maps" and "Mp3" from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre></div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_macOS&diff=3415Installation on macOS2022-08-30T15:25:58Z<p>Kambala: new download links</p>
<hr />
<div>= Download and install VCMI =<br />
<br />
* Intel (x86_64) builds: https://builds.vcmi.download/branch/develop/macOS/intel<br />
* ARM builds: https://builds.vcmi.download/branch/develop/macOS/arm<br />
<br />
Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
<br />
If your problem is Mac-specific: DMG corrupted or if it doesn't start please use following topic:<br />
* [https://forum.vcmi.eu/t/macos-builds/550 VCMI for macOS]<br />
Make sure to specify what hardware and macOS version you use.<br />
<br />
= Installing Heroes III data files =<br />
<br />
* Find a way to unpack Windows Heroes III or GOG installer.<br />
<br />
* Copy "Data", "Maps" and "Mp3" from Heroes III to:<br />
<pre><br />
~/Library/Application\ Support/vcmi/<br />
</pre></div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(Windows/Vcpkg)&diff=3413How to build VCMI (Windows/Vcpkg)2022-08-25T11:24:33Z<p>Kambala: add note that building deps from source with vcpkg is impossible on 32-bit Windows</p>
<hr />
<div>= Prerequisites =<br />
* Windows Vista or newer.<br />
* Microsoft Visual Studio [https://www.visualstudio.com/vs/older-downloads/ 2017] or [http://www.visualstudio.com/downloads/download-visual-studio-vs 2019]<br />
* CI use VS2019, so you are going to have less problems with it.<br />
* Git or git GUI, for example, SourceTree [http://www.sourcetreeapp.com/download download]<br />
* CMake [https://cmake.org/download/ download]. During install after accepting license agreement make sure to check "Add CMake to the system PATH for all users".<br />
* To unpack pre-build Vcpkg: [http://www.7-zip.org/download.html 7-zip]<br />
* To create installer: [http://nsis.sourceforge.net/Main_Page NSIS]<br />
<br />
= Choose directory =<br />
<br />
Create a directory for VCMI development, eg. '''C:\VCMI'''<br />
We will call this directory as '''[VCMI_DIR]'''<br />
<br />
'''Warning!''' Replace '''[VCMI_DIR]''' with path you chosen in following commands of this instruction.<br />
<br />
== How to choose good directory ==<br />
<br />
It is recommended to avoid non-ascii characters in the path to your working folders. The folder should not be write-protected by system. <br />
Good location:<br />
* '''C:\VCMI'''<br />
Bad locations:<br />
* '''C:\Users\Michał\VCMI''' (non-ascii character)<br />
* '''C:\Program Files (x86)\VCMI''' (write protection)<br />
<br />
= Install dependencies =<br />
<br />
You have two options: to use pre-built libraries or build your own. We strongly recommend start with using pre-built ones.<br />
<br />
== Option A. Use pre-built Vcpkg ==<br />
So you decide to start using Vcpkg packages pre-built by VCMI team.<br />
<br />
Package guaranteed to work since they tested with every commit by [https://ci.appveyor.com/project/vcmi/vcmi AppVeyor]<br />
* Please note that as of 2020, this lib wasnt yet updated for vs2019, so for vs2019 you will probaby have to use option B. <br />
=== Download and unpack archive ===<br />
<br />
Archives are available from GitHub: https://github.com/vcmi/vcmi-deps-windows/releases<br />
<br />
Only download latest version available.<br />
<br />
* vcpkg-export-'''x86'''-windows-v140.7z to build for 32-bit no debug, 3 times smaller file size<br />
* vcpkg-export-'''x64'''-windows-v140.7z to build for 64-bit no debug, 3 times smaller file size<br />
* vcpkg-export-'''x86'''-windows-v140-debug.7z to build for 32-bit with debug configuration available<br />
* vcpkg-export-'''x64'''-windows-v140-debug.7z to build for 64-bit with debug configuration available<br />
<br />
Extract archive by right clicking on it and choosing "7-zip -> Extract Here".<br />
<br />
=== Move dependencies to target directory ===<br />
<br />
Once extracted "vcpkg" directory will appear with "installed" and "scripts" inside it.<br />
<br />
Move extracted "vcpkg" directory into your '''[VCMI_DIR]'''.<br />
<br />
== Option B. Build Vcpkg on your own ==<br />
Please be aware that if you're running 32-bit Windows version, then this is impossible due to https://github.com/microsoft/vcpkg/issues/26036<br />
<br />
Be aware that building Vcpkg might take a lot of time depend on your CPU model and 10-20GB of disk space.<br />
=== Create initial directory ===<br />
<br />
=== Clone vcpkg ===<br />
<br />
# open SourceTree<br />
# File -> Clone<br />
# select '''https://github.com/microsoft/vcpkg/''' as source<br />
# select '''[VCMI_DIR]/vcpkg''' as destination<br />
# click '''Clone'''<br />
<br />
From command line use:<br />
<pre><br />
git clone https://github.com/microsoft/vcpkg.git [VCMI_DIR]/vcpkg<br />
</pre><br />
<br />
=== Build vcpkg ===<br />
* Run <br />
<pre><br />
[VCMI_DIR]/vcpkg/bootstrap-vcpkg.bat<br />
</pre><br />
<br />
=== Build dependencies ===<br />
* For 32-bit build run:<br />
<pre><br />
[VCMI_DIR]/vcpkg/vcpkg.exe install sdl2:x86-windows sdl2-image:x86-windows sdl2-ttf:x86-windows sdl2-mixer:x86-windows boost:x86-windows qt5-base:x86-windows ffmpeg:x86-windows fuzzylite:x86-windows smpeg2:x86-windows tbb:x86-windows luajit:x86-windows<br />
</pre><br />
* For 64-bit build run<br />
<pre><br />
[VCMI_DIR]/vcpkg/vcpkg.exe install sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows boost:x64-windows qt5-base:x64-windows ffmpeg:x64-windows fuzzylite:x64-windows smpeg2:x64-windows tbb:x64-windows luajit:x64-windows<br />
</pre><br />
<br />
For the list of the packages used you can also consult [https://github.com/vcmi/vcmi-deps-windows vcmi-deps-windows readme] in case this article gets outdated a bit.<br />
<br />
= Build VCMI =<br />
<br />
== Clone VCMI ==<br />
# open SourceTree<br />
# File -> Clone<br />
# select '''https://github.com/vcmi/vcmi/''' as source<br />
# select '''[VCMI_DIR]/source''' as destination<br />
# expand Advanced Options and change Checkout Branch to "develop"<br />
# tick Recursive submodules<br />
# click '''Clone'''<br />
<br />
or From command line use:<br />
<pre><br />
git clone --recursive https://github.com/vcmi/vcmi.git [VCMI_DIR]/source<br />
</pre><br />
<br />
== Generate solution for VCMI ==<br />
# create '''[VCMI_DIR]/build''' folder<br />
# open '''[VCMI_DIR]/build''' in command line:<br />
## Run Command Prompt or Power Shell.<br />
## Execute: cd [VCMI_DIR]/build<br />
# execute one of following commands to generate project<br />
<br />
'''Visual Studio 2017 - 32-bit build'''<br />
<pre><br />
cmake [VCMI_DIR]/source -DCMAKE_TOOLCHAIN_FILE=[VCMI_DIR]/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017"<br />
</pre><br />
<br />
'''Visual Studio 2017 - 64-bit build'''<br />
<pre><br />
cmake [VCMI_DIR]/source -DCMAKE_TOOLCHAIN_FILE=[VCMI_DIR]/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"<br />
</pre><br />
<br />
'''Visual Studio 2019 - 32-bit build'''<br />
<pre><br />
cmake [VCMI_DIR]/source -DCMAKE_TOOLCHAIN_FILE=[VCMI_DIR]/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A Win32<br />
</pre><br />
<br />
'''Visual Studio 2019 - 64-bit build'''<br />
<pre><br />
cmake [VCMI_DIR]/source -DCMAKE_TOOLCHAIN_FILE=[VCMI_DIR]/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A x64<br />
</pre><br />
<br />
== Compile VCMI with Visual Studio ==<br />
# open '''[VCMI_DIR]/build/VCMI.sln''' in Visual Studio<br />
# select "Release" build type in combobox<br />
# right click on '''BUILD_ALL''' project - build project. This BUILD_ALL project should be in "CMakePredefinedTargets" tree in Solution Explorer.<br />
# grab VCMI in '''[VCMI_DIR]/build/bin''' folder!<br />
<br />
== Compile VCMI from command line ==<br />
<br />
'''For release build'''<br />
<pre><br />
cmake --build [VCMI_DIR]/build --config Release<br />
</pre><br />
<br />
'''For debug build'''<br />
<pre><br />
cmake --build [VCMI_DIR]/build --config Debug<br />
</pre><br />
Debug will be used by default even "--config" if not specified.<br />
<br />
= Create VCMI installer =<br />
Make sure NSIS is installed to default directory or have registry entry so CMake can find it.<br />
<br />
After you build VCMI execute following commands from '''[VCMI_DIR]/build'''.<br />
=== Execute following if you built for Release: ===<br />
<pre><br />
cpack<br />
</pre><br />
=== If you built for Debug: ===<br />
<pre><br />
cpack -C Debug<br />
</pre><br />
<br />
= Troubleshooting and workarounds =<br />
Vcpkg might be very unstable due to limited popularity and fact of using bleeding edge packages (such as most recent Boost). Using latest version of dependencies could also expose both problems in VCMI code or library interface changes that developers not checked yet. So if you're built Vcpkg yourself and can't get it working please try to use binary package.<br />
<br />
Pre-built version we provide is always manually tested with all supported versions of MSVC for both Release and Debug builds and all known quirks are listed below.<br />
<br />
=== Debug build of VCMI won't run since SDL2.dll / libbz2.dll missing ===<br />
<br />
Almost all of Vcpkg debug libraries are built with "d" prefix, but for whatever reason VCMI or some libraries might expect them to be named without prefix. Workaround is to just make a copy of said library with different name.<br />
<br />
Likely this can be resolved by some CMake configuration magic so if you know how please make pull request.<br />
<br />
=== I got crash within library XYZ.dll ===<br />
<br />
Good workaround is to use debug version of said library instead of release one or vice versa. If that's helped you can swap the library within Vcpkg package itself so you don't need to do it every time when you.<br />
<br />
=== Build is successful but can not start new game ===<br />
<br />
Check that all non-VCMI dlls in AI and Scripting (vcmilua.dll and vcmierm.dll) folders are also copied to the parent folder so that they are available for vcmi_clent.exe. These are tbb.dll fuzzylite.dll lua51.dll. Also there should be as well folder scripts (lua scripts for ERM). If scripting folder is absent please build vcmiLua and vcmiErm projects. There is no direct dependency between them and vcmi_client for now (2021-08-28)<br />
<br />
=== Debug build is very slow ===<br />
<br />
Debug builds with MSVC are generally extremely slow since it's not just VCMI binaries are built as debug, but every single dependency too and this usually means no optimizations at all. Debug information that available for release builds is often sufficient so just avoid full debug builds unless absolutely necessary. Instead use RelWithDebInfo configuration. Also Debug configuration might have some compilation issues because it is not checked via CI for now.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3412How to build VCMI (iOS)2022-08-18T04:22:36Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining dependencies ==<br />
Follow instructions at https://github.com/kambala-decapitator/vcmi-ios-depends<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're two [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device and for simulator, named <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device:<br />
<nowiki>cmake --preset ios-device \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME \<br />
-D CMAKE_PREFIX_PATH=~/Downloads/vcmi-ios-depends/build/iphoneos</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click '''VCMI''' with blue icon on the very top in the left panel with files), select '''vcmiclient''' target, open '''Signing & Capabilities''' tab and select yout team. Now you can copy the value from '''Build Settings''' tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3411How to build VCMI (iOS)2022-08-18T04:20:24Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining dependencies ==<br />
Follow instructions at https://github.com/kambala-decapitator/vcmi-ios-depends<br />
<br />
== Configuring project ==<br />
Only Xcode generator (<code>-G Xcode</code>) is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're two [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device and for simulator, named <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device:<br />
<nowiki>cmake --preset ios-device \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME \<br />
-D CMAKE_PREFIX_PATH=~/Downloads/vcmi-ios-depends/build/iphoneos</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click <code>VCMI</code> with blue icon on the very top in the left panel with files), select <code>vcmiclient</code> target, open <code>Signing & Capabilities</code> tab and select yout team. Now you can copy the value from <code>Build Settings</code> tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code>.<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3410How to build VCMI (iOS)2022-08-18T04:17:00Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining dependencies ==<br />
Follow instructions at https://github.com/kambala-decapitator/vcmi-ios-depends<br />
<br />
== Configuring project ==<br />
Only Xcode generator is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're two [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device and for simulator, named <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device:<br />
<nowiki>cmake --preset ios-device \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME \<br />
-D CMAKE_PREFIX_PATH=~/Downloads/vcmi-ios-depends/build/iphoneos</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click <code>VCMI</code> with blue icon on the very top in the left panel with files), select <code>vcmiclient</code> target, open <code>Signing & Capabilities</code> tab and select yout team. Now you can copy the value from <code>Build Settings</code> tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]]. But this is not necessary if you are going to run on simulator, as it is able to use game data from your Mac located at <code>~/Library/Application Support/vcmi</code><br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3409How to build VCMI (iOS)2022-08-17T11:22:06Z<p>Kambala: </p>
<hr />
<div>== Requirements ==<br />
# '''macOS'''<br />
# Xcode: https://developer.apple.com/xcode/<br />
# CMake 3.21+: <code>brew install --cask cmake</code> or get from https://cmake.org/download/<br />
<br />
== Obtaining dependencies ==<br />
Follow instructions at https://github.com/kambala-decapitator/vcmi-ios-depends<br />
<br />
== Configuring project ==<br />
Only Xcode generator is supported!<br />
<br />
As a minimum, you must pass the following variables to CMake:<br />
<br />
* <code>BUNDLE_IDENTIFIER_PREFIX</code>: unique bundle identifier prefix, something like <code>com.MY-NAME</code><br />
* <code>CMAKE_PREFIX_PATH</code>: path to the downloaded dependencies, e.g. <code>~/Downloads/vcmi-ios-depends/build/iphoneos</code><br />
<br />
There're two [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html CMake presets]: for device and for simulator, named <code>ios-device</code> and <code>ios-simulator</code> respectively. You can also create your local "user preset" to avoid typing variables each time, see example [https://gist.github.com/kambala-decapitator/59438030c34b53aed7d3895aaa48b718 here].<br />
<br />
Open terminal and <code>cd</code> to the directory with source code. Configuration example for device:<br />
<nowiki>cmake --preset ios-device \<br />
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME \<br />
-D CMAKE_PREFIX_PATH=~/Downloads/vcmi-ios-depends/build/iphoneos</nowiki><br />
<br />
By default build directory containing Xcode project will appear at <code>../build-ios-device</code>, but you can change it with <code>-B</code> option.<br />
<br />
=== Building for device ===<br />
To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click <code>VCMI</code> with blue icon on the very top in the left panel with files), select <code>vcmiclient</code> target, open <code>Signing & Capabilities</code> tab and select yout team. Now you can copy the value from <code>Build Settings</code> tab - <code>DEVELOPMENT_TEAM</code> variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in <code>CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM</code> variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project.<br />
<br />
Advanced users who know exact private key and provisioning profile to sign with, can use <code>CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY</code> and <code>CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER</code> variables instead. In this case you must also pass<br />
<br />
<code>-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual</code>.<br />
<br />
== Building project ==<br />
<br />
=== From Xcode IDE ===<br />
Open <code>VCMI.xcodeproj</code> from the build directory, select <code>vcmiclient</code> scheme (the only one with nice icon) with your destination device/simulator and hit Run (Cmd+R).<br />
<br />
You must also install game files, see [[Installation on iOS]].<br />
<br />
=== From command line ===<br />
<code>cmake --build <path to build directory> --target vcmiclient -- -quiet</code><br />
<br />
You can pass additional xcodebuild options after the <code>--</code>. Here <code>-quiet</code> is passed to reduce amount of output.<br />
<br />
Alternatively, you can invoke <code>xcodebuild</code> directly.<br />
<br />
There's also <code>ios-release</code> configure and build preset that is used to create release build on CI.<br />
<br />
== Creating ipa file for distribution ==<br />
Invoke <code>cpack</code> after building:<br />
<br />
<code>cpack -C Release</code><br />
<br />
This will generate zip file, you need to change its extension to <code>ipa</code> manually or use [https://github.com/vcmi/vcmi/blob/develop/ios/zip2ipa.sh simple script] that we have in the repository at <code>ios/zip2ipa.sh</code>.</div>Kambalahttps://wiki.vcmi.eu/index.php?title=Installation_on_iOS&diff=3408Installation on iOS2022-08-17T10:52:39Z<p>Kambala: </p>
<hr />
<div>You can run VCMI on iOS 10.0 and later, all devices are supported.<br />
<br />
== Download and install VCMI ==<br />
Daily builds: https://builds.vcmi.download/branch/develop/iOS/<br />
<br />
To run on a non-jailbroken device you need to sign the IPA file, you have the following options:<br />
<br />
* [https://altstore.io/ AltStore] or [https://sideloadly.io/ Sideloadly] - can be installed on Windows or macOS, don't require dealing with signing on your own<br />
* Get signer tool [https://dantheman827.github.io/ios-app-signer/ here] and a guide [https://forum.kodi.tv/showthread.php?tid=245978 here] (it's for Kodi, but the logic is the same). Signing with this app can only be done on macOS.<br />
* [https://github.com/kambala-decapitator/xcode-auto-signing-assets Create signing assets on macOS from terminal]. In the command replace <code>your.bundle.id</code> with something like <code>com.MY-NAME.vcmi</code>. After that use the above signer tool.<br />
* [https://github.com/indygreg/PyOxidizer/tree/main/apple-codesign Sign from any OS]. You'd still need to find a way to create signing assets (private key and provisioning profile) though.<br />
<br />
== Installing Heroes III data files ==<br />
To play the game, you need to upload HoMM3 data files - '''Data''', '''Maps''' and '''Mp3''' directories - to the device. Use Finder (or iTunes, if you're on Windows or your macOS is 10.14 or earlier) for that. You can also add various [https://wiki.vcmi.eu/Mod_list mods] by uploading '''Mods''' directory. Follow [https://support.apple.com/en-us/HT210598 official Apple guide] and place files into VCMI app. Unfortunately, Finder doesn't display copy progress, give it about 10 minutes to finish.<br />
<br />
Note: currently iOS doesn't support music in mp3 format. If you want to listen to game music, convert mp3 to ogg, e.g. with FFmpeg. Place the ogg files in the "Mp3" directory.<br />
<br />
=== Installing data files with Xcode on macOS ===<br />
You can also upload files with Xcode. You need to prepare "container" for that.<br />
<br />
# Connect your device to your Mac<br />
# Start Xcode<br />
# Open Devices and Simulators window: Cmd+Shift+2 or Menu - Window - Devices and Simulators<br />
# Select VCMI<br />
# In the bottom find "three dots" or "cogwheel" button (it should be next to + - buttons) - click it - select Download Container...<br />
# Place the game directories inside the downloaded container - AppData - Documents<br />
# Click the "three dots" / "cogwheel" button in Xcode again - Replace Container... - select the downloaded container<br />
# Wait until Xcode finishes copying, progress is visible (although it might be "indefinite")<br />
<br />
== Game controls ==<br />
* Tap = left click<br />
* Tap and hold (long press) = right click<br />
* Pinch with 2 fingers = tab (activates chat/console in the game)<br />
<br />
You can start game directly (avoiding the launcher) by changing setting in iOS Settings app - VCMI.<br />
<br />
== Reporting bugs ==<br />
* Please report about gameplay problem on forums: [https://forum.vcmi.eu/c/international-board/help-bugs Help & Bugs]<br />
* Please report iOS-specific issues in [https://forum.vcmi.eu/t/ios-port/820 this forum thread] or (better) at [https://github.com/kambala-decapitator/vcmi/issues GitHub]</div>Kambalahttps://wiki.vcmi.eu/index.php?title=How_to_build_VCMI_(iOS)&diff=3406How to build VCMI (iOS)2022-08-17T07:53:00Z<p>Kambala: Created page with "placeholder"</p>
<hr />
<div>placeholder</div>Kambalahttps://wiki.vcmi.eu/index.php?title=TODO_list&diff=3402TODO list2022-08-14T07:40:58Z<p>Kambala: add iOS to the list of supported platforms</p>
<hr />
<div>The list of all essential, optional and requested features alongside with the team members interested in them.<br />
= Heroes III =<br />
[https://trello.com/b/68e5rAAl/vcmi-missing-features-only Missing features at Trello]<br />
=== Most important bugfixes ===<br />
* merge scripting branch<br />
* fort recruitment crash bug, this is a build tools problem https://bugs.vcmi.eu/view.php?id=3080<br />
* right click in campaign crash bug https://bugs.vcmi.eu/view.php?id=2958<br />
* daily build contains broken vcmi essential package (ticket is for linux but same problem on Windows also) https://bugs.vcmi.eu/view.php?id=2986<br />
* desync in multiplayer cross-platform https://bugs.vcmi.eu/view.php?id=2583<br />
<br />
<br />
=== Establish release process ===<br />
In January 2021 there was a proposition on Slack to make 3 branches: develop, beta and stable.<br />
develop is where people make their changes when they are ready, people can test it but its not for normal players<br />
beta could be for players who agree to be testers. stable could be for players who want stable version.<br />
Hovewer there were no decision made<br />
<br />
=== HD mod/quality of life ===<br />
contact MikeLodz if you have questions about this section<br />
<br />
These are necessary, as although they werent present back in 1999, they are standard today.<br />
* quick transfer of artifacts and armies between heroes, started here https://github.com/vcmi/vcmi/pull/636<br />
* adventure map: movements points preview and cost<br />
* move artifacts between visiting town and garrison heroes<br />
* hero list preview on the "start map" screen.<br />
etc<br />
see here for full list of enhancements: https://sites.google.com/site/heroes3hd/eng/description/extended-ui<br />
<br />
* some walking creatures need to move faster during battles, as its a complete waste of time (we need a so called "turbo" mode)<br />
<br />
* this one not sure if its a bug or missing hd mod feature: it should be possible to preview hero screen when choosing a skill on levelup.<br />
<br />
=== Hota rebalances? ===<br />
contact MikeLodz about this section<br />
* what is our stance on Hota rebalances ? we should discuss them at least and decide which to adopt, and which to ignore *<br />
<br />
<br />
=== Random map generator ===<br />
Dydzio said about it on Slack:<br />
finish https://github.com/dydzio0614/vcmi/tree/rmgtemplates (random map generator template pick,<br />
better selection lists for random map generator template - two versions<br />
(two bitmaps provided)<br />
also one more thing - for random map template pick my vision was to create more generic select list component and make town portal select component derive from it <br />
<br />
<br />
=== [[Adventure AI]] ===<br />
* More functionality<br />
** Adventure map spells support<br />
** Survival instinct - AI defending towns, escaping etc.<br />
** Handling of all adventure map objects<br />
* Evaluating game objects<br />
** priority for visited objects over others sharing similiar function<br />
** Support for new objects possible to add via mods - use abstract interface to determine rewards etc.<br />
* Advanced strategy<br />
** Battle preparation (constructing suitable army & strategy)<br />
** Expert system for Bonuses ([http://forum.vcmi.eu/profile.php?mode=viewprofile&u=130 Warmonger])<br />
<br />
=== Main menu ===<br />
* Hall of Fame<br />
<br />
= Modding =<br />
* Possibility for creatures to cast arbitrary spells, as in H4/H5<br />
=== Scripting system ===<br />
* Language support<br />
* Synchronising scripts in multiplayer<br />
=== Mod system ===<br />
* Adding new content<br />
** Adventure map objects<br />
** Battlefields<br />
[http://forum.vcmi.eu/viewtopic.php?t=471&postdays=0&postorder=asc&start=0 Forum thread]<br />
<br />
=== Wog features ===<br />
* Mithril<br />
* ERM handling (Tow, Tow Dragon)<br />
<br />
= New features =<br />
* Support for other languages files ([http://forum.vcmi.eu/profile.php?mode=viewprofile&u=336 Ivan])<br />
* Support for multiple map levels<br />
* [http://forum.vcmi.eu/viewtopic.php?t=1139 New map editor]<br />
* Installer<br />
=== Online game ===<br />
* Simultaneous turns<br />
* Spectator mode<br />
* Dedicated server mode<br />
* [http://forum.vcmi.eu/viewtopic.php?t=264 Replays]<br />
=== Other platforms ===<br />
* Linux (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=112 forum thread])<br />
* Mac OS (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=439 forum thread])<br />
* Android (<span style="color:green">'''Supported'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=850 forum thread])<br />
* iOS (<span style="color:green">'''Supported'''</span>, [https://forum.vcmi.eu/t/ios-port/820 forum thread])<br />
* Haiku (<span style="color:yellow">'''Status unknown'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=310 forum thread])<br />
* Maemo (<span style="color:yellow">'''Status unknown'''</span>, [http://forum.vcmi.eu/viewtopic.php?t=328 forum thread])<br />
* FreeBSD (<span style="color:yellow">'''Status unknown'''</span>)<br />
<br />
= New graphics =<br />
=== New menus project and graphics ===<br />
* New stack experience menu ([http://forum.vcmi.eu/viewtopic.php?t=376&start=0 forum thread])<br />
* New stack artifact dialog<br />
=== Improved support for high resolutions ===<br />
* Auto-adjust resolution<br />
* Moddable menus<br />
=== New players ===<br />
* More player color graphics<br />
* New menus<br />
=== 32-bit graphics ===<br />
=== 800 x 480 resolution ===<br />
Experimental version posted on our forum is available [http://forum.vcmi.eu/viewtopic.php?t=273 here].<br />
<br />
= Platform-specific =<br />
=== iOS ===<br />
You can find the list [https://github.com/kambala-decapitator/vcmi/issues here]</div>Kambala