Database Mapping??

sir_kris

Chieftain
Joined
Dec 9, 2010
Messages
26
Hi all,

Please forgive me if this is a stupid question (and try not to berate me for it lol), but where can I find a reference to the existing tables/columns in the Civ 5 database? I've spent the last several hours searching but no luck.

I've been developing PHP applications for the last 10 years now so I'm very familiar with SQL syntax. I understand that, using Mod Buddy, I can add SQL queries to alter various settings/etc within the game. Here's the problem: I have no idea where anything is!

Normally, I could just login to the database, do a "show tables" followed by "describe" and "select" statements for each of the tables to study and familiarize myself with it. But for the life of me, I cannot find any such means of access. How can I alter something in the database if I don't have any information on the contents of the database or even its structure?! I can find plenty of guides/tutorials going over the basic SQL syntax along with one or two rudimentary examples, but nothing telling me what's actually in the database or how to find out what's in it. That's my problem.


I would really appreciate it if one of you could point me in the right direction here, because I'm obviously missing something. For example, I'd love to know which table/column value to update to modify how much unhappiness is generated by a city/population, or how much maintenance in gold each unit costs. If I could study the database or view a spec somewhere, I could probably figure it out on my own. Any ideas?
 
Please forgive me if this is a stupid question (and try not to berate me for it lol)

There are no stupid questions, only stupid people. You can usually identify the stupid people by the fact that they don't ask questions.

but where can I find a reference to the existing tables/columns in the Civ 5 database? I've spent the last several hours searching but no luck.

C:/Program Files/Steam/steamapps/civilization V/assets/Gameplay/XML/

(I'm at work, so I can't double-check that, but it should be something similar to that.)

Within those directories are the vanilla game's XML files. At the top of each file will be the table declarations telling you what lines are within each structure.
 
There are no stupid questions, only stupid people. You can usually identify the stupid people by the fact that they don't ask questions.



C:/Program Files/Steam/steamapps/civilization V/assets/Gameplay/XML/

(I'm at work, so I can't double-check that, but it should be something similar to that.)

Within those directories are the vanilla game's XML files. At the top of each file will be the table declarations telling you what lines are within each structure.

Awesome! Thanks, Spatz!! =)
 
I personally prefer to check the XML files, but you can view the game database also. It should be in My Documents/My Games/ Sid Meyer's Civ5/cache/Civ5CoreDatabase.db

Kael recommended using SQLite Manager addon for Firefox, so that's what I use. You can test your SQL queries on the database without screwing up the game, because this database is recompiled every time the game starts, based on XML files.
 
Back
Top Bottom