Post tutorial RSS Homeworld 2 Error Codes

When the game crashes, usually the reason for the crash is explained in Hw2.log, but there're some cases that there's simply no reason for the crash. This tutorial aims to record different reasons for crashes that apparently have no reason!

Posted by on - Basic Client Side Coding

Some HW2 crashes just won't give any reason in Hw2.log, for example:

1. If LoadModel(NewShipType, 1) is put behind StartShipHardPointConfig() function in any ship script, the game will crash without any reason.

2. If LoadSharedModel() function is used for a subsystem script, make sure the target subsystem exists, otherwise the game will crash without any reason.

3. The outer boound of a map could be the reason for crash wihout any reason, increase it until it doesn't crash anymore. This problem could occur only when there's something really big in the map, for example, a planet.

4. The lod levels in ship script should match with the ones in the HOD file, otherwise when you zoom in on the ship, the game will crash without any reason.

5. From my experience, if the HOD file is somehow messed up, the game will crash without any reason.

6. The shader types and algorithm in every HOD model should match those in the shader folder. If there's any mismatch, the game will crash without giving any reason.

Here're some frequently recorded error codes in the ErrorLog.txt or MiniDump.dmp:

00000000 -- general issues, like loading a later game without outer bounds, or when a game has turned too messy and the memory is screwed up somehow. In the latter case, there's no clear solution except making the game less messy. One possible scenario is too many damage sound fx being played at the same time (dmp file shows exception code 0xC0000005), and applying a max polyphony limit to the sound should fix it. Changing the battlescar files (removing some battlescars) and then loading an previous game will cause this crash too during loading screen (dmp file shows exception code 0xC0000005).

One type of this crash shows Bytes at CS:EIP: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??. This is most likely related to internal AI logic error (for example, when there is a wave spawn system for survival mode). The solution seems to be removing the AI at the spawn of the ships and program their behaviour using lua script instead.

0000000c -- related to big objects colliding when moving or rotating. Trying to avoid collisions by removing these big objects or making them unmoveable solves the problem. If there's a singularity or black hole that pulls all ships towards the center of the map, this collision error will definitly occur at some point in the game.

This crash also occurs right after a new game has loaded if a ship HOD contains undefined navlight. Bytes at CS:EIP: d8 51 0c df e0 f6 c4 05 7a 05 d8 71 0c eb 3d d8

00000004 -- This happens when a ship file loads a non-existing shared model or the ship HOD is missing (or have the wrong name).

00000010 -- This happens when a ship is built but its builder doesn't have "ShipHold" ability (exception code is 0xC0000005 in the dmp file).

0000010c -- This happens when SobGroup_SpawnNewShipInSobGroup is used to create ship belonging to the 7th (non-existent) player. Exception code is 0xC0000005 in the dmp file.

This crash can also be produced when using a ship HOD in the background folder (don't ask me why I tried that).

It crashes at game start when there are undefined asteroids in the map.

The absence of a mad file in the ship's folder caused a crash of 00000010, while madstate was still there!

There is strong evidence that repeated use of SobGroup_SetSwitchOwnerFlag in conjunction with SobGroup_MakeUntargeted function for an ever changing global sobgroup (such as during the spawning of dummy hyperspace gates) will cause 00000010 crash.The safe solution seems to be moving the SobGroup_SetSwitchOwnerFlag function to the beginning where that sobgroup was first created and call it there only once, and also removing all make untargeted commands (this was the bug that haunted my mod for 3 years and took hundreds of games to debug).

When the salvages of a ship don't have HOD models, 00000010 crash will occur upon loading the map that contains this ship. In ErrorLog.txt, there is mentioning of lua_error and lua.dll, except the list is much longer, and the bytes at CS:EIP are: 8b 48 10 83 c4 10 8d 85 98 fe ff ff 50 e8 2a 40.

00000020 -- this error code appears when the save menu says there's some invalid file name and crashes, but it could also have something to do with the hangar management system. In some occassions, accessing the launch menu just after a ship exited hyperspace will crash the game and give this error code, especially when there're supposed to be some instant dockers in the dock (e.g., repairing patchers are programmed to instantly dock when the host enters hyperspace). If the launching menu is accessed 10 seconds after hyperspace is finished, there won't be such a problem.

This code can also be produced when AMD graphics card is used to launch some mod for HW2Classic from the HWR bundle, causing instant crash (the solution is to add " -nopbuffer" to the command line, but at the cost of losing shadows).

00000030 -- I suspect this is related to launching conflict, or perhaps forced AI behaviour without removing the AI.

00000034 -- this can be caused by corrput debris fx in the events file (crashes during load). It can also be caused by loading ship HODs that have unsupported shaders (like loading HWR ship or asteroid models in HW2).

00000168 -- map object not found in the given type. This can happen when a dust cloud object is added with the addCloud function. Also happens when a weapon fire is not found in the weapon file.

00000368 -- linked to 00000000 crash, likely related to internal AI logic. Removing the AI for the ships can solve it.

00781000 -- related to visual effect overloading (dmp file shows exception code 0xC0000005). Bytes at CS:EIP:
a5 a5 8b 7d e8 83 45 e8 68 83 c7 20 ff 4d dc 8d

6bd11cd8 -- too many skirmish options than allowed (max is 32).

When too many Hiigaran pulsar beams, smoke animations or damage effects (especially dmg_damage_puff_combo and the default subsystem damage fx) are being played at the same time, the game will crash with this error code. Reducing or removing those effects will solve the problem.

0xC0000005 -- this crash happens upon starting the game if the number of skirmish options exeeds the maximum limit (32 is max including hidden). Also happens when exiting the program after a long game (HW2 seems to be freeing heaps of memory that were too large).

0xC0000017 -- fail to save after a long time of playing, reason unknown.

No error code crash -- the code is fucked up.

Freezing problems:

Can be caused by infinite loop in the lua code.

Can be caused by a buildable ship without addAbility(NewShipType, "CanLaunch"). When this ship is built, the game would freeze.

Can be caused by a ship wihout the Latitude parameter on the hardpoint for the weapon. This type of freeze typically occurs after the ship gets out of hyperspace. This is a hardpoint problem.

More to add... By you!

Comments
_mickey_
_mickey_

Thanks, usefull info

Reply Good karma Bad karma+1 vote
_mickey_
_mickey_

I have new info about 00000050

my experience shows: 00000050 -- a error code related to the CPU player. I only got it when the player's CPU had a ship with four zero visibility values

NewShipType.visualRange=0
NewShipType.prmSensorRange=0
NewShipType.secSensorRange=0 NewShipType.detecti

On the player's side, the game had no problems, but as soon as the player's CPU received a ship with zero values, the game crashed

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.