My Map Just Starts And Says I Lost

Have modding questions or discovered something new? Post here.
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: My Map Just Starts And Says I Lost

Post by TommyCD1 »

I mean you cannot copy specific parts of a map. You have to copy all of it or nothing. The best you can do is make a copy of the entire mission itself (the .x archive) and then delete what you don't what. That is: any extra .cfg files that may be inside that aren't game.cfg objects.cfg or types.cfg. Or any other such files that remain. game.cfg and objects.cfg can of course be edited within the studio.

Likewise, you can also choose to copy over only specific files from a mission you want.
  • game.cfg - Contains information about lighting, teams, and map size.
  • objects.cfg - Contains information about all props and actors that exist by default. This includes script actors, such as regions or objectives.
  • terrain.blk - Contains information about the geography of the map. Basically the ground itself and any textures or paint on it.
  • types.cfg - Tells the game which specific files to load into memory when playing this map. This file isn't usually required, unless you have custom props that aren't included by default for the world.
Note that if you choose to borrow game.cfg or terrain.blk, then the map you are copying to MUST be the exact same in size. If they do not match, then the map will become unplayable.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: My Map Just Starts And Says I Lost

Post by {RaheeXF} »

Thanks a ton. But I wanted to actually know, how the default multiplayer map looks very beautiful? How did the developers do it? Did they copy half of the map and then paste it on the other half or something else? The official multiplayer maps looks very realistic and cool. I hope you understand. Thank you
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: My Map Just Starts And Says I Lost

Post by TommyCD1 »

They most likely had a dedicated map artist create a heightmap and then imoprted it. From there they would have to have another or the same artist paint the map and furnish it themself. Remember that the developers had an entire team to work on the game, and they could hire or employ specific people who's talent was doing this stuff and who had lots of experience.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: My Map Just Starts And Says I Lost

Post by {RaheeXF} »

So you are saying that, they just created a height map image using a painting software and then imported it? Done? I am not an artist so, I guess I can't make great designs of maps. But I will try my best. Thank you for the information. Also, David (TheTech) just fixed my lag, now I can play with unlimited units and buildings. Yesterday, (8 * 200) = 1600 troops were recruited and the game had no lag, that's very interesting. David just gave me some files of dgVoodoo and the lag just died forever. But sometimes, I get 1 second of lag, I guess it's the lag of the network? Okay, whatever, thanks.

Edit: I just realized, that the game still lags.

Edit 2: After using the FPS booster mod, the game doesn't lag anymore! Even with 2000 troops! Thanks to David.

:W :GAME: <:-P
Last edited by {RaheeXF} on Mon Jun 13, 2022 8:22 am, edited 1 time in total.
*RaheeXF*
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: My Map Just Starts And Says I Lost

Post by {RaheeXF} »

Bro, I modified the Advanced-Air AI and now it is just making troops but not attacking! The AIs has ton of units but it is not attacking. Please, help me. Also, is there any document which teaches you about the AI parameters and everything? Please let me know. Thank you.
Attachments
SE2.rar
The AI (X File)
(3.06 KiB) Downloaded 55 times
SE2.rar
The AI (X File)
(3.06 KiB) Downloaded 55 times
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: My Map Just Starts And Says I Lost

Post by TommyCD1 »

This is just the Advanved-Air AI. No changes have been made to it whatsoever.

If your AI isn't attacking, what I can recommend is trying a higher %.dangerRatio variable. For example, the default.x AI uses 0.5 and 0.3, which basically means the AI interprets their unit's effectiveness at half or one third of it's true power. Usually, the higher the dangerRatio, the more willing the AI is to put that squad into danger. If you don't care if the unit survivors then you can just set the dangerRatio to something very high like 9999.0 and the units will always head into battle regardless of their effectiveness. Also keep in mind that a squads effectiveness will always stem directly from the units that make up that squad. So for example a squad of ten tanks with a dangerRatio of 0.3 will always be more willing to move into battle than a squad of ten grunts with a dangerRatio of 0.5.

Lastly, no there isn't any such document that explains exact AI settings, paraments, and functions and whatnot. Most if not all of my own knowledge simply comes from tweaking individual parameters one at a time and seeing what change is seen ingame. The best I can offer is the Dark Reign 2 technical reference manual, but even that seems to be either partially incomplete, or based on an earlier build of the Zero engine that not even Dark Reign 2 uses.
And no, such a reference manual for Army Men RTS specifically would take hours if not days, if not weeks to write, and even then would still be incomplete without helpful materials such as source code, or dev documents like Dark Reign 2 has. And I have my own projects and life to occupy my time, so I am not going to drop everything to write such a document at this time. So don't even ask. At best I can try to answer individual questions if I happen to know a concrete answer to them.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: My Map Just Starts And Says I Lost

Post by {RaheeXF} »

What do you mean by "no changes have made"? I have changed the ordered units and the base steps, please take a deeper look. Also, thanks a lot for the information and you don't have to write a whole documentation for the AI parameters, I will figure it out myself. Thanks.
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: My Map Just Starts And Says I Lost

Post by TommyCD1 »

I mean it is completely identical. Maybe you have uploaded the wrong file?
se2.png
se2_content.png
  • Files from your post
    • mod.cfg

      Code: Select all

      ///////////////////////////////////////////////////////////////////////////////
      //
      // Pandemic Studios
      //
      // AI Personality Configuration
      //
      
      // Is this personality available for random selection
      Random(1);
      
      // Add files to the AI configuration stream
      Files("AI")
      {
        Add("personality_adv_air_scripts.cfg");
        Add("personality_adv_air_placement.cfg");
        Add("personality_adv_air_orderers_units.cfg");
        Add("personality_adv_air_orderers_buildings.cfg");
        Add("personality_adv_air_bases.cfg");
      }
      
      StartActionAll()
      {
        // Create the base
        AddBase("base", "personality.adv-air.army");
      
        // Add all units currently on the team
        AssignBaseConstructors("base");
        AssignBaseUnits("base");
      
        // Start up the scripts
        ExecuteScript("offense.sarge", "personality.adv-air.offense.sarge")
        {
          Op("%.danger", "=", 0.57);
          Op("%.types", "=", "personality.adv-air.recruit.sarge");
          Op("%.base", "=", "base");
          Op("%.tag", "=", "personality.adv-air.tags.sarge");
        }
        ExecuteScript("offense.land1", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.25);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land2", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.5);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land3", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.75);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land4", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 1.0);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air1", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.25);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air2", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.5);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air3", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.75);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air4", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 1.0);
          Op("%.base", "=", "base");
        }
      
        ExecuteScript("defense.land", "personality.adv-air.defense.land")
        {
          Op("%.base", "=", "base");
        }
        ExecuteScript("defense.medic", "personality.adv-air.defense.medic")
        {
          Op("%.base", "=", "base");
          Op("%.tag", "=", "personality.adv-air.tags.sarge");
        }
      }
      
    • personality_*_bases.cfg

      Code: Select all

      ///////////////////////////////////////////////////////////////////////////////
      //
      // Pandemic Studios
      //
      // AI Personality Configuration (Bases)
      //
      
      Strategic()
      {
        CreateBase("personality.adv-air.army")
        {
          InitialState("initial");
      
          State("initial")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage1", 800, 50, 0);
      
              Add("personality.adv-air.offense.infantry2", 1, 60, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 55, 0);
              Add("personality.adv-air.garage3", 400, 65, 0);
            }
            Satisfied("hq2");
          }
      
          State("hq2")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              Add("personality.adv-air.dumptruck2", 450, 65, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense and upgrade
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage2", 1600, 55, 0);
      
              Add("personality.adv-air.offense.infantry1", 1, 55, 0);
              Add("personality.adv-air.offense.infantry2", 1, 55, 0);
              Add("personality.adv-air.offense.infantry3", 1, 55, 0);
              Add("personality.adv-air.offense.infantry4", 1, 55, 0);
              // start cranking out some defensive vehicles
              Add("personality.adv-air.defense.vehicles", 1, 60, 0);
              // vehicles are used in attacks too, y'know!
              Add("personality.adv-air.offense.air1", 1, 65, 0);
              Add("personality.adv-air.offense.air2", 1, 65, 0);
              Add("personality.adv-air.offense.air3", 1, 65, 0);
              Add("personality.adv-air.offense.air4", 1, 65, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 60, 0);
              Add("personality.adv-air.garage4", 800, 60, 0);
      
              // and the final touches...
              Add("personality.adv-air.baserepair", 100, 55, 0);
              Add("personality.adv-air.aagun.front", 150, 65, 0);
              Add("personality.adv-air.aagun.left", 150, 65, 0);
              Add("personality.adv-air.aagun.right", 150, 65, 0);
            }
            Satisfied("hq3");
          }
      
          State("hq3")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              Add("personality.adv-air.dumptruck2", 450, 65, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense and upgrade
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage2", 1600, 55, 0);
      
              Add("personality.adv-air.offense.infantry1", 1, 55, 0);
              Add("personality.adv-air.offense.infantry2", 1, 55, 0);
              Add("personality.adv-air.offense.infantry3", 1, 55, 0);
              Add("personality.adv-air.offense.infantry4", 1, 55, 0);
              // vehicles are used in attacks too, y'know!
              Add("personality.adv-air.offense.air1", 1, 65, 0);
              Add("personality.adv-air.offense.air2", 1, 65, 0);
              Add("personality.adv-air.offense.air3", 1, 65, 0);
              Add("personality.adv-air.offense.air4", 1, 65, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 60, 0);
              Add("personality.adv-air.garage5", 1600, 60, 0);
      
              // upgrade the garage and start reaching out for resource
              Add("personality.adv-air.resourcedepot.roaming", 700, 90, 0);
              // and the final touches...
              Add("personality.adv-air.baserepair", 100, 60, 0);
              Add("personality.adv-air.aagun.front2", 300, 65, 0);
              Add("personality.adv-air.aagun.left", 150, 65, 0);
              Add("personality.adv-air.aagun.right", 150, 65, 0);
            }
          }
        }
      }
      
    • Excerpt from personality_*_scripts.cfg

      Code: Select all

        // Air offense script
        CreateScript("personality.adv-air.offense.air")
        {
          InitialState("Wait");
      
          CreateVarFloat("%.danger", 0.2);
          CreateVarInteger("%.cluster.target");
          CreateVarString("%.base");
      
          State("Wait")
          {
            Conditions()
            {
              Condition("Count")
              {
                Amount(2);
                Operator(">=");
                Transition()
                {
                  GoToState("Find1");
                }
              }
            }
          }
      
          State("Find1")
          {
            Action("ApplyRule")
            {
              Rule("FindUndefendedCluster");
              Var("%.cluster.target");
              DangerRatio("%.danger");
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find2");
              }
            }
          }
      
          State("Find2")
          {
            Action("ApplyRule")
            {
              Rule("FindProtectBase");
              ArmourClass("structure");
              Var("%.cluster.target");
              Base("%.base");
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find3");
              }
            }
          }
      
          State("Find3")
          {
            Action("ApplyRule")
            {
              Rule("FindShelteredCluster");
              Var("%.cluster.target");
              MaxDistance(4992);
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find1");
              }
            }
          }
      
          State("Move")
          {
            Action("Move")
            {
              Attack(1);
              Location()
              {
                Base("VarCluster", "%.cluster.target");
              }
            }
            Conditions()
            {
              Condition("Count")
              {
                Amount(4);
                Operator("<");
                Transition()
                {
                  GoToState("Wait");
                }
              }
              Condition("ObjectiveCondition")
              {
                Condition("Timer")
                {
                  Time(30);
                }
                Transition()
                {
                  GoToState("Find1");
                }
              }
              Status("Completed")
              {
                GoToState("Find1");
              }
            }
          }
        }
  • Files from Advanced-Air.x
    • mod.cfg

      Code: Select all

      ///////////////////////////////////////////////////////////////////////////////
      //
      // Pandemic Studios
      //
      // AI Personality Configuration
      //
      
      // Is this personality available for random selection
      Random(1);
      
      // Add files to the AI configuration stream
      Files("AI")
      {
        Add("personality_adv_air_scripts.cfg");
        Add("personality_adv_air_placement.cfg");
        Add("personality_adv_air_orderers_units.cfg");
        Add("personality_adv_air_orderers_buildings.cfg");
        Add("personality_adv_air_bases.cfg");
      }
      
      StartActionAll()
      {
        // Create the base
        AddBase("base", "personality.adv-air.army");
      
        // Add all units currently on the team
        AssignBaseConstructors("base");
        AssignBaseUnits("base");
      
        // Start up the scripts
        ExecuteScript("offense.sarge", "personality.adv-air.offense.sarge")
        {
          Op("%.danger", "=", 0.57);
          Op("%.types", "=", "personality.adv-air.recruit.sarge");
          Op("%.base", "=", "base");
          Op("%.tag", "=", "personality.adv-air.tags.sarge");
        }
        ExecuteScript("offense.land1", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.25);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land2", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.5);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land3", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 0.75);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.land4", "personality.adv-air.offense.land")
        {
          Op("%.danger", "=", 1.0);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air1", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.25);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air2", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.5);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air3", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 0.75);
          Op("%.base", "=", "base");
        }
        ExecuteScript("offense.air4", "personality.adv-air.offense.air")
        {
          Op("%.danger", "=", 1.0);
          Op("%.base", "=", "base");
        }
      
        ExecuteScript("defense.land", "personality.adv-air.defense.land")
        {
          Op("%.base", "=", "base");
        }
        ExecuteScript("defense.medic", "personality.adv-air.defense.medic")
        {
          Op("%.base", "=", "base");
          Op("%.tag", "=", "personality.adv-air.tags.sarge");
        }
      }
      
    • personality_*_bases.cfg

      Code: Select all

      ///////////////////////////////////////////////////////////////////////////////
      //
      // Pandemic Studios
      //
      // AI Personality Configuration (Bases)
      //
      
      Strategic()
      {
        CreateBase("personality.adv-air.army")
        {
          InitialState("initial");
      
          State("initial")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage1", 800, 50, 0);
      
              Add("personality.adv-air.offense.infantry2", 1, 60, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 55, 0);
              Add("personality.adv-air.garage3", 400, 65, 0);
            }
            Satisfied("hq2");
          }
      
          State("hq2")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              Add("personality.adv-air.dumptruck2", 450, 65, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense and upgrade
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage2", 1600, 55, 0);
      
              Add("personality.adv-air.offense.infantry1", 1, 55, 0);
              Add("personality.adv-air.offense.infantry2", 1, 55, 0);
              Add("personality.adv-air.offense.infantry3", 1, 55, 0);
              Add("personality.adv-air.offense.infantry4", 1, 55, 0);
              // start cranking out some defensive vehicles
              Add("personality.adv-air.defense.vehicles", 1, 60, 0);
              // vehicles are used in attacks too, y'know!
              Add("personality.adv-air.offense.air1", 1, 65, 0);
              Add("personality.adv-air.offense.air2", 1, 65, 0);
              Add("personality.adv-air.offense.air3", 1, 65, 0);
              Add("personality.adv-air.offense.air4", 1, 65, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 60, 0);
              Add("personality.adv-air.garage4", 800, 60, 0);
      
              // and the final touches...
              Add("personality.adv-air.baserepair", 100, 55, 0);
              Add("personality.adv-air.aagun.front", 150, 65, 0);
              Add("personality.adv-air.aagun.left", 150, 65, 0);
              Add("personality.adv-air.aagun.right", 150, 65, 0);
            }
            Satisfied("hq3");
          }
      
          State("hq3")
          {
            Orderers()
            {
      
      // resource, priority,
              // Bulldozer
              Add("personality.adv-air.bulldozer", 200, 10, 0);
              // Then build an HQ...
              Add("personality.adv-air.hq1", 400, 20, 0);
              // ...and a resource depot
              Add("personality.adv-air.resourcedepot.permanent", 500, 30, 0);
              Add("personality.adv-air.resourcedepot.permanent.far", 900, 60, 0);
              Add("personality.adv-air.dumptruck1", 450, 30, 0);
              Add("personality.adv-air.dumptruck2", 450, 65, 0);
              // ...and a barracks.
              Add("personality.adv-air.barracks", 300, 40, 0);
      
              // now, get some rudimentary base defense and upgrade
              Add("personality.adv-air.hq2", 400, 55, 0);
              // build a garage
              Add("personality.adv-air.garage2", 1600, 55, 0);
      
              Add("personality.adv-air.offense.infantry1", 1, 55, 0);
              Add("personality.adv-air.offense.infantry2", 1, 55, 0);
              Add("personality.adv-air.offense.infantry3", 1, 55, 0);
              Add("personality.adv-air.offense.infantry4", 1, 55, 0);
              // vehicles are used in attacks too, y'know!
              Add("personality.adv-air.offense.air1", 1, 65, 0);
              Add("personality.adv-air.offense.air2", 1, 65, 0);
              Add("personality.adv-air.offense.air3", 1, 65, 0);
              Add("personality.adv-air.offense.air4", 1, 65, 0);
      
               // upgrade
              Add("personality.adv-air.hq3", 600, 60, 0);
              Add("personality.adv-air.garage5", 1600, 60, 0);
      
              // upgrade the garage and start reaching out for resource
              Add("personality.adv-air.resourcedepot.roaming", 700, 90, 0);
              // and the final touches...
              Add("personality.adv-air.baserepair", 100, 60, 0);
              Add("personality.adv-air.aagun.front2", 300, 65, 0);
              Add("personality.adv-air.aagun.left", 150, 65, 0);
              Add("personality.adv-air.aagun.right", 150, 65, 0);
            }
          }
        }
      }
      
    • Excerpt from personality_*_scripts.cfg

      Code: Select all

        // Air offense script
        CreateScript("personality.adv-air.offense.air")
        {
          InitialState("Wait");
      
          CreateVarFloat("%.danger", 0.2);
          CreateVarInteger("%.cluster.target");
          CreateVarString("%.base");
      
          State("Wait")
          {
            Conditions()
            {
              Condition("Count")
              {
                Amount(2);
                Operator(">=");
                Transition()
                {
                  GoToState("Find1");
                }
              }
            }
          }
      
          State("Find1")
          {
            Action("ApplyRule")
            {
              Rule("FindUndefendedCluster");
              Var("%.cluster.target");
              DangerRatio("%.danger");
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find2");
              }
            }
          }
      
          State("Find2")
          {
            Action("ApplyRule")
            {
              Rule("FindProtectBase");
              ArmourClass("structure");
              Var("%.cluster.target");
              Base("%.base");
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find3");
              }
            }
          }
      
          State("Find3")
          {
            Action("ApplyRule")
            {
              Rule("FindShelteredCluster");
              Var("%.cluster.target");
              MaxDistance(4992);
            }
            Conditions()
            {
              Status("Completed")
              {
                GoToState("Move");
              }
              Status("Failed")
              {
                GoToState("Find1");
              }
            }
          }
      
          State("Move")
          {
            Action("Move")
            {
              Attack(1);
              Location()
              {
                Base("VarCluster", "%.cluster.target");
              }
            }
            Conditions()
            {
              Condition("Count")
              {
                Amount(4);
                Operator("<");
                Transition()
                {
                  GoToState("Wait");
                }
              }
              Condition("ObjectiveCondition")
              {
                Condition("Timer")
                {
                  Time(30);
                }
                Transition()
                {
                  GoToState("Find1");
                }
              }
              Status("Completed")
              {
                GoToState("Find1");
              }
            }
          }
        }
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: My Map Just Starts And Says I Lost

Post by {RaheeXF} »

Hey Tommy CD 1!

I just fu**ing realized that, I really uploaded the wrong file. Sorry mate.
Here you go. By the way, I edited the danger ratio and it works but not perfectly.
Take a look, please.

Thanks.
Regards,
Your Stupid Student
Md. Rahee
Attachments
AA3.rar
The AI (Advanced-Air AI Edited)
(3.05 KiB) Downloaded 55 times
AA3.rar
The AI (Advanced-Air AI Edited)
(3.05 KiB) Downloaded 55 times
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: AI questions

Post by TommyCD1 »

Several things I can see that may cause issues.
  • %.dangerRatio is extremely low. Squads won't move out until they've amassed a significant number of units, which can be problematic with unit limits in place.

    Code: Select all

      ExecuteScript("offense.land1", "personality.adv-air.offense.land")
      {
        Op("%.danger", "=", 0.1);
        Op("%.base", "=", "base");
      }
      ExecuteScript("offense.land2", "personality.adv-air.offense.land")
      {
        Op("%.danger", "=", 0.1);
        Op("%.base", "=", "base");
      }
      ExecuteScript("offense.land3", "personality.adv-air.offense.land")
      {
        Op("%.danger", "=", 0.1);
        Op("%.base", "=", "base");
      }
      ExecuteScript("offense.land4", "personality.adv-air.offense.land")
      {
        Op("%.danger", "=", 0.1);
        Op("%.base", "=", "base");
      }
    Original code has %.dangerRatio values of 0.25, 0.5, 0.75, and 1.0. You have set all of yours to 0.1. 0.1 is not greater than any of the other values. Remember that the higher the %.dangerRatio value, the more willing a squad is to venture forth into danger.
  • Your initial base state doesn't have a resource depot. If you are playing on a map that does not have unlimited resources, your AI will not be able to build much besides an HQ and some Barracks.

    Code: Select all

        State("initial")
        {
          Orderers()
          {
    
    // resource, priority,
            // Bulldozer
            Add("personality.adv-air.bulldozer", 200, 10, 0);
            // Then build an HQ...
            Add("personality.adv-air.hq1", 400, 20, 0);
            // ...and a barracks.
            Add("personality.adv-air.barracks", 300, 40, 0);
    
            // now, get some rudimentary base defense
            Add("personality.adv-air.hq2", 400, 55, 0);
            // build a garage
            Add("personality.adv-air.garage1", 800, 50, 0);
    
            Add("personality.adv-air.offense.infantry2", 1, 60, 0);
    
             // upgrade
            Add("personality.adv-air.hq3", 600, 55, 0);
            Add("personality.adv-air.garage3", 400, 65, 0);
          }
          Satisfied("hq2");
        }
  • You have several instances of facilities within multiple Orderes using the "BaseLevel" manifest. These will conflict with each other, as BaseLevel only maintanes the given number of units/buildings across the entire AI, and not just the orderer. So for example, if you have two BaseLevel manifests, one with 3 barracks1 and one with 4 barracks1, instead of building 7 barracks1's it will only create a total of 4, since it will only try to maintain the highest value. If you want multiple facilites in multiple orderes, try using the "OrdererLevel" or "Direct" manifests instead.

    Code: Select all

      CreateBase::Orderer("personality.adv-air.garage1")
      {
        ReserveMinimum(400);
        ReserveMaximum(800);
        Manifest("BaseLevel")
        {
          Placement("personality.adv-air.garage");
          Types()
          {
            Add("army.building.garage1", 2);
            Add("army.building.barracks1", 2);
          }
        }
      }
  • Your unit orderers are extremely populated while using the "Ratio" manifest. This is okay for large armies, but be aware that it is EXTREMELY expensive on the computer player's resources and can also create a large gap of time before the base's state becomes "satisfied".

    Code: Select all

      // Offense vehicles
      CreateBase::Orderer("personality.adv-air.offense.air4")
      {
        Manifest("Ratio")
        {
          Script("offense.air4");
          Types()
          {
            Add("army.unit.chopper", 2);
            Add("army.unit.tank", 2);
            Add("army.unit.dumdum", 2);
            Add("army.unit.sniper", 2);
            Add("army.unit.bazooka", 2);
            Add("army.unit.machinegunner", 2);
            Add("army.unit.medicjeep", 1);
    
          }
          CanBuild(1);
          Random(1);
          //NoBeyondWeighting(1);
        }
      }
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests