Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Wintermute Engine source code - the complete guide  (Read 18671 times)

0 Members and 1 Guest are viewing this topic.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Wintermute Engine source code - the complete guide
« on: March 23, 2013, 04:18:25 PM »

Obtaining the source code

The source code is available in a public repository stored on BitBucket. There are several ways of getting the code:

1) Download the code in a compressed archive. Go to the downloads section, select the "tags" or "branches" tab and download the arcive of your choice. The "tip" tag represents the latest version of all files.
2) Clone the repository on your computer. You will need a mercurial client for this. If you prefer GUI tools, you'll probably want to use TortoiseHG. In TortoiseHG Workbench use the "Clone repository" command. The advantage is that you can later refresh your local repository by pulling new changes.
3) Create a fork of the repository on BitBucket. Use the fork link on BitBucket. Use this option if you want to work on the source code, separately from the main repo. You can then offer your changes by sending a pull request to the main repository.


Preparing your development environment

WME development is done in Visual Studio 2008. Therefore all the solution and project files, as well as precompiled dependencies are in Visual Studio 2008 format. It *should* be possible to compile in newer Visual Studio versions, but I haven't tried. Also, if you are using Visual Studio 2008 Express, you may need to install the Windows SDK and modify some of the sources (namely the .rc files, referencing the afxres.h file which is not included in VS Express).

To be able to compile the engine and the tools, you will need to install DirectX SDK. WME comes in two flavors, DirectX8 and DirectX 9. For DirectX 9 it's been tested with the "DirectX SDK June 2007", which can be downloaded HERE. It may or may not work with newer SDKs, I haven't tried.
The DirectX 8 version is more tricky. Since Microsoft doesn't support DX8 anymore, the neseccary header and lib files are no longer included in the SDK. To be able to compile the DirectX 8 version of WME you will need a fairly old version of SDK, which can be downloaded HERE (external site, MS doesn't provide the SDK anymore).

Next you will need to setup the directories in Visual Studio properly. Go to "Tools -> Options" and select "Project and Solutions" and then "VC++ Directories". Now setup your directories similarly to following pictures. The "F:\DXSDK\" path represents the location of the old DirectX SDK, and "F:\DXSDK (June 2007)" is the June 2007 DirectX SDK. Please note that the order of items DOES matter!



Note: In Visual Studio 2010 and later these directories are set on a per-project basis.


Compiling the source

Once you have obtained the source and setup your environment properly, you should be able to compile the engine and tools. There are many solutions included, representing various pieces of Wintermute Development Kit. What you'll be probably most interested in is the engine runtime itself. You'll find the solution file in "src\wme\wmeold.sln". By changing the build configuration you can choose between Debug, Release, Debug D3D9 and Release D3D9.
The tools each live in their own directory, e.g. ProjectMan solution is in "src\ProjectMan\ProjectMan.sln" etc.

There's a special solution for building everything needed for a complete Wintermute Development Kit. It's in "src\BuildAll\BuildAll.sln". However it probably won't wor for you unless you switch the build configuration to "Release" and unless you've build the individual projects before. But, must people won't need this solution anyway.

The dependencies (3rd party libraries used by WME) can be found in the "src\external_lib" directories. They are precompiled for Visual Studio 2008, but if you are using a different VS version or if you want to get rid of the annoying "debugging information is missing" warning while compiling WME, you will need to recompile the dependencies. Each of the libraries comes with a .sln file which can be used for this.


Running WME from Visual Studio

If you compile WME in Visual Studio and try to run it, you will probably get the "Some of the essential game files are missing" error. That's because your freshly compiled WME executable doesn't know what game to run. You must point it to a WME project. To do so, first right-click the "wme" project in Solution Explorer and choose "Properties":



In the properties window choose "Configuration Properties -> Debug", and fill-in the "Command Arguments" field. Enter something like: -project "path_to_your_game\project.wpr" (remember to enclose the path in quotation marks if it contains spaces).



Note that this option is build-configuration specific, i.e. different for Debug builds, Release builds etc.

Next time you execute WME from Visual Studio, it should run the specified project. If you only see a black screen, it means WME cannot compile game scripts, because it can't locate the script compiler. The easiest way is to copy the "dcscomp.dll" file to the same directory where your freshly compiled wme.exe file is located (e.g. src\wme\Debug\wme.exe). The dcscomp.dll is the WME script compiler, and you will find it in your WME installation directory (or you can compile it yourself, the sources are included as well).


Note about porting

From time to time someone attempts to port WME to other platforms. Before you attempt anything like that, please note that there already IS a portable fork of WME. It's called WME Lite and it has a dedicated forum section. The tools, I'm afraid, are totally non-portable.

Also ScummVM does support WME games now.


Closing words

If you have any questions or suggestions related to WME source release, please start a new thread in this forum section.
« Last Edit: March 23, 2013, 04:24:22 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.108 seconds with 24 queries.