Revolution: with BarbarianCiv, Rebellion, AIAutoPlay

I just love this mod, but I couldn't merge it with mine! Could you point out the exact changes please so we could all enjoy fusing it into our composite mods? :)
 
Fachy said:
I just love this mod, but I couldn't merge it with mine! Could you point out the exact changes please so we could all enjoy fusing it into our composite mods? :)
I've been intending to write a merger guide ... kind of a trade off, do something new or write some documentation :p What kind of a mod do you have? An XML only mod should be almost trivial. A Python mod is easily doable, with the one catch being if you're using script data for cities like this mod is. If you've got your own SDK mod, you'd have to merge the source files and sort out functions we both might have changed.

One note: The file CvModName has only one line, which must be the name of the folder in which the mod is (so Revolution for this mod) ... that would be one less than obvious trick. With that, the game can find the .ini file and initialize everything properly.

There are some notes on merging in the other two threads in my sig, you could start there (the Rebellion with SDK is nearly the same). That would cover everything in most cases ... I'll try and put one together for this mod soon.

Glad you like it :)
 
I'm good with xml, barely started teaching myself pyhton today (using common sense.. that line here + that line there :p)

My mod, which I've been building for like 6 hours now is composed of:
Fachy's Realistic Religious (updated)
Pirates
Enhanced Culture Conquest
Enhanced Tech Conquest
Techcost
Unit JReligion
Immigration
Mercenaries

So as you can see, pretty much all your files would need to be mergable :p

Btw I just want the Barbarian (which I tried to merge alone, failed also!) + Revolution. I don't need the rebillion yet as it's still under development.. nor do I want the AI turns and all, if that would help simply things?
 
I barely see rebellions in civs on Noble. I've only had one happen and I paid off the rebels. Could you make internal rebellions more common for the player and AI's? Also, is the revolution part of the mod coming along. I think that that aspect will really make this mod complete.
 
Relating your reply:
Yeah, a violent and not revolution are certainly something I'm thinking about. My thoughts were, if the situation is not too bad (either is bad, but improving, or bad but city is still happy), that the city and whoever else wants to revolt with it would ask for partial independence (Vassal state when that becomes a possibility). If you let them go, they would become your Vassal state and you'd avoid war ... but maybe other colonies would be more likely to ask. If you don't, the cities would have a large boost to their revolution index and would probably be inclined to fight you in short order.
I surely like the feature of a part of your civilization asking for independence before doing so. And refusing should increase the possibility of the revolution becoming violent.
If it is violent or not - if you will be at war with the new civilization after the revolution - could be determined by creating another index:

The [RevolutionType Index] starts at 500.
Violent Revolution > 500 > Peaceful Revolution.
Index cannot increase beyond 750 nor can it decrease beyond 250.
If Police State increase the [RevolutionType Index] by 4 each turn.
If Hereditary Rule increase the [RevolutionType Index] by 3 each turn.
If Civilization is unhappy increase the [RevolutionType Index] by 5 each turn.
If Civilization is at war increase the [RevolutionType Index] by 4 each turn.

If Free Speech decrease the [RevolutionType Index] by 3 each turn.
If Universal Suffrage decrease the [RevolutionType Index] by 4 each turn.
If Civilization is happy decrease the [RevolutionType Index] by 5 each turn.
If Civilization is at peace decrease the [RevolutionType Index] by 2 each turn.

When a city reaches 900 in [Revolution Index] (not RevolutionType) a popup will appear where the area will ask for independence. If refused add 300 to [RevolutionType Index].

When a city reaches 1000 in [Revolution Index] decrease the [RevolutionType Index] by 175.

Hmmm ... I agree that cities never owned should get a pretty high revolution value, less for cities previously owned, and even less when the city has significant nationality from the conquerer. But I was thinking the city wouldn't immeadiately forget their previous woes, if you had suffered under the previous ruler, you wouldn't put up with as much from the new owner. It does make things more complicated though ... perhaps keeping 1/4 of the previous value, with a cap on the total possible revolution index of a captured city of say 750?
Yeah that seems like a good suggestion. Most cities that have been conquered would be unstable to some extent. They might - however - feel saved by the new conquering civilization and thus more stable, but it would be more complex to add this, and at the moment i do not consider this to be an important feature. Do you?

A significant garrison in the city should certainly reduce the chances of a revolution ... but I wonder whether that should be manifested in the index or in subsequent computation of odds? While tanks rolling by my window every day would keep me from taking up arms, it wouldn't make me happy to live there ... and it would be hard to get the AI to use this fact. But having too many modifiers on the odss of a revolution will make it intractable ...
Yeah. One must also stay in the spirit of Sid Meier's Civilization and keep things simple. I do not think this feature is important. Low priority?

Questions:
What formulas do you/would you use when a new civilization is formed due to revolution? My suggestion is the synergy effect, though you may have a better method?

How would you calculate the risk of the revolution? I think the index is plenty.

How are things progressing? Will we soon have a simplified version of the revolution feature?

Have you considered - at a later point of time - adding a more realistic economics model so that a civilization's economy could burst and thus leading to depression?
 
I also noticed that rebellions don't seem to really occur after the Medieval Times. Could you possible up the chance for rebellions to occur?
 
Great mod. I have a couple of issues though:
1. The rebellion and barbarian civ messages only show up briefly and when I go back to look at them again in the message log, they are not there. It would be nice if these messages were logged too.
2. I think some messages are not displaying at all. A few times every game I will get a message that says "The Spanish civilization has been destroyed" or some other civ, when that civ never existed and no message ever appeared to tell me that that the Spanish were formed in a rebellion against someone.

**edit**
3. I noticed two other bugs. When I use the CTRL-SHFT-P command to change a player, everything changes successfully except for the unit flags remain the same as the old civ. **edited again** Sorry, I just noticed this is a known issue.
4. When I use CTRL-SHFT-H to switch the human player to a civ that formed recently from a barbarian city, some of my new civ's cities appear as city ruins instead of cities! Then when I switch the human off of that civ, they return to normal.

Also, I haven't noticed or really figured out what the "Viking style" civ is. Are civs that form from barbs on islands supposed to spawn galleys or something? I haven't noticed it if that is what is supposed to happen.

I'm excited for the vassal states and colony rebellions that will be upcoming!
 
I was playing a game on Noble-large map-archipelago with only 7 starting civs. There are many uninhabited islands so I figured that barbarians would appear and settle into civs. Well this didn't happen at all. I didn't even find a barbarian city. All I saw was one barb galley. This is so wierd. I would have expected nations to form. In other games I have played it has worked ,though. Could having played a custom game affected the barbs and them settling?
 
No I don't think custom game has anything to do with it. I play custom games all the time and have had great success with barb cities. Here is some info on barb cities:

For one thing, I think barb cities will not form on small islands. There have to be a minimum number of squares before they will form (maybe 10-15+ tiles). Also, you are only playing on Noble and the chances of barb cities forming is small. I adjusted the HandicapInfos.xml file to have a very high chance of cities forming on any difficulty level. I also increased the probability of barb cities changing into full-blown civs (this is in the revolution.ini file). Finally checking Raging Barbarians further increases the chance of cities forming.
 
Justinian519 said:
I was playing a game on Noble-large map-archipelago with only 7 starting civs. There are many uninhabited islands so I figured that barbarians would appear and settle into civs. Well this didn't happen at all. I didn't even find a barbarian city. All I saw was one barb galley. This is so wierd. I would have expected nations to form. In other games I have played it has worked ,though. Could having played a custom game affected the barbs and them settling?
I've tested with archipelago and island maps and seen them form ... unless you turned off barbs all together, the custom settings shouldn't have affected anything. Strange that you didn't see anything, but suspendinlight may be right about the island size things. But, there's not much my mod can do when there are no barb cities to work with :crazyeye:
 
Justinian519 said:
I barely see rebellions in civs on Noble. I've only had one happen and I paid off the rebels. Could you make internal rebellions more common for the player and AI's? Also, is the revolution part of the mod coming along. I think that that aspect will really make this mod complete.
In my testing, I've found the AI's get hit with a good number of rebellions ... whether you do or not depends on how well you're running your empire! If your cities are never unhappy, they will never rebel! There are several config options in the ini file you might consider adjusting to change your experience. There's a float that adjusts rebellion frequency, up that to increase the odds a city rebels when it's thinking about it. You might also try turning on "happy rebellions", ie rebellions without the city first being unhappy ... there are others, check it out.

The Revolution component is coming along quite well ... it's been completely reworked per the ongoing discussion here, and currently stands at around 1500 new lines of Python!!! Still much more to do before its working, but at this point cities are deciding to revolt, what style of revolt (join their cultural homeland, break away for religious reasons, demand civics changes, etc), and other cities are joining them ... but actually spawning the revolutionary units and handling all the different popups is yet to be done. It's going to take a while yet, but maybe in a couple weeks it will be playable. I'm really excited about how it's coming together :cool:

Justinian519 said:
I also noticed that rebellions don't seem to really occur after the Medieval Times. Could you possible up the chance for rebellions to occur?
Do you mean in your empire or for the AI as well? This can certainly happen, as sometimes the game falls into what I call 'Shiny happy people ...', where no one hates anyone and no one is at war. Without a little strife, there's no reason for cities to become unhappy ... I often play with Agressive AI to keep this to a minimum, but again turning on happy rebellions is another option. Or pick some fights I suppose. When there are wars going on, the 1700-1900's seem the most rife with rebellion in my testing, as empires get bigger and distant cities start to approach the happiness limit ... The revolution component will address this as well, as happy or certainly not-unhappy cities will revolt if other things are bad enough.
 
suspendinlight said:
Great mod. I have a couple of issues though:
1. The rebellion and barbarian civ messages only show up briefly and when I go back to look at them again in the message log, they are not there. It would be nice if these messages were logged too.
Thanks :) I will work on getting them logged as well, good suggestion.

suspendinlight said:
2. I think some messages are not displaying at all. A few times every game I will get a message that says "The Spanish civilization has been destroyed" or some other civ, when that civ never existed and no message ever appeared to tell me that that the Spanish were formed in a rebellion against someone.
The messages only display if you can contact the civ whose city is rebelling ... however, the civ destroyed message shows up all the time. I've thought of trying to intercept this, and either have it say "The Spanish rebels ..." or not show if you can't talk to them, but hadn't really decided on anything yet.

suspendinlight said:
4. When I use CTRL-SHFT-H to switch the human player to a civ that formed recently from a barbarian city, some of my new civ's cities appear as city ruins instead of cities! Then when I switch the human off of that civ, they return to normal.
Yeah, this has happened to me a few times as well, don't have any clue why ... I'd forgotten about it though, so I'll add it to the investigate list.

suspendinlight said:
Also, I haven't noticed or really figured out what the "Viking style" civ is. Are civs that form from barbs on islands supposed to spawn galleys or something? I haven't noticed it if that is what is supposed to happen.

I'm excited for the vassal states and colony rebellions that will be upcoming!
The Viking style settling is somewhat rare ... you are correct that they will get a few galleys and go out hunting for another civ. However, several factors have to combine for this to work.
Spoiler :

First, the barb civ has to settle militarily, the odds of which are decreased when they're alone as builder types will be more competitive in the long run. So the odds are 35-60 percent depending on the leader that they'll even have a chance of getting boats.

If they do, on a lot of maps, there are no other civs that are easily accessible by galley. So a lot of factors have to turn out right for this kind of barb settling to occur. If you want to see it for sure, play an archipelago map.

It would be possible to sometimes give regular militaristic barbs some boats with the proper AI setting so they'll invade you by sea also ... I'll consider doing this. Not sure what good conditions for making that decision are. Hmm

Anyway, thanks for the feedback! Keep it coming :)
 
Thanks for ignoring my inquiry jdog :mad:
 
For all of you who may be trying to merge this mod with others:

How to merge

This mod pack uses DrElmerGiggles custom event manager and config parser components, many thanks to him for putting them together! I highly recommend you adopt this convention for your mod, it makes merging event driven components much easier. If you are using these conventions, the only needed changes are:

SDK changes:

If your mod doesn't require any other SDK changes, just copy over the dll from Revolution to (your Mod)\Assets\ folder. If you do need additional SDK changes, my source code is either in the Revolution download or on the front page of the forum thread. See the SDK FAQ in the Revolution folder.

Python changes:

Move all of the .py files to your mod's Assets\Python folder. You can put .py files in subfolders without any difficulties.

Copy the Revolution settings from Revolution.ini to "(Your ini file name).ini"

Make sure CvConfigParser can find your mod folder, probably by changing the contents of CvModName.py to your mod's name.

In CvCustomEventManager.py, add import ____ for all of the Revolution python files to the top of the file. So:
import BarbarianCiv
import Rebellion
etc ...

Then, in __init__, add:
config = CvConfigParser.CvConfigParser("(Your ini file name).ini")

And then for each component you want to be able to use:
if( config.getboolean("BarbarianCiv", "Enable", True) ) :
BarbarianCiv.BarbarianCiv(self, config)

For documentation on the syntax for config files, check out DrElmerGiggles forum thread or the CvConfigParser file.

Done! All revolution components will register their own event and popup handlers and you're on your way. If you're not using this convention, then you need to figure out how to register the events and popup handlers covered in each components __init__ file and make sure it can find the config settings.

Potential Conflicts

There should be no problems using XML mods that add leader, civs, units, techs, etc to the game ... these mod components will make use of new civs, leaders, techs and units without you needing to do any additional coding. New civics will not cause problems, but will not be given any special handling in Revolutions. Mods that remove or rename some techs, civics, or traits could be an issue.

Make sure your other mod components add additional handlers for the various events, instead of replacing the handlers for certain events (easy to do with DEG's convention) ... otherwise the Revolution components will never get activated.

The Rebellion and Revolution components both use script data for cities, which allow them to store important state information when the game is saved. If you're using other mod components that make use of this feature, you'll need to adjust how the components initialize the script data and which script data list element they're reading from. I've tried to make it easy to update how those functions use script data with stored indices and access functions, but you'll probably have to do a little debugging.
 
Fachy said:
I'm good with xml, barely started teaching myself pyhton today (using common sense.. that line here + that line there :p)

My mod, which I've been building for like 6 hours now is composed of:
Fachy's Realistic Religious (updated)
Pirates
Enhanced Culture Conquest
Enhanced Tech Conquest
Techcost
Unit JReligion
Immigration
Mercenaries

So as you can see, pretty much all your files would need to be mergable :p

Btw I just want the Barbarian (which I tried to merge alone, failed also!) + Revolution. I don't need the rebillion yet as it's still under development.. nor do I want the AI turns and all, if that would help simply things?
If the tech cost you're refering to is the mod I put out a while ago, it will be more difficult to merge with this mod pack as it requires seperate SDK changes ... doesn't sound like you're getting in that deep, so you might consider dropping that one to make things easier.

Many of the other components you mention use DrEG event manager convention, which should make your life a lot easier! They may have slightly different ways of using it (I have my functions register their events in the __init__, others do it differently), but the changes to CvCustomEventManager should be in the same place and very similar.

Getting AIAutoPlay to work as well shouldn't add any more complexity than a few more lines in the event manager ... but even if you don't need a particular function, you should bring over the python files as there is a little cross referencing between, well Rebellion and ChangePlayer specifically (this is what allows you to optionally take control of rebels in game).

Let me know how things go ... if you run into any specific problems I'm happy to help. Information about what's crashing when is good. You will probably want to turn off HidePythonExceptions and turn on LoggingEnabled (I'd also turn on OverwriteLogs and MessageLog) in CivilizationIV.ini if you haven't already ... with this, you'll get popups when some piece of Python crashes and also a PythonDbg.log and PythonErr.log in My Games\Sid's Civ4\Logs which are very helpful. Good luck!

Fachy said:
Thanks for ignoring my inquiry jdog
Sorry, ran out of time last night ... I'm traveling around a bit and can only fit this in at odd hours.
 
Thanks jDog.. trying to work on it to incorporate it in my mod which I'm already having alot of troubles with!

Btw, is there an option which prevents any city from breaking when the capital is taken, if that city has, say, 50%+ nationals? For example if I'm China, no city with 50%+ Chinese population would break away if my capital is taken

I'm not sure if that has to do with the option "Percent of cities nationality" as I don't understand that option itself!
 
I just got the following error while playing a game. I don't think I did anything unusual.

In fact, it seems to be happening every turn now.

**edit** It went away after maybe 15 turns or so.
 

Attachments

  • error.JPG
    error.JPG
    185.7 KB · Views: 150
When I tried to play this mod, it crashed the game. Any suggestions? It looks really interesting, but I didn't even get a chance to see it. :(
 
Top Bottom