Useful Patches for Civ 3 Conquests v1.22

Well, an interesting thing: I could have simulated retreatable combat. As it turned out, the game stores in save-file current value of a randomizer. So, when I time after time load the game and make an attack (cavalry agains hoplite) it always returns the same random value.

So, I've found one place inside class_Combat_Controller::process_Combat function. It toggles the brakepoint only if I attack with cavarly (or cossack) against some other unit.

Both units in simulation: the cavalry and the hoplite has 2-nd experience level (Index: 1, base hit points: 3, retreat bonus: 50). The cavalry has damage = 1 (so 2 hit points remained). The hoplite has full health.

The breakpoint toggles only after 1-st round complete, when the cavalry loses 1 hit point.

The condition in the following piece of code compares 2 values: random(Hoplite.Retreat_Bonus + 50) and Cavalry.Retreat_Bonus.

Cavalry retreats only if random(Hoplite.Retreat_Bonus + 50) < Cavalry.Retreat_Bonus.

In that simulation random(100) always returns 0x11 = 17. 17 < 50. So the cavalry retreats.

But if I change result of random function to smth greater than 50 (like 51) the cavalry dies in the combat.

Code:
        if ( _this->Attack_Unit->Body.CivID )
        {
          v162 = class_Unit::Get_Default_Hit_Points(_this->Attack_Unit) - _this->Attack_Unit->Body.Damage;
          if ( v162 >= 0 )
          {
            if ( v162 <= 9999 )
            {
              if ( v162 == 1 )
              {
                v163 = class_Unit::Get_Default_Hit_Points(_this->Defence_Unit) - _this->Defence_Unit->Body.Damage;
                if ( v163 >= 0 )
                {
                  if ( v163 > 9999 || v163 > 1 )
                  {
                    if ( class_Random::Get_Random(
                           &Random_1,
                           BIC_Data.CombatExperience[_this->Defence_Unit->Body.Combat_Experience].Retreat_Bonus + 50) < BIC_Data.CombatExperience[_this->Attack_Unit->Body.Combat_Experience].Retreat_Bonus )
                    {
 
Hmm. Strange, I don't see anything related to movement point here. Is there something else later in the function?

It is me or is there a lot of useless code here?

if ( v162 >= 0 )
{
if ( v162 <= 9999 )
{
if ( v162 == 1 )
{
}

Why not use directly if(v162 == 1)? The other tests are useless... Unless there is something else important in this function?
 
The other tests are useless... Unless there is something else important in this function?

No. this conditions doesn't have "else" block.

This is really stange code, and the function itself (too big and too tortuous).
And there is another place with the same conditions and random comparing. I'm trying to find out, what is it related with...
 
No. this conditions doesn't have "else" block.

This is really stange code, and the function itself (too big and too tortuous).
And there is another place with the same conditions and random comparing. I'm trying to find out, what is it related with...

The only thing I can think of...is that maybe they were testing something at one time and then forgot to remove the top 2 if statements.
 
Interesting to see that the code already makes use of both defender and attacker Exp. Lvls for determining if withdraw occurs. Although I am not sure the hardcoded inflexible bonus of +50 to defender is really the way it should be handled.
 
Amazing i didnt know anyone could do this! Im looking forward to more patches. Its time someone made this game work as intended. Anything you can fix i'll take it :D. I have no requests since i know you will tackle the problems 1 by 1. I'll just wait for it thanks a ton!!!
 
Oh yea have you done the submarine bug yet? Its not only submarine stuff. When you create an invisible unit u get the same results. I couldnt even make snipers in my mod :/
 
Oh yea have you done the submarine bug yet? Its not only submarine stuff. When you create an invisible unit u get the same results. I couldnt even make snipers in my mod :/

I made my snipers invisible and didn't encounter too many problems. What happened?
 
Unless i assumed wrong, I had my snipers become available in the modern age. Once the AI started building them, wars started to break out all over the globe. I play on a world map and its kinda messy the way the Ai builds cities when they are cramped up in Europe. Specially along the borders of Germany, Russia, and Asia.

My snipers didnt require any resources so i assumed most of the smaller european nations would build them and send them to their cities all across asia since i made them a defensive unit and invisible.

Unless i was really unlucky, but basically after the AI had the tech to build snipers WW3 followed.
 
Heck yea! If you fix that your name shall forever be in the civ 3 hall of fame. Most annoying bug of my life. I've even had to slaughter my own allies cuz of it :backstab:
 
Unless i assumed wrong, I had my snipers become available in the modern age. Once the AI started building them, wars started to break out all over the globe. I play on a world map and its kinda messy the way the Ai builds cities when they are cramped up in Europe. Specially along the borders of Germany, Russia, and Asia.

My snipers didnt require any resources so i assumed most of the smaller european nations would build them and send them to their cities all across asia since i made them a defensive unit and invisible.

Unless i was really unlucky, but basically after the AI had the tech to build snipers WW3 followed.

Exactly the same happened to me once invisible units got available (in medieval era in my mod). As long as they have both attack and defensive strength, AI builds them like crazy. The only way to avoid AI constantly triggering wars, was to give the invisible units hidden nationality. That has of course the side effect that AI can attack them without declaring war (and they WILL attack them when they are spotted by a unit that detects invisible units).
 
asuming the patch frame work works.

could it be possible to choose the several thins tht are patchedwhen installing the patch?

i mean. some like the removed pollution or the bigger cities but others not. it would be great if there is a way to choose what u want to use in a game.
 
New version of patch, which provides logging of unit actions.
Download

Sources

The following unit actions are logged
-Create
-Delete
-Move
-All AI actions (20 actions, see AI Strategies flags)
-Skip_Turn
-Attack
-Unit_Loses (when attacking unit loses)
-Unit_Wins (when attacking unit wins)

Also the method Set_Unit_State is logged separately. The following unit states are provided:
-Normal
-Fortifying
-Build_Mines
-Irrigate
-Build_Fortress
-Build_Road
-Build_Railroad
-Plant_Forest
-Clean_Forest
-Clear_Jungle
-Clear_Pollution
-Build_Airfield
-Build_Radar_Tower
-Build_Outpost
-Build_Barricade
-Intercept
-Go_To
-Road_To_Tile
-Railroad_To_Tile
-Build_Colony
-Auto_Irrigate
-Build_Trade_Routes
-Auto_Clear_Forest
-Auto_Clear_Swamp
-Auto_Clear_Pollution
-Auto_Save_City_Tiles
-Explore
-State_27
-State_28
-State_29
-State_30
-Auto_Bombard
-Auto_Air_Bombard
-State_33
-State_34
 
Top Bottom