Results 1 to 1 of 1

Thread: Crashes and how to fix them

  1. #1

    Default Crashes and how to fix them

    Guide to crashes

    The purpose of this guide is to explain what is causing the various types of crashes to desktop (CTD) in mods and provide some advice on how to fix them.

    Before I begin I would like to point out that the best way to resolve a crash is to add the following line to your mod's .cfg file.

    Code:
    [log]
      to = logs/system.log.txt
      level = * error
    This will give you a log report which contains basic information about the crash.

    Code:
    [log]
      to = logs/system.log.txt
      level=*script* trace
    This will give you a log report which contains more information about the crash.

    Code:
    [log]
       to = logs/system.log.txt
       level = ai.ltgd trace
    This will give you a log report which contains information about what the AI was doing when the crash occurred.

    Code:
    [log]
       to = logs/system.log.txt
       level=*script* trace
    This will give you a log report which contains the most information about the crash, though it's hard to read.

    Always check the error log in the 'Medieval II Total War\logs' folder to find out which file is causing problems (default location 'C:\Program Files\SEGA\Medieval II Total War\logs'). The error is usually at the bottom of the error log as they're the last thing it records before it crashes. Though some errors are recorded part way through the error log; such as a missing skeleton, a missing mount, and a building gap.

    If you think a file is causing problem change its name and see if this fixes the problem (if M2TW can't find a file it reverts to the default version). If this fixes the problem then you know this file is faulty.

    Common abbreviations:
    EBD: export_descr_buildings.txt
    EBU: export_descr_unit.txt

    Mod CTD and without starting

    CTD on startup
    Q: When you start the mod you get a black screen and the mod CTDs.

    A: There is an erronous entry in the data\unit_models\battle_models.modeldb, normally a reference to an non-existant mesh or texture, or an entry is incorrect. You won't recieve any help in the log for this so you'll have to check your entries manually.

    The easiest way to check this file is to use the 'formatted_modeldb_version2' by 'KnightErrant' here:
    http://www.twcenter.net/forums/downl...o=file&id=1180

    First format the battle_models.modeldb, then use the checking program. This will find most errors. For the remaining errors the easiest way to find them is to edit the number in the battle_models.modeldb highlighted below in red.

    Code:
    22 serialization::archive 3 0 0 0 0 985 0 0
    This number tells M2TW how many entries there are in this file. It you change it from 985 to 500 M2TW will only check the first 500 entries before starting the mod. If the error is not in the first 500 the mod will load to the splash screen (though it is likely to crash for other reasons). If the error is in the first 500 entries M2TW will still CTD.

    By changing the number it is possible to find the exact entry that is causing the problem (though you'll need to use KnightErrant's checking program to find out which unit this is).

    The only problem with changing this number is that if it is set to a number higher than the number of units in the mod it will cause a crash.

    CTD on startup vRAM
    Q: When you start the mod you get a black screen and the mod CTDs. The logs say you lack enough vRAM.

    A: There are two possible causes for this.

    1) A texture for a campaign (strategy) map unit cannot be found. This can be resolved by checking that the all the textures mentioned in the 'data\descr_model_strat.txt' file are in the 'data\models_strat\textures'.

    2) The cas file's texture is not present in an entry in the 'data\descr_model_strat.txt' file (such as 'northern_general' or 'islamic_merchant'). Each cas file has a texture assigned to it and if the cas file cannot find this texture in the entry using the cas file it will crash. There is no easy way to determine which tga the cas file wants, though Errant Knight's cas to m3sd program does tell you which tga file the cas file uses when you convert a cas file to an m3sd file and vice verse.

    Black screen CTD
    Q: When you start the mod you get a black screen and it it will not disappear unit you hit the 'return' key. Often it's replaced with a black version of the intro.

    A: This normally occurs when you sound system has been disabled. You can re-enable it by clicking on the 'Control Panel', then 'Administrative Tools', then 'Services', then scroll down in the pop-up until you find 'Windows Audio'. Starting this should fix this problem (if not reboot your computer).

    Mod loads, then CTD without starting

    Loading CTD
    Q: The game starts to load, then CTD.

    A: This usually occurs because an entry can't be found in the 'data\export_descr_buildings.txt' or 'data\export_descr_unit.txt'. The log files should tell you which unit or building is missing.

    Loading CTD after adding a new building
    Q: The game starts to load, then CTD.

    A: If the description for the building is missing in the 'data/text/export_buildings.txt' the mod won't load and the missing building won't be listed. The best way to find the missing building is to use the 'level=*script* trace' to find the last building that was processed and check the 'data\export_descr_buildings.txt' to see which building came after it.

    Loading game CTD, with Insufficient video memory error message
    Q: The game starts to load, then CTD and error log says there is 'Insufficient video memory'.

    A: This is normally caused when you tell M2TW to look for an image file that doesn't exist. The this is normally due to an error in the descr_model_strat.txt. Ensure that all the image paths (eg models_strat/textures/southern_ambasador_papacy.tga) lead to an image file (.tga) and the spelling is correct.

    If both are correct ensure that in every entry the .cas file has its .tga file assigned to one faction (without opening the cas file it's impossible to tell which tga file it needs). If this tga file is not listed in the 'descr_model_strat.txt' entry the mod will crash. For example any entry using the 'late_general_northern.CAS' has to have one faction assigned the 'late_general_england_strat.tga' or the mod will crash.

    Below is an example. The 'mesoamerican_king.cas' requires the 'mesoamerican_king_mayans.tga'. The following will produce an 'Insufficient video memory' error because the 'mesoamerican_king_mayans.tga' has not been assigned to the 'mesoamerican_king.cas'.

    Code:
    type                mesoamerican_king
       skeleton            strat_named_with_army
       scale                0.7
       indiv_range            40
       texture                aztecs, models_strat/textures/mesoamerican_king_aztecs.tga
       texture                mayans, models_strat/textures/mesoamerican_king_aztecs.tga
       texture                tlaxcalans, models_strat/textures/mesoamerican_king_tlaxcalans.tga
       texture                tarascans, models_strat/textures/mesoamerican_king_tarascans.tga
       texture                slave, models_strat/textures/mesoamerican_king_aztecs.tga
       model_flexi_m            models_strat/mesoamerican_king.CAS, max
       shadow_model_flexi        models_strat/shadow_sword.CAS, max
    But this one will work because the 'mesoamerican_king_mayans.tga' has been assigned to the 'mesoamerican_king.cas'.

    Code:
    type                mesoamerican_king
       skeleton            strat_named_with_army
       scale                0.7
       indiv_range            40
       texture                aztecs, models_strat/textures/mesoamerican_king_aztecs.tga
       texture                mayans, models_strat/textures/mesoamerican_king_mayans.tga
       texture                tlaxcalans, models_strat/textures/mesoamerican_king_tlaxcalans.tga
       texture                tarascans, models_strat/textures/mesoamerican_king_tarascans.tga
       texture                slave, models_strat/textures/mesoamerican_king_aztecs.tga
       model_flexi_m            models_strat/mesoamerican_king.CAS, max
       shadow_model_flexi        models_strat/shadow_sword.CAS, max
    CTD after removing regions
    Q: After removed most of the regions the mod CTDs. The error message just says the mod has crashed.

    A: M2TW requires a mininium of 10 regions, so try adding some more. Also you have to delete the data\world\maps\base\map.rwm file everytime you alter the data\world\maps\base\map_regions.tga file.

    CTD after adding a lot of regions
    Q: After adding a lot of new regions the mod CTDs. The error message just says the mod has crashed.

    A: M2TW cannot have more than 198 regions and 1 sea, so try deleting some. Also you have to delete the data\world\maps\base\map.rwm file everytime you alter the data\world\maps\base\map_regions.tga file.

    CTD after editing some regions, no map.rwm
    Q: After moding the map_regions.tga file, deleting the map.rwm, and selecting a faction the mod CTDs without generating a new map.rwm file. The error message just says the mod has crashed.

    A: This is caused by one of the following.
    1) One or more regions does not have a black pixel representing a settlement.
    2) One or more of the pixels is the wrong colour, causing M2TW to treat it as a new region without a settlement.
    3) One or more regions has the black pixel touching mutiple regions (it must be located inside only one region).

    To resolve the first 3 you need to ensure all the pixels are the correct colour (even a small variation that is invisible to the human eye will cause the mod to crash). To resolve the 4th problem you need to move the black pixel.

    M2TW works just fine if one or more regions by the sea does not have a white pixel representing a port.

    CTD after editing some regions, no map.rwm but map.rwm is generated if the sea is turned into land

    Q: After moding the map_regions.tga file, deleting the map.rwm, and selecting a faction the mod CTDs without generating a new map.rwm file. However a map.rwm is generated if all the sea in the 'map_heights.tga' is turned into land. The error message just says the mod has crashed.

    A: M2TW has a limit of 20 land masses per map. If there are more then 20 land masses the mod will crash. To fix this either merge the islands together or add a pixel of each island to another island, so M2TW believes they are one land mass (see this thread for more details).

    http://www.twcenter.net/forums/showt...97#post4343897

    CTD after adding some regions, map.rwm generated
    Q: After moding the map_regions.tga file, deleting the map.rwm, and selecting a faction the mod CTDs but generates a new and complete map.rwm file. The error message just says the mod has crashed.

    A: This can be caused by:
    1) The RGB (Red Green Blue) colour of a region does not matching the colour in the data\world\maps\base\descr_regions.txt (usually the problem). Fixing the incorrect entry will solve this problem.
    2) The settlement in the region is in an inaccessable area eg in a forest or up a mountain (the error log normally tells you which settlement is on an 'invalid tile'). To fix this move the black pixel elsewhere (this is mainly trial and error).
    3) You have assigned units to a settlement in the 'data\world\maps\campaign\imperial_campaign\descr_strat.txt' file but that have not added this settlement to the descr_strat file. This error also says that you have choosen an 'invalid tile' for the settlement.
    4) The region's settlement is in the sea (the error log tells you where the problem settlement is at location (0,0)). To fix this move the black pixel further inland (this is mainly trial and error).
    5) Some graphics programs cannot generate map_regions.tga files that M2TW will accept. I had this problem when I edited the map_regions.tga file using Photoshop Elements 4.0 but not when I switched to Gimp.

    Mod CTD during game, viewing the strat map

    Loading or during game CTD, with no error message
    Q: The game CTD and error log just says the mod has crashed.

    A: This is normally caused by one of the files in the data/text folder not containing all the required information. It's often the data/text/expanded.txt but not always.

    Faction selection CTD, missing region
    Q: The mod crashes CTDs when you try to play as a specific faction, error message says a province is missing.

    A: There are 4 files that deal with provinces:
    data\text\imperial_campaign_regions_and_settlement_names.txt
    data\world\maps\base\descr_regions.txt
    data\world\maps\campaign\imperial_campaign\descr_strat.txt
    data\world\maps\campaign\imperial_campaign\descr_win_conditions.txt

    The make sure the missing province appears in the first three of these and that the missing province is spelled correctly in all of them.

    CTD when nearby a region
    Q: When you get near to a region M2TW crashes. The error log says nothing.

    A: If a region is too large this can cause M2TW to crash. To fix this try breaking the region up into smaller regions.

    CTD while trying to view a settlement in a region
    Q: When you try to view a settlement in a region M2TW crashes. The error log says nothing.

    A: This can be caused by a settlement having a total religious level that is not 100. To fix this you need to open the 'data\world\maps\base\descr_regions.txt' file and change the religious levels in the problem settlment so that they are 100 in total. Then delete the 'data\world\maps\base\map.rwm' file so the changes will take effect.

    CTD while trying to view a rebel settlement in a region
    Q: When you try to view a rebel settlement in a region M2TW crashes. The error log says nothing.

    A: If a rebel settlement contains rebels that the slave faction is not allowed to have M2TW will crash (unlike other factions which are fine regardless of units in a settlement). To fix this problem open the 'data\world\maps\base\descr_regions.txt' file and find which rebels are in the problem settlement. Then open the 'data/descr_rebel_factions.txt' file, find the problem rebel group, and replace their units with units from another rebel group. Test to see if this fixes the problem. If it doesn't try a different rebel group until M2TW stops crashing. Once you've got a working rebel group you can try changing the units present to get rebels that suit the region.

    Mod CTD during game, other strat map, during first turn

    Building crash
    Q: Game crashes at the start when you try to bring up a settlement's building browser.

    A: Either this settlement starts with a building this faction cannot have (this only causes a crash at the start of the game), or there's an error in the data\export_descr_buildings.txt file regarding one of the settlement's buildings [thanks to Monkwarrior].

    Unit crash
    Q: Game crashes when you try to get the information about a unit or when you go to battle with a particular unit.

    A: The data\export_descr_unit.txt info for that unit contains an error. Make sure the tabs and spaces are in the right place, information is not missing or duplicated, and that the 'soldier' line refers to a an actual unit (try not to change this).

    Faction Crash
    Q) The mod crashes when you try to play as a particular faction and during this faction's turn. However the problem faction works fine in Custom Battles.

    A) Check that the entry for 'ai_label' in the data/world/maps/campaign/imperial_campaign/desc_strat.txt appears in the 'data/descr_campaign_ai_db.xml' [thanks to dp_best].

    Mod CTD during game, other strat map, after several turns

    Start of turn crash
    Q: The game crashes at the start of the player's turn.

    A: This can be caused by an event that is in the 'data\world\maps\campaign\imperial_campaign\campaign_script.txt' or 'data\world\maps\campaign\imperial_campaign\descr_events.txt' (default locations 'C:\Program Files\SEGA\Medieval II Total War\data\world\maps\campaign\imperial_campaign') but is not listed in the 'data/text/historic_events.txt' file. Adding this event to the 'data/text/historic_events.txt' will fix this error (this file is case sensitive).

    5th turn crash
    Q: The game crashes at the end of the fifth turn / start of the fifth turn.

    A: I actually had this error, it's not a joke. This error is caused when I tried to exclude the following trait in the data\export_descr_character_traits.txt file from a culture.

    Code:
    ;------------------------------------------
    Trait ReligionStarter
        Characters family
        Hidden
    
        Level General_Religion
            Description General_Religion_desc
            EffectsDescription General_Religion_effects_desc
            Threshold  1 
    
            Effect Piety  3 
    
    ;------------------------------------------
    Whenever one of the excluded cultures got a new general, who is supposed to automatically get this trait, the mod crashed. Excluding other hidden traits can also cause crashes.

    20th turn crash
    Q: The game crashes during the AI's turn at about turn 20 and the error log just says the mod has crashed.

    A: I had this error and it took me a long time to fix it. This error occurred because I increased the number of children allowed in the data/descr_campaign_db.xml file. When the AI's family had more than 4 children the mod crashed.

    Game crashes during the AI's turn
    Q: The game crashes during the AI's turn and the error log just says the mod has crashed.

    A: There are several possible causes:

    1) The trigger for a trait is incorrectly written. I once had this problem when the trigger's 'WhenToTest' was 'GeneralAssaultsGeneral', rather than 'PostBattle'. You can test this by deleting the triggers of all your traits in the 'data/export_descr_ancillaries.txt' and 'data/export_descr_character_traits.txt' files (create backups before doing this) and loading the mod to see if the crash stops.

    2) A culture has a trait excluded but the corrisponding 'antitrait' is not excluded. This causes a problem when a general or agent switches from a trait to its antitrait (due to a loss or gain of skill points).

    3) The mod will also crash if an agent without a name gets an Epithet. This can be fixed by changing the agent's name in the 'data\world\maps\campaign\imperial_campaign\descr_strat.txt' and restarting the mod so it uses the new name.

    Player and Slave crash

    Q: The mod crashes after 4-6 turns when the only remaining factions are the player and slave. The slave factions does not have viable victory conditions.

    A: The mod will crash if there is only one factions left with viable victory conditions but they have not achieved victory. Giving the slave factions viable victory conditions will remove this error (controlling every province is NOT a viable victory condition, nor is controlling more provinces then there are in the mod).

    Mod CTD during game, Battle map

    Battle crash, any unit
    Q: The mod crashes while loading for battle regardless of what units or factions will be fighting in the battle.

    A: Most likely there are multiple spaces in the 'data\unit_models\battle_models.modeldb' file when there should only be one or two spaces (this won't cause the mod to crash when loading, unlike a number or spelling error). Carefully checking the battle_models.modeldb file or the reverting to a backup is the only way to fix this.

    Battle crash after adding an officer to a unit
    Q: After adding an officer to a unit in the 'data/export_descr_unit.txt' the mod crashes while loading for battle regardless of what units or factions will be fighting in the battle.

    A: The officer entry must appear in the 'data\unit_models\battle_models.modeldb' file or the mod will crash. Unfortunately the error log doesn't say which officer has caused the crash so you have to search through all the entries until you find the one causing the crash. Make several backups before adding officers.

    Battle crash, specific unit
    Q: The mod crashes while loading for battle when a specific unit will be fighting in that battle.

    A: Most likely the path to the unit's mesh, texture, or sprite is incorrect in the 'data\unit_models\battle_models.modeldb' file. To fix this problem find the unit's entry in the battle_models.modeldb and check the location and name of the texture and mesh are correct (this problem may only affect one faction's unit).

    Battle crash, many units together
    Q: The mod crashes when a lot of units fight in a very small area.

    A: If too many units fight in a small area M2TW is unable to handle this and crashes (this often happens in castle sieges). Reducing the unit size can prevent this.

    Custom Battles

    Unit selection crash
    Q:The mod crashes after you select the factions you want and click next, but before the unit selection screen appears.
    A: If one of the selected factions has too many units assigned to it M2TW will crash. I have not determined the maximum number of units but I did get a faction to work with 192 units.

    Other errors that don't cause CTD

    Building gap at the end of the export_descr_buildings.txt
    Q: The error log says there is a building gap but the line number of the error is for the bottom of the 'data/export_descr_buildings.txt' .

    Code:
    00:41:51.734 [script.err] [error] Script Error in mods/conquest/data/export_descr_buildings.txt, at line 9078, column 2
      Building DB error - faction aztecs has gap in building prior to stone_wall
      00:41:51.750 [script.err] [error] Script Error in mods/conquest/data/export_descr_buildings.txt, at line 9078, column 2
      Building DB error - faction aztecs has gap in building prior to large_stone_wall
      00:41:51.750 [script.err] [error] Script Error in mods/conquest/data/export_descr_buildings.txt, at line 9078, column 2
      Building DB error - faction aztecs has gap in building prior to huge_stone_wall
      00:41:51.750 [data.invalid] [error] Target building level not allowed: Inca Empire, castle -> large_town, core_castle_building[2](castle) -> core_building[1](wooden_wall)
      00:41:51.750 [data.invalid] [error] Target building level not allowed: Inca Empire, fortress -> city, core_castle_building[2](castle) -> core_building[1](wooden_wall)
      00:41:51.750 [data.invalid] [error] Target building level not allowed: Inca Empire, citadel -> city, core_castle_building[2](castle) -> core_building[1](wooden_wall)
    A: If a faction or culture is not listed at an early level of a building tree but is listed at a later level this generate an error. Unfortunately the error log states that the error is at the end of the 'data/export_descr_buildings.txt' instead of the correct line.

    A: The easiest way to fix this error is to search the 'data/export_descr_buildings.txt' for the first building the error log lists (in this case 'stone_wall') and check the building level before it (in this case the 'wooden_wall' level of the 'core_building' building tree).

    Code:
            wooden_wall city requires factions { northern_european, middle_eastern, eastern_european, southern_european, }
    As the faction listed in the error log is the aztecs by adding them to this building level I can fix this error.

    Code:
            wooden_wall city requires factions { northern_european, aztecs, mesoamerican, middle_eastern, eastern_european, southern_european, }


    Missing Skeleton

    Q: The error log says that a skeleton is missing for a secondary weapon.

    Code:
    01:07:29.687 [script.err] [error] Script Error in mods/conquest/data/export_descr_unit.txt, at line 3149, column 1
      Missing skeleton for secondary weapon in model type 'magyar_swordsmen', used by unit 'Hungarian Crossbowmen'.
    A: The is error means that you've assigned a one weapon 'soldier' model to a two weapon unit in the 'data/export_descr_unit.txt'. The soldier models are listed at the end of every unit entry in the 'data/unit_models/battle_models.modeldb' and can give a unit one weapon or two (cavalry and missile units usually have two weapons, while melee infantry usually only has one).

    To fix this error find the problem unit ('Hungarian Crossbowmen' in this example) and change their 'soldier' line to another unit.

    For example this entry:
    Code:
    type             Hungarian Crossbowmen
      dictionary       Hungarian_Crossbowmen      ; Crossbowmen
      category         infantry
      class            skirmish
      voice_type       Light
      accent         East_European
      banner faction   main_missile
      banner holy      crusade
      soldier          magyar_swordsmen, 48, 0, 0.8
    Is edited so the 'soldier' used is now 'Crossbowmen', rather than a 'magyar_swordsmen'.
    Code:
    type             Hungarian Crossbowmen
      dictionary       Hungarian_Crossbowmen      ; Crossbowmen
      category         infantry
      class            skirmish
      voice_type       Light
      accent         East_European
      banner faction   main_missile
      banner holy      crusade
      soldier          Crossbowmen, 48, 0, 0.8
    Other
    Additional information on crashes and how to solve them is appreciated.
    Last edited by uanime5; September 13, 2009 at 08:12 PM.
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •