Announcement

Collapse
No announcement yet.

Which file has the combat calculations?

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

  • Which file has the combat calculations?

    Which file has the combat calculations? My ambitious project is to write a little routine that checks which types of units are stacked with the attacker. If any two of (infantry, ranged, or monuted) are togetehr the attacker will get a bonus. If all three are together he will get a bigger bonus. This will encourage a combined arms type strategy. If possible, I'll also check the defender's stack and give him the same bonuses.

    So, can anyone get me started by telling me which file has the combat calculations in it?

    Roger Bacon

  • #2
    Or you could just give them promotions while they are stacked so you dont have to change any combat calc.

    Comment


    • #3
      Kinda like paradox' HOI2, "combined arms" feature that you get when you have inf & tanks in the same stack.



      Actually, i think a "promotion" routine would be the best option. I think Bhruic should have some experience with that - afterall he wrote a few lines that gave promotions to units in forts.


      As for how it should work, i think you should get +5% strength for every different Class_type you have.

      Archer, mounted, melee, gunpowder, armored, helicopter, siege,... except recon, naval and air of course.

      So assuming you have one unit of each class in your stack, that would amount to a total of 35%. Since your not likely to have helo's & armor in the same stack as archers, were looking at a high of 25% at any given time.


      Anyone up for the task?

      Comment


      • #4
        I'm not sure why the "of course" applies to recon - isn't better tactical intelligence worth a bonus?

        Comment


        • #5
          indeed, you are right. Didn't think of that. Perhaps that would give explores more use - never build them anyway.

          Comment


          • #6
            But an archer supporting a tank should not give any extra.
            And a longbow suporting a warrior should give more than a archer for an example. But to start easy the extra 5% is nice.



            A bit more advanced:

            Supporting unit that has at least haft of selected unit in strength and are of another type give +10% (max 1 per type and max 3 alltogether).

            Supporting unit that has less than half streangth of selected unit and are of another type, or have more than half strength and are of same type, +5% (max 3).

            Comment


            • #7
              The only real exploit i can think of is players keeping ARchers & melee units around until the late game to get an additional 5%.

              Perhaps a routine could be written that if a gunpowder unit is in the stack, Melee & archer units will get excluded?

              Comment


              • #8
                To answer the actually question, these calculations are done in engine, so there's no getting at them till at least the SDK release.

                Comment


                • #9
                  There's no getting to them directly, but there are a couple of modders who have reported success writing code that checks every unit on every move and applies temporary promotions if certain conditions are met. I think you could look at the "real forts" mod to see an example? You can do all sorts of hacks this way.

                  Comment

                  Working...
                  X