How to build Lix for a 32-bit Windows machine ============================================= If you get stuck at any point, don't hesitate to contact me (Simon N.) and ask me for help: Issues: https://github.com/SimonN/LixD/issues Forums: lemmingsforums.net, I'm Simon, we have boards for Lix IRC: irc.quakenet.org #lix, I'm SimonN or SimonNa E-Mail: s.naarmann@gmail.com Web: https://www.lixgame.com Consider 64-bit --------------- I encourage you to build the 64-bit version of Lix instead of 32-bit Lix! Please see ./doc/build/win64.txt instead of this file, and continue there. Since 2010, computers with 32-bit Windows are extremely rare. Most likely, you and your fellow players all have 64-bit machines. 32-bit Lix is inferior: D's garbage collector will often be confused by 32-bit pointers and thus will hog memory that could be freed. On large maps, 32-bit Lix will even crash. But in case 64-bit Lix has other problems for you, here are the 32-bit build instructions as a backup. Install D and dub ----------------- Download DMD, the Digital Mars D compiler: https://dlang.org/download During the installation, when asked: * Add the programs to PATH. You want to call them from the command line later. * You don't need to add anything to the start menu. * You don't need 64-bit support (32-bit building is easier to set up). * You don't need D1 support. If you would like, you may test the D environment. See appendix 1 at the bottom of this file for how to write and compile a hello world program. DMD already ships with dub, the D package manager. Clone the Lix repo and test dub ------------------------------- If you don't have git, download the source as a zip archive here, and unzip: https://github.com/SimonN/LixD/archive/master.zip If you have git, you can instead clone the repository: git clone https://github.com/SimonN/LixD.git Open a command line shell, navigate into the Lix root directory (where the file dub.json sits) and run: dub The package manager will download and set up D bindings for libraries I use. It should finish the compilation, but error out during linking, because we haven't installed the Allegro libraries. We will do that now. Install Allegro 5 ----------------- Locate your D installation directory, and look for the windows/ subdir. It might be in one of these paths: C:/D/dmd2/windows/ C:/"Program Files"/D/dmd2/windows/ ~/.wine/drive_c/D/dmd2/windows/ (if you're cross-compiling on Linux) This also has subdirectories bin/ and lib/. If you like, make backups of these directories, so you can retry if something goes wrong. To install Allegro 5, you have a choice between two methods. Method 1: Download the Allegro DLLs and *.lib files from my website: https://www.lixgame.com/dow/lix-dlls-libs-dmd32.zip Extract this into your D installation's windows/ directory. This way, the DLLs should automatically land in windows/bin/, and the *.lib files should land in windows/lib/. Method 2: Build Allegro 5.2 DLLs yourself, then follow the instructions by SiegeLord on how to generate your .lib files from your own DLLs: https://github.com/SiegeLord/DAllegro5#windows-notes Summary: Find implib.exe, then, for each Allegro DLL xyz, call: implib /s allegro_xyz.lib allegro_xyz-5.2.dll You can automate these calls with this batch file: https://github.com/SiegeLord/DAllegro5/blob/master/create_import_libs.bat Put the resulting .lib files in the D installation's lib/ dir. Remove the version number, e.g., `-5.2', from Allegro's .lib files in lib/. Do not remove the version number from the DLL files, and keep those in bin/. If it's not clear, ask me. See top of file for contact details. Install enet ------------ Method 1: If you extracted the `alleg-5.2-dlls-libs.zip' to which I pointed in the earlier section on installing Allegro, Option 1, you already have the enet DLL in the correct place, and don't have to do anything here. Method 2: Find an enet DLL of version 1.3.x or build one yourself from enet's source. Put enet.dll in the D installation directory's `windows/bin/'. In a pinch, Lix singleplayer works without the enet DLL, but Lix will terminate with an error once you try to connect to a networking server. Compile Lix ----------- Enter the Lix directory, and run: dub --compiler=dmd --arch=x86 It should build the game, finding and linking against the Allegro 5 libraries in the progress. If the game starts and runs without errors, compile a release build for performance: dub build -b release --compiler=dmd --arch=x86 This takes longer to build. In case of a crash, you won't get a good crash report either. Non-fatal errors go to ./user/log.txt. Add music --------- Lix has music, but the music is not in version control. I encourage you to add the music for a more complete experience. To get the music, download: https://www.lixgame.com/dow/lix-music.zip Extract this into Lix's directory, you'll get a subdirectory `./music/'. Appendix 1 ---------- To test whether the D compiler is set up, copy this into a file hello.d: import std.stdio; void main() { writeln("Hello World!"); } Open a command line shell, and run: dmd hello.d It should generate an executable file, hello.exe, and an intermediate object file, which you can safely delete. Appendix 2 ---------- If you want to use the D compiler LDC instead of DMD for building Windows 32-bit Lix, download these library files for Allegro and enet instead: https://www.lixgame.com/dow/lix-dlls-libs-ldc32.zip Extract this archive into your LDC installation directory, thus adding its files into the existing directories `bin` and `lib32`. Get help -------- If you run into any kind of roadblock, don't be shy and ask: Issues: https://github.com/SimonN/LixD/issues Forums: lemmingsforums.net, I'm Simon, we have boards for Lix IRC: irc.quakenet.org #lix, I'm SimonN or SimonNa E-Mail: s.naarmann@gmail.com Web: https://www.lixgame.com