Announcement

Collapse
No announcement yet.

Getting Civs to Surrender

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

  • #16
    yes it is a ctp thread and yes you are not dreaming. it just happens wen two members find them selves on line at the same time.

    Any more problems and my and locutos or somebody will be fighting to help you like me and locutos did. not twenty minutes ago
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

    Comment


    • #17
      Oops, my bad. When you use non-standard notational conventions, I guess you should explain them. I read somewhere that the standard convention for capitals, eg "TMP_PLAYER", is that they should stand for constants. But I've been using them for global variables so that I can see at a glance when a variable is a global.


      BTW, what does MilitaryRank return? A value between 1 and 100 or something?

      Yup, as I recall it was described someplace in CTP1 as returning a "normalized rank": the top player gets 100 and everyone else gets a "percentage" (or something like that). There was a bunch of these in CTP1; I seem to recall coming across them originally in some document you did. The others that are still usable are CitiesRank, PopulationRank, KnowledgeRank, GoldRank, and TradeRank.


      There's no real bugs in it but IMO the handler doesn't trigger soon enough. I only tried it once in a proper game and by the time it triggered it was clear that any remaining Yamato resistence was totally futile. Maybe the numbers just need tweaking or maybe it needs keying on the number of military units that the two players have. Something like this might work better:

      Code:
      if( MilitaryRank(player[0])>MilitaryRank(player[1]) && player[0].militaryunits >2* player[1].militaryunits ) {

      BTW, Wombat, the article that contains the quote I posted in the 'Who Should Design Civ4 ?' thread is called "The Poor Get Richer: The Ancient Art of Game Balance <http://www.gamespy.com/devcorner/april01/reynolds/>" . Sometimes I wonder about Civ3 players: there they were going on about Brian Reynolds, and I give them this quality quote (especially if you think about it in relation to Civ3), identifying the author only as "a guy who used to post on these forums". And nobody bit! Or was it too obvious?

      Comment


      • #18
        Originally posted by Peter Triggs
        Oops, my bad. When you use non-standard notational conventions, I guess you should explain them. I read somewhere that the standard convention for capitals, eg "TMP_PLAYER", is that they should stand for constants. But I've been using them for global variables so that I can see at a glance when a variable is a global.
        "You read somewhere"?! I always took you for an experienced programmer! But an experienced programmer saying such a thing is like a doctor saying "I read somewhere CPR can save lives" What *is* your pre-CtP programming background exactly, if I may be so bold to ask?

        Yup, as I recall it was described someplace in CTP1 as returning a "normalized rank": the top player gets 100 and everyone else gets a "percentage" (or something like that). There was a bunch of these in CTP1; I seem to recall coming across them originally in some document you did. The others that are still usable are CitiesRank, PopulationRank, KnowledgeRank, GoldRank, and TradeRank.
        Yeah, I know about those functions (is there any function I don't know about? ), but I had no idea what they returned. I figured it would return 1 for the best player, 2 for the second player, etc. I always thought those were pretty useless functions but that changes things a bit (esp. when working with AI decision making)...
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #19
          I told you ages ago, Wouter, I'm not a professional programmer. My background is in logic, philosophy and, to a lesser extent, mathematics. But I did do some BASIC programming for my own use ages ago and SLIC has given me an opportunity to get back into it. So really I'm just an enthusiastic amateur.

          Comment


          • #20
            Yes, I vaguely seem to recall that now. The quality of your code must have confused me or something...

            But yes, you are right of course, if you'll check my MedMod code you'll see that the names of all the constants (or rather, the variables that don't change value, not quite the same) are in capitals. I always indicate global variables (or at least I have started to do so recently) by giving them a mod-specifc prefix (MM2_, PBEM_, etc). Helps with mod-compatibility too
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #21
              Originally posted by Peter Triggs
              BTW, Wombat, the article that contains the quote I posted in the 'Who Should Design Civ4 ?' thread is called "The Poor Get Richer: The Ancient Art of Game Balance <http://www.gamespy.com/devcorner/april01/reynolds/>" . Sometimes I wonder about Civ3 players: there they were going on about Brian Reynolds, and I give them this quality quote (especially if you think about it in relation to Civ3), identifying the author only as "a guy who used to post on these forums". And nobody bit! Or was it too obvious?
              I guess the crowd who were lpping up every review before the game are different to the ones still there. Or else they're all stupid.
              Concrete, Abstract, or Squoingy?
              "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

              Comment


              • #22
                I was looking at your code last night when i saw this bit
                int_f SwapCity (city_t swCity, int_t swPlayer, int_t killUnits)
                {
                int_t i;
                int_t tmpPlayer;
                int_t numUnits;
                unit_t tmpUnit;
                city_t tmpCity;
                location_t tmpLoc;

                tmpCity = swCity;

                if (CityIsValid(tmpCity)) {
                tmpPlayer = swPlayer;
                tmpLoc = tmpCity.location;
                numUnits = GetUnitsAtLocation(tmpLoc);
                if (killUnits == 1) {
                for (i = 0; i < numUnits; i = i + 1) { // Kill all units
                GetUnitFromCell(tmpLoc, i, tmpUnit);
                Event: DisbandUnit(tmpUnit);
                }
                }
                Event:GiveCity(tmpCity, tmpPlayer);
                }
                else {
                return -1;// Can't swap due to invalid city
                }
                }
                i did not know you could do this. I used the code in my exchange city code and it looks cool now.
                "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                The BIG MC making ctp2 a much unsafer place.
                Visit the big mc’s website

                Comment

                Working...
                X