Contents |
This section is only required the first time you wish to debug the Scorched 3D solution.
1. Make sure you have first completed all of the steps in Compiling in Windows.
2. Open the scorched project file, scorched.sln (you must download the source first Download_Source_Code)
Double click on the scorched.sln file in the root directory of the source code.
3. Choose "Debug" from the drop down at the top of the page for the Solution Configuration. Note: This will run Scorched3D in debug mode which will allow it to be debugged but will run at a much reduced speed.
3. Right click on the scorchedc project icon in the Solution Explorer window on the left hand side and choose "Properties" from the pop-up menu.
4. Select "Debugging" and change the working directory to : $(SolutionDir)
5. Repeat this process (steps 3 and 4) for each of the other projects (scorched, scorchedc and scorcheds).
1. Open the scorched project file, scorched.sln (you must download the source first Download_Source_Code)
Double click on the scorched.sln file in the root directory of the source code.
2. Build scorched3d
Press the F7 key or choose "Build Solution" from the "Build" menu.
3. Choosing what to debug
Make sure project you want to debug is selected as the default/startup project. In most cases this will be the "scorchedc" project (the main game).
Note: If you debug the launcher (the "scorched" project) you can launch the server and the client as usual, but this is not the best way to debug them as you will need to manualy attach the debugger afterwards.
4. Start Debugging
Press the F5 keys or choose "Start Debugging" from the "Debug" menu. The Scorched3D game should now start running as normal.
1. When Scorched3D crashes a dialog like the one below will usualy be shown. Choose the debug option.
2. A stack trace similar to the one below will be shown in the bottom right of the visual studio window. This shows the path through the source code to the error.
It is possible to select one of these path points by choosing a line from the stack frame drop down at the top of the screen.
If source code is available for the chosen stack frame it will be shown in the main window. Only source code for the lines that involve Scorched3D code will be available. The line in the source code that coresponds to the point in the stack trace should be indicated.
Advanced: You can also switch threads if you need to see what another thread is doing at the time of the crash. Each thread has a seperate stack trace, stack frames can be chosen as above for each thread.
3. Stop Debugging.
Press the Shift and F5 keys or choose Stop Debugging from the Debug menu.