Recently I tried to compile and run the source code of Quake 3 engine. I basically followed this article. However it doesn't work for me.

I am using Visual Studio 2010 on Windows 7, with June 2010 DirectX SDK (I doubt if it is necessary). Here is how I did:

  1. Install the original version of Quake 3 Arena to "D:\Quake III Arena", and update to 1.32
  2. Download and extract the source code
  3. Open quake3.sln in "code" folder. Visual Studio upgraded it to 2010 format.
  4. Build all the 8 projects in Debug mode (in some order). I checked that every project had been built successfully
  5. In the properties of quake3 project, in Debugging page, I changed "Working Directory" to "$(TargetDir)" and "Command Arguments" to "+set fs_cdpath "D:\Quake III Arena""
  6. Set quake3 as the Startup Project and press F5

The game started and could correctly recognize the game folder and parse some options, such as screen resolution. However an exception window popped out before I can see the game main menu, saying "Unhandled exception at 0x053e9938 in quake3.exe: 0xC0000005: Access violation."

I tried to start the game from command line, but it had the same problem.

I followed the code and found that the exception was generated in int VM_CallCompiled(vm_t *vm, int *args), when executing call entryPoint in the __asm block, located in line 1148 of vm_x86.c. Since it's assembler code, I don't know how to debug it.

I don't know if anyone here knows about this problem. Could anyone provide some help on this? Thanks gratefully.

  • \$\begingroup\$ Callstack? Look at the parameters of the functions, this might give you an idea. Looks like a NULL pointer access, look where this pointer is coming from. \$\endgroup\$ – Maik Semder Jun 13 '11 at 12:56
  • \$\begingroup\$ Correction: not a NULL pointer, I was reading 0x00000005, however, did you run a debug build or release build? Try to build a debug build if you didnt do it yet. \$\endgroup\$ – Maik Semder Jun 13 '11 at 14:00
  • \$\begingroup\$ Can you write the call stack?, this window can be shown in Debug->Windows->Call Stack \$\endgroup\$ – momboco Jun 13 '11 at 14:03
  • \$\begingroup\$ This is probably an error inside the Q3VM, which is a byte code interpreter/JIT. Can you rebuild the game code as DLL:s instead of Q3VM and run that? vm_cgame 0, vm_game 0 and vm_ui 0 in your config to use native DLL:s instead of byte code. \$\endgroup\$ – void Jun 13 '11 at 14:32
  • 1
    \$\begingroup\$ @void Ah, I figured out, I have to add another parameter +set sv_pure 0. It was inspired from some comments in unix\ChangeLog. Thank all the people here. \$\endgroup\$ – markeric Jun 13 '11 at 16:02

Add +set sv_pure 0 +set vm_game 0 +set vm_cgame 0 +set vm_ui 0 in the command line argument.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.