-
Notifications
You must be signed in to change notification settings - Fork 0
Build Instructions
So first things first, lets get a copy of the source. You can download it from: https://github.com/Meridian59/Meridian59/zipball/master
Now that you've got it, extract it somewhere.
You can also use a git client, but unless you're planning on trying to push something to the branch, this is enough to get started.
You'll want to create the folders you need for the destination files to drop into.
Once you've got the source, you'll want to get a copy of Visual Studio:
Visual Studio 2008 Express Edition: http://www.microsoft.com/en-us/download/details.aspx?id=6506
Visual Studio 2012 Express Edition: http://www.microsoft.com/visualstudio/eng/downloads (Go down to Visual Studio Express 2012 for Windows Desktop, click the Plus and click "Install now")
Download now produces an ISO of the install CD which isn't bad either. Eventually you will be prompted to register, you'll need to do this to keep the software working past the 29 day eval. It's free, you just have to sign in a windows live account.
(Additional Resource: http://social.msdn.microsoft.com/Forums/da-dk/Vsexpressinstall/threads)
In order to compile the client, you'll need the Directx 8 SDK (the dx81sdk_full will work) and you'll want to include the SDK in the path. Someone on StackOverflow was nice enough to host it:
http://stackoverflow.com/questions/5192384/looking-for-the-old-directx-8-1-sdk
Extract it somewhere easily accessible (c:\dx8sdk for the example), and update the common makefile in the root of your build directory to include the libraries and headers for directx:
# c:\m59src\common.mak: LIB = $(LIB);$(BLAKLIBDIR);$(TOPDIR)\miles\lib;C:\dx8sdk\DXF\DXSDK\lib INCLUDE = $(INCLUDE);$(BLAKINCLUDEDIR);$(TOPDIR)\miles\include;C:\dx8sdk\DXF\DXSDK\include
Once you've installed I recommend creating a build environment batch file.
If you installed visual studio in c:\VS2012\
You'll want to create a shortcut that has the target of CMD /k "c:\VS2012\Common7\Tools\vsvars32.bat" And you can set it to start in the directory you extracted meridian in (eg: *c:\m59src*)
I named mine VS2012 CMD (Meridian)
What this does is make sure you have all the path and environment variables you need to successfully build a project.
To test this, open up the command shell you just created and execute:
nmake Bsprocket
You should get output something like:
c:\m59src>nmake Bsprocket Microsoft (R) Program Maintenance Utility Version 11.00.50727.1 Copyright (C) Microsoft Corporation. All rights reserved. Making in .\sprocket sprocket.c Creating library debug\sprocket.lib and object debug\sprocket.exp 1 file(s) copied.
Hurray! We built our first target.
Now that you've completed one target, we want to actually get blackserv running.
You should be able to type "nmake" at the top level to build all of the components.
Once you've built those components, you should be able to copy the dlls from the c:\m59src\run\localclient\ directory into the c:\m59src\run\server directory. (You will probably need to, though loadkod seems to handle sprocket.dll for you.)
After that, you should now be able to start blakserv.exe.
Once you've built the client and the server (using nmake RELEASE=1), you still need to make sure your client has all it needs to allow it to load all the relevant resources and maps.
The server (by default) references the room files in resource\room\*.roo and the bof/rsc files created by the Bkod target. Blakserv is going to treat those files as the correct versions. Your client should have a resource file that is a merged master of all the resources you built in the Bkod target.
To make that, you'll need to use the rscmerge command, which is documented in the provided manual. The below would work, if the localclient already had all the resources it needs. But since it doesn't we'll have to prepare it.
c:\m59src\bin\rscmerge.exe -o c:\m59src\run\localclient\resource\rsc0000.rsb c:\m59src\run\server\rsc\*.rsc
So I prepared a directory by pulling the bgf, wav,xmi,msi, and bsf files (and the lonely Heidelb1.ttf) with all the relevant resources, so it's a one click process post build to have an updated test client. We can fix some of this in the make process, but the resource files themselves still need to exist somewhere, so you can put them wherever you like. So long as it's the resource folder that has the newly generated rsc0000.rsb and proper roo files.
Example post build script:
@echo off echo Post-Build started. echo Clearing client RSC files... del .\run\localclient\resource\*.rsc echo Copying RSC files.... for /R .\kod\ %%f in (*.rsc) do copy "%%f" .\run\server\rsc\ echo Building RSB file.... .\bin\rscmerge.exe -o .\run\localclient\resource\rsc0000.rsb .\run\server\rsc\*.rsc if "%errorlevel%"=="0" echo RSB Success! echo Copying Room files to client folder. copy /y .\resource\rooms\*.roo .\run\localclient\resource\ echo Copying .dll files to client folder. copy /y .\module\chess\release\chess.dll .\run\localclient\resource\ copy /y .\module\mailnews\release\mailnews.dll .\run\localclient\resource\ copy /y .\module\merintr\release\merintr.dll .\run\localclient\resource\ copy /y .\module\char\release\char.dll .\run\localclient\resource\ copy /y .\module\intro\release\intro.dll .\run\localclient\resource\ copy /y .\module\dm\release\dm.dll .\run\localclient\resource\ copy /y .\module\admin\release\admin.dll .\run\localclient\resource\ echo Copying Official Graphics to client folder... copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.bgf" .\run\localclient\resource\ copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.wav" .\run\localclient\resource\ copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.xmi" .\run\localclient\resource\ copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.mp3" .\run\localclient\resource\ copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.bsf" .\run\localclient\resource\ copy /y "%userprofile%\AppData\Local\Meridian 59\resource\*.mid" .\run\localclient\resource\ echo Post-Build Finished.
That will create the directory in the localclient path, and drop the rsb file that makes reference to the kod files you just built. It will also put the room roo files into the same path, so you can actually load rooms. The dlls relevant to the client are also copied so you can test admin/dm/and regular user functions. If you have installed the 101/102 client from http://www.meridian59.com, it will also copy the graphics, and sounds to the test client resource path.