Ck2 Crash On Startup

Автор:
Ck2 Crash On Startup Average ratng: 4,2/5 9261 votes
The CTD.. Don't expect Windows to find any solution for you, you'll have to dig !

I recently downloaded the Game of Thrones mod for Crusader Kings 2. Whenever I start up the game it brings up the screen showing DLC and mods. In my mod box I have two (both from the same download), A Game of Thrones and something caleld NB + AGoT editon version 1.0. I choose the simple mod and it allows me in the game no problem. It allows me to browse the various characters and do normal. Discuss the topic 'Crashing at 'Loading Databases.' ' in the Bug Reports CK2:MEP Community Forum. This is a full conversion Tolkien mod for Crusader Kings 2 which will feature bookmarks throughout the Third Age. This mod is being developed independently from any other LotR or Middle Earth mods out there. When I start the game I see a.

Troubleshooting is the identification of the cause of crashes, bugs or other problems. Some of CK2's debugging features are restricted in retail builds, but there is still plenty to work with.

  • 3Crashes

Log files[edit]

The game stores various log files in your CK2 user folder (~DocumentsParadox InteractiveCrusader Kings IIlogs). These are overwritten every time the game starts.

More logging can be activated by using command line arguments (via Steam game properties / define launch options):-debug -debugscripts

FileDescription
game.logIn game notifications and output of logcommands. Since patch 2.4.1 only logged if -debugscripts is enabled.
setup.logGame data loading logs (gui, modifiers, traits, ..)
error.logParsing and loading errors. More asserts will be logged when enabling -debugscripts.

The following lines are OK if no elements is listed:

historical_setup_errors.logExtra errors linked to title/character history. Only logged if -fullhistoricalsetuplog is enabled.
system_interface.logErrors linked to interface modding
graphics.logErrors linked to map modding
system.logHardware report
system_interface.logInterface errors
text.logAsserts on localization keys
script_optimizations.logAsserts on events that fire for courtiers
ai.log
exceptions.logIn case of crash, you may get a stacktrace, with the last method called (ex: CLandedTitle::GetShortName)
time.logLogs the game loading time.
memory.logLogs the memory usage.

Loading[edit]

When launching the game the following steps occur:

  • Initialising Map Logic
  • Loading Databases
  • Generating Coat of Arms
  • Loading Events
  • Loading Sounds
  • (Loading of vanilla history files occurs here (even if is replace_path), though it'll still show as 'Loading Sounds') - very slow step !
  • Processing Flags - generates the flag sprites in gfxflags from the individual .tga files
  • Loading Flags
  • Loading Graphics
  • Creating Provinces
  • Loading Map(Creating Terrain)
  • Loading Map(Creating Borders)
  • Loading Map(Creating Trees)
  • Loading Map(Creating Textures)

Once this is done the lobby interface will be rendered.

Crashes[edit]

Crashes or Crash To Desktop (CTD) are the despair of the players and nightmare of the modders. There is usually little to no information to identify the cause.

Here is a list of known issues:

SymptomTroubleshooting
Instant CTD clicking Play in the launcherCheck no new defines.lua entries are missing in the mod (or better use defines folder to override, and avoid duplication)
CTD at 'Loading Databases'
  • Compare setup.log with the mod and with raw vanilla : next steps normally logged in vanilla are the likely cause of the crash
  • Check the format and color indexes of map files (terrain.bmp, ..)
CTD at 'Loading Events'
  • Check for unbalanced quotes, such as has_dlc = 'Reapers
  • Can be caused by excessively long log commands with multiple references to global variables.
CTD at 'Loading Graphics
  • Ensure that your 'positions.txt' is not misnamed and that it is empty.
CTD when rendering the lobby interfaceCheck that interface .gui and .gfx files are properly merged with vanilla, if copied in the mod.
CTD on applying history (initial load or selecting a bookmark)Check that all groups in technology history have an entry for earliest starting date of the mod. See technology modding.
CTD on load/resign
  • Check that no character has a death date past the end date of the mod.
  • Check that no character has a birth date later than death date.[1]
CTD after 1 in-game day
  • Check loaded trade routes reference valid provinces. For total conversion mods, use replace_path = 'common/trade_routes' or blank vanilla files.
CTD after a random elapsed time

It is the worst kind of CTD, because it can be caused by ANY event or decision occurring in the game.

  • If it slows down before crashing, it might be an infinite loop in an event. Check for a stackoverflow error being reported in exceptions.log. See Event modding#Recursive events
  • If it crashes without warning, it may be a scripting error regarding parameter types that is not safely handled by the engine. Use The Validator and fix the errors reported, in priority effects used in a wrong context or with wrong parameters. For instance set_graphical_culture = norse vs set_graphical_culture = norsegfx used to CTD.
CTD when hovering or clicking an event optionInvalid syntax in the event, or calling a command with an invalid value.
CTD when clicking on religion screenCheck that no more than 5 holy sites are defined in landed_titles for that religion
CTD when clicking on button to open College of CardinalsSee Interface modding#Papal succession
CTD when starting typing specific letters in the Title finderCheck that there are no empty geographical regions (at least 1 valid province)
CTD when you click the 'Arrange Marriage' rings button next to a character's portraitCheck that no character, living or dead, that is conceived illegitimately is missing the required 'Bastard' Trait. The Trait must be placed in each character's Character History entry BEFORE their birth date and WITHOUT being enclosed in brackets.
Crash when you click a baron holding in a province to open building interfaceCheck that there's no illegal buildings in that holding, e.g ca_con_wall_6(Theodosian Walls) in a city.

Debugging crashes on Windows[edit]

In last resort you can use Visual Studio (including the free Express editions; get the 'Windows Desktop' one) to see detailed debugging information. Though it won't let you debug step by step, as the sources for the game are not available.

Simply start the game, then use the Debug > Attach to process.. menu option. Use the Output window to read the game's messages, which will include script validation errors and performance data.

For best results create an empty project and configure it to launch CK2.exe with your mod active (i.e. with the argument -mod=mod/foo.mod); check the documentation for details on how to do this. You will then be able to launch the game with debugging by clicking the green Play button in Visual Studio. This will ensure that you capture any problems that show up right after the game starts.

When the game crashes Visual Studio will freeze it, tell you where the offset at which crash happened, and provide the option to save a 'minidump'. The offset and dump won't mean much to you but if you want to report the crash to Paradox they would find both useful.

Debugging crashes on macOS[edit]

Install Xcode from the App Store, then run xcode-select --install in a Terminal window.

Launch the game from lldb:

If the game crashes, it will be paused in the debugger, letting you use the bt command to get a stack trace. Most other debugger features are unavailable without source code.

Meanwhile, use tail in separate terminal tabs to monitor the game's own logs:

Bugs[edit]

Bugs are usually easier to identify than crashes, as there is in-game context to identify the cause. Most non-functional bugs can be spotted via The Validator, a third-party tool which checks script files for various kinds of problems.

SymptomTroubleshooting
Blank event popups that pause the game and can't be closed.
  • Save the game after the popups have appeared (without checking the compress save checkbox), and look in the save for the faulty eventID that is the source. They will be at the bottom of the file, in a player_event section.
  • Use The Validator, check for Parse failures, or invalid node type errors.
Scripting keywords appearing in decisions/councillor names
  • Use The Validator, check for parse errors, missing curly braces
Decision not appearing
  • Move conditions from potential to allow block, to see failing conditions in tooltip.
Decision not having any effect when taken
  • Use The Validator, check for duplicate decision IDs
Truncated localization
  • Open .csv file with OpenOffice and check for extra columns containing text
  • Make sure translations do not contain semi-colon character, as it used separate languages
Localization not appearing in game
  • Ensure file extension is .csv, not .txt
  • Check that mod folder is named localisation, not localization.
  • Ensure overridden vanilla keys are loaded before vanilla (i.e. 00_ file prefix)
Localized names show strange characters (Ã)
  • Check encoding of landed_titles, culture, and localization files to be Windows 1252 (ANSI), and not any type of Unicode.
Events not triggering (but OK via console testevent)
  • Check for invisible non-breakable spaces in event files (they can be found with Notepad++ by searching with 'Extended mode' the Unicode string u00A0)
Titles have wrong flags
  • Clean the flag cache in ~DocumentsParadox InteractiveCrusader Kings II(Mod user_dir)gfxflags
  • Make sure all titles above barony have a corresponding flag in gfx/flags (with The Validator)
  • Try to see at which title it starts messing up, that's usually where you're missing the flag.
Black coats of arms
  • Verify the pattern file size in Coats of arms.txt
  • Ensure all religion match a CoA group
Missing layers in portraits for custom ethnicities
  • See Portrait modding#Custom ethnicities referencing DLC assets
Casus Belli immediately ends inconclusively
  • Make sure can_use/can_use_title/is_valid_title blocks are in synch.
All units models use wrong gfx
  • Check that no province history files reference a barony that is not defined in landed_titles (with The Validator)
Rivers are flowing from east to west on the map
  • Rivers flowing east to west typically means that there is something wrong with the color index of rivers.bmp. [2]
Title is badly displayed on the map (not visible or way outside its area)
  • Check for stray pixels in provinces.bmp
Popups like naming children not showing up
  • When using replace_path = 'events', the following script needs to be added in the mod events folder:

Testing[edit]

Testing is the process of checking your mod for bugs, including crashes, broken functionalities, or gameplay/balance issues.

Tooling for testing include:

  • In-game console, with various debugging (or cheating..) features, including:
    • play, take control of a specific character
    • testevent
    • event
    • run, for testing your conditions and commands without restarting the game
  • Cheat mods
  • Observer mode (observe console command), to check for game balance, and detect random CTDs over hundred of in-game years.

References[edit]

  1. In 2.6.3 game is fully playable and crashes only if you load saved game or resign the game
  2. [1]
Characters • Dynasties • Provinces • Titles • Bookmarks
Commands • Conditions • Scopes • Modifiers • Events • Decisions
Defines • Game rules • Alternate starts • Religion • Culture • Governments • Traits • Bloodlines • Technology • Laws • Buildings • Casus Belli • Tributaries • Units • Objectives • Disease • Death • Minor titles • Societies • Artifacts • Offmap power • Councillors • Trade routes • Succession • Great works • Nicknames
Map • Graphics • Coats of arms • Portraits • Interface • Minimap • Music • Localisation
Troubleshooting • The Validator • Console commands • Save-game editing • Steam Workshop • EU4 Converter
Retrieved from 'https://ck2.paradoxwikis.com/index.php?title=Troubleshooting&oldid=41178'

This tutorial explains in details the steps required to create a basic mod.

Note that another approach is to copy/paste and modify an existing mod (though not a mod installed via Steam Workshop since these are packaged differently).

It is assumed that the OS is Windows, but this could apply to MacOS or Linux with few changes.

  • 2Steps

Prerequisites[edit]

  • Install a good text editor (such as Notepad++), since default Notepad on Windows can possibly mess up the file encoding.

Steps[edit]

Create the CK2 mod directory[edit]

There are 2 different directories involved:

  • The CK2 install directory: it contains the base game files, which should not be modified directly and considered 'read-only' (modifications will be lost when Steam is updating). It can be found via Steam: find CK2 in your games library, right click on the name and select properties in the menu. Choose the local files tab and then press browse local files.
  • The CK2 user files: it contains the user data (saves, game preferences, logs and mods). The path is ~/My Documents/Paradox Interactive/Crusader Kings II/. ~ is the home directory, depending on your configuration and Windows version, this could look like: C:Users<YourUser>DocumentsParadox InteractiveCrusader Kings II

Tip: you may create shortcuts to these directories on your desktop.

Step 1: Create a mod folder ~/My Documents/Paradox Interactive/Crusader Kings II/mod/, if it doesn't exist.

Note: there is also a legacy commonCrusader Kings IImod folder in the CK2 install directory, but it must not be used to store mods.

Create the .mod file[edit]

The .mod format here is just a plain text file, saved with .mod file extension instead of the .txt extension.

Tip: most CK2 files use .txt extension, but there is also .csv (localization), .gfx (graphics), .sfx (sounds), .gui (interface), .lua (global variables) and .info (documentation).

Step 2: Create an empty file named 'mymod.mod' in the CK2 mod folder (~/My Documents/Paradox Interactive/Crusader Kings II/mod/mymod.mod).

Ck2 crashing on startup 2019

Note: make sure the file extension is .mod (and not .mod.txt) - disable 'Hide Known Extensions' option of Windows explorer.

Step 3: Open the file with your editor and add:

Notes: Celemony melodyne 3 2 keygen for mac.

  • Don't forget the quotes, it is mandatory in case there is a space.
  • Save the file with ANSI (Windows-1252) encoding. This is true for all CK2 files: never use UTF-8 encoding (with or without 'BOM') !

Tip: the path is relative to CK2 user directory, hence the 'mod/' prefix.

Create the mod data folder[edit]

Step 4: Create an empty folder named 'mymod' in the CK2 mod folder (~/My Documents/Paradox Interactive/Crusader Kings II/mod/mymod/).

Tip: best practice is to use same name for path folder as the mod file name, so that they are next to each other when browsing the CK2 mod folder.

Note: folder and file names are case sensitive on OS other than Windows, so a best practice is to use only lower-case.

Making a game modification[edit]

Creation of 00_mymod.csv file

We need a little change that will be quickly visible in-game, to validate that the mod is working.

Let's do some basic localization modding and change the text 'Choose Your Starting Era' on the lobby to 'Choose Your Favourite Era' (the corresponding localisation key is PICK_YOUR_STARTING_ERA)

Step 5: Create an empty folder named 'localisation' in the mod data folder (~/My Documents/Paradox Interactive/Crusader Kings II/mod/mymod/localisation/).

Notes:

  • A mod follows the same folder structure as the base game, and the two are merged when loading in memory.
  • Beware the folder has to be named 'localisation' and not 'localization' !

Step 6: Create an empty file named '00_mymod.csv' in that folder (~/My Documents/Paradox Interactive/Crusader Kings II/mod/mymod/localisation/00_mymod.csv).

Mercury 11n wireless usb adapter mw150u drivers. Adapter socket.Available network types.After-sales service.Transmission speed.Buy hotspot.Brand.Model.

Tip: the '00_' prefix is to ensure our localization is loaded first and overrides the vanilla one. Each folder has its own loading order/overriding behavior.

Step 7: Open the file with a text editor and copy the following lines to the file and save:

That's it !

Testing the mod[edit]

The modded era selection screen

Step 8: Activate the mod 'My mod' in the launcher (and don't activate any other mod) and start the game.

Troubleshooting: if the mod doesn't show up in the launcher, it probably means the .mod file is not in the correct folder or has the wrong extension (.txt instead of .mod).

Tip: notice that the in-game checksum has not changed compared to the one from the launcher. This is because the localisation folder doesn't alter the checksum, as it's only a cosmetic change.

Step 9: Click on Start and verify that the title of the pop-up has changed.

Troubleshooting: if the change is not visible in game, or the game crashes, check for errors logged by the game at startup in error.log.

Step 10: Take some time to congratulate yourself, and go back for more modding !

Note: each time you modify something in the mod files, you need to stop and restart CK2 so that the change is taken into account.

What's next ?[edit]

  • Mod other game files. Take it slowly, with small challenge, one problem at a time !
  • Register your CK2 game and ask for help on the Crusader Kings II - User Modifications forum
  • Upload your mod to the Steam Workshop
  • Zip the mymod.mod and mymod folder together into a mymod.zip and upload the mod on the forum

External links[edit]

  • Guide: Your first mod - to add an event option.

References[edit]

Retrieved from 'https://ck2.paradoxwikis.com/index.php?title=Creating_a_mod&oldid=39803'