Integrate mods in original files

Serp

King
Joined
Apr 1, 2015
Messages
666
Hi :)

I created the modpack shown in my signature with the MPMPM-Tool (http://forums.civfanatics.com/showthread.php?t=533238).

This tool reads out the databse of the game while it is running, and copy paste most <Gamedata></Gamedata> things to one single xml file, to create a DLC like modpack.
If you don't know how it looks like, download my modpack (or any other you find in the MPMPM thread) and take a look at the modpack/override/Civ5Units.xml file.

The downside of such a modpack is, that civilization takes quite long to start (from doubleclick icon to first menu).
I was told that this is because the game loads the database meanwhile. It adds all the database entries from the original game and after that it adds the DLCs. The modpack is deleting nearly everything in the database and adds everything again, like it was with mods active.
So in short: With a modpack there is alot of unneeded work done. which results in a *10 of the normal loading time.

To reduce the loading time, my thought was, that I could empty all original xml files, that include <Gamedata>anything</Gamedata>, so just <Gamedata></Gamedata> is left.
I already did this succesfully with notepad++ and made sure only these <Gamedata> things are deleted, that are in the modpack (so nothing is missing, like Map_Folder entries).

But unfortunately the game crashes now before I reach the menu.
The database.log shows:
Code:
[74886.562] columns StrategicViewType, TileType are not unique
[74886.562] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
I don't know which file this execution "INSERT INTO ArtDefine_StrategicView(S..." does, I searched all sql files, this line is in none of them.

Does anybody know how database creation works?
Where to place my modpack xml file, to prevent crashing? Everything the game needs should be there now.
 
You will get that error in the Database.log even without any game modifications.
hm...thanks for this hint.
And how to find out what exactly causes the crash? There is also no minidump file =/

Or do you now more about the database, where to put the override xml files?
Or should it work that way, and it only crashes because I might deleted something that is not in the modpack?
 
The game core needs a certain amount of the vanilla database present so it can initialise BEFORE it checks for what DLC you have. So you've almost certainly deleted something the game needs, despite it being over-written later by your pseudo-DLC.
 
What whoward69 said, and... at a guess, the files are replaced in the wrong order, since you edited Firaxis' files AFTER you made the MPMPM modpack. Try re-saving each file in the modpack.
 
The game core needs a certain amount of the vanilla database present so it can initialise BEFORE it checks for what DLC you have. So you've almost certainly deleted something the game needs, despite it being over-written later by your pseudo-DLC.

okay... do you have a clue which things are needed for initialise?

Maybe the original xml files should not only include
<Gamedata></Gamedata>
but also the definition of tables? Like:
Code:
<Table name="AICityStrategies">
		<Column name="ID" type="integer"  primarykey="true" autoincrement="true" />
		<Column name="Type" type="text"  unique="true" notnull="true" />
		<Column name="CheckTriggerTurnCount" type="integer"  />
		<Column name="MinimumNumTurnsExecuted" type="integer"  />
		<Column name="WeightThreshold" type="integer"  default="0"/>
		<Column name="NoMinorCivs" type="boolean"  default="0"/>
		<Column name="Permanent" type="boolean"  default="0"/>
		<Column name="TechPrereq" type="text"  default="NULL"/>
		<Column name="TechObsolete" type="text"  default="NULL"/>
		<Column name="Advisor" type="text"  />
		<Column name="AdvisorCounsel" type="text"  />
		<Column name="AdvisorCounselImportance" type="integer"  default="1"/>
	</Table>

If so, I don't know an easy way how to edit more than 2500 files that way, that everything exept those tables is deleted...

It would be better if I knew which files exaclty are needed (or first loaded), so I can copy paste the modpack stuff in it.


@Nutty:
so you say that the "last saved" date matters for the database?
I saved them again, but like expectred still the crash because the initialse might fail. but saving order might be also a point, thanks.
 
okay... do you have a clue which things are needed for initialise?

No. The code is in the .exe and the UI dll - neither of which we have the source code for. There is no easy way to do this. You're going to have to start from the original state, and delete/wipe the contents of a few (2 or 3) files, save, start, see if it crashes, if it does, it's one of those three files, if not, rinse and repeat 2 or 3 files at a go until you've identified every file you can delete/wipe. Good luck with that!

Edit: It's a similar, but different, problem to working out how much of the core data can be deleted for a TC mod - and finding that out took me the best part of two weeks.
 
SUCCESS ! :)

Thanks for your hints :)

I emptied not 2-3 files, but one whole folder (a total of ~20 folders) and tried if it crashes.
I found out that the reason for crash was the
Assets\Gameplay\XML\NewText\English.xml
because it includes the "Language" entries, which are not in the modpacks override file.

Also not in the override file are:
Map_Folders, in DLC\DLC_SP_Maps +2 + 3 Civ5Maps_DLC_SP_Maps.xml
Map_Sizes, in DLC\DLC_SP_Maps +2 + 3 Civ5Maps_DLC_SP_Maps.xml
Maps, in DLC\DLC_SP_Maps +2 + 3 Civ5Maps_DLC_SP_Maps.xml
MemoryInfos, in Assets\Gameplay\XML\BasicInfos\CIV5MemoryInfos.xml

Conclusion:
I was able to delete EVERY .xml file (in the Assets folder), that includes <Gamedata> ...</Gamedata> stuff, except those 4 mentioned above (and of course not the ones in my modpack :D)

The game loads much faster now, I stopped time at my (quite fast) laptop:
Normal game without modpack: 52 seconds
Normal game with modpack : 171 seconds
Lite game withmodpack : 52 seconds


So ~ 3 times faster :) And at slower Pcs this is a huge difference. At laptops from my friends the normal modpack game takes ~15 minutes to load. 3 times faster will be very good :D

If someone also want to do it, here is how I did it:
  • Make a backup copy of your whole game folder. (if something wents wrong, or you want to play without the modpack some time again)
  • Install eg. Notepad ++ to "search and replace" in files.
  • Search for <Gamedata> in all xml files of your game...but because they are too many, notepadd++ might crash. So I did it folder by folder (all DLC folders on their own and all Gameplay folders in their own)
  • Don't change the 4 files I mentioned above! (and if you play in another language than English, there might be also other language files like "German.xml")
  • I don't know if Notepad is able to delete, so I just told notepadd++ to find and replace <Gamedata> with anything... like KKKKKKKK or what you like.
  • Now I used "WinMerge" to compare the original Asset folder with my changed Asset folder.
  • WinMerge will show you all the xml files you just changed.
  • Now you can mark them all and rightclick->delete.
  • Done

If something goes wrong, use your backup folder to restore files. Or I think also steam itself has the feature to check files to restore them ;)
 
Back
Top Bottom