DLC Tech Tree modding issue...

lemmy101

Emperor
Joined
Apr 10, 2006
Messages
1,064
So we're writing a tech tree editor (PLUG) and in doing this I've noticed a potentially very annoying issue with the DLC system and the modding when it comes to new tech trees.

I was trying to figure out why it was crashing with a fully new tech tree, since the tool hunts for all changes between your tree and the original, I could't understand why it was crashing when looking for TECH_MASONRY (which no longer exists) when it should have made the correct XML to redirect every one of these.

I looked in the debug database and figured it out: Babylon require masonry for their UB walls. And Babylon's details are in a separate directory in separate XML files so the tool wasn't picking them up.

Uh oh. So this means if you've done a TC and have a completely new tech tree, then if DLC comes out for a new Civ that has any references to techs, then it'll crash the game regardless of whether that particular Civ is a player in the game or not.

I suspect the solution for total conversions would be to make sure ALL civs are deleted from the game via a delete tag before the new ones are added, which would be fine for your 'Fall from Heaven' equivalents. If your mod takes place on Earth and you're using the existing Civs, but make heavy changes to the tech tree, then you're going to need to update your mod to cater for every piece of DLC that comes out.

Anyone got any ideas how to protect against this? In the tool am making it check for DLC so to create the right redirect updates, but that will only work if the mod author has all the DLC, and updates the mod every time a new DLC leader / civ comes out.

(NB: The same applies to other mods, but when the incompatibility stuff is working I doubt that'll be an issue as you wouldn't expect many other mods to work with a total conversion, where DLC is automatically applied)
 
Hi lemmy:

What I heard from the 2K wiki is that deleting techs will lead to game crash. Then I assume that if I use a fully new tech tree, the game will crash too, since that the old techs are all deleted. Is it true?

xxhe
 
And the very real problems I foresaw months ago that the DLC method would cause slowly starts to make their appearance ...


Anyway, can't you alter the tags used in DLCs? If you can, then making a sweeping delete/reset of all possible TechPrereq occurances before deleting the original techtree would seem the way to go.
 
no probs :)

There seems to be an issue with completely new tech trees, I'm not sure why Civ doesn't like them but it's nothing to do with an SQL error due to references to removed techs.

Hi lemmy:

What I heard from the 2K wiki is that deleting techs will lead to game crash.

Yeah I assumed that was down to SQL errors, since I was getting them in the database.log before the crash... but since the database doesn't ever complain now... :/

Bah!
 
Yeah you can do that no problem. The problem is we're aiming for as high a modularity as possible, so sweeping delete / resets are out otherwise one small change would invalidate all other tech change mods.
How so? If the plan is to remove ie. Masonry altogether then whether you do it by a sweeping change or hand pick the deletion then all other mods requiring Masonry will cause an error - regardless if they are of the DLC format or are usermade.
 
Perhaps you're right, if the 'sweeping change' was specific enough anything that said masonry but nothing else.

I guess the problem comes from making that assumption is more an issue of the tool than hand coded XML. for e.g. where it just reassigned everything that was masonry to another tech, it would be difficult to then go and move those displaced things to a new tech as you don't have the breakdown of what they are, just that 'there are some that were redirected'.
 
Lemmy,

Perhaps add a report window/output file for what was changed?

Not glamorous I know, but at least that way if something does break, someone could manually find the offender and smack it about some.

Thanks for working on this tool, looking forward to seeing it in action.
 
I'm surprised you were even able to delete one tech. (Or have you?) I tried deleting one tech and then replacing it with the same exact tech --- this always leads to game crash for me.

On the other hand, I don't see why the DLC thing is a problem. You'll need to strip out all dependencies on technologies anyway (with sql lines like UPDATE Buildings SET PrereqTech='Null', UPDATE Units SET ObsoleteTech='NULL', and so on...). These will work on DLC content just as well as non-DLC content. (Note: I haven't looked at the tool yet so I might not be understanding the problem.)
 
I've figured out the crashes are caused when a Goody Hut is landed on by the player or AI, I'm looking into it now. It doesn't seem to spring up unless you've deleted a tech that is a Goody Tech technology...

re: the DLC thing I never considered a blanket sql thing I probably posted a bit hastily. In the tool for other reasons I'm doing specific SQL updates to get rid of conficts just so that the modder can read the generated xml and see what has been altered so they can provide a proper alternative. As such without the actual civ name to use as a key for the conflict removal, it wouldn't work.

I forgot that in an actual mod's xml you would likely do more sweeping changes.
 
BINGO!

The reason it crashes is that the IDs will have gaps in them as techs are removed. At some point it must be trying to access them in an array and breaking. I've added functionality to the tool so it will realign all the IDs for all the techs from 0 - whatever in the output, you can remove techs to your heart's desire now. ;D
 
Nice. Work.

Is it safe to assume that many game crashes people are experiencing when deleting other things like buildings, leaders, etc is caused by the same ID gap problem? And if so, is there some generic code you can post that would realign those as well?
 
Y'know lemmy101, with all the different aspects of the game that your touching on at such speeds; it's like you're TheLopez v2 (with all due respect to TheLopez for creating so many brilliant mods in such little time for Civ IV). When you'd think that lemmy was too caught up in one thing or another, he creates another thing out of the blue. Seriously though, good job man. With all your creeping paranoias about Firaxis plotting against the modders, you manage to hang in there and beat (more or less) everything that's folly with Firaxis' design with Civ V. This tool - along with NexusBuddy - are tremendous stepping stones for us content modders.
 
Back
Top Bottom