1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Automated Builders + Archaeologists BETA 0.98.0

Rewritten Builder + Archaeologist automation code for human players

  1. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    MadManCam submitted a new resource:

    Automated Builders + Archaeologists - Rewritten Builder + Archaeologist automation code for human players

    Read more about this resource...
     
  2. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    How to Change the Mod Settings

    Here's how to change some of the settings for the mod. Keep in mind that your changes will be overwritten whenever you update the mod. I no longer recommend doing this with the game open but that you restart the game after saving your changes in the files.

    IMPORTANT: Editing game files, including those from mods, may cause de-syncs in Multi-player games. You may just have to play wtih default settings in a multi-player game with your friends.


    Automated Archaeologists Settings
    1. Find AutoArchaeology.lua in the Scripts/ folder and open it with any text editor (Notepad or Wordpad on Windows)
    2. The mod settings are at the very top of the file. The default settings are shown below.
    3. Compared to Builders, there are only a few relevant settings here. Here are the main things you can do:

    Archaeologists only know where artifacts are in plots you have explored
    - Change the "b_ArchaeologistsExplore" variable from true to false.

    Archaeologists will check open borders and excavate in other player's territory
    - Change the "b_ArchaeologistsExcavateInOtherBorders" variable from false to true.

    4. Once you have made your changes, copy them and save them somewhere else so you have them in case the mod updates.
    5. Save the file and close it.

    Code:
    --------------------------------------------------------------------------------------------------------
    -- AUTOMATED ARCHAEOLOGY SETTINGS
    --------------------------------------------------------------------------------------------------------
    local b_ArchaeologistsExplore :boolean = true; -- Set to false to disable automated Archaeologists knowing where all artifacts are even if you haven't explored that area.
    local b_ArchaeologistsExcavateInOtherBorders :boolean = false; -- Set to false to disable automated Archaeologists excavating in other player's territory.
    
    local debug :boolean = true; -- Set to true to enable basic debug messages in the Lua.log
    local debug_FindAction :boolean = false; -- Set to true to enable LOTS of debug messages for finding plot actions and scoring them.
    local debug_GameInfo :boolean = false; -- Set to true to enable printing all of the resources, improvements, features, and terrains loaded into mod.
    

    Automated Builders Settings
    1. Find AutoBuilders.lua in the Scripts/ folder and open it with any text editor (Notepad or Wordpad on Windows)
    2. The mod settings are at the very top of the file. The default settings are shown below.
    3. There are detailed comments nested with the settings that you can read, but here are some of the main things you can do:

    Automated Builders build farms within 4 tiles if plot is adjacent to a farm within 3 tiles if there is nothing else to do
    - Change the "b_FarmsIn4Tiles" variable from false to true.

    Automated Builders only perform certain actions such as repairing improvements and roads
    - Delete the line for the action you don't want them to perform under the "m_Scoring" variable. For example to have Builders only repair stuff, delete every line for m_Scoring besides m_Scoring["REPAIR"] and m_Scoring["REPAIR_ROAD"]

    Change how important distance from Builder is when they are deciding what to do
    - Change the value for the line "m_Scoring["DISTANCE"] = -5;" To make distance more important, lower the value from -5 to something like -10 or -25. If you change this value to 0, then distance will not be a factor when deciding what to do.

    If there are multiple improvements to choose from for one plot, what will be chosen?
    - This is determined by the lines right under local m_Improvement_Scoring = {}. If something has a higher value than 0 and anything else on the list, it will be chosen over other improvements. You can see by default that a mine will always be chosen over a farm if a Builder has to choose. You can also add a new line to give a priority for another improvement if for example you have a mod that adds another improvement.

    4. Once you have made your changes, copy them and save them somewhere else so you have them in case the mod updates.
    5. Save the file and close it.

    Code:
    --------------------------------------------------------------------------------------------------------
    -- AUTOMATED BUILDERS SETTINGS
    --------------------------------------------------------------------------------------------------------
    -- Set to true to enable automated Builders removing features for improvements (unless they can do something given a higher priority).
    local b_RemoveFeatures :boolean = false; -- Even if it is set to false, Builders will still remove features to improve resources.
    -- Set to true to enable automated Builders harvesting resources (unless they can do something given a higher priority).
    local b_HarvestResources :boolean = false;
    -- Set to true to enable automated Builders building farms 4 tiles out from your cities if the plot is adjacent to another farm that is within 3 tiles of cities after all strategic/luxury or within 3 tiles of cities have been improved.
    local b_FarmsIn4Tiles :boolean = false;
    
    local debug :boolean = true; -- Set to true to enable basic debug messages in the Lua.log
    local debug_FindAction :boolean = false; -- Set to true to enable LOTS of debug messages for finding plot actions and scoring them.
    local debug_GameInfo :boolean = false; -- Set to true to enable printing all of the resources, improvements, features, and terrains loaded into mod.
    
    local m_Scoring = {}; -- Don't delete this line.
    -- These settings are base scores to give each plot when choosing between the plot to move to.
    -- Higher numbers give the plot action a higher score when choosing a plot.
    -- If you delete a line entirely, the Builder will never perform that action.
    m_Scoring["REPAIR"] = 200; -- Repair an improvement
    m_Scoring["REPAIR_ROAD"] = 180; -- Repair a road.
    m_Scoring["IMPROVE_STRATEGIC"] = 160; -- Improve a strategic resource.
    m_Scoring["IMPROVE_LUXURY"] = 120; -- Improve a luxury
    m_Scoring["IMPROVE_BONUS"] = 60; -- Improve a bonus resource
    m_Scoring["BUILD_UNIQUE_IMPROVEMENT"] = 40; -- a unique improvement from a Trait or City State.
    m_Scoring["BUILD_IMPROVEMENT"] = 20; -- A normal improvement on a plot with no resource.
    m_Scoring["REMOVE_FEATURE"] = -20; -- Removing a feature (will never happen if it is disabled above)
    m_Scoring["HARVEST_RESOURCE"] = -10; -- Harvesting a resource (will never happen if it is disabled above)
    
    m_Scoring["DISTANCE"] = -5; -- Distance: A lower number will have the Builder factor distance into the decision more.
    -- For 0, the Builder will not care how far away a tile is, it will only go by the other scores above.
    -- A higher number will have Builders factor distance in more to what will be done.
     -- Example: with this number set to -5, for every tile a plot is far from a Builder, it will lose 5 score points.
    -- So if REPAIR for a tile gives 100 points, if the Builder is 10 tiles away then that plot action will have a 0 point score for that Builder,
    -- and it will choose to do something closer if it is has a better score.
    
    local m_Improvement_Scoring = {}; -- Don't delete this line.
    -- These are priorities for certain improvements. If there are multiple options for one plot, the improvement with the highest value will be chosen.
    m_Improvement_Scoring["IMPROVEMENT_MINE"] = 50;
    m_Improvement_Scoring["IMPROVEMENT_BEACH_RESORT"] = 40;
    m_Improvement_Scoring["IMPROVEMENT_FARM"] = 30;
    m_Improvement_Scoring["IMPROVEMENT_COLOSSAL_HEAD"] = -20; -- Colossal head gets a score less than -10 so it won't be chosen over other unique improvements.
    
    local m_Priorities = {}; -- Don't delete this line
    -- These settings are the priorities for individual plot actions.
    -- Higher numbers give the action a higher priority when choosing the best action for a plot.
    -- If you delete a line entirely, the Builder will never perform that action.
    m_Priorities["REPAIR"] = 80; -- Repair an improvement.
    m_Priorities["REPAIR_ROAD"] = 70; -- Repair a road.
    m_Priorities["IMPROVE_STRATEGIC"] = 60; -- Improve a strategic resource.
    m_Priorities["IMPROVE_LUXURY"] = 50; -- Improve a luxury
    m_Priorities["IMPROVE_BONUS"] = 40; -- Improve a bonus resource
    m_Priorities["BUILD_UNIQUE_IMPROVEMENT"] = 30; -- Priority for building a unique improvement.
    m_Priorities["BUILD_IMPROVEMENT"] = 20; -- A normal improvement on a plot with no resource.
    -- If you want to harvest all bonus resources or remove all features, enable it in the options above then give the below options higher numbers for a higher priority.
    m_Priorities["HARVEST_RESOURCE"] = 10; -- Harvesting a bonus resource will never happen if there is an improvement available.
    m_Priorities["REMOVE_FEATURE"] = 5; -- Removing a feature to put an improvement on the base terrain is the lowest priority.
    

    If anything went wrong, copy and paste the included default settings code above over the settings to get back the defaults. Be careful when pasting over your saved settings after an update in case I have changed how the settings are arranged or how they work.
     
    Last edited: Jan 4, 2018
  3. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    How to Report a Bug

    You are NOT experiencing a bug if:
    - The game kicks you back to main menu when you try to start/load a game. This is caused by another one of your mods that is having an error updating the database. This mod only adds two small items (Automate/Stop Automate unit actions) to the database and should not cause any issues.


    You are experiencing a bug if:
    - The unit panel doesn't show up when you select a unit.
    - You don't see a button to automate Builders or Archaeologists.
    - You press the automate/stop automation button and nothing happens (the action doesn't switch to the opposite from what you just pressed, i.e. automate --> stop automation)
    - The game is making you select an action for a Builder/Archaeologist that is currently automated.
    - When you have to select an action for a unit, I've set it up so that when you select the unit it will try to automatically do something else, but there is still a bug that caused the unit to have to receive orders and block ending your turn.
    - An automated Builder is sitting around doing nothing, but there is clearly something to do anywhere in your borders. Probably, the Builder is trying to do something on that plot that it is actually unable to do.
    - Automated Builders are trying to target a plot that is not in your territory.
    - Anything else is happening that is different from what I have described should be happening.


    Please follow these steps to report a bug:
    - If you aren't able to go through some of the work below, please at least let me know and provide some screenshots if possible and info about your game. Thanks!


    1. Once you get to where the bug occurs, stop and take any screenshots if it will help others understand the issue you had.
    2. Close the game. This is so that the log files are saved and the last bit of information will be from when you saw the bug.
    - Go to C:\Users\<User Name>\Documents\My Games\Sid Meier's Civilization VI\Logs\ (the file path is different on Mac, I think it is /Library/Application Support/Sid Meier's Civilization VI/Logs/)
    3. Open the Lua.log with any text editor (Notepad or Wordpad on Windows). Copy all of the contents to clipboard.
    4. Go to www.pastebin.com, and paste the Lua.log contents you copied into the "New Paste" box. Make sure the exposure is "Public" then click "Create New Paste".
    - Now that you've created the paste, you can copy the url that was generated for it and share that link for anyone to view.
    5. Make a post describing the bug you found. Please also describe your game setup (Which leader? Single/Multi player? Standard ruleset? Number of players?) and your PC setup (Windows? Mac?)
    6. Make sure to include in your post any relevant mods you were using that include resources or improvements.
    7. As a final part of the bug report, add the pastebin url you made for the Lua.log contents. Don't paste the Lua.log contents directly into your discussion post.
    8. If you have a screenshot post that as well.

    - Thanks for going through all that work to help make the mod better!

    Please remember that it is VERY difficult for me to fix bugs that I haven't been able to produce on my own computer without the Lua.log contents from your game! Posting them is very helpful to me!
     
    Last edited: Jan 4, 2018
  4. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
  5. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
  6. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    MadManCam updated Automated Builders + Archaeologists with a new update entry:

    More Mac/Linux Compatibility

    Read the rest of this update entry...
     
  7. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    MadManCam updated Automated Builders + Archaeologists with a new update entry:

    Some bug fixes.

    Read the rest of this update entry...
     
  8. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
  9. DanaLea

    DanaLea Chieftain Supporter

    Joined:
    Oct 15, 2002
    Messages:
    296
    Gender:
    Female
    Location:
    Houston, TX
    By the way, WE HAVE THE FALL PATCH NOW!! Yay!!!

    -Signed Mac Users


    p.s. may I put in a request next time you are working on this? I accidentally set a builder on automate when I was trying to get it to do something else. Is there any way to put in a confirm (just for builders)? If not, it's okay. I'm trying to be more careful.
     
  10. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
  11. MadManCam

    MadManCam Chieftain

    Joined:
    May 5, 2017
    Messages:
    50
    Location:
    Minnesota, United States
    Great, glad you finally got that patch because it was a nice one!

    I'm not planning on adding anything like that currently. It could possibly be another mod, though, adding a confirm yes or no button before actually pressing some options, possibly with settings for which actions to double check.
     

Share This Page