Announcement

Collapse
No announcement yet.

Weak units defend first?

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

  • Weak units defend first?

    Say I have a Phalanx fortified in my city, and a settler outside working.

    An enemy chariot approaches.

    On my next turn I cancel the settler's work and move him into the city (doh).

    The chariot then attacks my city and kills the settler, leaving the phalanx unharmed.

    WTF?!?!

    That is completely ludicrous.

  • #2
    I have also seen this behavior.
    Say I have a Stealth Bomber resting in a newly-captured city with 3 Mech. Infs.
    An enemy Armor approaches and attacks the city.
    My Stealth Bomber is destroyed.
    Maybe the code that chooses the defending unit compares the wrong values.
    American by birth, smarter than the average tropical fruit by the grace of Me. -me
    I try not to break the rules but merely to test their elasticity. -- Bill Veeck | Don't listed to the Linux Satanist, people. - St. Leo | If patching security holes was the top priority of any of us(no matter the OS), we'd do nothing else. - Me, in a tired and accidental attempt to draw fire from all three sides.
    Posted with Mozilla Firebird running under Sawfish on a Slackware Linux install.:p
    XGalaga.

    Comment


    • #3
      The settler has 20 hit point, compared to the the phalanx's 10, so it is quite possible that it had a better chance of winning, which would be the reason that the code choose it. But it would probably have been smarter anyway if it had chosen the phalanx.

      The stealth bomber thing sounds like a bug; but how many hit points the the mech inf's have left? If they had very few then the choice of defender would at least have made some sense.
      Last edited by Thue; July 8, 2003, 15:09.
      http://www.hardware-wiki.com - A wiki about computers, with focus on Linux support.

      Comment


      • #4
        Well, coming from a background of Civ 1-3 and all the variants, it would definately have been smarter to choose the Phalanx!

        Sheesh, I moved my settler into the city so he would be PROTECTED.

        IMO the code should be changed... settlers are definately weaker and more valuable than phalanxes.

        Comment


        • #5
          Why do you say a settler is a weaker defender than a phalanx? It doesn't seem obvious to me.
          http://www.hardware-wiki.com - A wiki about computers, with focus on Linux support.

          Comment


          • #6
            Settler's and phalanxes have the same defending ability.
            settler=D:1 HP:20
            phalanx=D:2 HP:10
            the settler has half the chance of hitting but lasts twice as long.

            My mech inf's all had full hp.
            American by birth, smarter than the average tropical fruit by the grace of Me. -me
            I try not to break the rules but merely to test their elasticity. -- Bill Veeck | Don't listed to the Linux Satanist, people. - St. Leo | If patching security holes was the top priority of any of us(no matter the OS), we'd do nothing else. - Me, in a tired and accidental attempt to draw fire from all three sides.
            Posted with Mozilla Firebird running under Sawfish on a Slackware Linux install.:p
            XGalaga.

            Comment


            • #7
              The Stealth Bomber is actually a very good defender, though a little costly.

              The usual way of calculating defense worth is (defense power) * (hit points) * (firepower). The sum total for mech inf is 180, for stealth bomber it is 200. Surprised? The stealth bomber has less defense power and hitpoints, but the extra firepower more than makes up for it!

              I remember that once I allowed the AI to build aircraft as city defenders (without regard to build cost), it choose to build stealth bombers. I was like "what the ***", but once I did the numbers, I realized it was not a bug. Later added an adjustment for build cost which made it stop doing that.

              As to the settler vs phalanx: They are weighted the same according to the above calculation, but if the phalanx was fortified, it should have been stronger, and it should have been the defender.

              (Note that the above calculation is not the one actually used to determine defender, but it is a close approximation.)

              Comment


              • #8
                I thought the bonus was for units that were in a city xor fortified. Is it actually a non-exlusive or?
                American by birth, smarter than the average tropical fruit by the grace of Me. -me
                I try not to break the rules but merely to test their elasticity. -- Bill Veeck | Don't listed to the Linux Satanist, people. - St. Leo | If patching security holes was the top priority of any of us(no matter the OS), we'd do nothing else. - Me, in a tired and accidental attempt to draw fire from all three sides.
                Posted with Mozilla Firebird running under Sawfish on a Slackware Linux install.:p
                XGalaga.

                Comment


                • #9
                  Originally posted by geeslaka
                  Settler's and phalanxes have the same defending ability.
                  settler=D:1 HP:20
                  phalanx=D:2 HP:10
                  the settler has half the chance of hitting but lasts twice as long.
                  I am not sure you can conclude that way. At least it requires more arguments, which I am too lazy to make .
                  http://www.hardware-wiki.com - A wiki about computers, with focus on Linux support.

                  Comment


                  • #10
                    You don't get any defense bonus just for being in a city, IIRC. But if you are fortified inside a city, you receive normal fortification bonus. (Note that the 'fortifying' status does not count as 'fortified'. It takes one turn to become fully fortified.)

                    Comment


                    • #11
                      Actually begin in a city is the same as begin fortified which is the same as begin fortified in a city. combat.c:493 :

                      Code:
                        if ((pcity || fortified) && is_ground_unittype(def_type)) {
                          defensepower = (defensepower * 3) / 2;
                        }
                      http://www.hardware-wiki.com - A wiki about computers, with focus on Linux support.

                      Comment


                      • #12
                        Originally posted by Thue, (begin -> being)

                        Actually being in a city is the same as being fortified which is the same as being fortified in a city.
                        I agree based on the snippet of code, but intuitively being fortified in a city should be better than just being in a city.

                        Does anyone know how Civ I or II handled this? I would always fortify my defense troops in their cities...

                        Comment


                        • #13
                          I can't believe some of you are arguing that the settler "is as good a defender as the phalanx, so who cares if it defends first".

                          Perhaps it is as good as a defender. But its more expensive, costs one population point, and I built it to construct roads and irrigation, not to defend my city!!!

                          That is why the Phalanx (a military unit) was fortified in my city, and the Settler (a group of civilians) was merely seeking cover.

                          Comment


                          • #14
                            To me it seems like the best thing to do is to check all units on the space and defend with the one with the lowest cost to defense ratio.
                            A unit that has a cost of 50 and a defense rating of 80 would be chosen before a unit with a cost of 70 and a defense rating of 80.

                            Something tells me there is something slightly wrong with this ut I can't figure out what.
                            American by birth, smarter than the average tropical fruit by the grace of Me. -me
                            I try not to break the rules but merely to test their elasticity. -- Bill Veeck | Don't listed to the Linux Satanist, people. - St. Leo | If patching security holes was the top priority of any of us(no matter the OS), we'd do nothing else. - Me, in a tired and accidental attempt to draw fire from all three sides.
                            Posted with Mozilla Firebird running under Sawfish on a Slackware Linux install.:p
                            XGalaga.

                            Comment


                            • #15
                              I have noticed this too. I had one phalanx in a city, and I just rush bought another. The phalanx which I rush bough died, and the fortified one remained alive, albeit at half strength.

                              Comment

                              Working...
                              X