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:
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.
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.
00000010 -- related to automatic ship creating by lua code, possibly due to conflict with the AI building queues. A solution I found is to create a SobGroup_CreateShip_InstantSpawnDock() function that spawns the ships elsewhere and then docks them instantly before launching, giving the fake impression that they are actually built not spawned. This code can also be produced when using a ship HOD in the background folder (don't ask me why I tried that).
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.
00000030 -- I suspect this is related to launching conflict. The SobGroup_CreateShip_InstantSpawnDock() function I introduced above solved the 00000010 problem, but this new problem occurred, although much less frequently.
00000168 -- map object not found in the given type. This can happen when a dust cloud object is added with the addCloud function.
00781000 -- related to visual effect overloading. When too many Hiigaran pulsar beams, smoke animations or damage effects are being played at the same time, the game will crash with this error code. Reducing or removing those effects will solve the problem.
More to add... By you!