Affinities As Yields

HandyVac

Gentleman
Joined
Apr 24, 2014
Messages
270
Location
The shire where the oxen cross the river. UK.
It bugs me a little that the main way to gain affinities is by researching techs, since to my mind affinities should be more like an ideology or philosophy, representing how your people use what they know, rather than what they know. And what better way to judge the ideology of your civilisation than by what it chooses to build?
So in this mod I remove the affinity rewards from researching techs and instead make tile improvements and buildings yield affinity points per-turn.

Key Changes

- No techs grant affinity points when researched. I.e. Affinity comes from what your choose to do with your knowledge, not what you know.

- Many (but not all) buildings and tile improvements yield affinity points per turn, so what you build dictates the affinity you progress towards. I.e. The work and living environment of your colony influences the ideology of your citizens.

For example, and not an exhaustive list:
farms, mines, domes, vivariums and old earth relics yield Purity points
generators, manufatories, nodes, autoplants and networks yield Supremacy
paddocks, plantations, biowells, xenonurseries and alien preserves yield Harmony​

- User interface changes show the new yields in tooltips, production lists and techweb filters. New icons in the city view screen show the total produced by that city, and the dropdowns from the top menu show the total produced colony-wide.
Hopefully all this makes it clear to the player what to build to persue which affinity.



Screenshots:
Spoiler :

Spoiler :

Spoiler :

Spoiler :

Spoiler :

Spoiler :


Now compatible with Rising Tide:
DOWNLOAD FROM CIVFANATICS
DOWNLOAD FROM STEAM

With alternate version for use without Rising Tide:
DOWNLOAD THE NON-RISING-TIDE VERSION FROM STEAM


Original first post:
Spoiler :
This is very much a work in progress, but I thought I'd share what I have so far.

It bugs me a little that the main way to gain affinities is by researching techs, since to my mind affinities should be more like an ideology or philosophy, representing how your people use what they know, rather than what they know. And what better way to judge the ideology of your civilisation than by what it chooses to build?
So in this mod I remove all affinity rewards from techs and instead make tile-improvements yield affinity-points-per-turn when worked. ;)

Download The Latest Version Here

So Far
The following tile improvements yield affinity when worked (not labelled in-game yet, but functioning):
  • Generator - 1 Supremacy
  • Quarry - 1 Supremacy
  • Firaxite Mine - 3 Supremacy
  • Geothermal Well - 2 Supremacy
  • Array - 3 Supremacy
  • Node - 4 Supremacy

  • Plantation - 1 Harmony
  • Paddock - 1 Harmony
  • Work Barge - 1 Harmony
  • Xenomass Well - 3 Harmony
  • Biowell - 4 Harmony
  • Alien Nest - 4 Harmony

  • Farm - 1 Purity
  • Mine - 1 Purity
  • Floatstone Quarry - 3 Purity
  • Petrol Well - 2 Purity
  • Dome - 3 Purity
  • Terrascape - 4 Purity
Thresholds for the affinity-points needed to level-up have been increased (though probably not enough) so you don't earn levels too quickly.

Still To Do
Add supprt for affinity-yields from buildings
Change civilopedia entries and help texts to mention the new yields
Balance the numbers so that all three affinities can be gained with equal ease. (supremacy tends to get left behind at the moment)
If possible, tweak the UI for showing tile yields, so icons for affinity yields are visible on the map.
 
Interesting idea. I suspect late game you're affinity will go through the roof.. I'll have to try this one out. (Can you actually 'work' an alien nest ?)
 
updated to (v 10)

Now supports yields from buildings, both as a flat yield and a percentage modifier for that city.

Added modified versions of InfoTooltipInclude.lua and PlotMouseoverInclude.lua, to show the new affinity yields in tooltips for map plots, city build lists and techweb.
 
Hope you don't mind some feedback.

I gave this mod a shot and it was ok, though the affinities came way too fast for me. Here's how my game went for an idea of the pace :

Standard Size, Gemini difficulty.

After only a few turns I was locked down into a dominant Affinity. Not sure how that happened but I was forced into harmony almost straight away... (I guess from making plantations) So ok... mindflower it is !

Turn 110
3 Cities, population total : 11
5 Harmony, 5 Purity and 3 Supremacy
Its very early in the game, my cities are stuck on a little isle and underdeveloped.

Turn 170
3 Cities, pop 23
Affinities 13/7/6
Its still rather early in the game.. I have no army to speak of and not a lot of tech yet, at this point I see my affinity is going to max out and so is the AI so I better start racing towards my victory conditions.

Turn 200
3 Cities Pop 27
18/9/7 (I have reached maximum harmony affinity)
At this point its an all out race... as the AI players mostly have 18/18/18 affinity levels ! But I dont think they understand the new system as they are not progressing towards victory.

Turn 303 (victory)
3 cities 38 pop
18/15/12

It was an interesting game and quite fun, but I'm not sure how to properly pursue/lockin an affinity during the first 10 turns. Also it seems that you really don't have time to explore/research much at all... you pretty much have to beeline to your victory conditions... not necessarily a bad thing though.

I did notice one other odd thing... though this is not really mod related... can probably happen in any game under right conditions. I had over 10 affinity ea when I researched tech for the aircraft carrier unit. It was odd because all my units were 'green' / harmony affinity based but my carrier was given the option to select any of the upgrades... thus I could have a supremacy(yellow) carrier while the rest of my units were harmony. I think the devs never expected anyone to have such high affinity levels when they researched that tech.
 
...I could have a supremacy(yellow) carrier while the rest of my units were harmony. I think the devs never expected anyone to have such high affinity levels when they researched that tech.
This is true for all unit types that have different versions based on affinity. I have played several games over the past few months in which I had selected a supremacy or purity option for an upgrade despite harmony being my primary. I do, however, play with only the total domination (conquest) victory enabled, so tech-rushing becomes quite important in keeping ahead of the AI opponents, and I gain a lot of affinity from techs of course.
 
Hope you don't mind some feedback.

I gave this mod a shot and it was ok, though the affinities came way too fast for me. Here's how my game went for an idea of the pace :

Standard Size, Gemini difficulty.

After only a few turns I was locked down into a dominant Affinity. Not sure how that happened but I was forced into harmony almost straight away... (I guess from making plantations) So ok... mindflower it is !

Turn 110
3 Cities, population total : 11
5 Harmony, 5 Purity and 3 Supremacy
Its very early in the game, my cities are stuck on a little isle and underdeveloped.

Turn 170
3 Cities, pop 23
Affinities 13/7/6
Its still rather early in the game.. I have no army to speak of and not a lot of tech yet, at this point I see my affinity is going to max out and so is the AI so I better start racing towards my victory conditions.

Turn 200
3 Cities Pop 27
18/9/7 (I have reached maximum harmony affinity)
At this point its an all out race... as the AI players mostly have 18/18/18 affinity levels ! But I dont think they understand the new system as they are not progressing towards victory.

Turn 303 (victory)
3 cities 38 pop
18/15/12

It was an interesting game and quite fun, but I'm not sure how to properly pursue/lockin an affinity during the first 10 turns. Also it seems that you really don't have time to explore/research much at all... you pretty much have to beeline to your victory conditions... not necessarily a bad thing though.

I did notice one other odd thing... though this is not really mod related... can probably happen in any game under right conditions. I had over 10 affinity ea when I researched tech for the aircraft carrier unit. It was odd because all my units were 'green' / harmony affinity based but my carrier was given the option to select any of the upgrades... thus I could have a supremacy(yellow) carrier while the rest of my units were harmony. I think the devs never expected anyone to have such high affinity levels when they researched that tech.

Yep, looks like affinity levels are gained much too fast at the moment, I'll have to increase the points-needed-for-next-level thresholds some more. It's gonna take a while of trial and error to get that pacing just right.
I suspect the aparrent tardiness of the AI in progressing to victory is another symptom of fast affinity leveling, since if they haven't researched the tech to build that victory wonder they can't start winning yet, no matter how many affinity levels they have.

Another problem with pacing here is affinity-level thresholds don't scale with the selected game-speed. I've been testing the mod on Quick game speed, but levels are going to be gained in the same number of turns in Standard, Epic or Marathon too, which is obviously not ideal. :mischief:
I'll need to figure out a way to change the level thresholds dynamically via lua depending on gamespeed (another thing to add to my to do list), but until then I reccomend playing this mod on quick.
 
Thanks for your work in any case. Its still a worthy mod as is. I look forward to any updates it may receive.
 
Updated to (v 17)

- Increased the spacing between affinity levels by roughly three times. In my test runs the AI now gets it's first affinity level around turn 30, and maxes out it's dominant one around turn 400, which seems reasonable on quick gamespeed.

- Added support for player perks which change the affinity yield from buildings.

- Added modified version of UnitPanel.lua, to show affinity-yields-changes for worker builds.

- Added modified version of TopPanel.lua, to show you colony's total affinity-yield-per-turn in the affinity level tooltips.
 
This sounds really good! Gaining affinity this way seems a lot more lore-friendly.

I had a similar idea a while back, though I didn't create a mod (no time, and I'm a lousy coder).
 
as the AI players mostly have 18/18/18 affinity levels ! But I dont think they understand the new system as they are not progressing towards victory.

I don't think this has anything to do with the mod, the AI seems to just kinda stumble into a victory, or not do anything at all. I played an Apollo game recently where a runaway Koslov had fully conquered ARC (he had like 30 cities) and had full Purity, yet didn't make progress towards any of the victories.:crazyeye:
 
Updated to (v 18)

- Bugfix. Mod will no longer make the game freeze when you get a "choose a free affinity level" quest reward.

- General pass over buildings and wonders to give them appropriate affinity-yield values. Buildings from further out in the techweb give larger yields, wonders either increase the percentage yield in that city, or increase yields from a certain building type.

- Increased spacing between affinity levels, to accomodate the increased yields from buildings.

- Manufactories now yield 2 supremacy. Should make supremacy levels a little easier to get, and gives supremacists more of a chace to get production.
 
I don't think this has anything to do with the mod, the AI seems to just kinda stumble into a victory, or not do anything at all. I played an Apollo game recently where a runaway Koslov had fully conquered ARC (he had like 30 cities) and had full Purity, yet didn't make progress towards any of the victories.:crazyeye:

On a related note, several times now playing with this mod I've seen the AI building a victory wonder for an affinity other than their dominant one. I.e. a harmony civ building the Emancipation Gate, or a purity civ winning with a Mind Flower.

I'm not sure if thats the AI following some grand strategy to level-up affinity A but accidentally getting affinity B instead from the yields system, or if the AI just picks a victory at random when it happens to meet the prereqs for all of them.
 
I think the AI perhaps doesn't understand how to get affinity so it picks a goal and doesn't know how to get there. This may be why Firaxis didn't go this way with affinity. It's hard to get the AI to effectively build cities, and even harder if they also have to follow a bigger strategy when doing it.
 
When it comes to victory wonders the AI will usually just build whatever is available first, as they have insanely high flavor-numbers (200, while everything else has about 5-25, going to 50 for some wonders).

@Topic: That's a REALLY cool project, so much more interesting than what we currently have in the game.

I personally would remove the affinities from the standard builds though, as they're not really divided by affinity - a supremacy player will for example not be able to spam generators and still do fine overall. Everyone goes for farms early on. I personally think a more balanced version would be to instead add these yields when certain affinity-related techs are reached - you could display that in the tech web via dummy-playerperks.
 
Since you've modified some UI elements, it would be relatively easy to modify the techweb to use the old affinity icons instead for yield modifications. It would make things clearer. This may have the additional bonus of allowing the same improvement to have different affinity yields, depending on which research path you take.
 
Updated to (V 22)

- Optimised code to run faster (by saving info about yields in a lua table, instead of doing the same database lookups an ever-increasing number of times each turn)

- Changed filters in the techweb screen, filtering by affinity now highlights all buildings and improvements which give that affinity yield. (Should make it clearer for the player which techs to prioritise when persuing a certain affinity).
 
Top Bottom