[OTHER] [HOWTO]Debug crash issues

Lots of cool and useful tips to mod either serverside or clientside

[HOWTO]Debug crash issues

Postby Senshi » Wed Jan 23, 2013 9:27 pm

Battlefield 42 offers great modding capabilities, but in case of errors, it usually just locks up or crashes to desktop without any message. However, not all is lost, as BF42 actually has quite a reasonable debugging and loggin system that allows to get helpful pointers.

This tutorial will explain a bit on how to get at this information and how to understand some common crash issues diagnosed by these messages.

There are two ways to get advanced logging (called debugging). I like them to call "debug light" and "real debug".

The light version has the advantage of being far easier to do, but also offers far less information.
  1. Go to Battlefield 1942\Mods\bf1942\settings\ and open the VideoDefault.con with a text editor
  2. Change (or add, if it doesn't exist) this line:
    Code: Select all
    renderer.setFullScreen 0

    This disables fullscreen mode.
  3. Launch the game as usual and do everything you did to reproduce the crash. If the game encounters an "error" level issue in windowed mode, the game process gets paused and it generates a popup window, showing said message.
    This popup always offers three options: Ignore, Retry and Cancel.
    What these options do:
    Ignore - Ignores the error and tries to continue the game. If it's a fatal error, the game will now crash to desktop. If it's just a "warning" error, the game might be able to continue running without issues.
    Retry - The same as "Ignore", but will suppress all error popups in the future. Not really useful for debugging.
    Cancel - Immediately exits the game process.

    The error message given often is enough to help detect the responsible source (vehicle, terrain or similar).

In rare cases, the error message is not good enough or a popup does not occur when the game crashes. In these cases, you'll have to go for a real debug.

  1. Make sure you run in windowed mode.
  2. Launch the game with the bf1942_r.exe . This is the debugger exe that will feature a lot of additional possibilities.

    The debugger is far more critical than the regular exe, and it will give popup error messages even on "warning" level errors that are not necessarily fatal or even noticeable ingame. These are errors like having wrongly formatted audio files (44khz files in 11khz folders etc.) and can safely be ignored.
  3. This is the same as for the "light" version. Just reproduce your crash issue, everything will seem the same.
  4. One of the perks of the debugger is that it writes a logfile of every single action and call of the engine. These files are stored in the subfolder "Logs" of the active mod's folder (If you mod vanilla, it'll be in bf1942\Logs). Each run of the debugger, a new logfile will be generated. Just look for the correct timestamp and open the file.

    Usually, just looking at the last handful of lines in the file will give you enough info to find out the root of your issues, as obviously the debugger stops logging once it crashes :) .
  5. If you still cannot figure out what the hell happened, you at least have a set of solid information that you can open a new thread here on http://www.bfmods.com and explain the issue in detail, providing the last ten or so lines of the logfile right away. This will make it way easier for the rest of us here to help you.

Good luck with debugging!
User avatar
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany

Return to General Modding Tutorials

Who is online

Users browsing this forum: No registered users and 15 guests