1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Help understanding AI code

Discussion in 'Civ3 - General Discussions' started by Rifraf, Jun 6, 2018.

  1. Rifraf

    Rifraf Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    10
    Greetings all. Longtime Civ 5 player here, but never registered. I mod another game called Star Trek Armada 2 and have some questions regarding the AI. I know that sounds odd, but the game engine used in Civ 3 was also used in Battlezone, Dark Reign and Start Trek Armada 1 and 2 and has a lot of similarities.

    I'm hoping there is an AI guru here who may have knowledge of the AIP files in Civ 3. I can post the whole file if needed, but I'm looking for any insight into the following entries:

    build_buildings_priority = 100.0;

    build_troops_priority = 100.0;

    seige_priority = 200000.0;

    explore_priority = 30000.0;

    attack_troops_priority = 200000.0;

    attack_region_priority = attack_troops_priority/2;

    settle_priority = 100000.0;

    defend_priority = 90000.0;

    perimeter_priority = 0.0;

    chokepoint_priority = 10.0;

    patrol_priority = 20.0;

    harass_priority = 20.0;

    bombard_priority = 20.0;

    rustle_priority = 20.0;

    expel_priority = 20.0;

    sally_priority = 20.0;

    retreat_priority = 20.0;

    convert_priority = 20.0;

    bioterror_priority = 20.0;

    nanoattack_priority = 20.0;

    pillage_priority = 20.0;

    pirate_priority = 20.0;

    counter_stealth_priority = 20.0;

    counter_stealth_priority = 20.0;

    bonus_food_priority = 20.0;

    goody_hut_priority = 20.0;

    defuse_mines_priority = 20.0;

    enslave_priority = 20.0;

    plant_nuke_priority = 20.0;

    create_park_priority = 20.0;

    underground_railway_priority = 20.0;

    establish_embassy_priority = 20.0;

    franchising_priority = 20.0;

    assasinate_ruler_priority = 20.0;

    steal_technology_priority = 20.0;

    injoin_priority = 20.0;

    incite_revolution_priority = 20.0;

    cause_unhappiness_priority = 20.0;

    nuke_city_priority = 20.0;

    danger_diminishment = 0.5;

    max_danger_raw_bonus = -10.0;

    reform_city_priority = 20.0;

    sue_franchise_priority = 20.0;

    probe_wormhole_priority = 20.0;

    build_end_game_object_priority = 100.0;

    build_capitalization_priority = 100.0;

    max_threat_raw_bonus = -1.0;

    distance_from_home_priority_modifier = -1000.0;

    distance_from_enemy_priority_modifier = 1.0;

    max_chokepoint_raw_bonus = 500.0;

    random_modifier = 100.0;

    human_target_raw_bonus = 100.0;

    defenseless_city_raw_bonus = 100.0;

    fzbuild_priority_modifier = 1.0;

    fzwonder_priority_modifier = 1.0;

    fzfreight_priority_modifier = 1.0;

    per_capita_modifier = 200.0;

    threat_proximity_modifier = 100.0;

    max_misc_bid_bonus = 10000.0;

    persistence_modifier = 1000;

    distance_from_unit_priority_modifier = -10.0;

    better_unit_type_modifier = 200.0;

    patrol_one_in_n = 10;

    memory_rounds = 10;

    memory_rounds_stealth = 2;

    min_attack_matching_force_ratio = 1.5;

    min_defense_matching_force_ratio = 1.0;

    num_city_defenders = 1;

    More specifically I really need to try and understand how the following affect the AI:


    danger_diminishment = 0.5;
    max_danger_raw_bonus = -10.0;
    max_threat_raw_bonus = -1.0;
    threat_proximity_modifier = 100.0;
    max_misc_bid_bonus = 10000.0;
    persistence_modifier = 1000;

    From info I've found on other sites regarding these entries I can't understand why you would diminish the danger?
    As to the danger_raw_bonus and threat_raw_bonus are those to add weight or incentive for the AI to determine what/where to attack?
    As to the threat_proximity_modifier is that telling the AI to give more weight towards threat that is closer to it?
    As to the max_misc_bid_bonus I have no idea?
    Lastly, I think I've determined that persistence_modifier is something to do with when squads get assigned to a goal this is used to keep the same squad going back to the same goal or something?

    I hope I've provided enough info and any assistance is appreciated.
     
  2. Civinator

    Civinator Blue Lion Supporter

    Joined:
    May 5, 2005
    Messages:
    5,412
    Rifraf, welcome in the CFC Civ 3 forums. :band:

    For me this is interesting news about similarities in the game engines of Civ 3 and Star Trek Armada 1 and 2. So I do a lot of modding Civ 3, I never heard about AIP files. There are some threads in the Civ 3 customization and modding forum, where civers are guessing about priorities for the AI in Civ 3, but I think here we can learn much more from you, than you can learn from us.

    May be the modders Quintillus and Wild Weasel can give you some more information, but I´m not sure about it. Nevertheless it could be a good idea, if a moderator transfers your post to the Civ 3 Creation & Customization forum.
     
  3. Rifraf

    Rifraf Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    10
    I'm glad someone took an interest. I'll start by stating I could have mislead in Civ 3 using the same engine as the Star Trek Armada games. I should have said parts of the engine and/or file structures were used/modified for each subsequent game. From what I've found the engine started with a Mech Warrior game back in '95. Then a modified version of that engine or at least parts of it were used on the Interstate 76 game. Then modified again to whatever degree for Battlezone. Maybe it skipped Battlezone II and Dark Reign, however some of the AIP entries I posted above do appear in Dark Reign files. Some of the very same AI entries were then used in Civ 3 and finally it was modified to some degree for Star Trek Armada and Armada 2.

    I'm not up on how some of the lingo is used, but in Star Trek Armada and Armada 2 the AI has build list files for what ships/stations to build and AIP (Artificial Intelligence Personality) files for how it decides where and what to attack and when to change its strategy based on what is happening in the game. I've always heard it's better to beg for forgiveness than ask for permission so I'll post some reference links and files here and if that's not allowed please remove them I'll accept my punishment. In my searches I've found sample files from Civ 3 for Goals that the AI uses. They are goalsally.h, goalbombard.h, goalretreat.h, and goalexpel.h. I presume these are part of the personality files Civ 3 uses? I can post one of the files here if interested though it sounds like you already know what they are.

    In Armada and Armada 2 the AI has 4 personality files it uses at different stages of the game called aggressive, defensive, exploration and very_aggressive. It uses it's aggressive AIP most of the game sometimes switching to exploration to presumably find enemy bases and then back to aggressive once it's done so. Defensive is for when it's been beaten back into its starting base and very_aggressive is for when it's beaten it's enemy back into its starting base. So it switches build lists and AIP files, but the exact trigger is fully understood. At least no one I know has complete understanding of it. I keep playing game over and over and changing a value here and there and watch what happens so I've started to understand what a lot of the settings do. I'll post a stock AIP file and the one of my modded ones with notes if anyone is interested in looking through them.
     

    Attached Files:

  4. Civinator

    Civinator Blue Lion Supporter

    Joined:
    May 5, 2005
    Messages:
    5,412
    Rifraf, I made a link to your post at the Civ 3 Creation & Customization forum: https://forums.civfanatics.com/thre...lone-utterly-dead.625696/page-7#post-15166798

    I know such kind of files you have posted from Space Empires IV (see the attachment below). Unfortunately it seems, that no such kind of files are existing in Civ 3 and its expansions. These decisions seem to be burried deep inside the Civ 3 programming.

    Btw.: Star Trek Armada 1 and 2. These are good games and I have both of them. Do you know an easy instruction how to install and play them with Win 10, 64 Bit? I also want to have a look to your mod. Where can I find it?
     

    Attached Files:

  5. justanick

    justanick Chieftain

    Joined:
    Oct 6, 2010
    Messages:
    847
    Location:
    Germany
    On Win 7 64 bit i needed a fan patch(1.2.5 if i recall correctly) to run Armada 2.
     
  6. Civinator

    Civinator Blue Lion Supporter

    Joined:
    May 5, 2005
    Messages:
    5,412
    justanick, thank you very much. :)
     
  7. Rifraf

    Rifraf Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    10
    Just a thought, but have you tried running in compatibility mode for XP? You could also install the Fleet Operations 3.2.7 mod which is a completely new Star Trek mod which also allows you to play other mods inside it. Including the original Armada 2? I don't know if we're allowed to post links off site, but just google Fleet Operations and you should find it. Hopefully the 1.2.5 patch justanick mentioned works for you.
     
  8. Civinator

    Civinator Blue Lion Supporter

    Joined:
    May 5, 2005
    Messages:
    5,412
    Rifraf, thank you very much for your advice, too. :)
     

Share This Page