revolutions / dynamic history / realism mod

Thanks, that's enough to get me going. I don't know why I can't find your code at sourceforge. When I press "View All Files", I see exactly nothing. Clearly I don't know what I'm doing.
 
Keep up the good work Afforess! I was just lookin at your submission from yesterday. Lookin like you're working hard on this.
 
You can save data to 3 objects in the game, Players, Units, and Plots. I have tested two of these, and Players and Plots work fine. The function is the same for all of them. Use Players[iPlayerID]:GetScriptData() to retrieve the string, and layers[iPlayerID]:SetScriptData() to save it. The large part of my code is for serializing tables into savable strings and back.

The SVN is public, FYI.
I might have to have a peek at your code and then try to figure a way to make it more modular/portable (assuming it isn't) so two mods can each save stuff without it causing a clash (potentially). Shouldn't be that hard from what you already have. I'd then put it out as a modcomp and encourage others to use it if they want to save anything. Does this make sense to folks?
 
I'd then put it out as a modcomp and encourage others to use it if they want to save anything. Does this make sense to folks?
great idea

Thanks, that's enough to get me going. I don't know why I can't find your code at sourceforge. When I press "View All Files", I see exactly nothing. Clearly I don't know what I'm doing.
click not "files" but "code->svn browse", then go to "revolutions" folder
 
Ideas are a dime dozen. Most serious modders don't need a lot of idea suggestions, just feedback and balancing suggestions.

Anyway... here goes ;)

I think revolutions and unit allegiance are tightly coupled. If a city is near revolution, how reliable would any troops produced there be?

From history I offer up the Romans. After a number of revolts where the local "Roman" soldiers joined the rebellion (eg Batavian revolt, Illyrian revolt, etc...), they finally adopted the policy of stationing troops far away from where they were raised. Troops raised in Brittania would be stationed in Syria!

Another example is Nazi conscripts from the East stationed on the West Wall. Only some Cossacks joined the Nazi cause and fought on the Eastern Front. Any other troops raised there were sent to garrison on the Western Front.

The code I imagine is pretty simple. When a unit is created attach script data with where and the turn number. When a revolution happens check units in some radius of the city for a match, and compare turn - turn created vs some threshold. Perhaps set some damage from the mutiny.. and call it good!
 
Interesting idea. I always wanted to do a troop loyalty factor.

At any rate, I've been thinking about the revolution mechanic a bit, and would love feedback on these ideas:

In Civ4, Revolution stability was represented by a rather arbitrary revolution index. 3000 was extremely unstable, 0 totally stable. Instead, why not use a percent stability. So a city would list 85.67% stable, or some such number.

Also closely linked to stability would be the concept of Loyalty. Cities loyalty would stem from nationality and culture. Loyal cities would quell rebellions without outside interference, (read: without military involvement), while disloyal cities would churn out rebels as fast as possible. Basically, a cities stability can fluctuate quickly. Happiness situations can fluctuate wildly in the space of a turn, and starvation can quickly switch to immense growth. So stability would represent the fast changing aspects. Loyalty would be slower to change. Cities founded by the player would start at 100.00% loyalty (and the capital would always remain 100% loyal to the founder). This would change if the stability of the city was poor for extended period of time.

But I fear the loyalty-stability system might be too redundant, and it might be worth simplifying into one modifier. Not sure what to call it yet.
 
I think I'm going to stick with just a stability percent, for simplicity. I had to create Puppet City Visibility so that players would be able to see into puppets to know how they were doing, stability-wise. Here's a screenshot. Basically the framework is all there, but there is no insides.
Spoiler :

Stability.jpg
 
I think I'm going to stick with just a stability percent, for simplicity. I had to create Puppet City Visibility so that players would be able to see into puppets to know how they were doing, stability-wise. Here's a screenshot. Basically the framework is all there, but there is no insides.
Spoiler :

Stability.jpg

:goodjob:
 
Yes, the dll would be most needed to do extensive mechanics modding :)

Just out of curiosity, but what can we accomplish with the .dll we're being given to play with? I have a basic understanding of C++ (polymorphism, i/o streams, exceptions, etc.) but I've never done any serious modding before*. I'm curious as to what exactly I can accomplish with the SDK when it releases.

* unless you count the Mount&Blade's pseudoscript as serious modding.
 
now i'm about to start coding for revolutions mod (have to finish emigration v2 at first).
here is my plan:

stability:
* there is a state stability SS and a city stability CS.

state stability factors:
good:
* culture: +f((total accumulated culture))
* enemy unit killed: +f(N/(player's army size)) per killed unit - this should not be a big factor for not to favor warmongering
* happiness: +f(H) per turn
* peace agreement: +N stability
* rebellion suppressed:+N stablility
* being at peace: +N per turn
* proficit: +f(N) per turn
* size of treasury: +f(log(Gold)) per turn
bad:
* casualities: +f(N/(player's army size))
* unhappiness: same as happiness
* war declaration (+) no penalty with autocracy (or honor?)
* deficit: -f(N, numCities) per turn
* rebellion: -N
* being at war: -N per turn
* running rebellion: -N per turn

+number of cities has to affect most of "per turn" formulas (except war and peace states)

city stability factors:
good:
* culture
* specialists
* some buildings
* bribing
* propaganda (also decreases foreign culture in a city)
bad:
* immigration (+) no penalty with freedom
* emigration
* starvation
* enemy in city radius
* foreign culture
* distance to capital

(+) also random events may be added to affect stabilities.

city loyality is a value that determines city behavior, it depends on city and state stability.

CLL (city loyality level) = CS * SS + f(cityCulture/cityForeignCulture).
good/bad effects come into after certain CLL is hit and may increase (probability and scale) with CLL further changing.

consequences of disloyality:
permanent:
* corruption: decreased productivity/gold. corruption modifier.
probabilistic:
* unrest: crippling garrison/city defences, destroying buildings, kill population
* resistance: crippling player's units in city radius (-1 hp per turn)
* uprising: spawn rebels/capture cities (if there are no garrison)

high loyality bonuses:
* patriotism: citizens help defend cities by providing levy units (from earlier era, or from same era if armory/arsenal is built).
* partisans: enemy units in city radius are being crippled.
* optimism: increased population growth rate
* enthusiasm: increased productivity

negative effects probability lowering factors:
* garrisoned military units
* spies (+)

what rebels can do:
* rebel state - one or more cities conquered by rebels. other civs may intervence but can only liberate those cities to a former owner.
* after some time rebel state can turn into a new civilization (or several new civs).
 
now i'm about to start coding for revolutions mod (have to finish emigration v2 at first).
here is my plan:

stability:
* there is a state stability SS and a city stability CS.

state stability factors:
good:
* culture: +f((total accumulated culture))
* enemy unit killed: +f(N/(player's army size)) per killed unit - this should not be a big factor for not to favor warmongering
* happiness: +f(H) per turn
* peace agreement: +N stability
* rebellion suppressed:+N stablility
* being at peace: +N per turn
* proficit: +f(N) per turn
* size of treasury: +f(log(Gold)) per turn
bad:
* casualities: +f(N/(player's army size))
* unhappiness: same as happiness
* war declaration (+) no penalty with autocracy (or honor?)
* deficit: -f(N, numCities) per turn
* rebellion: -N
* being at war: -N per turn
* running rebellion: -N per turn

Adding a National Stability shouldn't be very hard. I'm curious how you plan on implementing the code for when enemy units killed - is there a callback we can use?

Also, I'm not sure having a negative effect when a rebellion is occuring is such a great idea. That's a negative feedback loop which will only make it harder for players to recover. While rebellions probably do encourage other rebellions, it's not going to be a popular mechanic.

And notably, you forgot golden ages.


+number of cities has to affect most of "per turn" formulas (except war and peace states)

What I have done so far is split factors into two classes. One class directly affects the stability, say 1 per turn. The other modifies the effect. E.g, puppet cities have 50% more instability from all factors. City size and number of cities should be a modifier, not a direct effect.

city stability factors:
good:
* culture
* specialists
* some buildings
* bribing
* propaganda (also decreases foreign culture in a city)
bad:
* immigration (+) no penalty with freedom
* emigration
* starvation
* enemy in city radius
* foreign culture
* distance to capital

(+) also random events may be added to affect stabilities.

You might want to take the time to merge in the Emmigration mod then. I assume we'll be using it. I've already merged in Puppet City Visibility so players will be able to see the factors inside of puppet cities.

city loyality is a value that determines city behavior, it depends on city and state stability.

CLL (city loyality level) = CS * SS + f(cityCulture/cityForeignCulture).
good/bad effects come into after certain CLL is hit and may increase (probability and scale) with CLL further changing.

consequences of disloyality:
permanent:
* corruption: decreased productivity/gold. corruption modifier.
probabilistic:
* unrest: crippling garrison/city defences, destroying buildings, kill population
* resistance: crippling player's units in city radius (-1 hp per turn)
* uprising: spawn rebels/capture cities (if there are no garrison)

high loyality bonuses:
* patriotism: citizens help defend cities by providing levy units (from earlier era, or from same era if armory/arsenal is built).
* partisans: enemy units in city radius are being crippled.
* optimism: increased population growth rate
* enthusiasm: increased productivity

negative effects probability lowering factors:
* garrisoned military units
* spies (+)

what rebels can do:
* rebel state - one or more cities conquered by rebels. other civs may intervence but can only liberate those cities to a former owner.
* after some time rebel state can turn into a new civilization (or several new civs).

Okay, but we are still a long way off from any of these getting added. Some of these will definitely need DLL access.
 
Yeah its just a plan i havent devised yet what certain parts can be introduced with Lua and what can not.

for unit killing we can use SerialEventUnitSetDamage i believe.

the idea behind rebellions provoking rebellions is to make things more dynamic. maybe its not good, we'll see.
 
Great work guys! I know there are dozens of thousands of people waiting for this type of mod to come along. Already, dynamic world concepts like tech diffusion and emmigration are making the game more interesting to play. Keep it up!!
You two are on the very cutting edge of what can be done currently with the tools given. Very impressive.
 
Killmeplease,

I'm thinking we should abandon the arbitrary indexes from Civ4's RevMod, and use a percentage stability and percentage loyalty instead. It's harder to explain a arbitrary number, and why 3000 "is bad" to new players. It's easier to understand, "my city is 45.57% stable", which is bad.
 
Killmeplease,

I'm thinking we should abandon the arbitrary indexes from Civ4's RevMod, and use a percentage stability and percentage loyalty instead. It's harder to explain a arbitrary number, and why 3000 "is bad" to new players. It's easier to understand, "my city is 45.57% stable", which is bad.
i agree, percents will be much better
 
Is ther a way to fix the nationality of the "rebels" ?
Cause in (Civ4) it was very disapointing to have the American "rebels" spliting off my Russian Civ...
And other things like this.

I agree for the percent.


Could we push up a revolution inside our neighbors borders and the Ai could do the same to another Ai, or a human player ?

revolution will be more dynamic, not only the consequence of a good or bad gestion of City or Empire, but the consequence of our neighbors politics, and our on them.

Provocate a Revolution, or to be hunder a provocated revolution ?
 
Better yet, make nationality based on the city and whether or not the city is in the "New World". That way you can get English where both factions speak the same language.
 
Hi everyone. Just wanted to say good luck with this mod. It must take up a load of your time doing this stuff for the Civ community. Been waiting for a revolution mod since Civ V came out! Appreciate it!
 
Back
Top Bottom