For modders & mergers

jdog5000

Revolutionary
Joined
Nov 25, 2003
Messages
2,601
Location
California
This thread is for questions and answers about the coding aspects of the Revolution mod and how to customize it or merge it with other mods. Some of these comments still hold for RevolutionDCM, but much has been changed by the new additions and the switch to the WOC Lite system for modular XML loading.

Source Code

The source code for RevolutionDCM, the latest and greatest version of Revolution, can be found on sourceforge. The source code for the last stand-alone version of Revolution is available here on CivFanatics.

General Modding Notes

This mod uses DrElmerGiggles custom event manager, many thanks to him for putting it together! It should be very easy to merge the Python portion with other mods that also use this convention.

This mod also uses Teg Navanis's enhancement of Stone-D's tool kit for saving mod data.

The Revolution effects for civics are now completely controlled by XML fields in CivicInfos.xml! This means this mod can now be merged with civics mods. See the XML FAQ and included CivicInfos.xml for a guide on how to set things up to work well. It also means that these XML changes are now required for the proper functioning of the mod.

SDK Parts

There are few gameplay changes in the Revolution SDK code, instead these changes mainly enable new features that were not possible otherwise. Included in these new features are the ability to create new civs in the middle of the game. The extensive Python parts of the mod make use of these new features and are really what drive Revolution.

Sources for the SDK code are included in the download as is an FAQ that contains (somewhat outdated but still useful) descriptions/answers to how to use the SDK sources for your own mod.

Compatibility With Other Mods

All components are designed to be as compatible with other mods as possible. It will work with any mod that simply adds new units/techs/civs/leaders, as it searches through the XML data for the best buildable units of a certain class or with a certain AI type and spawns new civs by searching for unused civs. However, it may not work properly if you have removed unit classes or removed some techs (like Horseback riding) or removed the minor or barbarian civs from the XML. For civics mods, you'll need to merge your changes with the Revolution fields in CivicInfos and associated Schema, see the include XML FAQ.

Multiplayer

Revolution does not work in multiplayer, but if you want to try to update it for multiplayer, please post. Not a trivial task.
 
I have absolutely no experience at modmaking and I tried to merge revolution with Visa version3 by putting the two assets folder together into a new mod named Visa_Revolution along with all the specific rule changing folders for both mods. This is too simple obviously as after loading this mod, i tried to load a game. At this point the game simply freezes. How would I go about merging revolution with a mod such as Visa or Amra, or at least with the Ethnically Diverse Units mod? (there was an amravolution modpack at one point but it isnt compatible with the warlords v2.08 patch). thanks for the great mod
 
The difficulty of merging two mods varies greatly based on exactly which ones you choose, but with Amra or the VISA mod for example, you would need to:

- Merge SDK changes to create a single DLL.
- Merge Python event handling code.
- Include both mods custom python files.
- Merge and include both mods XML files
- Include any new graphics

You might want to check out Grave's History in the Making modpack he just released, if nothing else he might be able to tell you about how merging went.
 
While i dont actully mod (i just fiddle with the XML files for changes i want to make) i seem to be haveing an issue with a change i made to the speed settings of one mode, i always keep some kind of backup so i can change it to normal if a fix is not possable, anyway on to the problem my custom speed setting makes it impossable to use units as a stablizing force i as a test dropped 93 units in one city and it had no effect at all the city just keeps getting more and more unstable so i was wondering if the garrison modifier is somehow tied to number of game turns? i set it up so that the number of game turns was 6050 set to increment 1turn=1year and reaserch costs were jacked way up while production of units and buildings was close to normal rate, if unfixable ill just have to make sure time victory is off and if i can find a way make sure that the year listing is hidden.
 
While i dont actully mod (i just fiddle with the XML files for changes i want to make) i seem to be haveing an issue with a change i made to the speed settings of one mode, i always keep some kind of backup so i can change it to normal if a fix is not possable, anyway on to the problem my custom speed setting makes it impossable to use units as a stablizing force i as a test dropped 93 units in one city and it had no effect at all the city just keeps getting more and more unstable so i was wondering if the garrison modifier is somehow tied to number of game turns? i set it up so that the number of game turns was 6050 set to increment 1turn=1year and reaserch costs were jacked way up while production of units and buildings was close to normal rate, if unfixable ill just have to make sure time victory is off and if i can find a way make sure that the year listing is hidden.

The stabilizing effect of units is limited, though 93 defenders gets you a -19 effect in a city with no walls or castle. However, if the city is unhappy that will only slow the demise of the city down as the unhappiness effect is stronger.

One thing to check, in the popup that tells you which components are running when you start or load a game, it also has a line saying how many turns it believes are in the game. Check if that number is correct, if not than you could see strange behavior.
 
the number of turns it was reading matched what i set it to also to note that the city i was useing as my test subject was just built and grew steadly worse over time even with that garrison force i was not getting above -1 and from what i can tell that was not comeing from the unit garrison.
4000BC kind of new city
 
Has anyone had sucess merging it with the edu mod? If so could you tell me what you did.
 
the number of turns it was reading matched what i set it to also to note that the city i was useing as my test subject was just built and grew steadly worse over time even with that garrison force i was not getting above -1 and from what i can tell that was not comeing from the unit garrison.
4000BC kind of new city

If you wouldn't mind linking the changed XML files, I'd like to have a look. There were issues with different game speeds causing ridiculous explosion of Revolutions before, but I've fixed those (or thought I had ...). Thanks.
 
at the moment i have disabled the speed changes opting for just super pricey resaerch as that allows me to do what i intended (a long game that will hold on each era long enough for world conquest if you really want it at a particular point) i just have to ignore the AD BC clock.

The only changes i made was useing the xml speed file to remove inflation and adjusting one of the speed catigorys (dont seem to matter witch one thay all end up messing up the mod) so that all are at zero except the 1 turn per year set to 6050.

<iYearIncrement>15</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>10</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>8</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>5</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>2</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>1</iYearIncrement>
<iTurnsPerIncrement>6050</iTurnsPerIncrement>

i left the other turn increment tables in because it has not hurt anything in past modifications, that line up is based on the marathon speed line up however i dont have the file i tinkered with that seems to be the only change i made that seem to have a negative impact on the garrison stability count.
from what i can tell when i dont fubar the mod with this speed change a despotism can hold stable a size 4 city useing only troops assumeing no other negative modifiers like religion or natonality or the many other items.
i also noticed with the speed change all net effect civics have a net gain of 0 except despotism that has a net of 1 im certain that isnt normal.

last moment correction the garrison stability aswell as the gov stability modifiyers are both effected by the speed change.

Mebey my number of turns streached the gov/units stability to thin and it defaulted on one or more instability modifiyers while not showing it. (just a wild stab in the dark)
 
Question: Is there a minimum time that it takes to form civs from barbarians? And is there some easy way to mod this? I can't find it anywhere (figured it would be in the .ini file). I set barbarian cities to appear earlier, but it still seemed to take a bit for civs to pop out.


Which brings me to my second question, not directly related to this mod but I'm hoping for some help. I set barbarian cities to start appearing in one turn from the beginning with a 100&#37; probability (which I'm assuming is supposed to mean that there is a 100% chance for one barbarian city to form on a fogged tile on the map each turn). The file I edited was the Civ4handicapinfo.xml file. But when I tested this a few times, no barbarian cities appeared early in the game... is there some hard limit that says barbarian cities can't appear within x # of turns from the start? (btw I know the xml file was working, since the extra scout I added to everyone appeared). Am I modding the wrong file or something?
 
Question: Is there a minimum time that it takes to form civs from barbarians? And is there some easy way to mod this? I can't find it anywhere (figured it would be in the .ini file). I set barbarian cities to appear earlier, but it still seemed to take a bit for civs to pop out.

There is no hard constraint, the odds of settling down depend on the population of close proximity barb cities, or any culture in barb cities. They won't settle until they're somewhat established. To increase the chances of settling so they settle earlier, increase:

; Change odds of barb settling down
Modifier = 1.00

It linearly scales the odds.


Which brings me to my second question, not directly related to this mod but I'm hoping for some help. I set barbarian cities to start appearing in one turn from the beginning with a 100% probability (which I'm assuming is supposed to mean that there is a 100% chance for one barbarian city to form on a fogged tile on the map each turn). The file I edited was the Civ4handicapinfo.xml file. But when I tested this a few times, no barbarian cities appeared early in the game... is there some hard limit that says barbarian cities can't appear within x # of turns from the start? (btw I know the xml file was working, since the extra scout I added to everyone appeared). Am I modding the wrong file or something?

There is a constraint that no barb cities can appear before players have a second city. Don't remember exactly how it works, but I did come across it at some point and note it. Maybe in the SDK, but I don't remember where.
 
There is no hard constraint, the odds of settling down depend on the population of close proximity barb cities, or any culture in barb cities. They won't settle until they're somewhat established. To increase the chances of settling so they settle earlier, increase:

; Change odds of barb settling down
Modifier = 1.00

It linearly scales the odds.

Yeah, that's one of the things I was changing... when you say linearly scales the odds, does that mean 2 would be twice the probability, and 4 would be 4X?


There is a constraint that no barb cities can appear before players have a second city. Don't remember exactly how it works, but I did come across it at some point and note it. Maybe in the SDK, but I don't remember where.

Ok, that makes a lot of sense, thanks for the info.
 
Yeah, that's one of the things I was changing... when you say linearly scales the odds, does that mean 2 would be twice the probability, and 4 would be 4X?

Correct. If you turn on logging you can see exactly what the odds are for different setups by opening PythonDbg.log. The lines you're looking for a spat out every turn the odds are > 0:

PY: BC - Barb odds: 4 pop, 0 cul 0

The odds from population are 4 in 1000 in this case, so this is probably a single city with a single population point. Culture odds are used much less frequently.
 
at the moment i have disabled the speed changes opting for just super pricey resaerch as that allows me to do what i intended (a long game that will hold on each era long enough for world conquest if you really want it at a particular point) i just have to ignore the AD BC clock.

The only changes i made was useing the xml speed file to remove inflation and adjusting one of the speed catigorys (dont seem to matter witch one thay all end up messing up the mod) so that all are at zero except the 1 turn per year set to 6050.

<iYearIncrement>15</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>10</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>8</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>5</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>2</iYearIncrement>
<iTurnsPerIncrement>0</iTurnsPerIncrement>
<iYearIncrement>1</iYearIncrement>
<iTurnsPerIncrement>6050</iTurnsPerIncrement>

i left the other turn increment tables in because it has not hurt anything in past modifications, that line up is based on the marathon speed line up however i dont have the file i tinkered with that seems to be the only change i made that seem to have a negative impact on the garrison stability count.
from what i can tell when i dont fubar the mod with this speed change a despotism can hold stable a size 4 city useing only troops assumeing no other negative modifiers like religion or natonality or the many other items.
i also noticed with the speed change all net effect civics have a net gain of 0 except despotism that has a net of 1 im certain that isnt normal.

last moment correction the garrison stability aswell as the gov stability modifiyers are both effected by the speed change.

Mebey my number of turns streached the gov/units stability to thin and it defaulted on one or more instability modifiyers while not showing it. (just a wild stab in the dark)

Basically, the game speed tuning logic isn't set up to handle 6050 turns. All per turn revolution effects in this case are basically divided by 10, and since it's rare to get to -20 per turn, the revolution reducing effects are essentially capped at -1 per turn if everything is going well. However, one time benefits or penalties like losing a city or rejecting rebel overtures are not currently scaled, so it'll take impossibly long to overcome the 300 rev index penalty for rejecting rebel demands, and they'll rebel again. So, once the rebellion cycle starts it won't stop.

The mod just isn't set up to run with that many turns. I may be able to improve this for the next version, we'll see. Perhaps scaling by construction percent instead of number of turns would make more sense, or capping the possible changes at double/half would make sense.
 
you posted a link to amravolution, however this mod won't work as it isnt compatible with warlords v2.08. Is there a simple way to make them compatible?
 
Any chance you'd be willing to make the amravolution for 2.08, since Amra has taken a vacation from here at least until BTS?
I've tried myself several times now, but with no success.
 
It definitely requires merging DLL code and recompiling, so no there is no simple way. I do not have any time to pursue creating a new version, but one thing you might want to check out is Grave's History in the making mod. If you don't like all the features, it should be simpler to turn them off than recompile for Amra.
 
It definitely requires merging DLL code and recompiling, so no there is no simple way. I do not have any time to pursue creating a new version, but one thing you might want to check out is Grave's History in the making mod. If you don't like all the features, it should be simpler to turn them off than recompile for Amra.

K, thanks. I'll look into giving that a try.
 
Top Bottom