Partisans Mod

Joined
Jul 5, 2004
Messages
23,562
Location
Canberra, Australia
Partisans Mod - by GIR

Current documentation of what happens
The number of Partisan units depending on city size (before conquest) and if the loser of the city is stronger or weaker (military power) as the new owner of the city.

city size
|
Partisan Units if
|
Partisan Units if
|
reduce population

before conquest
|
loser weaker than conquer
|
loser stronger than conquer
|


01-06​
|
1 - 2​
|
0 - 1​
|none
07-13​
|
2 - 3​
|
1 - 2​
|- num partisans
14-20​
|
3 - 5​
|
1 - 3​
|- num partisans
21-27​
|
4 - 6​
|
2 - 4​
|- num partisans
28-34​
|
5 - 8​
|
2 - 5​
|- num partisans
35-41​
|
6 - 9​
|
3 - 6​
|- num partisans
...​
|
...​
|
...​
|- num partisans



Loser has
  • Nationhood civic then +3 units
  • Protective trait then +1 unit

  • Tech Rifling

Units get promotions based on the losers technological knowledge and the plot types in the work area of the city
technology
|
plot types
|
promotions
|
chance
assembly line |
-​
|+ drill|
100%​

industrialism |
-​
| + drill |
100%​

rocketry |
-​
| + drill |
100%​

plastics |
-​
| + drill |
100%​

railroad |
-​
| + flanking I |
100%​

combustion |
-​
| + flanking II |
100%​

radio |
-​
| + morale |
50%​

fascism |
-​
| + combat |
50%​

computers |
-​
| + combat |
100%​

robotics |
-​
| + combat |
100%​

composites |
-​
| + combat |
100%​

laser |
-​
| + combat |
100%​

-|
forest / jungle​
| + woodsman I |
100%​

assembly line |
forest / jungle​
| + woodsman II |
75%​

industrialism |
forest / jungle​
| + woodsman III |
50%​

- |
hill​
| + guerilla I |
100%​

assembly line |
hill​
| + guerilla II |
75%​

industrialism |
hill​
| + guerilla III |
50%​

Program logic order
  • if the city is barbarian
    or loosing player does not have Rifling
    or the city is being reconquered by its owner
    or it is the last city of a nation
    exit ie do nothing​
  • otherwise
    • calculate the random number of units to spawn
    • adjust this number based on the percentage culture in the city belonging to the conquering player
    • add the civic and trait adjustments
    • identify the plots the partisans spawn in
    • identify the promotions the units will have and how much damage they will have taken
    • place the units
    • reduce the city population

Things we need to do
  • Add in all the partisan line
  • Add in the new C2C terrains eg Ancient Forest
  • Add in promotions for when Terrain Damage option is on
  • Add in new promotions
  • Work radius of a city needs to be adjusted for C2C's third tier.
 
  • Nationhood civic then +3 units
  • Protective trait then +1 unit
These are interesting effects that should be tags since they could/should be something we can adjust on traits, particularly if we're going to have traits ramping up. They can factor into the value of a trait as well so should be considered with trait design.

Furthermore, trait tags and civics tags go hand in hand as they often share the same processing like promos and unitcombats so once one is made the other is very easy to include as well. Civic valuations should take this into account as well!

Also, should there not be a boolean 'setting' for both civics and traits to make it so that this effect can only take place when the civics or traits that activate the effect exist? We could make that setting based on the same tag that modifies the number of emerging units. A -1 would mean 'doesn't activate'. A 0 would mean 'activates'. Anything above 0 would be a positive adjustment (although this does limit us to only being able to influence with a bonus rather than any penalties.) I could get you a python exposed boolean to say whether the effect is active or not.

Add in all the partisan line
As stated elsewhere this is trickier than it may seem. We could define it basically as any non-mounted ruffian I suppose.

Add in the new C2C terrains eg Ancient Forest
Good observation. Yes.

Add in promotions for when Terrain Damage option is on
The promotions are there whether the option is on or not and are combat beneficial regardless. I wouldn't hinge anything on the option in this case. But each of those promo lines do cover differing types of terrains and we did a strange thing to make each level of those promos address a different terrain type rather than to have all of the terrain types in the group get a gradually increasing bonus (in the way that Guerrilla and Forestry works.) I've long suspected we'd eventually see reason to change it over to this approach and this might be it.

Add in new promotions
Meaning the Freedom Fighter promo I'll be putting together for this right?

Work radius of a city needs to be adjusted for C2C's third tier.
The work radius doesn't seem to factor in currently based on what you've said... in what way do you see this needs to be taken into account? Does it have to do with where the 'partisans' can be spawned?
 
These are interesting effects that should be tags since they could/should be something we can adjust on traits, particularly if we're going to have traits ramping up. They can factor into the value of a trait as well so should be considered with trait design.

Furthermore, trait tags and civics tags go hand in hand as they often share the same processing like promos and unitcombats so once one is made the other is very easy to include as well. Civic valuations should take this into account as well!

Also, should there not be a boolean 'setting' for both civics and traits to make it so that this effect can only take place when the civics or traits that activate the effect exist? We could make that setting based on the same tag that modifies the number of emerging units. A -1 would mean 'doesn't activate'. A 0 would mean 'activates'. Anything above 0 would be a positive adjustment (although this does limit us to only being able to influence with a bonus rather than any penalties.) I could get you a python exposed boolean to say whether the effect is active or not.

If we are going to do this in the XML I think a simple integer tag is all we need. Simply iFreedomFightersOnConquestAdjustment(? I am sure you can come up with a better name) any integer number is valid and the process needs to add all the civic and trait values together to get the final adjustment. This will allow us to have -ve adjustments in some cases if it seems likely.

Also need to consider slaves both settled and population. They are more likely to join the invader if the invader is not running the Slavery World View for instance.

As stated elsewhere this is trickier than it may seem. We could define it basically as any non-mounted ruffian I suppose.

I was going to ask if it was possible to ask for the best unit in a line. There are a number of places where the units in the line are hard coded in the python. It would be better in the long run if the python could just ask. The problem of course is that it is not just technology that needs to be considered. There are also the "post apocalypse" units to consider as they are the fall back on some units if the resources are no longer available.


The promotions are there whether the option is on or not and are combat beneficial regardless. I wouldn't hinge anything on the option in this case. But each of those promo lines do cover differing types of terrains and we did a strange thing to make each level of those promos address a different terrain type rather than to have all of the terrain types in the group get a gradually increasing bonus (in the way that Guerrilla and Forestry works.) I've long suspected we'd eventually see reason to change it over to this approach and this might be it.

I thought that there were just promotions to stop the damage. Ah there are they currently only apply to animal units.

Meaning the Freedom Fighter promo I'll be putting together for this right?

Yes.

The work radius doesn't seem to factor in currently based on what you've said... in what way do you see this needs to be taken into account? Does it have to do with where the 'partisans' can be spawned?

The units spawn inside the work radius of the city conquered.

The terrain the spawn on is the one that determines which terrain promotions they get.


Further:

Suggest: For each settled gladiator in the city one of the units should get a leader promotion. The base leader promotion I assume. The gladiator would be removed from the city so probably need a chance they will join the freedom fighters.

Suggest: For each Military Instructor settled inside the city there is a chance they will join the freedom fighters. For each 5 joining the freedom fighters give a Warlord unit (best the city can build - yes this may give them more than they should have). Those 5 will then be removed from the city. Those left over of those joining the city should also give leader promotions - if some units already have the first leader promotion then they give one of them a second level promotion to that unit. One unit each for a max of 4.

Consider: I was looking at Pie_at's mod, there is a population specialist that he has which represents retired army families. These add to the defense of the city. They are only available with certain civics.
 
If we are going to do this in the XML I think a simple integer tag is all we need. Simply iFreedomFightersOnConquestAdjustment(? I am sure you can come up with a better name) any integer number is valid and the process needs to add all the civic and trait values together to get the final adjustment. This will allow us to have -ve adjustments in some cases if it seems likely.
So we would then adjust the base calculation by one less and simply expect that if there is a unit modifier in the positive then the event can fire? That would make more sense.

Also need to consider slaves both settled and population. They are more likely to join the invader if the invader is not running the Slavery World View for instance.
Lol... I will be leaving THAT to you. But it's a good idea. Are we talking about letting some or all of the cities planted slave (free) specialists be removed and become units then? This could be a good add-on effect.

I was going to ask if it was possible to ask for the best unit in a line. There are a number of places where the units in the line are hard coded in the python. It would be better in the long run if the python could just ask. The problem of course is that it is not just technology that needs to be considered. There are also the "post apocalypse" units to consider as they are the fall back on some units if the resources are no longer available.
Yes, this is how the AI determines what to build. But it does work off an AI setting to define the 'line' I think. Not sure if you can ask for the best UnitCombat. You might be able to... I'll have to check on this. I'll get back to you soon on it.

Suggest: For each settled gladiator in the city one of the units should get a leader promotion. The base leader promotion I assume. The gladiator would be removed from the city so probably need a chance they will join the freedom fighters.
I'd be ok with that. A good idea but it doesn't have an equivalent throughout later eras. Man, though, these kinds of effects would really upset the player that loses these when the city is lost, even if he CAN take the city back it won't be the same city he had!

Suggest: For each Military Instructor settled inside the city there is a chance they will join the freedom fighters. For each 5 joining the freedom fighters give a Warlord unit (best the city can build - yes this may give them more than they should have). Those 5 will then be removed from the city. Those left over of those joining the city should also give leader promotions - if some units already have the first leader promotion then they give one of them a second level promotion to that unit. One unit each for a max of 4.
I would counter suggest that for every 5 'partisans' given, a Warlord also emerges IF the city has a Military Instructor it can sacrifice to do so. This would be simpler both for the player and the programmer. BUT, would we let the Warlord limit be exceeded with this effect? Could be an interesting reason to. The Warlords are about to be reviewed to be Ruffian 'leaders' anyhow so this could work nicely. Particularly if you give them the Freedom Fighter promo as well - which would be SOME justification to why we could allow these types of spawned Warlords to exceed the limit.

Consider: I was looking at Pie_at's mod, there is a population specialist that he has which represents retired army families. These add to the defense of the city. They are only available with certain civics.
hmm... Interesting concept. hmm... perhaps another discussion topic itself. Sounds like an effect that would be derived from the unit food support modification I had long ago suggested. If/when the unit is dissolved back into the city it could add this 'heritage' modifier. Sure it would be best if it did play into the partisan XP though.
 
So we would then adjust the base calculation by one less and simply expect that if there is a unit modifier in the positive then the event can fire? That would make more sense.

I think it should "fire" anyway or be based on other factors or even another tag.

One tag should just be the adjustment and it can have any number so it is possible that the number of units will be zero or less when added up across the traits and civics.

When this adjustment is added to the expected number of units then if the number is zero or less nothing happens.
 
I think it should "fire" anyway or be based on other factors or even another tag.

One tag should just be the adjustment and it can have any number so it is possible that the number of units will be zero or less when added up across the traits and civics.

When this adjustment is added to the expected number of units then if the number is zero or less nothing happens.

You don't feel this is an effect that should be limited to a select few traits or civics? The ability to have this happen would be a compelling reason to take a particular trait or civic if most of them don't give the effect.
 
You don't feel this is an effect that should be limited to a select few traits or civics? The ability to have this happen would be a compelling reason to take a particular trait or civic if most of them don't give the effect.

If only a few give positive values then you get the same thing but with more scope for combinations.
 
I think it should "fire" anyway or be based on other factors or even another tag.
Maybe I'm misunderstanding this statement to mean that the spawning event should always be valid and this tag is purely just to modify the amount of units?

If only a few give positive values then you get the same thing but with more scope for combinations.
This suggests you'd be onboard with the suggested 'postive total modifier means the event can take place for the player' proposal.

So I'm confused. I'd prefer to minimize the number of tags needed if we can so another tag to say the event would or wouldn't take place seems a little frivolous with mem use. Such an approach wouldn't mean we couldn't have negative modifiers... just means that unless the total is positive, the resistance wouldn't rise.

This is assuming that the base is still determined by most of the original factors as you gave them at the beginning of the thread. Sounds like you'd want the ability to have it be possible to have the event trigger be valid while the overall modifier is still in the negative. In such a case we would need another tag, which I'm trying to resist but don't have that big a problem introducing as well. A bool on a player level isn't that much effort nor mem used so it'd be a fairly small thing. I've just gotten used to TRYING to be as streamlined as possible.
 
There is no event and no event trigger in the Civ IV sense. Every time a city is captured (actually acquired is the correct word) the test is applied and the correct number of partisans are created.

Therefore currently nothing happens if
  • the conquered city owner does not have Rifling
  • the city was reconquered by its owner - based on the city.isOccupation()
  • the city is barbarian
  • it was the last city of a nation
  • the total number of partisans to build is zero or less

Another effect (not in the first post yet) - the percentage of the number of partisans is adjusted based on the conquering Players percentage of the city culture at conquest. This is applied after the random number due to city size but before the trait and civic adjustments are made.

edit adjusted the first post to add in the program logic - I have not yet had my coffee and had a very late night last so the last 3 points may not be totally accurate and I may have missed a step towards the end.
 
There is no event and no event trigger in the Civ IV sense. Every time a city is captured (actually acquired is the correct word) the test is applied and the correct number of partisans are created.
I suppose I should clarify I was using the term 'event' more loosely and not necessarily saying I figured it was handled by the game's event engine. Sorry for any confusion the terminology may have been creating.

Therefore currently nothing happens if
  • the conquered city owner does not have Rifling
  • the city was reconquered by its owner - based on the city.isOccupation()
  • the city is barbarian
  • it was the last city of a nation
  • the total number of partisans to build is zero or less

Another effect (not in the first post yet) - the percentage of the number of partisans is adjusted based on the conquering Players percentage of the city culture at conquest. This is applied after the random number due to city size but before the trait and civic adjustments are made.
Ok that last step sounds extremely rational as well.

This doesn't really answer my question to you though. If we use just negative modifiers to partisan volumes that spawn from this 'circumstance', then we'd need heavy negatives to indicate turning off the mechanism just to counter the base amounts, which then would conflict with those civics and traits that we want having access to this 'native defense mechanism'.

So the question I was asking you, to rephrase it, are you wanting this to be basically for all nations of all traits and civics or just for a limited few that take those traits/civics in part for the value this added defensive measure brings?

I'm kinda neutral on it so don't take this as me arguing for a particular outcome. I was just thinking that it might be a nice persuading factor to take a less otherwise beneficial trait or civic if your nation is beleagured by invasion. As for 'traits', if a boolean switch turning this on or off entirely was part of the trait, it would be a strong reason to have that trait despite potential deficiencies that trait may otherwise exhibit.
 
Ok, so do you want a boolean tag for civics and traits that compiles to a final value on CvPlayer to become a qualification for Freedom Fighter emergence or do we want to make it apply to all civics and traits and only use modifiers to the final amount of FFs that spawn? Either way I'll be doing the modifiers. I just need to know if the bool is desired or not.

All I will do with this though is create the tags and have the Player compile the sum results of those tags then report that to python for ya. Similar to how we worked the captive mechanism.

(Unless you WANT this to be completely coded... that would take a bit longer to develop of course.)
 
Ok, so do you want a boolean tag for civics and traits that compiles to a final value on CvPlayer to become a qualification for Freedom Fighter emergence or do we want to make it apply to all civics and traits and only use modifiers to the final amount of FFs that spawn? Either way I'll be doing the modifiers. I just need to know if the bool is desired or not.

All I will do with this though is create the tags and have the Player compile the sum results of those tags then report that to python for ya. Similar to how we worked the captive mechanism.

(Unless you WANT this to be completely coded... that would take a bit longer to develop of course.)

It can stay exactly as is for now and leave it for v38 if it is too much for the two of us:D. I would need to make sure the Partisans are only appearing given the correct tech.

I would prefer a tag on traits/civics which is an integer rather than boolean simply because we currently have a +3 on one civic currently.

All I will do with this though is create the tags and have the Player compile the sum results of those tags then report that to python for ya. Similar to how we worked the captive mechanism.

Exactly what we need. It is an integer rather than a percentage but both are just numbers;).
 
It can stay exactly as is for now and leave it for v38 if it is too much for the two of us:D. I would need to make sure the Partisans are only appearing given the correct tech.

I would prefer a tag on traits/civics which is an integer rather than boolean simply because we currently have a +3 on one civic currently.



Exactly what we need. It is an integer rather than a percentage but both are just numbers;).

The integer and the boolean are both in place now. Civics and traits that turn the effect ON should do so with the boolean (and you'd need to include the player level bool check in the conditions for Freedom Fighter spawning if you want to use it.) The integer is there as well and equally as accessible by python.
 
Well this is interesting... I just ran across this which may help to explain some of your frustrations about barbarian workers:
Code:
/************************************************************************************************/
/* REVOLUTION_MOD                         01/31/09                                jdog5000      */
/*                                                                                              */
/* For BarbarianCiv                                                                             */
/************************************************************************************************/
				// Give barb cities in occupied areas free workers so that if the city settles
				// it has some infrastructure
Then it goes on from there to spawn some free barb workers... apparently their cities aren't actually building them (well... not proven there but this shows it's not necessary for them to for barbs to have workers and also explains the thinking behind it.)

EDIT: Just as interesting is how I clicked on another thread entirely to make this post and it ended up being made in this thread. Not sure how THAT happened... lol.

So... ON the subject of THIS thread: The Freedom Fighter promo is in place and ready to be implemented as a free promo given to emergent Freedom Fighters.
 
Top Bottom