JurassicParkTrespasser/jp2_pc
2020-05-08 18:39:44 +02:00
..
BinData Initial commit 2018-01-01 23:07:24 +01:00
BuildTools CMake: move CMake binary submodule from Tools to BuildTools 2020-03-28 13:20:09 +01:00
cmake SystemTest/CMakeLists.txt: add IniFileTest.cpp 2020-04-23 22:05:00 +02:00
Documents Initial commit 2018-01-01 23:07:24 +01:00
gtest@6a7ed316a5 gtest: forward to head of v1.10.x branch 2020-04-16 00:29:40 +02:00
Inc MaxSDK/tab.h: use modern STL header names 2020-04-04 13:54:48 +02:00
lib Initial commit 2018-01-01 23:07:24 +01:00
Metrowerks Additions Initial commit 2018-01-01 23:07:24 +01:00
MWBuild Initial commit 2018-01-01 23:07:24 +01:00
Source TexturePackSurface: add cache of deleted nodes to prevent following dead links 2020-05-08 18:39:44 +02:00
Tools Initial commit 2018-01-01 23:07:24 +01:00
.cproject Initial commit 2018-01-01 23:07:24 +01:00
.project Initial commit 2018-01-01 23:07:24 +01:00
ADPCM.eel Initial commit 2018-01-01 23:07:24 +01:00
AI.DSP Initial commit 2018-01-01 23:07:24 +01:00
Ai.mcp Initial commit 2018-01-01 23:07:24 +01:00
ai.txt Initial commit 2018-01-01 23:07:24 +01:00
ArtStats.txt Initial commit 2018-01-01 23:07:24 +01:00
Audio.dsp Initial commit 2018-01-01 23:07:24 +01:00
Audio.mcp Initial commit 2018-01-01 23:07:24 +01:00
Bugs.dsp Initial commit 2018-01-01 23:07:24 +01:00
CacheList.txt Initial commit 2018-01-01 23:07:24 +01:00
CMakeLists.txt Root/CMakeLists.txt: add RegToIniConverter 2020-04-23 22:05:24 +02:00
CollisionEditor.dsp Initial commit 2018-01-01 23:07:24 +01:00
DebugLog.txt Initial commit 2018-01-01 23:07:24 +01:00
dsort.txt Initial commit 2018-01-01 23:07:24 +01:00
EntityDBase.dsp Initial commit 2018-01-01 23:07:24 +01:00
EntityDBase.mcp Initial commit 2018-01-01 23:07:24 +01:00
Error.scn Initial commit 2018-01-01 23:07:24 +01:00
errorlog.txt Initial commit 2018-01-01 23:07:24 +01:00
File Test.dsp Initial commit 2018-01-01 23:07:24 +01:00
File.dsp Initial commit 2018-01-01 23:07:24 +01:00
fog.txt Initial commit 2018-01-01 23:07:24 +01:00
Game.dsp Initial commit 2018-01-01 23:07:24 +01:00
Game.mcp Initial commit 2018-01-01 23:07:24 +01:00
Generate-VS2019-x86.cmd CMake: add script to generate VS2019 solution with CMake 2020-03-28 21:45:03 +01:00
GeomDBase.dsp Initial commit 2018-01-01 23:07:24 +01:00
GeomDBase.mcp Initial commit 2018-01-01 23:07:24 +01:00
GroffBuild.dsp Initial commit 2018-01-01 23:07:24 +01:00
GroffExp.dsp Initial commit 2018-01-01 23:07:24 +01:00
GUIApp.BCE Initial commit 2018-01-01 23:07:24 +01:00
GUIApp.dsp Initial commit 2018-01-01 23:07:24 +01:00
GUIApp.mcp Initial commit 2018-01-01 23:07:24 +01:00
GUIApp.plg Initial commit 2018-01-01 23:07:24 +01:00
Hardware.txt Initial commit 2018-01-01 23:07:24 +01:00
HardwareD3D.txt Initial commit 2018-01-01 23:07:24 +01:00
How to build .doc Initial commit 2018-01-01 23:07:24 +01:00
JP2_PC.dsp Initial commit 2018-01-01 23:07:24 +01:00
JP2_PC.dsw Initial commit 2018-01-01 23:07:24 +01:00
JP2_PC.opt Initial commit 2018-01-01 23:07:24 +01:00
lastopt.txt Initial commit 2018-01-01 23:07:24 +01:00
LastScene.scn Initial commit 2018-01-01 23:07:24 +01:00
Loader.dsp Initial commit 2018-01-01 23:07:24 +01:00
Loader.mcp Initial commit 2018-01-01 23:07:24 +01:00
LoadLog.txt Initial commit 2018-01-01 23:07:24 +01:00
Math.dsp Initial commit 2018-01-01 23:07:24 +01:00
Math.mcp Initial commit 2018-01-01 23:07:24 +01:00
MathTest.dsp Initial commit 2018-01-01 23:07:24 +01:00
memoptions.txt Initial commit 2018-01-01 23:07:24 +01:00
MessageLog.txt Initial commit 2018-01-01 23:07:24 +01:00
Missing.cau Initial commit 2018-01-01 23:07:24 +01:00
occlusion.txt Initial commit 2018-01-01 23:07:24 +01:00
options.txt Initial commit 2018-01-01 23:07:24 +01:00
physics-stats.txt Initial commit 2018-01-01 23:07:24 +01:00
Physics.dsp Initial commit 2018-01-01 23:07:24 +01:00
Physics.mcp Initial commit 2018-01-01 23:07:24 +01:00
physics.txt Initial commit 2018-01-01 23:07:24 +01:00
PhysicsLog.txt Initial commit 2018-01-01 23:07:24 +01:00
PhysicsTest.dsp Initial commit 2018-01-01 23:07:24 +01:00
PhyState-000.txt Initial commit 2018-01-01 23:07:24 +01:00
PhyState.txt Initial commit 2018-01-01 23:07:24 +01:00
PipeLineTest.dsp Initial commit 2018-01-01 23:07:24 +01:00
PolyDump.txt Initial commit 2018-01-01 23:07:24 +01:00
predict.txt Initial commit 2018-01-01 23:07:24 +01:00
Processor.dll Initial commit 2018-01-01 23:07:24 +01:00
ProcessorDetect.dsp Initial commit 2018-01-01 23:07:24 +01:00
QuantizerTool.dsp Initial commit 2018-01-01 23:07:24 +01:00
Readme.doc Initial commit 2018-01-01 23:07:24 +01:00
README.md jp2_pc/README.md: - add explanation of dout debug channel 2020-04-26 11:54:08 +02:00
Readme.txt Initial commit 2018-01-01 23:07:24 +01:00
Render3D.dsp Initial commit 2018-01-01 23:07:24 +01:00
Render3D.mcp Initial commit 2018-01-01 23:07:24 +01:00
ScreenRenderDWI.dsp Initial commit 2018-01-01 23:07:24 +01:00
ScreenRenderDWI.mcp Initial commit 2018-01-01 23:07:24 +01:00
Settings.d3d Initial commit 2018-01-01 23:07:24 +01:00
shadows.txt Initial commit 2018-01-01 23:07:24 +01:00
SlideTest.scn Initial commit 2018-01-01 23:07:24 +01:00
SMACKW32.DLL Initial commit 2018-01-01 23:07:24 +01:00
Spatial.txt Initial commit 2018-01-01 23:07:24 +01:00
standard.txt Initial commit 2018-01-01 23:07:24 +01:00
Start-CMake-GUI.cmd CMake: add shortcut script to start the CMake GUI 2020-03-28 21:45:42 +01:00
Stats.csv Initial commit 2018-01-01 23:07:24 +01:00
Std.dsp Initial commit 2018-01-01 23:07:24 +01:00
Std.mcp Initial commit 2018-01-01 23:07:24 +01:00
System.dsp Initial commit 2018-01-01 23:07:24 +01:00
System.mcp Initial commit 2018-01-01 23:07:24 +01:00
terrain.txt Initial commit 2018-01-01 23:07:24 +01:00
test.eel Initial commit 2018-01-01 23:07:24 +01:00
Test.scn Initial commit 2018-01-01 23:07:24 +01:00
TextureLog.txt Initial commit 2018-01-01 23:07:24 +01:00
TextureUse.txt Initial commit 2018-01-01 23:07:24 +01:00
trespass.dsp Initial commit 2018-01-01 23:07:24 +01:00
trespass.mcp Initial commit 2018-01-01 23:07:24 +01:00
TweakTrespass.exe Initial commit 2018-01-01 23:07:24 +01:00
View.dsp Initial commit 2018-01-01 23:07:24 +01:00
View.mcp Initial commit 2018-01-01 23:07:24 +01:00
vssver.scc Initial commit 2018-01-01 23:07:24 +01:00
WaveTest.dsp Initial commit 2018-01-01 23:07:24 +01:00
WinShell.dsp Initial commit 2018-01-01 23:07:24 +01:00
World.txt Initial commit 2018-01-01 23:07:24 +01:00

Getting started with OpenTrespasser

General build requirements

Visual Studio 2019 with the C++ Desktop Development workload is required. That includes the C++ compiler and the Windows SDK. You will also need the packages for MFC and ATL libraries.

All other libraries and tools are provided in this repository, either directly or from Git submodules.

You should install the game Trespasser before starting development on OpenTrespasser, so that the game directory can be autodetected.

Generating the VS solution with CMake

The project configuration and build instructions are written in a CMake script.

It is recommended that you generate a VS solution and VS projects and work with these generated files. To do this, run the script Generate-VS2019-x86.cmd, the solution and project files will be generated under Build\cmake-x86.

If you want more control over CMake, then you can also run CMake-GUI with the launch script Start-CMake-GUI.cmd.

You can regenerate the solution with CMake while it is still open in VS. In that case, VS will ask if you want to reload the solution, which you should do.

VS2019 also has built-in support for CMake projects (if you install the package for that), but this has not been tested yet with OpenTrespasser.

Project configurations

OpenTrespasser knows three project configurations:

  • Debug: Compiler optimizations are disabled, runtime checks are enabled. All debugging code is enabled.
  • Release: Compiler optimizations are enabled, runtime checks are reduced to default. Some, but not all, debugging code is disabled.
  • Final: Same as Release, but all debugging code is disabled.

Note that debug symbols (PDBs) are generated in all three configurations, so using the debugger is always possible.

Execution and debugging

The game executable trespass.exe needs to be run in the Trespasser game directory, usually found in the C:\Program Files (x86)\... path. If a Trespasser installation is detected by CMake, then the Trespasser directory is automatically set to be the working directory for debug execution in VS. This means that you can start the game directly from VS.

Also the built trespass.exe is automatically copied to the Trespasser directory after each build.

Depending on your system configuration, a program running in the Trespasser directory might require elevated rights to write files in that directory. It is recommended that you start VS with admin rights (see below). You should also configure the program to start with admin rights directly, via the compatibility settings.

16bit color depth mode

The renderer only supports 16bit color depth. Adding 32bit support is an open issue.

Running the game with 32bit color depth is possible, but the graphics are faulty and it will inevitably crash after a few minutes. Some apps like GUIApp completely refuse to start in 32bit color depth mode.

We do not know how to make VS start a program in 16bit color depth mode. Perhaps it can be done by starting VS with 16bit color depth, but that would be very inconvenient.

The recommended procedure for using 16bit color depth is this:

  • Open the executable's compatiblity settings. Open its file properties and go to the compatibility tab.
  • Set the color mode to 16bit.
  • Start the program.
  • If you need the debugger, attach it manually as described below.

Attaching the debugger manually

You can use the VS Debugger without starting a program from VS. In the Debug menu in the main menu bar, there is a command to attach to a running process. If you attached the debugger once, another command is added to the Debug menu to reattach it, so you don't have to reselect the process.

When starting Trespasser, a warning message might pop up, telling you that your graphics driver is not certified for DirectDraw. It is highly recommended that you do not disable that message. The moment that warning is on display is an excellent opportunity to manually attach the debugger.

Output of debug information

In any normal Win32 GUI program, including the Trespasser game, output to console via std::cout and std::cerr does not work because there is no console. However, Windows offers a special debug output channel, which can be viewed in the Output window in Visual Studio. Trespasser gives convenient access to that channel with the global output stream dout (declared in Lib/Sys/DebugConsole.hpp), which can be used just like std::cout. Note that all output to dout is discarded in Final builds.

Trespasser also supports other forms of debug output, including log files and writing text directly to the game screen, as demonstrated by the bones cheat.

General Tips and Troubleshooting

  • Launch Visual Studio with admin rights. Just open the context menu (right-click) for its entry in the start menu and select Run as Admin. Trespasser wants to write files to its own directory under C:\Program Files (x86)\..., and that requires elevated rights on modern Windows configurations. By launching VS with admin rights, it can launch Trespasser with elevated rights as well.

  • If you want to make a new tool with the Trespasser code and use MFC/AFX in your project (like the GUIApp), then add this line before you include the MFC headers (i.e. in stdafx.h or pch.h):

    • #define DIRECT3D_VERSION 0x0700

    • The old Direct3D code in the Windows SDK headers is only activated if your project is based on Direct3D 7.0 or lower. In modern Windows SDKs, the MFC headers include the stuff of newer Direct3D versions by default.

  • If you get the error The command "setlocal during the build, that means something went wrong in the postbuild step which is supposed to copy the newly built trespass.exe to the Trespasser directory.

    • Ensure that VS is started with Admin rights (see above)
    • If the problem persists, disable the postbuild step.
      • To disable it in VS, open the project settings for trespass, go to Build Events and remove the postbuild command. Note that it will be added again when the solution is regenerated by CMake.
      • To disable the postbuild step in CMake, regenerate the solution, but set the CMake variable USE_TRESPASSER_DIRECTORY to FALSE. That can be easily done with the CMake GUI.