1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

What modcomp do you want me to design?

Discussion in 'Rhye's and Fall Modmods' started by Panopticon, Feb 24, 2010.

  1. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    I have some free time, so if anyone from RFC Europe or one of the other big projects wants to outsource some work on new game mechanics using DLL or Python, I can do it. Alternatively I can design small modcomps if anyone out there has ideas they want to implement. Keep me from becoming bored.
     
  2. sedna17

    sedna17 Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    1,091
    Any interest in revisiting your (first?) modcomp on the reformation? We use this code largely un-altered in RFC:Europe, and a few things could make it better.

    In the longer time-frame of our mod, having the reformation happen "all-at-once" feels a bit strange. I guess my wish would be for something more organic. The first civ to research tech X (Printing Press) gets the holy city and the choice to switch. Then the reformation choice spreads somewhat randomly/slowly to other Cathoic civs over a span of a few turns. I suppose you could get more complex than this, but I think the basic mechanism of a % chance which is historically appropriate is a-ok.

    As you may have seen here, there's also the special case of what happens when an Orthodox civ researches Printing Press first.
     
  3. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Good idea. Since Protestantism is a breakaway from Rome, it should only be available to civs with a Catholic state religion, right? So I don't think it should be handled by the normal religion founding mechanism.

    How does RFC:Europe handle Judaism? Is there some organic spread, or is it controlled by Python? If it is organic then I think something similar could happen for Protestantism.

    On the other hand, if there's no existing capability to have new religions spread organically to cities with incumbent religions, then you could have Protestantism slowly spread from the founding civ to nearby countries to further ones, using the definitions of neighbours. (Incidentally, Norse and Germany should probably be listed as neighbours.) That would be simple - use an array and a random choice of civ or civs each turn from the set of eligible civs (i.e. Catholic and adjacent ones).
     
  4. sedna17

    sedna17 Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    1,091
    Judaism spreads in two ways, both of them controlled by Python. There are specific areas which are likely to get Judaism at certain times (Spain early on, Poland later, etc.) In addition, when Jews are persecuted out of a city they will randomly re-appear in another one. So there is no present capacity for organic spread of religion to cities with at least one religion already present.

    I think your proposal for slow spread to neighboring Catholic civs would be a good solution.
     
  5. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    As a first step, I've migrated all Reformation code out of Consts and RiseAndFall into RFCEventX and Religions. Next will be an implementation of an idea along the lines discussed above. It will be difficult to test whether it is working perfectly, though, because by its nature there's a lot of randomness.
     
  6. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Now working. Two spread paradigms, please choose one of them:
    1. Each turn, Reformation spreads from the founding civ to its neighbours. Reformation process is rapid, probably about 4-6 turns, longer if founded on the outskirts of the map and shorter if founded in Central Europe. Reformation spreads in a radial way about the founder.
    2. Each turn, Reformation spreads to X civs that are neighbours of civs that have already experienced the Reformation. Reformation takes (22 / X) turns to work its way across all civs. Reformation spreads in a haphazard way that is more path-dependent on where it spread in the past, though it ultimately reaches all countries.

    Currently I have implemented option 2, with X = 3, so it takes 7-8 turns to spread around the world. Note that I have defined neighbours more broadly than the current code does, in a new list that only applies to the Religions.py file.

    Also, two holy city options:
    1. Protestantism founded in the capital.
    2. Protestantism founded in a random city unlikely to be the capital, as in the vanilla game, but which also must have Catholicism.
     
  7. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    One thing I'm looking into making myself is a handful of easy-to-use functions for doing all sorts of text messages in-game, and also for making custom pop-ups (like the one you had in the Reformation modmod). I've managed to get by myself by copying and adapting present code, but it really is a hassle with those long lines of code that pretty much force you to cut them up and spread over several lines. And then there are all those arguments and functions that are nestled into each other - and more parenthesis that you could wave a stick at!

    I don't know if you're interested in helping out with something like this or not, but the scenario maker using the functions would have to be able to do anything that Rhye has done in RFC. Like include a city name based on tile coordinates (and make that work 100% of the time, might I add...), or transplant a Civ name or adjective or what have you (what about a custom unit name?) in the middle of the main text. Making it user friendly is the key, and I'm also not sure if people can be expected to know how to make the XML text strings work. (Even if it is pretty easy! The best scenario might be to give the modder a choice of using variables, XML or simply entering their message into the function itself.)

    Well, its a suggestion anyway. :D
     
  8. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Another idea, as you're dabbling with religions at the moment:

    I'm doing a Russia scenario myself and am not including the Reformation modmod because the Orthodox faith wouldn't be represented - making Russia either Catholic or Protestant by name! ("Christian" sounds more open ended.)

    What about taking the plunge and adding religions, leading into a larger religion modmod? Schisms and reformations would be a part of all this, of course. That way there would be both Judaism and Christianity, as well as Zoroastrianism and whatever. Then there could be these breakaway churches spawning from within the religions. That way we get both Catholicism and Orthodoxy, as well as Protestantism and perhaps Calvinism?

    Another idea would be to have dynamic Rise-and-Fall of religions also. So that a city with several religions would have to make room for new ones. Some religions could be inheritable prone to be discarded with time, but it would still be possible to actively cultivate strange cults in order to maximize the dividends of Free Religion later on. (I'm thinking there still needs to be a cap of a maximum of 7 religions total in a city.)

    I'm not so sure if a Inquisitor unit is called for, even if I realize that would be high on many players wish list. Maybe there could be some other way of... eh... persecuting religions minorities? Like that you may chose a state religion, but what if you could also name the enemies of God? (Theocracy could have this built in - against all non state religions.) That way the influence of that religion would drop drastically, but there could also be negative implications (like instability).

    I just wish I could make something like this happen myself...
     
  9. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    I don't understand the first idea. I always wanted to include Orthodox Christianity in the mod, but never yet got around to expanding it. It would include new schisms and Theocracy persecuting minorities etc. I will certainly think about it.
     
  10. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Oh, that sounds great! :goodjob:

    What didn't you understand? The Rise'n'Fall of religions?
     
  11. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    No, the first post you made on this thread.
     
  12. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Oh, I almost forgot about that one. That's just something I'm gonna work on myself, but I might ask for your kind advice if I get hopelessly stuck...

    Instead of using the CyInterface().addMessage() function, which would look something like this:
    Code:
    CyInterface().addMessage(utils.getHumanID(), True, con.iDuration, (CyTranslator().getText("TXT_KEY_COLLAPSE_CUSTOM", \
        (gc.getPlayer(iCiv).getCivilizationAdjectiveKey(),))), "", 0, "", ColorTypes(con.iRed), -1, -1, True, True)
    ...I could make a more user friendly function for achieving the same thing. Perhaps by using a function along these lines:
    Code:
    custom.addMessage(iCiv, bHuman, szMessage, argsList, iColor)
    This would cover the most basic messages, but there could of course be different functions for different purposes, like one for major events and one that involves specific map tiles (with the arrows and whatnot). Sound effects could also be built into the different types of messages, so that the scenario maker doesn't have to go looking for the right one. I'm also thinking about finding some rule of automatically color coding messages (so if you enter "-1" the function will set the default color for the type of message).

    Then there would be functions for making pop-ups, perhaps even with support for multi-option buttons?

    If you have any input it would be greatly appreciated.
     
  13. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Oh, that would be great.

    sedna17: One other request. How do you want reformation for Independents implemented? I presume they do not get a state religion, so it's easy to feed them to the "reformationOther" function at the foundation of Protestantism.
     
  14. sedna17

    sedna17 Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    1,091
    I like options 2 in both cases. 7-8 turns seems about right. Slow enough to be sort of realistic but fast enough that the new Protestant civs won't all be diplomatically bullied back into Catholicism before they have some religious allies.

    I think that's right that the indys don't get a state religion. I hadn't really thought about them. I guess I'd be okay with just some random chance for a catholic indy city to become protestant. What does the "reformationOther" function do?
     
  15. 3Miro

    3Miro Chieftain

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    I made some changes to the reformation code so me time ago.

    1. Orthodox/Islamic/Jewish/Pagan (as in no State Religion) nations do not get to pick a side in the reformation. The only effect is that Catholic cities have a chance of getting Protestantism in addition to Catholicism.

    2. For Catholic nations that decide to go Protestant, fewer cities would switch and a lot more Catholicism would be left. For nations that say no to the Reformation, more Protestants would appear anyway. At the end, this encourages religious prosecutions.

    A slow growth of Protestantism would be nice to see. I am also thinking of implementing a Counter-Reformation by increasing the Catholic Faith Points gained from prosecutions after Protestantism has been founded.
     
  16. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Here are five replacement Python files to include the changes. Nothing happens in Consts or RiseAndFall any more. Everything happens in Religions and the EventHandler/Manager files.

    The only problem is that the existing religion foundation code favours cities without religion, so Protestantism will tend to be founded in a pagan city. My opinion is that it would be better if it started in a Catholic city. The easiest solution from my perspective would be to attach an amended CvPlayer.cpp file with a new routine for founding Protestantism, because then I would only need to amend existing code rather than translate fast C++ into slow Python.
     
  17. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    If you want to weaken the attraction of non-Catholic cities to founding Protestantism, add the following code to CvPlayer.cpp at line 7647, which should be just after the capital check:

    Code:
    			if ((eReligion == 0) && !(pLoopCity->isHasReligion((ReligionTypes)2)))
    			{
    				iValue /= 10;
    			}
    
    I haven't tested this, so I don't know if it works.
     
  18. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Files updated for RFC:E Alpha 11.
     
  19. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    This is a fully-working version, compatible with Alpha 11. Other versions are seriously flawed compared to this one.
     
  20. sedna17

    sedna17 Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    1,091
    Thanks, it's integrated into the SVN now. I have yet to have time to try a test game that covers the reformation, but I'm looking forward to it.
     

Share This Page