Skip to content

Commit

Permalink
Update building/running instructions for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Aug 6, 2024
1 parent 7bf3af9 commit f83d00d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 21 deletions.
56 changes: 47 additions & 9 deletions building.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ <h1>Plasma</h1>

<h2>Building</h2>

<p>Currently, the complete game client can only be built for Windows, using Visual Studio.</p>
<p>By default these steps will compile a client targeting your machine architecture. It is possible to build a 64-bit game client, but only the 32-bit (x86) client is officially supported.</p>
<p>Currently, the complete game client can only be built for Windows (using Visual Studio) and macOS (using Xcode). Several tools can be built for Linux, but not a complete game client.</p>
<p>By default these steps will compile a client targeting your machine architecture. It is possible to build a 64-bit game client, but only the 32-bit (x86) Windows client is officially supported.</p>


<h3 id="dependencies">Library Dependencies</h3>
Expand Down Expand Up @@ -151,11 +151,49 @@ <h3 id="building-windows">Building on Windows</h3>
</ol>


<h3 id="building-nix">Building on macOS &amp; Linux</h3>
<h3 id="building-mac">Building on macOS</h3>

<p>Linux and macOS are <strong>not officially supported targets</strong>, and the game client does not compile. However, several of the tools can be built and run.</p>
<p>Compiling on macOS requires macOS version 10.14 or newer, and the Xcode build system. Xcode is available as a free download from the <a href="https://apps.apple.com/us/app/xcode/id497799835?mt=12/">App Store</a>.</p>

<p>You will need to ensure all the required dependencies are available. On macOS, a Homebrew bundle file is included in the repository, which can be installed by running <code>brew bundle</code>. You can also use vcpkg on these platforms for automatically managing dependencies.</p>
<p>We strongly encourage using vcpkg to automatically build dependencies, however this requires some tools be manually installed in advance. The required tools are nasm and pkg-config, and can be installed using common package managers such as Homebrew or MacPorts.</p>

<p>For Homebrew users who wish to manage all dependencies, a Homebrew bundle file is included in the repository, which can be installed by running <code>brew bundle</code> after cloning the project.</p>

<ol>
<li>
<p>Clone the repository from GitHub, including all submodules, using a git client. On the command line, this can be done by executing the following:<br>
<code>git clone --recurse-submodules https://github.com/H-uru/Plasma.git</code></p>
</li>

<li>
<p>In the folder where you cloned the repository, run CMake to create a build folder:<br>
<code>cmake -G Xcode -DUSE_VCPKG=ON -B build -S .</code></p>
<p>This assumes you wish to use vcpkg to build dependencies. Leave off the <tt>USE_VCPKG</tt> flag to manage dependencies yourself.</p>
</li>

<li>
<p>Compile the project with the following command:<br>
<code>cmake -B build --config RelWithDebInfo</code></p>
</li>

<li>
<p>Install the resulting tools with the following command:<br>
<code>cmake -B build --target install --config RelWithDebInfo</code></p>
</li>

<li>
<p>The client will be built and installed into the <tt>build/install/client</tt> subfolder of where you cloned the repo.</p>
<p>The client output folder will be referred to as your “MOUL-OS” folder in the instructions on <a href="running.html">Running Plasma</a>.</p>
</li>
</ol>

<p>You can also open the project in the Xcode IDE by opening the <tt>build/Plasma.xcodeproj</tt> file.</p>

<h3 id="building-nix">Building on Linux</h3>

<p>Linux and other UNIX-like operating systems are <strong>not officially supported targets</strong>, and the game client does not compile. However, several of the tools can be built and run.</p>

<p>You will need to ensure all the required dependencies are available. You can also use vcpkg on these platforms for automatically managing dependencies.</p>

<ol>
<li>
Expand All @@ -165,19 +203,19 @@ <h3 id="building-nix">Building on macOS &amp; Linux</h3>

<li>
<p>In the folder where you cloned the repository, run CMake to create a build folder:<br>
<code>cmake --builddir build -S .</code></p>
<code>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build -S .</code></p>
<p>If you want to use vcpkg to automatically build dependencies, enable the <tt>USE_VCPKG</tt> option:<br>
<code>cmake -D USE_VCPKG=ON --builddir build -S .</code></p>
<code>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_VCPKG=ON -B build -S .</code></p>
</li>

<li>
<p>Compile the project with the following command:<br>
<code>cmake --builddir build --config RelWithDebInfo</code></p>
<code>cmake -B build</code></p>
</li>

<li>
<p>Install the resulting tools with the following command:<br>
<code>cmake --install build --config RelWithDebInfo</code></p>
<code>cmake -B build --target install</code></p>
</li>

<li>
Expand Down
28 changes: 16 additions & 12 deletions running.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ <h2>Running</h2>
<p>You should <strong>never</strong> use a custom-built client with servers that are not explicitly intended for testing. Newer features in the client code might be incompatible with those servers and could break the game for other players or result in permanent player data corruption.</p>
</div>


<h3 id="running-windows">Running on Windows</h3>
<p>Before running the client, you will need to do the following:</p>

<ol>
<li><p>Copy the folders <tt>avi</tt>, <tt>dat</tt>, and <tt>sfx</tt> from your existing MOULa installation to the MOUL-OS folder.</p></li>

<li><p>Get the appropriate <tt>server.ini</tt> file for the server you will be connecting to.</p></li>
</ol>

<h3 id="running-windows">Running on Windows</h3>

<ol start="3">
<li><p>Create a shortcut in the MOUL-OS folder to the compiled <tt>plClient.exe</tt>.</p></li>

<li><p>Edit the shortcut’s properties, and after the final quotation mark in the Target field, add <code>/LocalData</code>.<br>Also, change the Start in field to the path of your MOUL-OS folder.</p></li>
Expand All @@ -55,11 +58,7 @@ <h3 id="running-vs">Running in Visual Studio (for debugging)</h3>

<p>Follow these instructions if you wish to be able to debug using a single content folder from inside Visual Studio.</p>

<ol>
<li><p>Copy the folders <tt>avi</tt>, <tt>dat</tt>, and <tt>sfx</tt> from your existing MOULa installation to the MOUL-OS folder.</p></li>

<li><p>Get the appropriate <tt>server.ini</tt> file for the server you will be connecting to.</p></li>

<ol start="3">
<li><p>Open the Plasma folder in Visual Studio.</p></li>

<li><p>Switch to CMake Targets View in the Solution Explorer.</p></li>
Expand All @@ -72,14 +71,19 @@ <h3 id="running-vs">Running in Visual Studio (for debugging)</h3>
</ol>


<!-- No Linux client available, no point including this right now
<h3 id="running-linux">Running on Linux</h3>
<h3 id="running-mac">Running on macOS</h3>

<ol>
<li><p>Copy the folders <tt>avi</tt>, <tt>dat</tt>, and <tt>sfx</tt> from your existing MOULa installation to the MOUL-OS folder.</p></li>
<ol start="3">
<li><p>Open a terminal window in your MOUL-OS folder.</p></li>

<li><p>Get the appropriate <tt>server.ini</tt> file for the server you will be connecting to.</p></li>
<li><p>Run <code>./plClient.app/Contents/MacOS/plClient --LocalData</code> to start the client.</p></li>
</ol>


<!-- No Linux client available, no point including this right now
<h3 id="running-linux">Running on Linux</h3>
<ol start="3">
<li><p>Open a terminal window in your MOUL-OS folder.</p></li>
<li><p>Run <code>plClient --LocalData</code> to start the client.</p></li>
Expand Down

0 comments on commit f83d00d

Please sign in to comment.