City State Diplomacy Mod (Updated)

OKAY. Success! This version of CSD (v14, mk.2) has new .dll changes that teach the AI how to spend gold on items in its city queue. This system builds upon the pre-existing desires/needs of cities, so it is an intelligent system from the get-go. The system has a buffer of 300 gold built in, so that it will always have enough money to purchase a tile or suffer a few years of negative gpt.

I've attached this version of CSD below. It does not yet have whoward's dll included (as I hope to see him add this new .dll tweak to his version).

Please help me test this version for bugs and/or instability. I've posted the .dll file below as well (EconomicAI.cpp) so that the more adventuresome can dive in and look for sloppy errors in my implementation (search for 'Gazebo' in the document to find my changes). Whoward, if you are reading this, I could definitely use your debugging skills in this regard.

Other changes include a decrease in AI proclivity to purchase tiles and a slight nerf to flavor_diplomacy AI tweaks (closer to vanilla).

Enjoy!
G
 
A little new year's treat: an updated version of v14 (now mk3), with a much smarter purchasing function. Updated v14 and CvEconomicAI.cpp posted below (I'll be removing the ones above).

The function isn't perfect, and it isn't the most efficient method (I haven't been able to dream up a more efficient method), but it gets the job done far more effectively than the old hurry code. Also, you can trace the purchasing habits of the AI in the PlayerHomeLandAILog (in your Logs folder, if verbose logging enabled). Search for 'CSD' to see what the AI is doing with its gold.

As always, suggestions, tweaks and advice welcome. I eventually plan on offering this chunk of code up to the community in order to improve the quality of the AI.

At this point, if the code passes scrutiny and there are no glaring bugs, I'm going to prep for an official update of CSD to v14. Integration with Whoward's DLL will come if/when he feels this gold purchasing code fits his DLL methodology.

Once this is done, this will be my last major update to CSD for awhile - work calls, and, to be honest, I've just about jumped every major hurdle that I set out to correct when I started this whole thing.

Happy 2014!
G
 
Alright, I'm really happy with how v14 is performing. I'm going to go ahead and make this one official. It is now uploaded to the Workshop and here on civfanatics.

V14 without the dll will have the cost tweaks, but none of the new shiny elements from the dll (resolutions, AI gold purchasing, etc.).

Have fun,
G

Edit: one thing to note about the dll version is that diplomatic units are no longer considered great people. This means, if you want, you can disable all of the CSD-specific tweaks related to great people (Mausoleum of Halicarnassus, Reliquary Belief, etc.) and they'll work as they should.
 
Hi Gazebo

Congratulations on the new release and a happy new year. Can't wait to try it out - hopefully the dll changes will be incorporated in Whowards dll mod.

One thing though: the download link for the non-dll version here on the forums point to a file called "city_state_diplomacy_mod__csd___for_brave_new_world___no_dll__v_13.civ5mod"

\Skodkim
 
Hi Gazebo

Congratulations on the new release and a happy new year. Can't wait to try it out - hopefully the dll changes will be incorporated in Whowards dll mod.

One thing though: the download link for the non-dll version here on the forums point to a file called "city_state_diplomacy_mod__csd___for_brave_new_world___no_dll__v_13.civ5mod"

\Skodkim

Huh. I must've uploaded v13 by mistake. It is now fixed.
G
 
Anyone having any problems with v14? Thoughts?

Waiting on Whoward to finish up his super-dll – will combine that with CSD once finished for v15.

From there, anyone have any additional things they'd like to see added to CSD?

Some thoughts:

- Designing a new specialist type that generates a little bit of each resource, and contributes to Great Diplomats which act as the inverse of Great Merchants (little money, lots of influence). Would be the specialist-type tied to CSD-specific buildings.

- City-state quests: any new ones desired?

- World Congress events: same question– any new ones desired?

- Buildings/units/attributes?

G
 
Some new resources? Papyrus, Parchment, paper, sepia->ink?
 
Some new resources? Papyrus, Parchment, paper, sepia->ink?

Not a bad idea. I probably wouldn't seed the map with it, but it might be interesting to have the School of Scribes produce 1 paper, which is required for the production of a diplomatic unit. It would remove the rather artificial limitation of 1 Emissary, 2 Envoys, etc. Could also open up avenues of trading paper with major civs in order to produce more diplomatic units (and prevent/discourage them from doing so).
 
Yeah. That will be great. Also some new city-states (maybe implemented from Not Another City-State Mod)/ new types of city-states can produce these resources and trade them with another CS and/or civs.
 
Yeah. That will be great. Also some new city-states (maybe implemented from Not Another City-State Mod)/ new types of city-states can produce these resources and trade them with another CS and/or civs.

I'll probably leave the addition of other city states to that mod (as it is pretty well-received, and I'd hate to create mod conflicts). My goal is to make CSD as standalone as possible, so as to maximize compatibility. If another mod already does something, I tend to shy away from that. I am going to give the paper resource a go, however – could be fun.
G
 
OK. Pitty, that that mod is incompatible with CSD :(.
 
OK. Pitty, that that mod is incompatible with CSD :(.

Wait, why is it incompatible?

Edit: I looked at the mod (Not Another City-State Mod) and nothing in it should break compatibility with CSD - we operate on different ends of the city-state spectrum.
 
Mhm, but someone wrote, that he played many times with both mod activated and the game crashed every time. He/she did not write, if he/she uses other mods with it.
 
Mhm, but someone wrote, that he played many times with both mod activated and the game crashed every time. He/she did not write, if he/she uses other mods with it.

I believe that was a byproduct of the Fall Patch. There is no reason why the mods would not be compatible.
G
 
Anyone having any problems with v14? Thoughts?

Waiting on Whoward to finish up his super-dll – will combine that with CSD once finished for v15.

From there, anyone have any additional things they'd like to see added to CSD?

Some thoughts:

- Designing a new specialist type that generates a little bit of each resource, and contributes to Great Diplomats which act as the inverse of Great Merchants (little money, lots of influence). Would be the specialist-type tied to CSD-specific buildings.

- City-state quests: any new ones desired?

- World Congress events: same question– any new ones desired?

- Buildings/units/attributes?

G


Hey Gazebo. As far as quests go, two thoughts come to mind:

1) I'd like to see quests more reflective of the different types of City-States. So Mercantile Civs are the ones most likely to ask you to make contact with other Civs & City States, boost gold output, hook up a new luxury or produce a great merchant. A militaristic Civ will most likely ask you to bully another City-State, gift them units, produce a Great General or declare war on a particular civilization.

2) My big thing would be to see more quests that encourage greater exploration. It'd be great if a City-State (especially a maritime one) gave you a quest to prove the world is round, or asked you to discover a new continent, or to uncover a new set of Ancient Ruins and/or an antiquity site. It would also be great to see City-States ask you to be the first to build a National Wonder (given the building requirements for most National Wonders, this could become an interesting contest). I'd also like to see City-States give you a quest to declare war on a Civ or another City-State....especially likely if they had been responsible for bullying or a declaration of war against them. Just a thought.

Speaking of which, & I know it might be beyond the scope of your mod, but I'd love to see two City States "go at each-other" on a more regular basis. Maybe two mercantile City States battling each other for supremacy, or two Militaristic City States slugging it out-that kind of thing. This would be of particular use on Terra maps, where you rock up on a new continent, & find antiquity sites of former city-States that have long since been destroyed. Just a thought.

Aussie.
 
One very little cosmetic thing: I really don't like the icon for the emissary. It just doesn't fit the ancient era. How about using number 13 in the icon atlas instead?

\Skodkim
 
One very little cosmetic thing: I really don't like the icon for the emissary. It just doesn't fit the ancient era. How about using number 13 in the icon atlas instead?

\Skodkim

Yeah, it is tough to find good semi-art-deco ancient-appropriate art. I don't think it is terrible though. I'll look into it.

Aussie, some good ideas. Quests are tricky, but I agree that more diversity is needed. I'll look into it. Right now I'm working on my idea below (tied to Dilophosaur's resource idea) regarding specialists and great people. For v15, I want the units and buildings from my mod to reduce their impact on the balance of the game by removing unneeded science, gold and tourism bonuses. Those bonuses, though fun, can mess up the pace of the game.

Also a new flag icon, in order to better distinguish diplomatic units from great prophets.
G
 
Hey all,
Burning a little bit of midnight oil to push this out to you. v15 has some exciting changes:

  1. Unit limits now based on a new resource called 'Paper.'
  2. Paper produced by Buildings, Natl. Wonders and Wonders of CSD.
  3. Units require a steadily-growing amount of paper to be produced- 1 for emissaries, 2 for envoys, and so on.
  4. Can be traded as a Strategic Resource (AI values it highly), does not appear on map as terrain resource.
  5. Buildings made completely independent of other victory paths- unique specialists (Civil Servant) and a new Great Person, the Great Diplomat.
  6. Civil Servant grants 1 science, 1 culture, and 1 GPP towards Great Diplomats, but costs 1 Gold.
  7. Great Diplomats grant 150 influence. Influence taken away from Great Merchant (they still produce lots of gold, however).
  8. Great Diplomat production does not affect GP rate of other Great People.
  9. 25% increase for Great Diplomat production via Merchant Confederacy policy. Arts funding in World Congress affects Great Diplomats as well.
  10. New art for Emissary, School of Scribes - Envoy art now the old Emissary art (for you, Skodkim)
  11. New art for Paper, specialists as well as revised art for buildings.
  12. New art for Great Diplomat
  13. New Strategic View icon and flag icon (no more dove).
  14. Almost all new features dependent upon .dll. (I'm sorry, Whoward, I keep adding stuff to my Dll! I promise this'll be the last of it...for a bit.)

Download the beta below and let me know what you think!
- Gazebo
 
Hi G

Theres a discussion on how to use CSD with Whowards dll here

Maybe you could help out?

Also do you know if Whowards new dll includes all your recent changes, e.g. AI purchasing tweaks?

\Skodkim
 
And I have just finished playtesting v14 ;(

So instead of giving feedback on v14, I'll try to say what I think of v15 having in mind what I found weird / unbalanced for v15:

Unit limits now based on a new resource called 'Paper.'

This is awesome. In v14, a major issue that I've encountered on larger maps was randomness. Since there are no CS to give production or beakers (and to my knowledge, Not Another City-State Mod is very outdated), CS contest tends to spin out of control very quickly - you befriend few faith or culture CS with random quests, pop them to ally with GMs or diplomat units, and gather more culture and faith - which in turn allow you to pop even more quests (culture and faith quests as well as resource quests) - then you get to firend/ally with even more CS and they provide you even more resources, faith and culture and voila - snowball. It's extremely easy to amass huge ammounts of culture / faith on larger maps, making you almost imprevious to enemy Tourism and allowing you to easily keep the CS you allied with proper policies / faith and more diplomatic units. Most of the time, noone could actually fight back because of the extremely limited capability to produce diplomatic units for most of the game.

Buildings made completely independent of other victory paths- unique specialists (Civil Servant) and a new Great Person, the Great Diplomat.

This might be a good idea, but the ammount of influence should be era-dependent (as should the gold from GM pop - there is a mod for it, but I guess it won't work now). I heavily dislike the Arts Funding addition of promoting diplomats. This is actually a poor idea in my opinion - funding GMs and GDs should be completely separate (perhaps Free Commerce could be added - it might boost GMs, GDs and possibly GEs). The reason for this is that you should not be forced to aid an enemy victory (and a particular type of enemy victory at that). Cultural win and diplomatic win (as well as science win) should have different goals in the World Congress - if you want to strenghten a self-fulfilling prophecy of diplomatic win (I get more votes to vote so that I can have more votes), it should never cross with other victory paths and be easy to achieve. This is especially important in MP because it gives an easy time for the cultural guys (I know science is way easier in MP than cultural - but fixing that should not be done this way). Arts funding is loved by AI (unlike Science funding) and it is extremely easy to push through. It should not be easy, just like other self-fulfilling prophecies aren't (world religion / ideology). At the same time, culture from cultural CS is so extreme that the one World Congress motion that can be passed to help cultural civilisations achieve victory should not strenghten their greatest enemy - diplomatic civs with tons of free culture.

Other stuff that was not modified in v15 and could use some attention:
- Gunboat diplomacy is a tad over the top - militaristic city states give you units, allowing you to quickly amass a force that makes the "overal military power" skyrocket without the need to focus on building units too hard, and that is perhaps the largest factor in how easy it is to achieve "could demand tribute" status with a CS - I didn't even have units close to many CS I got a ton of influence with - a few units somewhere near far away CS clusters (or between spread far away CS) allowed for easy influence gain. It's not even the issue of how much Influence the policy gives, it's the issue of how easy it is to get it, especially since it doubles how intimidating your forces are. A large, cheap autocratic army could easily pay for itself just by standing still - even CS that were far away didn't need much "protection" to be influenced. They even gave me units to strenghten my influence over them! The largest issue by far is that the AI doesn't get what I'm doing - they were mad a bit when I took over their CS, but that's that. I could become a diplomatic powerhouse with just this single policy, just by virtue of having a large army to conquer the world. Also, it's really hard to counter the effects of this policy with diplomats.
- AI - with the .dll, I've sometimes noticed strange AI behavior - they charge a single CS like mad when there are other options availible and burn their diplomats on it in a way that seems random - other times they will manage their influence correctly (this is more common). Sometimes they will focus a CS I have 240 influence with and try to take it (and don't stop poping diplomats even when they have like 350 influence), sometimes they will wisely take those that are easier to take.
- AI again - the AI focus on diplomacy so hard that they have a hard time winning - building Uffizi, Louvre or Porcelain Tower was easy on Emperor even if the player wasn't beelining it and didn't have insane science. On the other hand, there were instances where even ancient-era wonders were not completed in the time they usually are because AI was rushing diplo wonders or spending countless turns to build a lonely Envoy that achieved nothing.

Hope this helps and keep up the good work.
 
Top Bottom