Requesting following features

edit: Don't miss the reply on the page before!

Another idea - what if all remaining slave rebel units would turn into Workers once slavery is abolished? This would surely work as an incitement to undergo some turn of Anarchy, not?

Oh, and I just realized that I haven't added anything to the actual Slave Revolt random event. So there is no additional option of abolishing slavery or anything in the event pop-up. :p

What my code does is it checks the Labor civics category for the victim of the rebellion every turn. If its anything else than Slavery then any Slave cities revert back to that player and all rebel units are disbanded.

Yet more ideas: Should the population of cities ever be impacted by the formation of rebel units? Because they do represent sections of the population, right?

edit: I added a 10 city minimum to the civil war code, by the way. Because it has to be 30% of all cities, and it should be a minimum of 3 revolting cities, right?
 
I guess there should be one main wave and little trickles after (maybee 1 unit, random turns).

Workers sound good but maybee half of them!

maybee lose 20% of the city population and gain 15% of it back when the rebellion ends (if possible)

yep that sounds fine for the civil war. Either 10 city min or 6 cities (because some civs are really slow starters (during my 1.2 playthroughs carthage took half the game to found 2 more cities! And by that time I had Gaul, Iberia and the Greek Isles))
 
I guess there should be one main wave and little trickles after (maybee 1 unit, random turns).
Yeah, I'll look into this. What rebellion types would this affect? All of them (= default setting)?

Workers sound good but maybee half of them!
Ok, we should revisit this topic once we have been able to test what we already have.

maybee lose 20% of the city population and gain 15% of it back when the rebellion ends (if possible)
20% and 15% may not mean that much with city sizes typically between 3 and 10, or something. It might just be easier to take one population point away whenever a rebellion occurs (also means that cities need a minimum size as a condition for rebellion). But since most rebellions only end when all rebel units are dead (all except the abolishment of slavery termination) it wouldn't make sense to get that population point back. (And if the slaves turn into workers, then there is no need to add any population either.)

Shall we do something with this now or save it for later?

yep that sounds fine for the civil war. Either 10 city min or 6 cities (because some civs are really slow starters (during my 1.2 playthroughs carthage took half the game to found 2 more cities! And by that time I had Gaul, Iberia and the Greek Isles))
I'm putting all these settings into the ModSettings module for you, so it will be possible for you to edit the values yourself when testing. This is what I have so far regarding rebellions:
Spoiler :
PHP:
iRebelReinforcementPercentage = 100
iNumRebelReinforcements = 1
iCulturalRebellionPercentage = 100
iResistancePercent = 100
iResistanceDomesticPercentage = 50
iResistanceDomesticTurns = 2
iDomesticRebellionPercentage = 100
iCapitalHappinessPenalty = 2
iMinorRevoltPercentage = 100
iCivilWarPercentage = 100
iCivilWarUnhappyCitiesPercentage = 30
iRequiredNumCivilWarCities = 6
iRequiredNumCivilWarUnhappiness = 2
iCivilWarRebelArmySize = 6
iSlaveRevoltDenominator = 100
All values ending with the word "Percentage" are of course percentile values (fractions of 100). These are pretty much dummy values to be used for testing, but you can alter them yourself later.

edit: There is also the option of giving spawning rebel units one free promotion (guerrilla, city raider, whatever) and/or another UnitAIType than city attack... These things will allow you to fine tune your design on the various rebellion types, but perhaps its for later...
 
ok all of them except the civil wars and slave revolts should get reinforcements!
 
Ok, done. What about city size? Do we decrease the size at all? (Perhaps one point per 3 spawned units, or something. You decide.) And what about a general minimum city size requirement for rebellions? Because size 1 cities shouldn't rebel, right? (Perhaps something like size 3 could be sufficient - your call.)
 
size 3 yes. we should not decrease the size (this would only be for rebels)
 
size 3 yes. we should not decrease the size (this would only be for rebels)
Ok, I'm doing the size 3 condition now. But what do you mean that only rebels get population decreased? :confused:
 
oh dear... :crazyeye: Meant Slaves! :lol:
I'm still not following... Please explain, in some detail, please.

A related issue, by the way, is that when cities flip when civil war breaks out, then all flipping cities are considered conquered. This decreases city size by 1...
 
no problem with that!

What I mean is we should not remove population from a city just because there is a rebellion (with the exception of the slave rebellions)
 
Ok, I already added code for subtracting/adding iSlaveRevoltPopulationDecrease from the city size on slave revolt/abolishment of slavery. So you can get back that lost population point by switching from slavery then.

But perhaps the value should be what number of slave units are spawned - and what amount of units remain - respectively. Something like 3 military units per population point, or whatever you like. (Don't forget about rounding effects!)
 
ok 3 units per pop. (if possible it could be made that it caculates the amount of units at the end of the rebellion being disbanded and divides that by 3 and adds to the city's population? bearing in mind some will become workers (and therefore not contribute to the pop))
 
I thought I'd just add city size changes at this juncture, and worry about spawning workers later. :D
 
Ok, since the number of slave rebels spawned is equal to the city size, this also means that the city size will shrink by 1/3 (rounded down). So a size 3 city would spawn 3 units and lose 1 population point, then.
 
I have decided to learn a bit of python and in my most recent lesson it clicked: I haven't I seen that before? and I realised I just learnt about how you are doing the rebel code!

you made a class
class Rebellion
#defined propeties

and when you wanted to make a sub catagory you did this

class Domestic(Rebellion)
and it takes the Rebellion propeties of Rebellion but adds it's own!/ changed some of them

:D

btw - I learn't about loops, and how to mkae a calculator so far, now I am working my way round simple programs and classes etc
 
I have decided to learn a bit of python and in my most recent lesson it clicked: I haven't I seen that before? and I realised I just learnt about how you are doing the rebel code!

you made a class
class Rebellion
#defined propeties

and when you wanted to make a sub catagory you did this

class Domestic(Rebellion)
and it takes the Rebellion propeties of Rebellion but adds it's own!/ changed some of them

:D

btw - I learn't about loops, and how to mkae a calculator so far, now I am working my way round simple programs and classes etc

Baldyr will be sooooo proud... :lol:
 
(I apologize in advance for the double post, but it has nothing to do with the previous one)

@j_mie6 - I have completed the ethnic buildings Mod you've requested. As you can see I made a full blown mod component out of it :D

I have merged the C++ code to the DLL I've created for you (it's version 5 now!). I haven't tested it after the merge, but there were no conflicts so it should work just fine. You should test it anyway.

You still need to merge a little python code and there's some XML work for you.
See the mod's thread for details.
 
I have decided to learn a bit of python and in my most recent lesson it clicked: I haven't I seen that before? and I realised I just learnt about how you are doing the rebel code!
Oh, programming is fun. And Python is super-fun, so you're not gonna regret this!

But the new Rebellion module I'm working on right now is not good for learning. Because its created with Object-Oriented Programming (much like CivIV is) and really the advanced class. What you need for learning the basics and getting into CivIV modding with Python is my tutorial - which incidentally uses the original Rebel mod-comp as the sample code. See my signature for a link!

Nothing you need to do yourself with Python requires you to create your own classes. Shall we find you a bite-size programming project to work on? :king:

edit: Some sample code from your own mod that doesn't use any class is found in the CustomFeatures module:
Spoiler :
Code:
### Custom game features for Jamie's Rome Mod, by Baldyr

from ModSettings import *
from Popup import PyPopup

tYieldTypes = (eFood, eProduction, eCommerce)
tExtraYields = (iNileFood, iNileProduction, iNileCommerce)

def gameTurn():
        if iGameTurn > -1:
                Game.setGameTurn(iGameTurn)

def showPopup():
        modPopup = PyPopup()
        modPopup.setHeaderString(Translator.getText(popupHeader, ())
        modPopup.setBodyString(Translator.getText(popupMessage), ())
        modPopup.launch()

def commandeering(pWinner, pLoser, winnerInfo, loserInfo):
        eWinner, eLoser = pWinner.getOwner(), pLoser.getOwner()
        if eWinner == eBarbarian:
                return
        elif eLoser == eBarbarian:
                pLoserCiv = pBarbarianCiv
        else:
                pLoserCiv = instance(eLoser)
        pWinningCiv = instance(eWinner)
        if ( winnerInfo.getUnitClassType() == eCommandeerer
             and loserInfo.getUnitCombatType() == eNaval
             and loserInfo.getUnitClassType() != ePrivateer
             and isChance(iCommandeeringProbability) ):
                pCaptured = pWinningCiv.get(PyPlayer).initUnit(loserInfo.getID(), pWinner.getX(), pWinner.getY())
                pCaptured.finishMoves()
                pCaptured.setDamage(iCaptureDamage, pWinningCiv.get(playerID))
                tStrings = pLoserCiv.getName(), loserInfo.getDescription()
                tColor = pHumanCiv == pWinningCiv, pHumanCiv == pLoserCiv
                addMessage(captureMessage, tStrings, tColor, getCoords(pWinner))

def riverNile():
        for iX in range(2):
                for iY in range(4):
                        for iYield in range(YieldTypes.NUM_YIELD_TYPES):
                                Game.setPlotExtraYield(53 + iX, iY, tYieldTypes[iYield], tExtraYields[iYield])
Key to understanding how some of this code works is to realize that the ModSettings module is imported at the top. So all variables and functions (names) in that module are also available here. And the ModSettings module is in turn importing the Utils module, which in turn is importing CvPythonExtensions (the actual Python API) and the CivPlayer module. And so on. If you can't figure some name (like instance, iGameTurn or isChance) out, then it is probably imported from some other module.
 
You still need to merge a little python code and there's some XML work for you.
Tell me if you need help incorporation the Python portions. Be advised that merging Python code is actually harder than writing new code! :eek:
 
Back
Top Bottom