Debugging (Civ5): Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 10: | Line 10: | ||
[[File:SQLiteManager.png|frame|View of the snapshot using SQLiteManager]] | [[File:SQLiteManager.png|frame|View of the snapshot using SQLiteManager]] | ||
=== Checking the logs === | === Checking the logs === | ||
If you | If you correctly set up your [[#configuration]], whenever you start a game, Civ5 saves some logs under <code>My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db</code>. | ||
* If there were errors with the XML formatting of your data files (wrong column names for example), they will logged in XML.log. | * If there were errors with the XML formatting of your data files (wrong column names for example), they will logged in XML.log. | ||
:<pre>[6904.323] Tag (TXT_KEYMODDING_SHOWDLCMODS) does not start with 'TXT_KEY_'</pre> | :<pre>[6904.323] Tag (TXT_KEYMODDING_SHOWDLCMODS) does not start with 'TXT_KEY_'</pre> | ||
Line 18: | Line 18: | ||
=== Using the snapshots === | === Using the snapshots === | ||
If you | If you correctly set up your [[#configuration]], whenever you start a game, Civ5 saves a snapshot of the database under <code>My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db</code> | ||
* This allows you to check how your XML and SQL files have been merged with the standard game data. | * This allows you to check how your XML and SQL files have been merged with the standard game data. | ||
Line 24: | Line 24: | ||
== Lua Debugging == | == Lua Debugging == | ||
=== Using the Firetuner console === | === Using the Firetuner console === | ||
If you | If you correctly set up your [[#configuration]], Civ5 will send all the Lua output to the Firetuner. This includes all the debugging output but also any error that may arise, with their stack traces. | ||
<pre> | <pre> | ||
Runtime Error: [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:41: attempt to concatenate local 'name' (a nil value) | Runtime Error: [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:41: attempt to concatenate local 'name' (a nil value) |
Revision as of 10:14, 23 September 2012
This article is under construction, come back in a few days.
Checklist
- Did you correctly import to the VFS the files that need to be?
- Did you correctly set up the actions and content tab in your project?
- Did you restart civ5 after you added new files?
XML Debugging
Checking the logs
If you correctly set up your #configuration, whenever you start a game, Civ5 saves some logs under My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
.
- If there were errors with the XML formatting of your data files (wrong column names for example), they will logged in XML.log.
[6904.323] Tag (TXT_KEYMODDING_SHOWDLCMODS) does not start with 'TXT_KEY_'
- If there were errors with the data integrity (missing foreign keys for example - types that reference rows from other tables), they will logged in database.log.
[6903.917] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_HARALD" does not exist in Leaders
Using the snapshots
If you correctly set up your #configuration, whenever you start a game, Civ5 saves a snapshot of the database under My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
- This allows you to check how your XML and SQL files have been merged with the standard game data.
Lua Debugging
Using the Firetuner console
If you correctly set up your #configuration, Civ5 will send all the Lua output to the Firetuner. This includes all the debugging output but also any error that may arise, with their stack traces.
Runtime Error: [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:41: attempt to concatenate local 'name' (a nil value) stack traceback: [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:41: in function 'dumpObj' [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:95: in function 'ScanAll' [string "C:\Users\Boss\Documents\My Games\Sid Meier'..."]:188: in main chunk [C]: ?
Here we can see that the main chunk called a function ScanAll at line 188. This one then called dumpObj at line 95. And this one caused an error on line 41.
Print, assert and error
Custom stack traces
Coroutines stack traces
Handling errors for the end-user
Troubleshooting
Game inspectors
Quick bug reproduction
Configuration
Look for the following files under My Documents/My Games/Sid Meiers' Civilization V
and open them in a text editor like the notepad (not in a word processor).
- config.ini
- Set
LoggingEnabled
to 1. Civ5 will write log files under theLogs
folder. - Set
EnableLuaDebugLibrary
to 1. Civ5 will display stack traces on Lua errors and you will be able to use the debug object. - Set
DebugPanel
to 1. By pressing the ² key (may be ù or something else depending on your computer's language) during a game, Civ5 will display a debug panel.
- Set
- usersettings.ini
- Set
DebugMode
to 1. Needed to enable other features previously mentioned.
- Set