Skip to content

How to compile trans3.exe

swordmaster2k edited this page Sep 19, 2013 · 13 revisions

Introduction

This is a no-nonsense "how-to" on compiling trans3.exe or namely the RPGToolkit's engine, using Visual Studio 2008 Express. This document was created with the hope of addressing the issue that has effected the development of the Toolkit over the past 5 years, which was:

No-one had a clue how to compile it nor did the previous developers leave behind any kind of documentation that even hinted towards successful compilation.

I would like to thank Khin for his invaluable help, as it was Khin who first successfully built and ran trans3.exe.

Basic Requirements

System Requirements

Realistically all you need is a system with about 2GB RAM (4GB RAM for 64bit), 1.5GHZ CPU, and about 7GB-10GB of free hard disk space. I highly recommend that you use Windows 7 for development as XP is starting to age and certain bugs might not appear on XP that would otherwise effect Windows Vista/7/8. The engine is wrote and compiled for 32bit architecture but should work fine on a 64bit OS. I have yet to build this on Windows 8.

Intellectual Requirements

At the bare minimum you need some working knowledge of C++ it doesn't have to be VC++ and also you will have to be familiar with the Visual Studio environment. You don't have to be a pro at either but you must have a good understanding of how to use BOTH of them. You may also need some knowledge of Git or another source control system.

Basically I will be assuming throughout this tutorial that you are reasonably competent programmer with at least some common sense, if your not then don't bother, simple as that. With that said I'll continue.

Getting Everything Together

Obtaining the Source

The latest version of the source code can be pulled from the Github repository at http://www.github.com/rpgtoolkit/engine. Alternatively you can download a snap snot of the repository as a zip file.

DO NOT move the source code into a directory that contains a space in its path, put it somewhere like _C:_ or C:\Users[your user name]\Documents, otherwise you may encounter problems when it comes to building it.

Windows Driver Kit 7.1.0

The engine relies heavily on MFC and ATL Microsoft technologies. Visual Studio C++ 2008 Express Edition does not come with either MFC or ATL integration so we will have to download them separately and link to them manually later.

The MFC and ATL libraries are included in the Windows Driver 7.1.0 which can be obtained from http://www.microsoft.com/en-us/download/details.aspx?id=11800. The download is stored as an .ISO disc image so you can either burn it to disc or extract the files using 7zip, if you choose to extract it then you will need to run “KitSetup” manually.

When you reach the features page of the setup you can leave out support for the “Device Simulation Framework” and the “Windows Device Testing Framework”, install everything else.

Selecting components.

Accept all of the license agreements and wait for it to finish installing. It will by default install itself to the _[main system drive]:\WinDDK\7600.16385.1_ path.

Setting install path.

Microsoft DirectX Feb2010 SDK

The engine also requires the DirectX SDK for some of its rendering routines, the previous version used DirectX 7, it has now moved onto DirectX 9. The SDK can be obtained from http://www.microsoft.com/en-us/download/details.aspx?id=10084. The download comes as an application just run it, accept the license and click next all the way through.

DirectX 9 SDK

Visual Studio C++ 2008 Express Edition

Finally you'll need to install Visual Studio C++ 2008 Express Edition. Downloads for this application are becoming rarer but it can be found at this Google link. Simply accept any license agreements and do not install SQL Server or Silverlight, it consumes around 1.8GB of disk space.

Visual Studio installation.

Configuration

Creating the Required System Variables

During compilation you'll need to include a number of header files and libraries from the DirectX SDK and the Windows Driver Kit, this will be done using System Variables. The DirectX SDK installer adds the required system variable itself so we only have to worry about the one for the Windows Driver Kit installation.

Computer->Properties

Right click “Computer” either on your desktop or Start Menu and click properties. On your system's properties page find the link to the “Advanced system settings” located in the top left of the window. Under the “Advanced” tab click on the “Environment Variables” button. It is here that we will add the required system variable. Under “Systems variables” click new and add a variable containing the following:

Adding a system variable.

Remember to substitute the drive letter for your own, typically _C:_. Hit OK, then OK again, followed by Apply. With that all done restart your computer for the changes to take effect.

Including Headers and Libraries

Open the trans3 solution file located in [where you put it]\RPGToolkit\engine\Trans3_2\vc\trans3. The project will be opened hopefully by Visual Studio 2008, if you have another version of Visual Studio installed you'll probably have to use right click->Open with. After you've opened Visual Studio 2008 go to: Tools->Options.

Options

Under the Options window find Project and Solutions->VC++ Directories, and select Show Directories for: Include files. Add the following three entires:

  1. $(WINDDK_DIR)inc\atl71
  2. $(WINDDK_DIR)inc\mfc42
  3. $(DXSDK_DIR)Include

Include files.

Next select Show Directories for: Library files, add the following three entires:

  1. $(WINDDK_DIR)lib\ATL\i386
  2. $(WINDDK_DIR)lib\Mfc\i386
  3. $(WINDDK_DIR)inc\win7\i386

Library files.

Double check all of the paths and click OK. If your using Windows XP then change the third entry to read: $(WINDDK_DIR)inc\winxp\i386.

Project Settings

Working Directory

Right click on the project in the project explorer and select properties, alternatively use Project->trans3 Properties... or ALT+F7.

Working directory.

Under the Debugging section set the “Working Directory” to a valid Toolkit3 install path, and apply the changes.

Updating FreeImage and Audiere

FreeImage and Audiere were recompiled with Visual Studio 2008 so you'll need to replace the ones that came with the Toolkit install that your going to test the engine with. FreeImage can be found in the engines source code folder under RPG-Toolkit\engine\vc\tkCommon\images, Audiere can be found at RPG-Toolkit\engine\vc\trans3\audio. Copy both .dll's and replace the ones that came with your test Toolkit install.

Updating FreeImage and Audiere

Building

Assuming that you followed all of the above steps correctly you should simply be able to do a full rebuild of the solution Build->Rebuild Solution. It will take several minutes to fully rebuild so be patient and wait for the result which should look like:

Output.

Once this has finished successfully, click the run button. Congratulations you've just run trans3.exe!

Success!