What is the limitation on resources and promotions?

Evalis

Prince
Joined
Mar 2, 2009
Messages
496
So if I understand correctly there are roughly 50 or so new promotions that can be added into the game and about 200 if all the previous entries are deleted. Is this right?

Is there a hard coded limit for luxury or strategic resources?
 
I known that in vanilla civ5 promotions would go haywire after 255 promotions.

Resources....well lets just say do not try and remove any strategic ones and best to just leave those files alone in my view. Issue here is that the script files used to build maps are somewhat hard coded to use specific resources.
 
Can't say about deleting resources as I have never found the need, but as to adding them, its all done in AssignStartingPlots.lua (Once you have built your xml for said resources ofc, its best to include all the tables to do with resources even thou some of them are not used atm, prolly left over from civ4), this file is very fickley :) but once you can undertand it, its quite a breeze. I've not had any trouble adding 15+ new resources to the game, strategic and bonus(not done luxury). Even at one point made ALL resources spawn with a random amount rather than the set amounts CiV currently has. Add layers is not an issue either. The file is actualy quite mod friendly once you can get over the size of it, and understand it all.

Oh and this is the script, maps scripts use for thier resource placements editing this single file will apply your additions to all map scripts(Vanilla and User), but not custom made maps. Unless said mapscripts bypass AssignstartingPlots.lua, not that I have come accross any that do yet.

If the silent cap is still in force I would hazard a guess that recources will prolly suffer the same issues promotions do at 255.
 
I known that in vanilla civ5 promotions would go haywire after 255 promotions.

200, not 255. Trust me, I was VERY familiar with this one; the vanilla game added about 160, and the DLCs another 4-5, so you were limited to only about 35 custom promotions in your mods. Starting at ID#201, any new promotions will be automatically given to every unit in the game, which will obviously break stuff.
However, I haven't checked to see if 674 or G&K raised this limit, and I'd be very interested in the answer. (I can't play Civ5 at the moment, my home internet is down and Steam refuses to run in offline mode.)

Also, you can't delete promotions easily. If you delete a promotion and add a new one, the ID of the original remains unfilled; that is, if you had 200, deleted #100, and added a new one, the new one would be #201 and 100 would still be blank. And in the case of that particular table, the game will crash when it hits an empty ID. So, you either need to explicitly set the ID of a new promotion to fill the hole left by the deletion, or use one of the re-indexing mods.

As for resources, no, there's no limit on adding new resources. But map scripts won't add those resources to the map unless you modify AssignStartingPlots significantly; my own mod added three new strategics that needed to appear on the map, and another three or four "hidden" luxuries that'd be awarded through Wonders and such, and therefore didn't need to be added to the map.

One small note: while there's no real limit on adding luxuries and strategics, things in the UI will break if you try to add a resource that acts as both. The game will treat any resource with a Happiness modifier as a luxury, and therefore not list it in any strategic UI elements (like the top panel). One of my three custom strategics added happiness, which is why I know this.
 
200, not 255. Trust me, I was VERY familiar with this one; the vanilla game added about 160, and the DLCs another 4-5, so you were limited to only about 35 custom promotions in your mods. Starting at ID#201, any new promotions will be automatically given to every unit in the game, which will obviously break stuff.

I could have sworn it was 255 in my case as the problem you described is exactly what would happen after hitting the limit. I do recall leaving all promotions in and having to recycle some. Will have to confirm tonight if mine does indeed stop at 200 or 255.

Coincidental, I am currently redoing all my scenario promotions from the ground up again via SQL updates, but have yet to run the files and test things. I will hopefully have an answer as to whether this limit still exists or is removed in G&K.

What is interesting is that this limit is likely to play havoc with any future expansion packs (knowing civ, there are at minimal 2 per volume) or DLCs in the near future, so you would think a 'smart' programmer (lets leave that topic for another thread as I am well aware of your view at this point Spatz :lol:) would try to resolve this restriction asap.
 
What is interesting is that this limit is likely to play havoc with any future expansion packs (knowing civ, there are at minimal 2 per volume) or DLCs in the near future, so you would think a 'smart' programmer (lets leave that topic for another thread as I am well aware of your view at this point Spatz :lol:) would try to resolve this restriction asap.

Yeah, I'm not going to keep bashing Firaxis about this, but I'll point out what the numbers are like in my own mods. The base game, plus DLCs, was adding ~165, my Base and Empires mods (the minimum for most of my gameplay) added another 20 and subtracted 5, and my two main content mods (Ascension and Mythology) each added another 15-20. This meant that I couldn't even use all of my own mods without hitting the cap, and every time they released a DLC that added another promotion I had to remove one of my own to stay below the cap. In the end I started using Lua coding specific to certain units and such instead of tying the effects to promotions like a rational person would prefer.

This is why I'd like someone to check. If the cap wasn't raised or removed in either 674 or G&K, and the expansion added some promotions, then it makes things even harder for modders. But if we're now unlimited on numbers of promotions, then it just might be possible to salvage my own mods after all...
 
The limit is still there. However while your units get all the icon of the promotions after this value, making it look like they have the promotion, they don't actually get the effects of the promotion. I don't know if it was always like that.

Promotions after this limit can still be applied to a unit and they work, so seems to be more to do with the IsHasPromotion check. You can edit the unitpanel.lua to hide promotions after the limit, but then u would never have a way of letting the player know if the unit has that promotion or not.

Hopefully that makes sense :lol:
 
Promotions after this limit can still be applied to a unit and they work, so seems to be more to do with the IsHasPromotion check. You can edit the unitpanel.lua to hide promotions after the limit, but then u would never have a way of letting the player know if the unit has that promotion or not.

So does this mean the actual visual bug (going off what your saying) might be fixable by us? Maybe this is a job for one of our UI coding gurus to look into!
 
So does this mean the actual visual bug (going off what your saying) might be fixable by us? Maybe this is a job for one of our UI coding gurus to look into!

Unfortunately, no. What he's saying is that the Lua IsHasPromotion function (which is what the Unit Panel uses when deciding what icons to show) breaks once you exceed the cap (i.e., add any promotion with an ID of 201 or higher.) I can't confirm this at the moment, unfortunately. Without that function, there's no way to say what promotions a unit has, so the only possible "fix" would be to edit UnitPanel to not use that function at all for anything with an ID of 201 or higher, meaning no higher promotions could ever be shown whether or not your unit has them.

Sure, you could design your mods such that promotions 201+ are things that shouldn't show up on a unit's icon lists, but there's a second problem: without a working IsHasPromotion function, any Lua that uses those promotions couldn't work. So a fix would only work if you had promotions that shouldn't be shown AND that don't require any Lua to function. More importantly, you have no control over what promotions get what IDs when multiple mods are involved, so you'd have to also add a re-indexing function to move nonessential stuff up to those IDs...

The problem is that those of us who do quite a bit of Lua coding NEED that IsHasPromotion function to work. Without it, a lot of our custom combat stuff won't function, so just hiding the icons wouldn't help. It's not just a UI mistake that occurs at 201; for any promotions that trigger Lua code, the IsHasPromotion check is what's used to determine whether or not the effect occurs.
 
Top Bottom