Requesting following features

sounds great! yer minor civs should not count... there are 2 of them!

@asaf: It shouldn't be nessisary to construct displays... You want to play my mod? :love: you can be my tester then :D

I'm going to start a playthrough now (been busy all day) and look for errors... (going to speed up the civil war event a bit too...just for testing)
 
Right did a test on the civil war code and a slightly different result... This time the units fliped BUT

The same thing happened! Clovis came back looking like Arcadius, It used the germanic flag and ERE colours and it was called the Germanic Empire! Isn't there something that will fix this like a code that ignors dead civs?

Also I captured Nicomedia first and it became the capital so the bug where Byzantium is not ALWAYS the capital (unless captured first) is not fixed... Maybee some sort of co-ordinate thing for the capital?

I will attach the code...

Btw: No python Exceptions!

EDIT: Alternativly it may be possible that if the ERE is in the senario file from the begining (thus dead) it may work... What do you think?
 

Attachments

  • Civil war to be fixed.zip
    61.4 KB · Views: 25
Ok, I'll add the Byzantine to my to-do list then. I propose that you add the Byzantine player in the WBS so that I can activate it later by spawning units to them. There is practically nothing that could go wrong with this setup. But I'm not even gonna bother with the random events interface myself, so my own module will be plugged into the Event Manager like the other ones. I will however see what corners I can cut by using some of The_J's code. (Not by copy-paste, obviously.)

Which task is up next? I'm still working on the catapult code, and waiting for the rebel civs to be included in a new version. I'm fine with doing the Byzantine last, but its basically your call. Its a new work week and I'm gonna be pretty busy, but I'll take the time to reply here anyway.
 
I would like the rebels up and running and this has been the subject of the initial playthrough:

1. Rebels appeared on each city I took apart from 1 (nice! this was a barbarian civ btw)
2. Rebellions were pathetic for the most part (not enough force in my opinion, could be stronger)
3. A laughable moment where the rebellion spawned Explorers! :lol: (Twice Actuly :lol:) this needs to be fixed (no non attacking units)
4. Couldn't tell when Domestic ones will happen?

other than that things work fine!
 
I would like the rebels up and running and this has been the subject of the initial playthrough:
Ok, send me the new version of the mod once your done with all the new players and Civs.

1. Rebels appeared on each city I took apart from 1 (nice! this was a barbarian civ btw)
Does this need to be tweaked up or down? Did you play one of the "civilized" players or one of the less so? (The latter only have half the chance for a rebellion to take place.)

Also note that you can easily disable the occupation rebellions in the ModSettings module.

2. Rebellions were pathetic for the most part (not enough force in my opinion, could be stronger)
3. A laughable moment where the rebellion spawned Explorers! :lol: (Twice Actuly :lol:) this needs to be fixed (no non attacking units)
I haven't tested this in-game myself, but the way it works is that the city spawns the unit type that would be available to it for conscription. Early on in the game (ages before the advent of Nationalism) its mostly melee units. But if there is no Copper/Iron present its mostly Warriors early on. :rolleyes:

The Explorers sound like a bug to me... :eek2: I have no idea what could prompt something like that.

We could use another setup entirely as far the unit types are concerned. What would you propose?

The number of rebel units should be raised, you say? Right now its based on two things: Its actually the higher one of two values. The first one is the number of "We yearn for our Motherland" unhappiness in the city. The second one is the number of unhappy citizens in the city (before they are counted against the happy faces) - minus the number of military units. So while the second value is readily controllable with large enough occupation/security force, the first one can only be affected with adding more culture - making the cultural unhappiness diminish.

Use this information as the basis of any proposal you might have.

4. Couldn't tell when Domestic ones will happen?
Those are disabled by default. (I thought you really didn't want those.) Enable them yourself in ModSettings if you wanna test them out.
 
that would explain why constantly bugging rome with spies in an attempt to cause domestic rebellion didn't work :lol:

Well, I think it was the fact that the most advanced unit they had was an explorer (maybee...)

I was playing Gaul so barbarian, but can I also check that

Me (rome) conquors bibrate (gaul) do I get 5% or 10%
Me (rome) conquors athens (greece) do I get 5% or 10%

in my opinion conquoring bibrate should give 10% and athens 5% or is it set up so that either one gives me 5%? (because rome is civilized)


I think the explorer bug could be fixed by stating the unit classes that should actually be able to do it!

I think that domestic revolts should be strong enough to take the city without much difficulty (they are there to punish after all!) because I want to see the rebels as a civ of it's own! Authough I dont know how it would be calculated... something do do with the population... (pop/2 *unhappiness)? would that work well? (only for demestic revolts mind... this with occutational would produce pitiful results...)maybee with distance to the capital as well so maybee [Pop/2*unhappiness+distance from the capital]? which do you think would be better?

After a certain time I think that a conquored city should loss it's occupational revolt chance and instead gain the domestic one

Btw what excatly will cause domestic ones? Spies supporting revolts? Civic changes for more than 1 turn? i'm not sure what would cause it...
 
I was playing Gaul so barbarian, but can I also check that

Me (rome) conquors bibrate (gaul) do I get 5% or 10%
Me (rome) conquors athens (greece) do I get 5% or 10%

in my opinion conquoring bibrate should give 10% and athens 5% or is it set up so that either one gives me 5%? (because rome is civilized)
Right now the lowered probability is for the current owner. But we can change it to the original owner.

And your opinion is irrelevant - what you request is what matters. :king:

I think the explorer bug could be fixed by stating the unit classes that should actually be able to do it!
You mean by having a list of rebel units? But what determines what unit on that list should be used? Random unit type?

One option could be to specify one rebel unit per era. So you need to decide on a Ancient, a Classical and a Medieval rebel unit then. Note however that the "era" could be any of these: 1. the current owner's current era, 2. the original owner's current era, or 3. the current game era. Which one should it be?

It is of course possible to make this as complicated as you want, but as the scenario designer you need to figure out all the specifics for whatever setup you'd prefer. (Using the conscript unit type was actually a short-cut I used to avoid complicating things.)

I think that domestic revolts should be strong enough to take the city without much difficulty (they are there to punish after all!) because I want to see the rebels as a civ of it's own! Authough I dont know how it would be calculated... something do do with the population... (pop/2 *unhappiness)? would that work well? (only for demestic revolts mind... this with occutational would produce pitiful results...)maybee with distance to the capital as well so maybee [Pop/2*unhappiness+distance from the capital]? which do you think would be better?
I honestly have no idea what would be sufficient. But you can basically get whatever you like to test out. So I'll change the number of domestic rebels to iPopulation / 2 * iUnhappyLevel + iDistance once we add the new stuff.

After a certain time I think that a conquored city should loss it's occupational revolt chance and instead gain the domestic one
I guess this would be once the cultural unhappiness dissipates from loyal culture. But any condition you can specify would also be possible to implement.

Btw what excatly will cause domestic ones? Spies supporting revolts? Civic changes for more than 1 turn? i'm not sure what would cause it...
As the code stands now - all rebellions are triggered by the CyCity.isDisorder() method. It makes no difference what prompted the disorder - occupation, espionage, foreign culture. But I added settings for you to disable/enable the occupation and the domestic kind. The occupation disorder is detected with CyCity.isOccupation() and the domestic one with CyCity.isNeverLost().

This is the whole thing:
Spoiler :
Code:
def checkCity(pCity, pOriginalOwner):
  return ( pCity.isDisorder()
           and ( bOccupation
                 or not pCity.isOccupation() )
           and ( bDomestic
                 or not pCity.isNeverLost() )
           and ( pOriginalOwner == Civ("Brittania")
                 or not pOriginalOwner in lCivilized
                 or Game.getSorenRandNum(2, "rebels") ) )
I'm tempted to rewrite the Rebels module once more and use a Object-Oriented approach this time... This would make it easier to implement different distinctly different types of rebellions. Anything, really, would be possible.
 
era stuff wouldn't work as there is only 2 era's in game... there should be a replacement basis

warriors untill copper -> axes untill iron-> Swordsmen -> Avanced Spearman -> Advanced Swordsman

or something like that, maybe with horses or something as well. Or just exclude certain units like explorers and the such.
 
Simply excluding units isn't a good option, so we need to define what triggers the progression. You're requesting Techs, then? What Techs? Who's Techs?
 
Ok, I've decided to redo the Rebels module once again. :D

This time around it will be based upon different "classes" of rebellions. So there will be domestic rebellions, ethnic rebellions, resistance rebellions, and any other sort of rebellion you can dream up. Like custom rebellions for historical events. (I believe you mentioned one earlier.)

Using classes for this basically means that the main Rebellion class will be used as a template for the different types of rebellions. These are the subclasses, and the nice thing about working with such an "Object-Oriented" approach is that its really easy to add new types of rebellions - and doing so doesn't entail redoing (or copying) tons of code. Instead, you only have to define what differentiates the new subclass from the main class - all the rest is automatically inherited from the original class. Like some other conditions, unit types or numbers of units. Or it could have a timer - making the rebellion automatically end in some number of turns. Or some other condition for the civil war to come to an end - like giving into the dissidents' demands. Or just about anything.

But before I start on this re-make it would be useful to try to define the various types of rebellions we have already discussed. So what are the prerequisite conditions for them? What type of units do they produce? Belonging to what Civ/player? How is the number of units calculated?

Later it will also be possible add stuff like slave rebellions, religious rebellions, secessions (defecting cities), defecting army units and what else. It is also possible to make a rebellion name generator that gives each rebellion a unique name, based on the actual circumstances. (Historical rebellions would of course get the historical name.) This is of course displayed in any messages/popups.

This ought to be fun, not? :D
 
hahahaha! this is where it gets MUCH better!

Occupational Rebellion (standard rebellion)- happens in conquored cities... Uses the highest unit available in defined technologies (to prevent explorers) of the original owner of the civ this could possibly revive a dead civ. this rebellion can no longer happen (and allows domestic rebellions to happen in conquored cities) after 50 turns of CONTINUOUS occupation.

Domestic Rebellion - uses the Civ Specific Rebels connected to certain civs to punish them for making their citizens unhappy, it WILL be strong enough to take the rebelling city as to forge a new minor civ to the game: it will be not be able to be contacted but NOT at war with everyone (like independent civs in Ryhe's). Uses highest unit available in defined technologies of target civ

Minor Domestic Rebellion - a quite rare rebellion which only occurs when the city is unhappy (more :mad: than :)) and will be quite small in it self... uses the Civ Specific Rebels! Not sure what units

Roman Rebellion - a 100% chance rebellion that will happen around mid point in the game: It will affect everything past a certain co-ordinate and will spawn the mighty Eastern Roman Empire to devour all roman cities in the east, if possible, attacks byzantium first and renames it constaninople (at a certain co-ordinate?) this basically replaces The J's code. However would it ALWAYS attack the cities it spawns next to or go else where? If it does go else where ignore this request... Uses LOTS of the highest unit available in defined technologies of romans.

Cultural Rebellion - a rebellion that happens in cities that are under cultural pressure (therefore may flip) from another civ. The rebellion can ONLY be triggered by a third party (not the current owner and not the original founder if conquored) and will be quite small with a small chance of actually taking the city. it removes 1 population from the target city (if the city is 1 pop the rebellion cannot take place. uses Highest unit available in defined technologies from the third party civ.

Forming of the Macedonians - a rebellion that happens in northern greece which will be quite strong. it is defined on a certain date, co-ordinate and spawns a city (if available) on the spawn co-ordinate. It uses the Hellenic Rebels as a base.

Slave Rebellions - these happen in conjuction with the random event: Slave Revolts. Instead of just a turn (or what ever I never run slavery so I have never seen one :lol:) of disorder it should also spawn a small army of relativaly weak units. maybee happening on the second slave revolt in the city?

I cannot think of any more at the moment, but I'm sure ideas could be made with this got any of your own?
 
First things first: You need to differentiate between "disorder" and "anarchy". The former affects one city and causes it to be non-productive. If the disorder is caused by foreign culture, then there is also a chance that the city will flip to an opponent. Anarchy, on the other hand, is what you have whenever you change your civics or state religion. This makes all cities non-productive, but there is no risk of secessions.

With that said, both disorder and anarchy could be used as triggers for some kinds of rebellions. But we need to be clear what we're talking about.

We also need to define "rebellion" as the new setup which is based upon classes requires some common ground rules. Otherwise I'll keep rewriting the Rebels module indefinitely.

As the code stands right now a "rebellion" is a unit spawning event triggered by city disorder. We can of course expand on this definition, but there still needs to be boundaries for when something no longer fit the definition.

You listed some historical events that are really civ spawns and would probably be better represented by city spawning/flipping - with or without unit spawning. The Macedonians and the Byzantine probably shouldn't be "rebellions" in the way we're discussing them in this context. But there is still nothing preventing us from scripting them with Python - they just don't have to be made to fit the rebellion mold. (Because we can have some other setup for this, like civ spawns or civil wars.)

I'm also beginning to second guess my previous decision to not use the built-in random events setup for your mod. Especially since you wanna interconnect one type rebellion with a pre-existing random event (the slave revolt). Either option should work basically the same, but if we go with the existing way of triggering events, then you'd have to do all the XML stuff for it yourself. Which can be a good or a bad thing - its basically up to you. One thing to consider is also the snazzy pop-ups that are created by the built-in system.

About the various types of rebel units - its basically the Tech that enables the unit, right? Meaning the Tech that is the prerequisite of that unit. I'll put all of this into a readily editable data structure for you, so you'll be able to rework this on your own in the future.

And I have an idea for the slave revolt event: What about spawning something like 1-2 units every turn that the city is in disorder. This means that you have an added incentive to quell the revolt in order not to lose improvements/workers. But the sheer number of units spawned would hardly ever threaten the city itself.

Note that it is also possible to have rebellions that end - meaning that all rebel units are disbanded at some point. This can be done by giving the units "flags" or hidden names (with scriptData). Once the code ending the rebellion is fired, it simply looks up all the units with that flag and deletes them.

It could also be noted that the UnitAITypes value of spawned units can be set to something else than the default NO_UNITAI. So while rebel units that are supposed to attack the city get the UNITAI_ATTACK_CITY the escaped slave units could have a non-combat setting like UNITAI_PILLAGE, UNITAI_EXPLORE, UNITAI_ANIMAL or something in this vein.

Keep all these possibilities in mind when you do your scenario design. Oh, and you could also have pre-set promotions for rebel units, like Guerrilla... The nice thing is that you'd be able to have a different set of settings for each type of rebellion. And any historical ones can of course be totally unique - like a Spartacus event or something.
 
I like your idea for a slave revolt but it should be only while in slavery.

yes it should be the tech thing you suggested


as far as I am conerned there shouldn't be any other problems outside of:

slave rebellion
Macedonia and Byzantium

correct?

The only one I think should end and have units disbanded is the slave revolt and this should be triggered by changing civics out of slavery (I will make a seperate rebel civ for slaves (with a pitchfork) for your flag thing...) and keeping thing in mind if this is linked up with the slave revolt event then the "snazzy" box will be able to have 2 options:

a Who Cares? option

and a We will switch from slavery immediatly! option
 
I like your idea for a slave revolt but it should be only while in slavery.
Yeah, of course. But its good to define these things for real.

as far as I am conerned there shouldn't be any other problems outside of:

slave rebellion
Macedonia and Byzantium
No, I'm not saying there even is a problem. But it might be suboptimal to define classes for rebellions that also are used for spawns and flips and whatnot. Definitions are good. And it might not be what you're looking for to have all these custom events be "rebellions" - to try to fit everything into the rebellion mold (as defined by the class/classes). When these Civ spawns can be handled by some other code altogether.

I'd wanna encourage you to define all these various scenario features as detailed as possible. You already did that, sure, but things can always be more refined - and better defined. Because it will help enormously with setting up the various classes.

The only one I think should end and have units disbanded is the slave revolt and this should be triggered by changing civics out of slavery (I will make a seperate rebel civ for slaves (with a pitchfork) for your flag thing...) and keeping thing in mind if this is linked up with the slave revolt event then the "snazzy" box will be able to have 2 options:
You could of course have yet another rebel civ/player but the Barbarians should do... About the rest of the slave revolt event - you should probably dig into the XML to see what can be done there. I actually don't know exactly, but if something needs to be added with a Python script, then I can manage that.
 
I will have to think further about how better to define these
 
And in the meanwhile I'll try to finalize the catapult construction code for the AI. (I got sidetracked during the week.:rolleyes:)
 
ok if you could quickly do a "Question & Answer" to help me define my rebellions that would be great!
 
Do I supply the question or the answer? :confused:
 
just write a bunch of questions that you need to know about each of the rebellions and I will get back to you!
 
Top Bottom