On tech diffusion

Setting these bug options might make thing a bit more to your liking, though they obviously won't help with a game already in progress like yours


These options also imply that BUG does distinguish somehow between Old and New World.

I'd say that for Spirictum New World Policy 2 or 3 is what you're looking for. And set the new worlders one or two eras behind and/or receive the tech known by a high fraction of players (i.e. only stuff everybody knows, no recently researched "cutting edge" new techs).
 

Attachments

  • bug barb civ nw.JPG
    bug barb civ nw.JPG
    223 KB · Views: 395
I had assumed that Spirictum meant that "New World Civs" are civs spawned with the Barb Civ option on continents with no proper civ on them.
Otherwise, if different continents all have their own full civ from the start of the game, then they're all "Old Worlds", aren't they?
 
So I'll do some more digging on this new code for tech diffusion, to see some examples to this feature (and hopefully to help newcomers or people who doesn't understand C++ code who want to better understand this feature).

For now, these are all modifiers which are applied to Tech Diffusion:


To a specific Player:

-To each known civ which got the tech already;
-----More if you have OB with it or if the civ is your vassal;
-----More if you're at war or if you're a vassal of the civ;
-Less if only less then 1/3 of all the civs have the tech;
-More if more then 2/3 of all the civs have the tech;
-More the more civs you know in the game (related to the total number of civs);

-More the bigger the gap between the best civ and the player in known techs;

-More the bigger the gap between the best civ and the player in score;


To the ones who just want to know what modifies it, there is your answer.

Now, to the weight of them. I separated them to show how the math applies to it all. It's in that order, now let's check the interactions:

First it checks from all civs, to all civs we know, which have the tech in question. For each you sum 0.5. But also for each you check if: It has OB or is a vassal? This civ contributes 2, instead of 0.5 to the sum. Is it at war with you, or is it your Master? This civ contributes with 1 to the sum instead of 0.5. All the others that are known and have the tech contribute with 0.5. Those who don't have the tech or are unkown don't contribute at all. So the more OBs and Vassals with civs that know the tech the better. Best yield (98) Worst yield (0)

After this the game checks if anyone you know has the tech by the previous function described above (it just checks if the above sum yielded more then 0, which should when there is at least someone you know that has the tech). If yes, then it checks the 2 following conditions: Have less then a third, between 1/3 and 2/3 or above 2/3 of the civs got the tech in question?

If Less then 1/3, the sum is divided by 100, if more then 2/3, the sum is multiplied by 3, if in between nothing is changed. So for this part, if less then a third of the civs don't know the tech, this number becomes really small. And after that the value is again multiplied, but now by the ratio between Known Civs and All Civs. So the more civs you know in the game, the less this ratio affects badly the value (which I'll call from now on knownExp, the name it's used on the Tech Diffusion code). If you know everyone, the value is unchanged because the ratio will yield 1, and it's multiplied to knownExp, so it results in the previous value. OBS: This ratio is between Known Civs and All Civs, so this has nothing to do with civs who know the tech, it's just a measurement of how many civs you know in the game, if you are well known then you have more tech diffusion. Best yield (294) Worst yield (0.0002)


Here is when this knownExp ends being calculated and starts affecting other variables. Now we will change the iModifier, the final variable to yield our tech diffusion modifier. It is started with the value 100. This following part will only happen if we know someone who got the tech (knownExp > 0, so if we went through the previous part, we will enter this one).

In this first operation we will get iModifier by adding it with iTechDiffusion. iTechDiffusion OTOH will be calculated using the following formula:

MAX[0, techDiffMod - (int)(techDiffMod * 0.85 ^ knownExp + 0.5)]
Where
MAX means the maximum value will be chosen between the result of the formula and 0
(int) denotes it'll yield an integer value, and the rounding is always down (e.g 6.9 = 6)
techDiffMod is defined in TechDiffusion_GlobalDefines.xml, and it's 70
knownExp is the only value calculated so far
and the math order of this formula is: 0.85^knownExp, then this multiplies techDiffMod, then it adds 0.5 (for the rounding issue) and finally you get techDiffMod and subtracts by this. This will always result in 70 - (x% of 70). Not surprisingly Best yield (70) Worst yield (0). With this we apply the following formula: iModifier(new) = iModifier(old) + iTechDiffusion, so iModifier(new) = 100 + (0, 70), which may result at Best (170) or at worst (100).

And now we reach the point where things may get a lot bigger or not. The game discovers the best player in tech points and checks our % of techs related to him (saved in iTechScorePercent). If we have 90% (defined in global defines as TECH_DIFFUSION_WELFARE_THRESHOLD) or less, then this part of the formula kicks in. Now we have iModifier with at best 170, or at worst 100, to add to another variable (iWelfareTechDiffusion). The formula is the following:

MAX[0, iWelfareMod - (int)(iWelfareMod * (0.98 ^ (iWelfareThreshold - iTechScorePercent)) + 0.5)]
Where
MAX as previously explained yields 0 or the formula result, which is higher
(int) denotes it'll yield an integer
iWelfareMod defined 1000 in TechDiffusion_GlobalDefines.xml
iWelfareThreshold defined 90 in TechDiffusion_GlobalDefines.xml
iTechScorePercent the % of our tech points related to the best in tech points
iModifier is the previous value already calculated (min 0, max 70)
and the math order is similar to the previous one: discover 0.98 ^ (90 - iTechScorePercent), then multiply by 1000, then add 0.5, get the integer result of this and subtract it from 1000 + iModifier. Best yield (838) Worst yield (20).

Now we will check if this value will be applied to iModifier or not, and if it'll suffer any new modifications too. Now we check scores! For every civ in game we check their scores to see who has the highest score. Now we store it and take the ratio BestScore/OurScore. If this is less then or equal to 1 (OurScore >= BestScore, so actually we have the best Score), forget about iWelfareTechDiffusion and your result may be at best 170 or at worst 100, as stored in iModifier. OTOH if we are below the best score then we take the ratio and multiply it by iWelfareTechDiffusion. As this ratio has to be >1, iWelfareTechDiffusion may only increase by this. Finally we make iModifier(new) = iModifier(old) + iWelfareTechDiffusion

Now this is hard to calculate. At worst we will have exactly what iWelfareTechDiffusion would yield (in case 20). At best is impossible to predict, but we can suppose a civ with 5000 score, and a new worlder with 100. The ratio becomes 50, so this means (50 * 838) + 170 which yields 42070.

According to 45° (I have no idea where this is in the code), this iModifier is applied to your :science:/turn. You divide it by 100 and multiply it by your tech production. I have no idea if this considers fractions or not. If it accepts, then even the slightest tech diffusion value influences your research rate (I truly think it accepts). If not only values of iModifier > 100 do any difference (and only multiples of 100).


So if the weight of the factor is what matters to you, then here is your answer: Score Rate > Tech Points Rate > Rate of Civs which know the tech. Then for every civ you know: (Number of known civs which know the tech: OBs and Vassals > At War and Masters > None of these) > Known Civs rate. This may be deceiving, because some values are dependent to others, so in words: The capability of generating tech diffusion from the best yield of iModifier if we have >= 90% of the best tech points civ in the game is at best 170, which supposedly makes your :science:/turn be mutiplied by 1.7. To this everything until iWelfareTechDiffusion is considered. But if we have < 90%, we add to this iModifier a value ranging from 20 to 41900+ which may mutiply our research by something between 1.2 (if iModifier was at minimal value of 100) or 1.9 (if iModifier was at maximum value of 170) to more then 40x your tech. So actually the rate of tech points and the rate of score are the most important to tech diffusion, and they care little for everything explained above them. So if you are a new worlder that has just been born, with 100 score, and a ship from the best score and techer of the game right outside your city, your knownExp will yield at worst 0.03, resulting in an iModifier (before iWelfareTechDiffusion) of 100 (minimum). But getting iWelfareTechDiffusion (and imagine that guy has 2000 score) your iWelfareTechDiffusion will yield something like 16760, so actually your final iModifier will be 16860, or 16.86x your :science:/turn. Nice heh :cool:


I guess the only mistakes I may have let pass are related to the difference between Team and Civ. I always considered Civs rather then Teams (not only this is different in different parts of the code, as I don't know exactly what's the meaning of a team in RoM-AND and BtS). If the devs may take a look at what I've written, please let me know if I did a mistake, I don't want to mislead the players.
 
I had assumed that Spirictum meant that "New World Civs" are civs spawned with the Barb Civ option on continents with no proper civ on them.
Otherwise, if different continents all have their own full civ from the start of the game, then they're all "Old Worlds", aren't they?

It took me so long to give that tech diffusion explanation that I didn't see your postings. You're right Noyyau, this is what I was talking about. I forgot these options existed. But now it made everything more confusing to me, because it seems you may change many things related to New/Old World maps, and if there isn't a way to distinguish them in the DLL, how does these changes apply? Do they apply at all or is this something old that's not functional anymore?
 
It took me so long to give that tech diffusion explanation that I didn't see your postings. You're right Noyyau, this is what I was talking about. I forgot these options existed. But now it made everything more confusing to me, because it seems you may change many things related to New/Old World maps, and if there isn't a way to distinguish them in the DLL, how does these changes apply? Do they apply at all or is this something old that's not functional anymore?

I'm not sure either. I suppose every new continent is considered "new world" for each civilization. What made me think it works like this is that if I choose barbarian civs to evolve only when they meet an "old world" civ, I've noticed that some barbarian civs that spawned near my border don't evolve when I meet them, but they do when some civ from another continent meets them.
 
I feel like tech diffusion is the wrong solution for a lot of the problems that keep coming up. Absurd amounts of diffusion to help keep behind civilizations up is hiding the real issue: AI's have trouble keeping up technologically.

Maybe we should be focusing on solving that and then tech diffusion could be turned down to a more reasonable amount.

So the real question is why do many AI civilizations struggle to keep up technologically? Big AI civilizations seem to do okay. Smaller ones or isolated island civilizations do not do so well. Perhaps that indicates we have made RAND tailored towards massive expansion as being the only winning mechanic. Civ3 had this problem: city spam was the way to win. So how do we fix it?

Perhaps some civics should be geared towards benefiting smaller civilizations. Right now Republic/Democracy/Federal are all basically clones of each other. Maybe Republic should give +25% :commerce: for civilizations with 5 and under cities, and -10% for each city after that (so with 10 cities, a net of -25% :commerce: ). Other civics could use similar mechanics. (Feel free to dream up new modifiers, I'm willing to implement them).
 
I feel like tech diffusion is the wrong solution for a lot of the problems that keep coming up. Absurd amounts of diffusion to help keep behind civilizations up is hiding the real issue: AI's have trouble keeping up technologically.

Maybe we should be focusing on solving that and then tech diffusion could be turned down to a more reasonable amount.

So the real question is why do many AI civilizations struggle to keep up technologically? Big AI civilizations seem to do okay. Smaller ones or isolated island civilizations do not do so well. Perhaps that indicates we have made RAND tailored towards massive expansion as being the only winning mechanic. Civ3 had this problem: city spam was the way to win. So how do we fix it?

Perhaps some civics should be geared towards benefiting smaller civilizations. Right now Republic/Democracy/Federal are all basically clones of each other. Maybe Republic should give +25% :commerce: for civilizations with 5 and under cities, and -10% for each city after that (so with 10 cities, a net of -25% :commerce: ). Other civics could use similar mechanics. (Feel free to dream up new modifiers, I'm willing to implement them).

Well, looks obvious to me that bigger civs keep up easier technologically in comparison with smaller civs. If a tech costs 10000 :science: a 20 cities civ has obviously a big advantage to a 3 cities civ. They simply have more buildings and specialists. If the number of cities ratio is 20 to 2, science output has (more or less) the same ratio or even more in favour of the bigger civ because of the wonders in might have built. So what the first civ can discover in 10 turns will take 100 turns for the smaller civ (without tech diffusion).
Yes, we could use civics to balance the game but I fear modifier should be huge in order to compensate such a huge gap. I fear a 10 to 1 ratio in science output can't be balanced with civics only. Even if we admit a 5 to 1 ratio it's huge anyway and will always make technologically behind civs fall even further behind. On the other hand, I always wanted to introduce some kind of penalty for bigger civs; right now is way too easy to win a conquest victory IMHO. I think it should be harder to manage a multi-continent-empire.
 
45°38'N-13°47'E;13304951 said:
Well, looks obvious to me that bigger civs keep up easier technologically in comparison with smaller civs. If a tech costs 10000 :science: a 20 cities civ has obviously a big advantage to a 3 cities civ. They simply have more buildings and specialists. If the number of cities ratio is 20 to 2, science output has (more or less) the same ratio or even more in favour of the bigger civ because of the wonders in might have built. So what the first civ can discover in 10 turns will take 100 turns for the smaller civ (without tech diffusion).
Yes, we could use civics to balance the game but I fear modifier should be huge in order to compensate such a huge gap. I fear a 10 to 1 ratio in science output can't be balanced with civics only. Even if we admit a 5 to 1 ratio it's huge anyway and will always make technologically behind civs fall even further behind. On the other hand, I always wanted to introduce some kind of penalty for bigger civs; right now is way too easy to win a conquest victory IMHO. I think it should be harder to manage a multi-continent-empire.

I don't think the tech gulf is that unbridgeable.

Let's use your example. Medieval era, a 20 city civilization will have 20 cities * 10 citizens (average) * 2 :commerce: per citizen, or 400 :commerce: output. At 90% science that is 360 :science: times around +35% science modifiers from civics and buildings, for ~500 science / turn. That seems reasonable, as it would take ~20 turns to research a 10000 :science: tech.

3 civ civilization will have 3 cities * 15 citizens (assuming fewer settlers = more growth) * 2 :commerce: per citizen or 90 :commerce: per turn. At so few cities, they can run at 100% science and get 90 :science: beakers, * 35% science modifiers for ~120 :science: per turn. That same tech would take 83 turns (ow).

However, let's say both civilizations were using Republic, with my suggested modifiers.

The 3 civ civilization would be at ~ 150 :science: per turn, while the 20 civ state would be at 400 :science: per turn (assuming the negative modifier caps out at -25% :commerce: )

The 3 city civilization is now at 60 turns, and the 20 city civilization is at 30 turns. Now a 63 turn gulf has been shortened to a 30 turn gap. Large, but not unmanageable.

If similar modifiers existed on a few more civics, it would force the larger civilization to run more expensive/less optimal civics or get hit with more penalties. I suspect the difference would become even smaller.
 
I suppose we can try but I fear a 3 cities civ with 15 population per city is overestimated. Also a 30 turns gap would always mean that gap for a single tech. If we also assume a smaller gap for other techs, gap will constantly increase. There's no way a civ like that can get some tech before any other civ, so I wonder if it will ever be able to stay afloat. But it's ok to me to try it.
 
I don't think that penalizing larger civs is the way to go. To me that kind of defeats the core concept of the game.

The maintenance costs for cities and civics already go up for every extra city (plus extra unit maintenance costs for more garrison units needed), so maybe adjust those?
Considering all the extra :gold: that is available from Reneissance and especially Industrial onwards in RAND, I wonder if it's possible for the maintenance adjustments to kick in only in/after a certain era? Ancient, Classical and Medieval seem reasonably balanced to me in that regard.
And let's not forget that big unknown Inflation, which I've no idea how exactly it works but might be useful as well.

But I do like the idea of certain civics giving bonuses to smaller civs. To use Afforess' example, I do like Republic giving extra :commerce: for having at most 5 cities, but I don't agree on the malus for having more than those 5 cities.
 
I don't think that penalizing larger civs is the way to go. To me that kind of defeats the core concept of the game.

I think larger civilizations are fine, but city spam is not. There should be some penalties for truly massive civilizations.

The maintenance costs for cities and civics already go up for every extra city (plus extra unit maintenance costs for more garrison units needed), so maybe adjust those?

Maintenance is confusing, hidden, and really not a good game mechanic in my opinion. I would rather it be reduced or removed than expanded.


Considering all the extra :gold: that is available from Reneissance and especially Industrial onwards in RAND, I wonder if it's possible for the maintenance adjustments to kick in only in/after a certain era? Ancient, Classical and Medieval seem reasonably balanced to me in that regard.

Civics, like I suggested.

And let's not forget that big unknown Inflation, which I've no idea how exactly it works but might be useful as well.

Inflation is an even worse modifier than maintenance IMHO, and I would be in favor of totally axing it and replacing it with different mechanics.

But I do like the idea of certain civics giving bonuses to smaller civs. To use Afforess' example, I do like Republic giving extra :commerce: for having at most 5 cities, but I don't agree on the malus for having more than those 5 cities.

I like the malus because republics are historically for small or tiny civilizations, they don't work at large scale (before you disagree, which civic is the USA? Hint: Federal). Also, these modifiers are optional, because I am talking only civics here. If the civic looks bad for your particular playstyle, don't use it. Not every civic should be equally useful every game.

45°38'N-13°47'E;13305024 said:
I suppose we can try but I fear a 3 cities civ with 15 population per city is overestimated. Also a 30 turns gap would always mean that gap for a single tech. If we also assume a smaller gap for other techs, gap will constantly increase. There's no way a civ like that can get some tech before any other civ, so I wonder if it will ever be able to stay afloat. But it's ok to me to try it.

IMHO, you are being too pessimistic. Closing the gap even a medium amount will have a big effect over a long game. However I don't want to use larger modifiers to hurt large civilizations too much, or help small civilizations too little. I'd rather there be multiple playstyles.

Other things we might consider is copying a feature from civ5: researching techs with other players. In Civilization 5 you can do a trade deal to have a temporary "tech research" alliance, where you pool tech research efforts and both mutually gain more research. Ideally this would only apply to civilizations "near" or ahead of you technologically, so the leading civilizations can not use this to boost themselves even farther.
 
I'd rather there be multiple playstyles.

Yes, please. And I agree with most of the points given.

This of course requires some give and take for each play style. And not that one must suffer more than another just because it's how the more vocal players play.

But another set of factors must be weighed in to this. And it compounds some of the problems, and that is Map size and types used and number of starting Civs (and still options like REV and Barb Civ must be considered as both introduce even more civs into a running game where not using those 2 options the number is set at start up).

If, for example, a player want to use a Huge or Giant non earth type map with only 7-10 civs how does "city spam" not occur? All these empires will be larger than a Large map with 15-20 starting civs, or even a Huge or Giant map using a bigger set of starting Civs for that matter.

Over the last 7+ years I've found that Map size and type plus starting set (#) of Civs are as dominating a set of factors as any other in the game. They also give the game it's diversity in play and replayability. Much more so than what Civs, or Leaders are used in the game.

Just some things to think about.

JosEPh
 
Other things we might consider is copying a feature from civ5: researching techs with other players. In Civilization 5 you can do a trade deal to have a temporary "tech research" alliance, where you pool tech research efforts and both mutually gain more research. Ideally this would only apply to civilizations "near" or ahead of you technologically, so the leading civilizations can not use this to boost themselves even farther.

Good ol MoO2 research treaty. Yes, please :)
 
I agree with Afforess. Civ V is a good example as you can play with one city-state or a large empire without being off-race.

I wonder how do you manage to keep all these modifiers in mind without confusing the whole map. In my engineering studies, i used Mind Maps to make things clearer. Maybe we'll need to use this tool to overview a solution ?
 
IMHO, you are being too pessimistic. Closing the gap even a medium amount will have a big effect over a long game. However I don't want to use larger modifiers to hurt large civilizations too much, or help small civilizations too little. I'd rather there be multiple playstyles.


I also like multiple playtyles. But I can provide plenty of savegames where a 3 cities civ has an average population between 6 and 10 on industrial/modern era. Both with blitz and normal speed.

Other things we might consider is copying a feature from civ5: researching techs with other players. In Civilization 5 you can do a trade deal to have a temporary "tech research" alliance, where you pool tech research efforts and both mutually gain more research. Ideally this would only apply to civilizations "near" or ahead of you technologically, so the leading civilizations can not use this to boost themselves even farther.

That's something I really like. My only problem with all those new features we're talking about is that they could introduce more OOS in multiplayer games (mod was quite stable until some revisions ago, although I haven't tried recently - I'm waiting for Vokarya's next update) and possibly that we need to rebalance the game.
 
45°38'N-13°47'E;13306058 said:
...that they could introduce more OOS in multiplayer...
This is the voice of wisdom !
 
45°38'N-13°47'E;13306058 said:
That's something I really like. My only problem with all those new features we're talking about is that they could introduce more OOS in multiplayer games (mod was quite stable until some revisions ago, although I haven't tried recently - I'm waiting for Vokarya's next update) and possibly that we need to rebalance the game.

New trade deals will not introduce OOS issues, trade was written in such a way by Firaxis that it always remains in sync. Only entirely new mechanics have any such risk.
 
I agree with Afforess. Civ V is a good example as you can play with one city-state or a large empire without being off-race.

Yeah, Civ5 did get civilization size balance pretty right, so I think it's a good place to steal ideas from.

I wonder how do you manage to keep all these modifiers in mind without confusing the whole map. In my engineering studies, i used Mind Maps to make things clearer. Maybe we'll need to use this tool to overview a solution ?

Memory. It helps to have a vast long term memory and no life. :lol:

Yes, please. And I agree with most of the points given.

This of course requires some give and take for each play style. And not that one must suffer more than another just because it's how the more vocal players play.

But another set of factors must be weighed in to this. And it compounds some of the problems, and that is Map size and types used and number of starting Civs (and still options like REV and Barb Civ must be considered as both introduce even more civs into a running game where not using those 2 options the number is set at start up).

If, for example, a player want to use a Huge or Giant non earth type map with only 7-10 civs how does "city spam" not occur? All these empires will be larger than a Large map with 15-20 starting civs, or even a Huge or Giant map using a bigger set of starting Civs for that matter.

Over the last 7+ years I've found that Map size and type plus starting set (#) of Civs are as dominating a set of factors as any other in the game. They also give the game it's diversity in play and replayability. Much more so than what Civs, or Leaders are used in the game.

Just some things to think about.

JosEPh

Well regarding huge and gigantic maps, city spam is relative. 20 cities might be normal, but 60 a lot. I'm not so worried because we can simply scale for map size.

I do think your point about the number of starting civilizations is a good one. If you aren't using revolutions, then the starting number of civilizations are the max there will be. However, that does not mean all civilizations should spread to fill the entire map. If I run a game with only 3 civilizations and no revolutions on gigantic, trying to fill the map would be an absurd strategy.

Right now RAND is geared far too heavily towards conquest victories. I can't recall the last victory of another type (excepting Mastery) that I've seen happen.
 
Does anyone ever try for a Cultural, Scientific, or Religious Victory. I don't use Mastery but do set those 3 plus Conguest Or Domination. But none of my games have ended with either the AI or myself accomplishing a Cultural or Religious. I did have a Scientific way back around SVN 560+ but I was only on Noble difficulty level and was really just testing out things back then.

And I've not done a Space race since the RoM days when zappara was still working on the early 2.0 development stage. And that's been awhile.

JosEPh
 
Top Bottom