Most frustrating things in Civ5 code

Krajzen

Deity
Joined
Oct 23, 2013
Messages
3,402
Location
Poland
Personally I hate one thing in Civ5 XML - lack of consequence and 'unification'. For example, I am currently working on changing balance of many units, and of course it would be too easy if all of them were named 'UNIT_NAME OF UNIT FROM GAME' - nooo, Mandekalu Cavalry has to be called 'MUSLIMCAVALRY' and Great Galleas 'VENETIAN_GALLEAS', so I have to check all those names...

From other annoying things - I wasn't modding in those old times, but I still remember how much time Firaxis needed to make game, well, truly moddable :p (farm bug!)

Maybe this is obvious for veterans, but personally I hate total lack of any references or explanations of lua commands - I am still wonderging how masters of lua in this community manage to find the lines they truly want :p

What are your frustrating experiences in modding Civ5 - XML, lua, DLL, graphics and so on? Or your biggest complaints? :p
 
All the xml tags of limited use, say... <MoveFriendlyWoodsAsRoad>? Or <CultureFromKills>? It's so useless, why did Firaxis even bother making an xml column for it in the first place?

I also wish there was such a table as <Trait_BuildingYieldChanges>, and that belief/religion XML columns could be used for traits, but I can live without it.

I also get fairly annoyed when nigh everyday some new modder approaches, describes their problem vaguely without any elaboration, doesn't give log entries, doesn't attach the mod, and if, heaven forbid, they even post their coding, it isn't within
Code:
 blocks so is pretty much unreadable... 
It's amazing I haven't had a meltdown yet. :lol:

That felt good to get out of my system. (Though I'm still trying to phrase everything as "tactfully" as possible) I feel better now. :)
 
What are your frustrating experiences in modding Civ5

Where to start?
Civilopedia.lua - why write a parameterised function and call it 19 times when you can copy/paste/edit the same 50+ lines of code 19 times - for about 8 different functions

Culture - not actually a yield, and then when they "fixed" it they only did a half hearted job ... and then when they added Faith they based that partly on the awful "JONS" code for Culture

And don't even get me started on Events!
 
Tourism apparently isn't a yield, it's just something that acts exactly like a yield in game.
Social policy modding being absurdly difficult. Such a key element to the game too.
Great works are basically completely unmoddable in my (limited) experience

And basically any function that only applies to one specific situation. Take culture from kills - would be so much better as its own separate table (So you could mod in "science from kills" "food from kills" etc) rather than a single tag.

This is just off the top of my head
 
Tourism apparently isn't a yield, it's just something that acts exactly like a yield in game.
And not forgetting Happiness, or should that be Local Happiness and Global Happiness - who knows? Apparently not the devs!

Great works are basically completely unmoddable in my (limited) experience
Only if you completely re-write the UI first and then mod the DLL - great design decision!

And basically any function that only applies to one specific situation. Take culture from kills - would be so much better as its own separate table (So you could mod in "science from kills" "food from kills" etc) rather than a single tag.
And then there's the whole change/modify yield inequality (compounded of course by Culture/Faith issues)

What also is frustrating is where they did it correctly first, but then as expansions came out they regressed to copy/paste - compare the structure of how the tabs are implemented in the DiploOverview screen to those of the Religion and Culture overviews - almost as if they were rushing to get stuff out the door and no longer caring about their own mantra of "the most moddable civ yet" :crazyeye:
 
AssignStartingPlots.lua
 
  • Lack of Multiplayer mod support
  • Ridiculous amount of stuff hardcoded into the DLL (I literally facepalmed IRL when I saw how the Samurai Fishing Boats buff was implemented)
  • Lack of GameEvents as opposed to Events (especially a GameEvents "equivalent" to RunCombatSim/EndCombatSim)
  • The previously mentioned issues with Culture/Faith/Tourism "yields"
  • The fact that multiple units in a game can have the same UnitID if they belong to different players
  • Very difficult to make changes to the AI without entering the DLL

That's just off the top of my head.

Great works are basically completely unmoddable in my (limited) experience

It took some fiddling, but I managed to make Great Works which grant dummy buildings to the Cities which contain them. I also figured out a function to generate a Great Work -- you create a dummy unit (with its own defined Works in XML/SQL) with InitUnit and immediately use PushMission to make it generate the Great Work. If you want to check out the code, it's the last mod in my signature.
 
Yeah, I must admit that personally I had a lot of problems with culture 'yield' too :p

Example: I was trying to give +2 culture to specialists. Of course normal Yield lines didn't work. Obviously I discovered that culture isn't treated as yield in this particular case (!) and to make specialist thing I had to modify... Palace (!). Lol

And DLL... God, please Firaxis make next game more moddable :p
 
Next absurdity:

HAPPINESS_PER_CITY_WITH_STATE_RELIGION

why the hell is it in GlobalDefines if it is relict from Civ4 which doesn't work :crazyeye:
 
And DLL... God, please Firaxis make next game more moddable :p
The great irony of this is that Firaxis adds a whole modding API and SDK to make modding easier...

...and still end up with useless code like this. :lol:

Firaxis seems to screw us over so much it's almost absurd.
 
Adding insult to injury:
Code:
      <FaithFromUnimprovedForest>0</FaithFromUnimprovedForest>
      <BonusReligiousBelief>0</BonusReligiousBelief>
      <AbleToAnnexCityStates>0</AbleToAnnexCityStates>
      <CrossesMountainsAfterGreatGeneral>0</CrossesMountainsAfterGreatGeneral>
      <MayaCalendarBonuses>0</MayaCalendarBonuses>
      <NoAnnexing>0</NoAnnexing>
      <TechFromCityConquer>0</TechFromCityConquer>
      <UniqueLuxuryRequiresNewArea>0</UniqueLuxuryRequiresNewArea>

This entire fraction of code is useless (Except maybe NoAnnexing)
 
To make things even worse, the NoAnnexing tag is tied, in the DLL, to being able to purchase in puppet cities. So if you want one but not the other, it's simply too bad.
 
Another one: Start biases.

Firstly, they're biases, so they're likely not to happen.

Secondly, they're not simultaneous. A start bias river and a start bias plains will spawn on a river, not plains.

Basically, one giant programming quirk.
 
Top Bottom