City State Diplomacy Mod (Updated)

Your evening is my morning - I just check stuff as I'm drinking my breakfast tea ;)
 
Your evening is my morning - I just check stuff as I'm drinking my breakfast tea ;)

And now it is I who is checking things over a caffeinated beverage (Coffee). Yeah, CSD's dll started out as a very simple dll change and I've added a lot since then. Someday I'll stop. Maybe today. Maybe not. :) Once I'm sure of my most recent changes, Whoward, I'll send it your way.
G
 
Alright, waiting for documents to upload means downtime! I rewrote the function real quick to draw from an XML list, so the free buildings created with this can now be edited without re-compiling (yay). I'll upload it below in a bit.

Changes:

Pioneer: 3 Move, 3 pop, 25% food basket at start, 3 free tiles
+1 Sight, embark defense increased
- Granary
- Market
- Library
- Barracks
- Shrine
- Watermill
- Monument

Colonist: 4 move, 5 Pop, 50% food basket at start, 5 free tiles
Pioneer buildings, plus:
+1 Sight, embark defense increased
- Workshop
- Forge
- Windmill
- Temple
- Aqueduct
- Lighthouse
- Harbor

The Conquistador now has the settle-power of the Pioneer.

I also thought it might be kinda fun to give a free Pioneer to Washington at Astronomy - seems appropriate, and would boost him a bit in power.

Thoughts on the changes thus far? Also, I have good artwork for the Colonist (there was some nice orphaned art in the latest expansion), but not the Pioneer. Any volunteers?

G

Update: Here's the latest v23. Cheers!

City-State Diplomacy Mod v23-mk3
 
Assuming Pioneer has 3 pop (you forgot to mention it :p) and that both have 3 move (Colonist does not have move score mentioned) and that you will update us with the cost of both of'em ;-) it's awesome ;]
 
I posted in the other thread about this but i thought I'd leave a message here too. I'm trying to load up your mod for MP using Gedemon's method. I get the mod to load ,but i cant research any techs beyond writing. Any tips on how you got it working?
 
I posted in the other thread about this but i thought I'd leave a message here too. I'm trying to load up your mod for MP using Gedemon's method. I get the mod to load ,but i cant research any techs beyond writing. Any tips on how you got it working?

I haven't tried it with v23, however, once I've finalized it I'll see if I'm encountering the same problem as you. I have not done extensive testing with Gedemon's MP creator – just a few minutes working on a proof of concept.

I will say that it is important to follow the .dll instructions, particularly the bit where you place the .dll in two separate locations (one in the CSD mod folder, the other in the MP DLC folder).

Also, the in-game compiler (via the firetuner) took a long, long time with CSD – I let it run for over an hour before it finished. Make sure you're letting it run the full duration, otherwise important data may be left out.

Thanerion, I updated the other post - was typing in a hurry!

The cost for both units is the same as a Settler – it isn't ideal, but the function to incrementally change the cost of the settler based on food production is arcane to say the least, and I didn't want to mess with it. My feeling on this is two-fold: the units are cheap (~2 turns to build on average), however, since you are typically moving them a long way away (other continents, etc.), the low cost is offset by risk and travel time.

I should also note I bumped them both forward on the tech track – Compass and Biology, to be precise. This allows the AI to possibly have settlers in-the-pipe once they've researched astronomy, and I chose Biology because of theme (Quinine, anyone?) as well as the fact that building a new city in the modern era is quite the investment, and there should be a near-guarantee that the AI is using the best possible settler.
G

Update: fixed a few things. Latest version still the same link.
 
Also, I have good artwork for the Colonist (there was some nice orphaned art in the latest expansion), but not the Pioneer. Any volunteers?
I've tried something (see attachment), one of the pilgrims - it's a rather iconic hat. While the wheat field somehow just... fits, it doesn't really represent much, a stylised settlement or something along these lines might work better? Not quite happy with it, though, ideas?
 

Attachments

  • 2014-04-26_00002.jpg
    2014-04-26_00002.jpg
    171 KB · Views: 92
Trying out the latest release (as of a couple of hours ago, you might have rolled a new one by now) and came across a strange, but not broken situation.

The Huns & Spain are at the bottom of the pile and are both either struggling to take CSs in battle or are fighting for their lives against bigger opponents, ie Morocco & Byzantium.

Just War is in place and for the next meeting I, as Greece, wanted to repeal it. Everyone disliked that idea, yet Morocco put forward Global Peace Accord as an alternative, and got it passed.

So units were 15% cheaper and no-one wanted to change that and voted Greece down, but Morocco gets their proposal through for a 25% increase in costs.:eek: The net result units are now 10% more expensive.
Also the effects panel shows a strange double up with 10% up & 10% down.
Not sure if that can be changed, probably not, just a case of 2 effects with differing values on the same things.



Also, and I can't see how this would change from previous releases, the Great Person counter sometimes shows the Great Writer as counting down with negative values each turn.

Lastly this is the only lua.log error that I have found.

Code:
CityView.lua:987: bad argument #1 to 'ConvertTextKey' (string expected, got nil)

Only CSD & CEP are active.
 

Attachments

  • Effects_from_WC.png
    Effects_from_WC.png
    103.3 KB · Views: 289
Trying out the latest release (as of a couple of hours ago, you might have rolled a new one by now) and came across a strange, but not broken situation.

The Huns & Spain are at the bottom of the pile and are both either struggling to take CSs in battle or are fighting for their lives against bigger opponents, ie Morocco & Byzantium.

Just War is in place and for the next meeting I, as Greece, wanted to repeal it. Everyone disliked that idea, yet Morocco put forward Global Peace Accord as an alternative, and got it passed.

So units were 15% cheaper and no-one wanted to change that and voted Greece down, but Morocco gets their proposal through for a 25% increase in costs.:eek: The net result units are now 10% more expensive.
Also the effects panel shows a strange double up with 10% up & 10% down.
Not sure if that can be changed, probably not, just a case of 2 effects with differing values on the same things.



Also, and I can't see how this would change from previous releases, the Great Person counter sometimes shows the Great Writer as counting down with negative values each turn.

Lastly this is the only lua.log error that I have found.

Code:
CityView.lua:987: bad argument #1 to 'ConvertTextKey' (string expected, got nil)

Only CSD & CEP are active.

Yeah, I was afraid of the effect of both Just War and Global Peace being active at the same time. I'll work on the logic of the display to see if I can get a third summary to work that combines the effects of both and disables the other two. I'll also look to see if it is possible to disable a resolution from being chosen if another is active.

Morocco's resolution passed because the AI hated your proposal more than his- the AI is not good at multitasking in the WC, so sometimes odd proposals slip through. I like to think of it as a metaphor for democracy. :)

Not sure about the lua or writer problems- I'll take a look. Writer seems odd, though is probably linked to the lua problem.

Everything else working well enough?
G

Update: I've looked at the lua, and I don't see anything wrong (though my eyes may fail me). It seems to be a missing 'help' definition for a unit, however all my 'helps' are accounted for. Is it a CEP problem, perhaps, or a conflict?

Also, I'll update v23 with a function that prevents contradicting resolutions from being proposed. So Just War can't be proposed if Global Peace is enabled, and Arts Funding if Science Funding, etc. Was a no-brainer, thanks for pointing it out.
 
Regarding that lua error, no it isn't a problem with your unit helps, they are always good. It only occurred after the 'mk2' or 'mk3' version of release 23, whichever was the last. Before then there were no problems with the display of the expected times for the GP.

Could be a problem with cache at my end, though I am usually pretty careful to clear everything beforehand. I will do a re-install and see.
A conflict with CEP?! What are you kidding?:D Well yeah it could be, but again the problem only showed with the last iteration of CSD.

A couple of points on the new settler units.

They are superb, no wait they're brilliant, no fantastic, no hang on what's a better superlative than those? Whatever that word is, that's what they are.
The extra tiles assigned to reflect the larger city is a nice touch.
Much better implementation than the CEP version. Admittedly we are doing slightly different things here. I think we, CEP, may have to make some adjustments to that policy that creates better settlers and if the user has CSD we can give something else.

Not sure if I imagined reading it here or just thought of it but are the costs to produce those units supposed to be the same as a base settler? If they are different and CEP is changing them I'll fix that, if they aren't different then they should be, IMO.
 
This is more of a question than anything else, I'm not 100% sure of the answer myself.

In the IdeologyChanges.sql the sections labelled: Wonder Culture & Natural Wonder are both using the variable 1_CulturePerWorldWonder in the text description.

Shouldn't that be 1_CulturePerNaturalWonder for RESOLUTION_NATURAL_HERITAGE_SITES?

Of course since the value is the same it doesn't make a lot of difference but...

Secondly, since the use of variables in text is a good thing, eliminates the need to re-write help files, could they be used more extensively? ie everywhere the value is shown in a TXT_KEY use the variable.
e.g. the same section has:

Code:
UPDATE Language_en_US
SET Text = 'Each Natural Wonder provides +2 to all Yields when worked.'
WHERE Tag = 'TXT_KEY_RESOLUTION_NATURAL_HERITAGE_SITES_HELP' AND EXISTS (SELECT * FROM CSD WHERE Type='IDEOLOGY_CSD' AND Value= 1 );

would that also display correctly with:

Code:
UPDATE Language_en_US
SET Text = 'Each Natural Wonder provides +{1_CulturePerNaturalWonder} to all Yields when worked.'
WHERE Tag = 'TXT_KEY_RESOLUTION_NATURAL_HERITAGE_SITES_HELP' AND EXISTS (SELECT * FROM CSD WHERE Type='IDEOLOGY_CSD' AND Value= 1 );

As I say, I'm not 100% sure of the answer, could depend on the order of loading the values into the database, I don't know. All I do know is I like how Thalassicus has made the task of maintaining the displayed information in CEP easier with his TooltipWriter so if an extra minute in writing these sql commands means not having to worry about them in later balance related changes, isn't that a goal?
 
"CulturePerNaturalWonder" is NOT a variable per se in "+{1_CulturePerNaturalWonder}" but a hint to the translators as to what to expect the {1} to be replaced with from within the DLL/Lua code

You could write "+{1_CulturePerNaturalWonder}", "+{1_CPerNW}" or "+{1}" in there - it's all the same to the code that replaces the parameters passed from the DLL/Lua code into the text
 
"CulturePerNaturalWonder" is NOT a variable per se in "+{1_CulturePerNaturalWonder}" but a hint to the translators as to what to expect the {1} to be replaced with from within the DLL/Lua code

You could write "+{1_CulturePerNaturalWonder}", "+{1_CPerNW}" or "+{1}" in there - it's all the same to the code that replaces the parameters passed from the DLL/Lua code into the text

You know, now that you mention that, I do recall having being told that before. Brain is starting to slip I'm afraid.:crazyeye:

Thank you, again.:goodjob:
 
I have few question regarding settings file:

1. Which buildings are mentioned here exactly?
Spoiler :
Code:
/*
Unhappiness for other ideologies caused by World Ideology Resolution
Also Enables Extra Vote Sources from Buildings
0 = Vanilla Difficulty
1 = Normal Difficulty (Default)
2 = Hard Difficulty
*/
2. I'm confused about these settings :crazyeye: Is this option enabled by default or disabled? :) Code belowis directly from fresh download of v22, and states that default value is "1", yet actual setting is "2".
Spoiler :
Code:
/*
CSD Beliefs and Traits
1 = Beliefs and Traits Enabled (Default)
2 = Beliefs and Traits Disabled
*/

INSERT INTO CSD (Type, Value)
VALUES ('CSD_BONUSES', 2);
3. The same as point 2:
Spoiler :
Code:
/*
Fix for Mausoleum of Halicarnassus (Wonders of the Ancient World DLC)
1 = Fix Enabled (Default)
2 = Fix Disabled 
*/

INSERT INTO CSD (Type, Value)
VALUES ('ANCIENT_WONDERS', 2);
4. The same as 2 and 3:
Spoiler :
Code:
/*
Sweden Trait Modification (G&K + Brave New World)
To compensate, Swedish Diplomatic Units have the Nobel Laureate Promotion which grants 20% more Influence from Diplomatic Missions.
3 = 40 Influence When Gifting Great People (Very Easy)
2 = 20 Influence When Gifting Great People (Easy)
1 = 0 Influence When Gifting Great People (Normal, Default)
0 = 90 Influence Per Mission (Vanilla- Not Recommended)
*/

INSERT INTO CSD (Type, Value)
VALUES ('SWEDEN_TRAIT', 0);

5. Can I somehow disable/modify World Congress voting bonus from grand temple? I find it to odd to have votes from my own cities - I would prefer to modify this to only foreign cities at least (or disable whatsoever).

And I just want to mention that I love this mod so much :goodjob: I was thinking so many times about how city states diplomacy is bad and how it could be better :)
It's a pity that I found this mod only just recently :sad:
 
Mscibor,

Those options.sql values are correct, in that they are disabled from the start to make CSD as compatible as possible. If you want those features, you'll need to make the 2 a 1.

Also Enables Extra Vote Sources from Buildings
This includes the votes from the three ideology-specific national wonders I added. If you disable this, those wonders won't show up (as one of the values they depend on will not exist). I'd leave it on, unless testing something.

5. Can I somehow disable/modify World Congress voting bonus from grand temple? I find it to odd to have votes from my own cities - I would prefer to modify this to only foreign cities at least (or disable whatsoever).

Yes - you can disable this by going to VanillaBuildingChanges.sql (in the Buildings Folder) and setting the following '4' to zero:

Code:
UPDATE Buildings
SET FaithToVotes = '4'
WHERE BuildingClass= 'BUILDINGCLASS_GRAND_TEMPLE'
AND EXISTS (SELECT * FROM CSD WHERE Type='CSD_AI' AND Value= 1 );

You can also bump that value up to increase the votes per x population (i.e. the 4 there = 4 cities).

If there is large demand for a 'foreign cities only' setting I can probably make that happen pretty easily. My feeling is that the Faith votes represented a player's total moral/religious authority, which includes your own people. To each their own, however (that's why I make it modular!).

And I just want to mention that I love this mod so much I was thinking so many times about how city states diplomacy is bad and how it could be better

Glad you like it! It has been a lot of work, but the payout has been great.


ExpiredReign,
Shouldn't that be 1_CulturePerNaturalWonder for RESOLUTION_NATURAL_HERITAGE_SITES?

That's the way it is listed in the game's text files, so I left it that way. It is, as whoward mentioned, simply a semantic issue - the game doesn't care what it says, just the integer value at the front of it.

Glad you like the settler unit - I'm really happy with them.

Not sure if I imagined reading it here or just thought of it but are the costs to produce those units supposed to be the same as a base settler? If they are different and CEP is changing them I'll fix that, if they aren't different then they should be, IMO.

They are the same, yes. I'm having a hard time figuring out how to modify the food -> production function, as the code is arcane. I could make them just cost flat production (in addition to food, possibly), but that might be harder to balance. I think, though, that since most mid/late-game settlers will be sent a long way away, having a quick build time is balanced by the risk of travel (and duration).

Still working on v23 when I get a chance. I had a list of things to include in this, and only two things remain. Hints? Both are city-state quests, and they both involve barbarian units. One is set in the classical/medieval period, the other in the modern era. Stay tuned!
G
 
@Gazebo
I'm beginning to realize why I like the progress of this mod so much, apart from the high quality of work that is. You actually have a vision in mind or at least a clearly defined set of tasks that you are working towards. That's how it appears to me anyway.
Working with the Communitas project can be a bit taxing since it is such a wide range of tasks with so many needing to be looked at at one time. Coming here and seeing steps forward is enjoyable.
Woah, that sounds like a whinge, sorry about that.:mischief: Better grab another coffee and move on.

Excellent work, looking forward to the new tasks. Capture a barbarian unit?
 
"Capturing" barbarians, as done by the Reformation belief (Missionairy "converts" barbs on the fly) or as "ottoman capture ship" is already done ;p;-) Didn't have time to test new settlers - still finishing .22 games ;p
 
You actually have a vision in mind or at least a clearly defined set of tasks that you are working towards.

Most of the time- sometimes I get a bit too ambitious. :) I'm not sure it is fair to compare CSD to CEP, though, as, like you said, CEP is so much more comprehensive. It is, however, always good to avoid having 'too many cooks in the kitchen,' so to speak.


Excellent work, looking forward to the new tasks. Capture a barbarian unit?

Not even close! I'm working on polishing it right now, but here are the quest texts for both quests:

Code:
The unhappiness of your empire has led citizens of {2_MinorCivName:textkey} to rise up to try and throw off your influence! Improve your happiness and defeat all of the rebels in [COLOR_POSITIVE_TEXT]{1_TurnsRemaining}[20][ENDCOLOR]turns, or the rebels will end your alliance!

That's the modern one. The quest fires (rarely) based on the following criteria:

- If it is the industrial or a later era
- If your empire is unhappy
- If your people want to convert to a different ideology
- You are allies with the city state querying the quest

These criteria lead to the chance for the rebel event - the quest notes change based on the ideology your civ (and thus your CS ally) wants:

If they want Order:

Code:
The proletariat of {2_MinorCivName:textkey} has risen up to try and throw off your influence in their city-state! Fix your negative happiness or defeat all of the rebels in [COLOR_POSITIVE_TEXT]{1_TurnsRemaining}[ENDCOLOR] turns, or your alliance will be severed!

If they want Autocracy:

Code:
Guerilla warriors of {2_MinorCivName:textkey} have risen up to try and throw off your influence in their city-state! Fix your negative happiness or defeat all of the rebels in [COLOR_POSITIVE_TEXT]{1_TurnsRemaining}[ENDCOLOR] turns, or your alliance will be severed!

And so on. Rebels will spawn four times from the beginning of the event until it ends twenty turns later. If your empire has recovered from unhappiness, or you've killed the rebels, you win the quest and nothing happens. If, however, you fail, you are stripped of your quests and influence with the CS, and the civs that have the ideology the CS wanted will gain influence with the CS. It is, essentially, a cold war-style revolution.

I need to refine some things, and work on the AI, however so far so good.

The other quest is similar in function, but has a different (and awesome) outcome:

Code:
A horde of barbarians has appeared near {2_MinorCivName:textkey}! Keep Barbarians away from their lands for [COLOR_POSITIVE_TEXT]{1_TurnsRemaining}[ENDCOLOR] turns, or the city will be sacked!

This quest fires (also rarely) if the CS has a barb camp really close to its borders and you are in the pre-industrial period. The same pattern of spawns occurs, however, if you fail the quest (i.e. if there are any barbarians still threatening the CS), the CS is captured by the barbarians. Yep! Barb city! Okay, I know, kinda goofy, but it works.

The latter actually meshes really well with CSD. Just after a CS was sacked by barbs, a nearby CS asked me to liberate it as a quest. Perfect.

Again, gotta work on the AI, but so far so good.
G
 
Top Bottom