Mod compatibility: Enlightenment Era & Future Worlds

richard1017

Chieftain
Joined
Aug 5, 2015
Messages
16
I used a tech cost modifier mod to adjust tech cost based on its GridX, which increase successive tech cost so I can enjoy each era a longer time. The modifier is quite simple which only contains one line sql code:
Code:
UPDATE Technologies SET Cost = Cost * (GridX*0.3 + 0.7);

This modifier works nicely with either Enlightenment Era or Future Worlds. But when use EE and FW at the same time, only the vanilla and EE techs are modified. Those provided by FW are not affected.

I tried to load EE and FW in different orders but the problem remains. I think it may due to the compatibility between Enlightenment Era and Future Worlds, since the modifier works well with either one of them.

Please help. Thank you very much.
 
I'm wondering if the issue may be because Future Worlds has a reference/dependency for EE to make it load after EE -- if the game is loading all mods that have dependencies after mods that don't, then it may be forcibly loading FW after your mod, meaning that none of the FW techs get updated.
 
That's amazingly brilliant! I commented out the EE reference in FW's modinfo, and the tech costs are now modified exactly as I expected.

Thank you so much, bouncymischa :)
 
I believe it should be possible to set up SQL triggers that will achieve this without modifying EE, but I don't know the syntax of how to set those triggers up off the top of my head, unfortunately! Whoward69 did do a tutorial on the subject though.
 
Thanks, S3rgeus. Creating trigger is a good idea which detects any changes to the Technologies table and triggers executing the modifier afterward. So far, I'm happy with the simple solution that delete dependencies between EE and FW --- no extra work needed :)


I believe it should be possible to set up SQL triggers that will achieve this without modifying EE, but I don't know the syntax of how to set those triggers up off the top of my head, unfortunately! Whoward69 did do a tutorial on the subject though.
 
Rather than delete the reference in FW you should add your own reference to FW. So FW will load after EE and then your mod will load after FW.

Writing a trigger would be incredibly complex, as you would need to know if the code had been run before, and then work out the correct value for cost
 
Better solution! Thanks, whoward69.

BTW, I have noticed that when the multiplier in my modifier is slightly bigger, the most expensive techs' cost become negative. This may due to the wraparound of integers. It seems the tech cost limit is around 215000, after that, it wraps around to a negative. Is it possible to change that?

Rather than delete the reference in FW you should add your own reference to FW. So FW will load after EE and then your mod will load after FW.

Writing a trigger would be incredibly complex, as you would need to know if the code had been run before, and then work out the correct value for cost
 
references may fix compatibility with these two mods. but does this script also work with any mod that add new techs, without having to reference a hundred different mods?
 
Is this tech cost modifier mod up somewhere, or did you make it yourself?

Looks like something I'd want to try out. My most recent modded games currently have me become somewhat way too runaway considering food and science, so I'm looking for ways to slow myself down on those categories. Tweaking my current mods is one way, but this looks to be a good method as well.
 
references may fix compatibility with these two mods. but does this script also work with any mod that add new techs, without having to reference a hundred different mods?

This is where the triggers mentioned would have come in ... but triggers can be tricky beasts to deploy correctly.

The simplest method to adjust tech-costs globally is to adjust the <ResearchPercent> column of table <GameSpeeds> for each 'Game Speed' "Type" in table <GameSpeeds>, or else to adjust <ResearchPercent> for the various HANDICAP_ "Type" designations in table <HandicapInfos>. There are also <ResearchPercent> and <NumCitiesTechCostMod> in table <Worlds>. Mod load order only comes into play then in that some other mod can re-write this info if it loads after your mod makes changes to this data (but this is the inherent problem in all mods and with all mod-load-order issues), but the structure of the <Technologies> table, and changes that have been or may be made to it are not relevant to the Tech-Cost adjustment when done through these various available <ResearchPercent> settings.
 
references may fix compatibility with these two mods. but does this script also work with any mod that add new techs, without having to reference a hundred different mods?

I think so, since the script only changes the tech cost base on its GridX value. That means every new tech added by other mods will definitely have its own GridX and will be modified by the script. The only issue is you must load this script after any mod that changes the tech tree. As I just learned, mod with reference will be forced to load after mods without references. For those, you need references in the script to make sure load the script after those mods that have references.
 
Is this tech cost modifier mod up somewhere, or did you make it yourself?

Looks like something I'd want to try out. My most recent modded games currently have me become somewhat way too runaway considering food and science, so I'm looking for ways to slow myself down on those categories. Tweaking my current mods is one way, but this looks to be a good method as well.

Hi, DistantRainbow. I made this mod myself. This mod is way more than simple which only contains a single line SQL code that I included in the original post. You can create a ".sql" file using that code and included the file in your mod. Have fun.
 
Rather than delete the reference in FW you should add your own reference to FW. So FW will load after EE and then your mod will load after FW.

Writing a trigger would be incredibly complex, as you would need to know if the code had been run before, and then work out the correct value for cost

Hi whoward69. After adding a reference to FW in my mod, Civ5 crashes on start right after the opening movie. The only log I got is:
Code:
[2414.109] columns StrategicViewType, TileType are not unique
[2414.109] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'

And following is the reference I added to my mod modinfo file:
Code:
<References>
    <Mod id="d9ece224-6cd8-4519-a27a-c417b59cdf35" minversion="0" maxversion="999" title="Future Worlds" />
  </References>

From the log, I have no idea what's happening here.
 
Hi whoward69. After adding a reference to FW in my mod, Civ5 crashes on start right after the opening movie. The only log I got is:
Code:
[2414.109] columns StrategicViewType, TileType are not unique
[2414.109] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'

And following is the reference I added to my mod modinfo file:
Code:
<References>
    <Mod id="d9ece224-6cd8-4519-a27a-c417b59cdf35" minversion="0" maxversion="999" title="Future Worlds" />
  </References>

From the log, I have no idea what's happening here.
  1. Everyone gets that error in the database.log
  2. If you are crashing after the start-up movie and before you ever get to the game's main menu, then the problem cannot be coming from any mod that is enabled via the game's mods menu because you haven't gotten to the point where mods and their info is being added to the game. Mods that are packaged as 'fake dlc' could be causing this sort of problem because they are treated as if they are another game-expansion, and get loaded before you ever get to the game's main menu.
  3. It is possible you have corrupted garbage somewhere in one of the cached files the game creates, so it may be of value to delete everything in the cache folder.
    • I only advocate this generally as a last-resort sort of thing because it also deletes the game's database tracking which mods were last enabled in the Mods menu, and this deletion will almost certainly mean any game-in-progress will be unrecoverable.
    • You should put Steam into 'Offline' mode, otherwise it will try to re-download any mods you are subscribed to on Steam
    • Leave Steam in 'Offfline' mode until you have either resolved the problem or satisified yourself it is not a 'cached file' issue
    • I also tend not to advocate this as a 1st-step solution because so far I have never been able to fix a mod-clash or corrupt-data issue by deleting my cache -- I have only been able to 'fix' the broken Steam Workshop mod-downloading system, and at this stage I prefer to just use SteamWorkshopDownloader to download any mod from the Workshop that I think looks interesting.
  4. Stopwatch.log is probably a better place to at least start looking to determine what the game was trying to do and what may have failed when the game went CTD
  5. If you meant you are actually getting CTD after you press "NEXT" in the Mods menu and then try to load a saved modded game when you get to that point, then this is likely being caused by attempting to change the modinfo file of your mod and then trying to reload a saved game. Editing the modinfo file forces you to re-enable the mod, and this instantly causes re-assignment of mod-loading-order, as would the code you are adding to your modinfo file for the Future Worlds Mod-Reference. Neither of these should be done unless you are starting a new game.
  6. Anything that causes mod-loading-order to be changed for a saved game generally will mean unrecoverable corruption because changing mod-loading-order causes ID re-assignment of BuildingIDs, UnitTypeIDs, PromotionIDs, PolicyIDs, etc., for anything added to the game by the active mods used within the saved game. Depending on what gets turned into a 'hash' as a result of this can cause CTD when attempting to reload a saved game.
 
If you are crashing after the start-up movie and before you ever get to the game's main menu, then the problem cannot be coming from any mod that is enabled via the game's mods menu because you haven't gotten to the point where mods and their info is being added to the game. Mods that are packaged as 'fake dlc' could be causing this sort of problem because they are treated as if they are another game-expansion, and get loaded before you ever get to the game's main menu.

Hi LeeS, thank you very much for this detailed analysis. With the hint, I found where the issue comes from.

In my modinfo, I originally used
Code:
<File import="0">LongerEras.sql</File>
That missing md5 caused all the problem. So I calculated the md5 of the file and added that to modinfo:
Code:
<File md5="68EC295BCA077DF6510A43DF67A43549" import="0">LongerEras.sql</File>
Now everything works well. :)

Thank you.
 
Top Bottom