Dark Ages mod

Don't know how the points will be (need testing for that), but the concept sounds amazing. Something is definitely needed to affect the large empires, once you're the biggest it's pretty hard to lose... you can use your size to out-tech everyone, and the longer you tech the more ahead you get. Eventually you're using dreadnought units against modern infantry :eek:

Yep, the more you build, the harder you fall :D

We might take these into account too:

1) factor into B2-points the weight of wonders, projects, buildings and so on
2) the same way golden age is computed in "good" , decreasing revolution levels in city, dark age should be "bad" and increase them
3) a proper mechanism of consuming dark age A-points and also changing iDarkAgePointsAttrition should be set in place. At the start of the game it could be ~0.5 (based on difficulty) and each dark age that occured shrinks this value. Based on dark age points and attrition we can make a way of computing duration of dark age.
4) triggering a golden age during a dark age should cut 8, 12 or whatever no. turns you'd be getting from the duration of your dark age. If there are less then that remaining, a golden age may start with the difference of these 2 values. This is a quick way for a player to deny dark age if enough great people.
5) dark ages durations can be accumulated if another one is triggered before the first ending.
6) for each tile producing at least 2 hammers, decrease one, same for commerce for duration of dark age
 
Well, us IT consultants (including myself :mischief:) usually go for Altova XMLSpy, but this is simple enough for any text editor with highlighting. The visual studio IDE is just as good.
@dexy: if you could set a default value for the iDarkAgePointsObsolete (like 0 which should be no effect?) and attach the XML here, I can change them accordingly.

Much simpler with XMLSpy than with a text editor. I'll attach the XSL file I'm using, it's very easy to understand it (you'll think "I can't believe this is so easy now" :cool:).

I assume we are doing this for the defines in \Rise of Mankind\Assets\XML\Buildings\CIV4BuildingInfos.xml from the latest patch from Afforess?

Yes, of course.

There should also be negative values allowed, as there are buildings and wonders which counter dark age effects (like Magellan's Voyage?)

Hmm...no. Those points (iDarkAgePointsObsolete) are added to dark age points when a building becomes obsolete. No building should be good to an empire when it goes obsolete.

I was thinking about values around 30-50 for buildings and 100-300 for wonders (note that this will be divided by the number of cities). Zero or very low values also make no sense to me.
 
So, here are 3 XSL files that I used to modify XML.

For BuildingInfo, there's some logic inside, maybe you don't need it. But check out files for CivicInfo - this is how it is done elegantly :cool:.

BuildingInfo_add_iDarkAgePointsObsolete.xsl

Adds tag iDarkAgePointsObsolete at the end of each BuildingInfo.
Sets it to values 300, 200, 100, 40 for world wonders, team wonders, national wonders and normal buildings respectively.
For buildings that provide a free building in every city (FreeBuilding != 'NONE') sets it to 0, since all those free buildings will be lost and create their points.

CivicInfo_add_iContemporaryFactor.xsl

This is the simplest it gets. Just add new tag (with comments) with a default value of 0.

CivicInfo_set_iContemporaryFactor.xsl

Here's the beauty of all of it. Simple setting for each civic option. You can see them next to each other and compare easily. Much better than going through XML and finding which tag belongs to which civic, right?
 

Attachments

So, here are 3 XSL files that I used to modify XML.

For BuildingInfo, there's some logic inside, maybe you don't need it. But check out files for CivicInfo - this is how it is done elegantly :cool:.

Here's the beauty of all of it. Simple setting for each civic option. You can see them next to each other and compare easily. Much better than going through XML and finding which tag belongs to which civic, right?

Right, I tried out some of your XSL transforms in XMLSpy and I got your general idea in doing this.
I'll see what I can do today... if the Altova XSL output is correct, that should be enough proof for the correctness of the XSL file, yes?
 
if the Altova XSL output is correct, that should be enough proof for the correctness of the XSL file, yes?

Define "the correctness of the XSL file".

If the XSL is not valid according to the schema you won't be able to run it anyway, no output will be produced at all.

Anyway, the final XML output is all that the game needs, so it doesn't matter whether you make it with XSL or type it in M$ Word letter by letter.
 
Define "the correctness of the XSL file".

If the XSL is not valid according to the schema you won't be able to run it anyway, no output will be produced at all.

Okay, here are the XSLs so far, for now just great wonders. Please try and see how they fit in :goodjob:

Edit: both Obsolete and Weight are in there, using just Obsolete for now in B-points would be fine but we'd be missing situations in which building something alleviates a dark age situation and when it expires creates a new worse situation. Also valid for stuff that doesn't go obsolete at all, like Modern/Transhuman
 

Attachments

"set" file, line 183, you wanted match="iDarkAgePointsWeight"

But anyhow, what is this tag supposed to mean?

The contribution to your B-points of something when it's built, positive if it's decadent and negative if it alleviates effects of dark age. The player should have a way of getting out of dark ages by careful planning of wonders for example. With all the stuff getting obsolete in renaissance, one might end up with no "renaissance" at all :lol:

Is there any better way of representing this? This would need to be tested first without taking into consideration the weight, to see the extent of dark ages in gameplay.
 
The contribution to your B-points of something when it's built, positive if it's decadent and negative if it alleviates effects of dark age. The player should have a way of getting out of dark ages by careful planning of wonders for example. With all the stuff getting obsolete in renaissance, one might end up with no "renaissance" at all :lol:

Is there any better way of representing this? This would need to be tested first without taking into consideration the weight, to see the extent of dark ages in gameplay.

OK, I get it now, it makes sense. But I need to code the dll to use this tag appropriately, it will not work on its own :). Will do it tomorrow, no prob.

On the other hand, I think the iDarkAgePointsObsolete is too weak in your last suggestion. Buildings don't go obsolete every turn, only once in their lifetime. I'd put a minimum of 40 for each building. And increase it more if the building is more valuable while not obsolete.

These are probability (in %) of a dark age happening. And those are divided by number of cities. So if you have 2 barracks in 5 cities (realistic enough), with iDarkAgePointsObsolete = 40, you'll get only 2 x 40 / 5 = 16% chance of getting a dark age with that. Next turn you get 8%, next 4%, etc. (due to B-points disappearing).
 
On the other hand, I think the iDarkAgePointsObsolete is too weak in your last suggestion. Buildings don't go obsolete every turn, only once in their lifetime. I'd put a minimum of 40 for each building. And increase it more if the building is more valuable while not obsolete.

Well then, add a multiplier based on age and maybe game difficulty for iDarkAgePointsObsolete, something like 3 for medieval, 1 for renaissance, 0 for transhuman? Proportionality between great wonders is the important aspect here.
 
These are probability (in %) of a dark age happening. And those are divided by number of cities. So if you have 2 barracks in 5 cities (realistic enough), with iDarkAgePointsObsolete = 40, you'll get only 2 x 40 / 5 = 16% chance of getting a dark age with that. Next turn you get 8%, next 4%, etc. (due to B-points disappearing).

This is a good algoritm for chance. How about using the weight to determine dark age duration? Each turn in dark age would consume from the accumulation of weight. Maybe a good reference would be minimum of 8 turns, like for golden age.

I will try to complete the XSLs today at work ;)
 
Well then, add a multiplier based on age and maybe game difficulty for iDarkAgePointsObsolete, something like 3 for medieval, 1 for renaissance, 0 for transhuman?

This just makes it complicated, without any benefit. Each building will go obsolete in exactly predefined era, where the appropriate tech is. So those multipliers can be calculated in the iDarkAgePointsObsolete from the start.

Difficulty should not matter; whatever we make will be applied to the AI the same way as for humans.

This is a good algoritm for chance. How about using the weight to determine dark age duration? Each turn in dark age would consume from the accumulation of weight. Maybe a good reference would be minimum of 8 turns, like for golden age.

The duration is fixed for now. It is equal to the golden age duration (that depends on the game speed (i.e. 6 for quick, 16 for marathon), without wonders modifiers.

I'll use the weight for changing B-points, it seems to be the best. Of course, divided by number of cities.
 
This is getting ridiculous... My PC is officially done modding for RoM 2.8. The testing of one component takes unlimited time compared to the coding of the component.

And finally I got to the point where adding a simple field in one class (CvBuildingInfo) makes the game not start :crazyeye:. Memory is probably the issue, I'm sure there are no bugs in the code.

All that I can do now is release the code that I made so far (it covers all the things from the big post http://forums.civfanatics.com/showpost.php?p=8651249&postcount=32). It is barely tested at all. I started a few games and got unrelated CTDs after some 50-100 turns. I guess my code works since those CTDs were always in different places. Afforess, you can take it from there and make it a real mod.

I'll make the Dark Ages modmod for RoM 2.4, the last really playable version for me. It will be for my own games, but if someone else ever wants it, I will release it too.
 
And finally I got to the point where adding a simple field in one class (CvBuildingInfo) makes the game not start :crazyeye:. Memory is probably the issue, I'm sure there are no bugs in the code.

Famous last words. I don't know how many times I thought my code was flawless, until users came back whining to me.

All that I can do now is release the code that I made so far (it covers all the things from the big post http://forums.civfanatics.com/showpost.php?p=8651249&postcount=32). It is barely tested at all. I started a few games and got unrelated CTDs after some 50-100 turns. I guess my code works since those CTDs were always in different places. Afforess, you can take it from there and make it a real mod.

Can I see the source code?
 
And finally I got to the point where adding a simple field in one class (CvBuildingInfo) makes the game not start :crazyeye:. Memory is probably the issue, I'm sure there are no bugs in the code.
Famous last words. I don't know how many times I thought my code was flawless, until users came back whining to me.

:)

OK, I haven't explained this thoroughly. There could be bugs in my code, of course. But for this issue, there's a 99.99% chance that the problem is just not enough memory:

The game starts OK with a specific code. Then I just add a new field in the class (simple int field, no getters/setters, no reading from XML!!!) and the game won't start, it reports mem allocation error when using new[] operator (this new[] allocates more than one int of course, it creates some array of arrays, size depending on numBuildings X sizeof(CvBuildingInfo)).

I'll post the src when I get home (in a few hours). I'd actually be glad that you (or someone else) find that 0.01% chance to be true and point to the bug for me ;).
 
maybe plague to go along with dark ages? because larger civs tend to have more large cities a plague would cause more damage to them then a small civ? possibly triggered by a lot of unhealthiness in a city, combine that with large pop and you have a plague possibility on your hands, a plague would spread by trade routes and proximity, I think this is possible because the mechanism except for the creation of a plague is in game in RFC
Just a friendly suggestion
 
Hey Folks,

my first post.
Dark Ages sound sounds very intresting, linmiting the ones on a winning streak during mid-game.
I often quit and restart in renaissance, cause see no challange.
What about this darkage trigger: if eg. 20% of all players have you as "worst enemy", then a dark age begins for you, maybe lasting till this condition ends. This means you have to adopt, or erase your foes.
 
The problem about conquests triggers is the strongest (and this is most often the human player) most likely wont loose any cities.

One trigger could be the plague (or other disease), if the civs population gets too big.
There was a ROM version with diseases in, but it seem to have been removed. I didnt get it for a loooong time)
Another could be an unexpected revolution if some city gets too unhappy or is too far away (alot of maintenance)
A third could be a random rebellions

Maybe the revolution mod can be tweaked better, so it is more difficult to have mega empires.
(I never had a revolution, even though I always play with it on, and I usually end up with half the world in area/population)

I'm inclined to go this route. Most civs/empires rarely get overly large AND stay large. Maybe REV Mod can be tweeked to keep civs from getting large to begin with. Several aspects of conquest I have concerns with:
1) conquering a city with a very different ethnic group
2) " " " religion
In history, capturing a foreign city AND holding for any given time is very rare. In cases of holding a city of different religion almost as rare.

However, I do like the idea of a 'Dark Age' in addition to the above. Just some thoughts.
 
OK, here's the source (and the built dll). All of the things from my big idea post (http://forums.civfanatics.com/showpost.php?p=8651249&postcount=32) are actually implemented.

The work that is needed now is to run some autoplay games, see the effects and balance the factors. This is where I must stop because of my stupid PC. I get a lot of CTDs, probably related to memory (the bigger the map, the more frequent the CTDs :mad:). There could be some CTDs that are caused by my code, but since I also get them with plain RoM 2.8, it is very hard to test more.

All of my code is enclosed in "Dexy - Dark Ages" comments.

For now, there's a lot of debug info displayed on scoreboard mouse hover. This should help the fine-tuning of each of the dark age factors. It should be removed in final version.

Edit: The c++ code is an update to RevDCM 2.60, which is in RoM 2.8. XMLs are also an update to plain RoM 2.8 files.
 

Attachments

Back
Top Bottom