Announcement

Collapse
No announcement yet.

Mod barbarians to give >10XP and GG-points

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mod barbarians to give >10XP and GG-points

    Does anyone know where I can edit the Barbarians so that they'll give >10XP and provide GG-points? Or is it hardcoded?

  • #2
    You realize this will probably help the AI much more than you?

    Wodan

    Comment


    • #3
      It's fairly simple to mod the max XP level. It's in /assets/xml/globaldefines.xml towards the bottom. Search for:
      BARBARIAN_MAX_XP_VALUE
      and change the next number from 10 to something bigger. If you change it to 1000 you'll be quite safe.

      Indeed it will help the AI somewhat, though I think it'll help the human player more; the AI isn't going to take its most powerful unit and go after a barbarian with it just for the free XP. (That's why the limit is there, to prevent us from just racking up the XP on barbarians, particularly in MP where this was in Civ3 a problem.)

      I'm fairly sure the GG stuff is in python; i'll hunt around a bit for it. I remember when I was testing Genghis that some of the GG stuff was in there, as it was somewhat different. If nothing else you could manually write a python trigger that worked out to
      ON_BARBARIAN_KILLED -> GIVE_GG_POINTS
      but I think it might be there already (the opposite of it, essentially).
      <Reverend> IRC is just multiplayer notepad.
      I like your SNOOPY POSTER! - While you Wait quote.

      Comment


      • #4
        Hmm, it's not directly in python ... here's where it's defined in the code:

        Code:
        if (isDead() || pDefender->isDead())
        				{
        					if (isDead())
        					{
        						iExperience = defenseXPValue();
        						iExperience = ((iExperience * iAttackerStrength) / iDefenderStrength);
        						iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
        						pDefender->changeExperience(iExperience, maxXPValue(), !isBarbarian(), pPlot->getOwnerINLINE() == pDefender->getOwnerINLINE());
        					}
        					else
        					{
        						iExperience = pDefender->attackXPValue();
        						iExperience = ((iExperience * iDefenderStrength) / iAttackerStrength);
        						iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
        						changeExperience(iExperience, pDefender->maxXPValue(), !pDefender->isBarbarian(), pPlot->getOwnerINLINE() == getOwnerINLINE());
        					}
        
        					break;
        				}
        The !pDefender->isBarbarian() returns FALSE if it's a barbarian and TRUE if it's not; this determines if XP is given to the GG or not.

        If you were to change the !pDefender->isBarbarian (and the !isBarbarian) to TRUE or 1 or whatever, it would always give GG experience. This is separate from the max XP issue which is easier to fix in the XML. As a side note, it looks like setting the max XP to -1 will make it maxint automatically, according to setExperience() later on.

        The changeExperience is exposed to python:
        Code:
         CyUnit::changeExperience(int iChange, int iMax, bool bFromCombat, bool bInBorders)
        This gives a unit experience iChange, up to a maximum xp level iMax, and applies that to the GG experience if bFromCombat is true, and applies the Great Wall bonus if bInBorders is true (or any other Border related bonus to GG points).

        More directly, you have:
        Code:
        void CyPlayer::changeCombatExperience(int iChange)
        void CyPlayer::setCombatExperience(int iExperience)
        The first adds (or subtracts!) GG experience points by amount iChange (but does not affect a particular unit); the latter sets the XP to a particular level. This is used extensively in the Genghis Khan mod in Warlords if you want to see some examples of how it's used, just search for it in the events file in that mod's python folder.
        <Reverend> IRC is just multiplayer notepad.
        I like your SNOOPY POSTER! - While you Wait quote.

        Comment


        • #5
          Originally posted by snoopy369
          Indeed it will help the AI somewhat, though I think it'll help the human player more; the AI isn't going to take its most powerful unit and go after a barbarian with it just for the free XP. (That's why the limit is there, to prevent us from just racking up the XP on barbarians, particularly in MP where this was in Civ3 a problem.)
          I wasn't thinking of that so much as the general accumulation of XP across the board. The AI gets a combat bonus against the barbs, last I looked, a much bigger one than humans. So, sending barbs against them to a large extent simply feeds them XP.

          As it stands now, you can definitely see when you go to attack the AI during your first war, that a good number of units are sitting pretty with just 1 or 2 promotins. Now, imagine how your Combat2 Swordsmen will fare if they have to face axes and fortified archer each with 3-4 promotions. It will have significance, definitely.

          Now, to be true, the human can "milk" barbs for XP a lot better than the AI. OTOH, the human does fast and intelligent city expansion and tends to eliminate available fog quickly. But, certainly, if your goal is to leave some fog out there for XP milking (heck you could do this the whole friggin' game!!) you could do so. Some little peninsula of desert or something would be ideal.

          Honestly, the whole milking mechanic just seems to be a lot of micromanagement. Look at it this way: the 10XP cap is to prevent you from going insane from minutae, not so much some game balance thing.

          As for GGs, the AI having an early GG may prove a big surprise when he goes whomping through your lands. Other than that, the AI usually pisses away their GGs... they put them into combat with the primary goal of winning battles, not with the primary goal of intelligently using the GG and preserving it to live and fight another day.

          Wodan

          Comment


          • #6
            Fairly simple, says Snoopy369! Then he fills my screen with barely comprensible code.
            No matter where you go, there you are. - Buckaroo Banzai
            "I played it [Civilization] for three months and then realised I hadn't done any work. In the end, I had to delete all the saved files and smash the CD." Iain Banks, author

            Comment


            • #7
              The >10xp from barbs is fairly simple, one text change. The rest is rather harder.
              <Reverend> IRC is just multiplayer notepad.
              I like your SNOOPY POSTER! - While you Wait quote.

              Comment


              • #8
                Originally posted by Blaupanzer
                Fairly simple, says Snoopy369! Then he fills my screen with barely comprensible code.
                alternatively you could say "Thankyou"

                Comment


                • #9
                  I say thank you Great! It's not for milking I want this, but the fact that fighting barbarians is simply just an other battle. And it's a bit frustrating that you fight a lot of barbarians off your land (e.g. when you are close to a lot of tundra/ ice) and gain almost nothing from it compared to all the military units you must build.

                  Comment

                  Working...
                  X