How to build Lix on a Windows machine ===================================== If you get stuck at any point, don't hesitate to contact me (Simon N.) and ask me for help: IRC: irc.quakenet.org #lix E-Mail: s.naarmann@gmail.com Web: http://www.lixgame.com Forum: https://www.lemmingsforums.net -- we have a Lix board Install D and dub ----------------- Download dmd, the Digital Mars D compiler. It's possible to use compilers other than dmd, for example gdc, but dmd is the one I've been using. Get dmd here: http://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: http://www.lixgame.com/dow/alleg-5.2-dlls-libs.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: Maybe you don't trust me instructing you to download opaque binaries? :-) You can find or 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 Instead of calling implib for each file by hand, you could write a Windows batch file that calls implib for each DLL. Here's SiegeLord's 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 ------------ I don't remember anything for this. Look at the enet section of `./doc/build/linux.txt' and guess what you must do in Windows. Most likely, you don't have to do anything now. The DLL is already bundled with the download of alleg-5.2-dlls-libs.zip to which I pointed in the earlier secton on installing Allegro, Option 1. If anything goes wrong, the game will terminate when you click "Networking mode" from the main menu, then "Connect to central server". Compile Lix ----------- Enter the Lix directory, and run: dub 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 maximum performance: dub build -b release-nobounds This takes longer to build. In case of a crash, you won't get a good crash report either. Non-fatal errors go to ./data/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: http://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. Get help -------- If you run into any kind of roadblock, don't be shy and ask: Web: http://www.lixgame.com Issues: https://github.com/SimonN/LixD/issues E-Mail: s.naarmann@gmail.com IRC: irc.quakenet.org #lix, I'm SimonN or SimonNa Forums: lemmingsforums.net, I'm Simon