User Tools

Site Tools


modtools:aieditor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
modtools:aieditor [2017/05/13 11:53] – [The Editor] adminmodtools:aieditor [2022/02/15 18:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== AI Editor ===== ===== AI Editor =====
  
-GearCity stores all AI companies in an XML file. Due to some variables requiring a City ID, //AI.xml// files are specific to //City.xml// files. As such they're generally shipped with game maps and not shared between maps. However, these files can be overridden on specified maps via the [[ModTools:make_a_mod_Editor|mod system.]]+GearCity stores all AI companies in an XML file. Due to some variables requiring a City ID, //AI.xml// files are specific to //City.xml// files. As such they are shipped with game maps and not shared between maps. However, the [[ModTools:make_a_mod_Editor|mod system]] can override these files on specified maps.
  
-Each AI node also contains a logo file. These files should be shipped with the map or added via the mod system as supplemental artwork.+Each AI node contains a logo file. These files are shipped with the map or added via the mod system as supplemental artwork.
  
 //If you add/edit an AI company, and the game crashes, check the [[ModTools:Reading_Log_File|log file]]. You're probably missing a logo because it hasn't been added to the .zip files containing the logos. (Or you're not loading those zip files...)// //If you add/edit an AI company, and the game crashes, check the [[ModTools:Reading_Log_File|log file]]. You're probably missing a logo because it hasn't been added to the .zip files containing the logos. (Or you're not loading those zip files...)//
Line 11: Line 11:
 ===== Mod Tools ===== ===== Mod Tools =====
  
-To access the AI Editor, you must open the Mod Tools. See [[ModTools:AccessingModTools|How to Open the Mod Tools]] if you do not know how to access the Mod Tools.+To access the AI Editor, you must open the Mod Tools. See [[ModTools:AccessingModTools|How to Open the Mod Tools]].
  
-The AI Editor is available on the left hand column of the Mod Tool's Main Menu. Click the button circled in the following image, labeled “AI Editor.” +The AI Editor is located on the left hand column of the Mod Tool's Main Menu. Click the button labeled “AI Editor.” 
  
 +\\
 +\\
 ===== The Editor ===== ===== The Editor =====
 This is the AI Editor. Below we'll walk you through what each part of the Editor is for. This is the AI Editor. Below we'll walk you through what each part of the Editor is for.
Line 33: Line 35:
   - Lists the AI companies entered into the editor.   - Lists the AI companies entered into the editor.
   - Clears AI Variable data so a new AI company can be generated from scratch.   - Clears AI Variable data so a new AI company can be generated from scratch.
-  - Adds/Edits the AI data on the left to the list of AI companies in the editor.+  - Adds the new AI company on the left to the list of AI companies in the editor. Or edits the selected AI company in the list.
   - Removes selected AI from list of AI companies entered into the editor.   - Removes selected AI from list of AI companies entered into the editor.
      
 +\\
 +\\
 ===== Files And How it Works ===== ===== Files And How it Works =====
  
-When the player starts a new game on a selected map, the //MapDataForGame.xml// file will tell the game which //AI.xml// files are available and how many AI to load from that file. The mod files can override this action, by supplying the game with it'own list of AI files and numbers of AI to load. However AI files are specific to the map, so even when the mod files override map files, it can only do it for a specific map.+When the player starts a new game on a selected map, the //MapDataForGame.xml// file will tell the game which //AI.xml// files are available and how many AI to load from that file. The mod files can override this action, by supplying the game with its own list of AI files and numbers of AI to load. HoweverAI files are specific to the map, so even when the mod files override map files, it can only do it for a specific map.
  
 The game can only load a random number of AI from an //AI.xml// file or all the AI from the file. With that in mind, multiple AI files may be needed. For example, Base City Map has 3 //AI.xml// files. One with 10 large companies, one with 25 large companies, and finally one that has 300 AI companies and is used for the "All" selection and the "Random #" selections. The game can only load a random number of AI from an //AI.xml// file or all the AI from the file. With that in mind, multiple AI files may be needed. For example, Base City Map has 3 //AI.xml// files. One with 10 large companies, one with 25 large companies, and finally one that has 300 AI companies and is used for the "All" selection and the "Random #" selections.
  
-The //AI.xml// contains all the behaviors, data, and starting information for AI companies. The actions of the AI are based on the variables presented in the //AI.xml// file. All data is moved from the xml file to the save game. So any changes made to the //AI.xml// will require a save game.+The //AI.xml// contains all the behaviors, data, and starting information for AI companies. The actions of the AI are based on the variables presented in the //AI.xml// file. All data is moved from the xml file to the save game. Any changes made to the //AI.xml// will require a save game.
  
-Finally, one of the variables for an AI company is the Head Quarters ID, or hqID. The hqID value corresponds to the cityID value in the //City.xml// files. As such, AI files can only work with maps that share the same CityID's. For example cityID 5 on //Classic Map// is London, but on //Base City Map// it is San Diego. So if an AI file from //Classic Map// was used in //Base City Map// all companies based in London would actually be based in San Diego... The exception to this rule is if you only add new cities to an existing //City.xml// file at the end of the list. For example, if there are 206 cities, you can add 207th and use the same AI file as long as the new city's ID is 207.+Finally, one of the variables for an AI company is the Head Quarters ID, or hqID. The hqID value corresponds to the cityID value in the //City.xml// files. As such, AI files can only work with maps that share the same CityID's. For example cityID 5 on //Classic Map// is London, but on //Base City Map// it is San Diego. So if an AI file from //Classic Map// was used in //Base City Map// all companies based in London would be based in San Diego... The exception to this rule is if you only add new cities to an existing //City.xml// file at the end of the list. For example, if there are 206 cities, you can add 207th and use the same AI file as long as the new city's ID is 207.
  
-There are also some advanced options in the [[modtools:cityeditor| City Editor]] that will take care of editing AI hqID's for you if you add new cities to a //City.xml// file in between other city IDs. This will however result in a new //AI.xml// file.+There are also some advanced options in the [[modtools:cityeditor| City Editor]] that will take care of editing AI hqID's for you. If you add new cities to a //City.xml// file in between other city IDs, it will automatically adjust the hqIDs. This will however result in a new //AI.xml// file.
  
  
 +\\
 +\\
 ===== AI Variables ===== ===== AI Variables =====
  
-The AI has lots of variables stored in the //AI.xml// files. But it is these variables that distinguish one company from the next. The following will break down the editable variables found in the variable panel ({{ :modtools:aieditor_2_editorv2.png?linkonly |#8 in this picture}}).+The AI has lots of variables stored in the //AI.xml// files. These variables distinguish one company from the next. The following will break down the editable variables found in the variable panel ({{ :modtools:aieditor_2_editorv2.png?linkonly |#8 in this picture}}).
  
  
Line 59: Line 65:
 |AI ID|This is a non-editable value that is used to uniquely identify an AI entry inside the game.| |AI ID|This is a non-editable value that is used to uniquely identify an AI entry inside the game.|
 |Name|This is the name of the company. It's typically how you'll see companies in the game. 26 characters is consider the soft maximum. You can put more, but it may cause text formatting issues.| |Name|This is the name of the company. It's typically how you'll see companies in the game. 26 characters is consider the soft maximum. You can put more, but it may cause text formatting issues.|
-|Owner|This is the AI ID of the AI that owns this company. If the owner is set to 0, then the company owns it self. Any other value than 0 will make this company a marque of the Owner ID company. The drop down to the right allows you to quickly select the ID of an existing company.|+|Owner|This is the AI ID of the AI that owns this company. If the owner ID is set to the same as the company ID, then the company owns it self. Any other value a marque of the Owner ID company. The drop down to the right allows you to quickly select the ID of an existing company.|
 |Head Quarters|This value corresponds to the City ID for the City.xml file. If you have loaded a City.xml file, the cities should be in the drop down box for you to choose from. If you select a city which does not exist in the City.xml file, the AI company will experience errors which could crash the game.| |Head Quarters|This value corresponds to the City ID for the City.xml file. If you have loaded a City.xml file, the cities should be in the drop down box for you to choose from. If you select a city which does not exist in the City.xml file, the AI company will experience errors which could crash the game.|
 |Founding Year|This is the year in which the AI company will appear in the game.| |Founding Year|This is the year in which the AI company will appear in the game.|
Line 144: Line 150:
 |Design Export| This adjust how often an AI company is willing to license out their designs to other companies. Higher values means that they are more likely.| |Design Export| This adjust how often an AI company is willing to license out their designs to other companies. Higher values means that they are more likely.|
 |Design Import| This adjust how often an AI company is willing to purchase other company's design license for their own use. A higher value means the AI will use other company's designs more often.| |Design Import| This adjust how often an AI company is willing to purchase other company's design license for their own use. A higher value means the AI will use other company's designs more often.|
 +\\
 +\\
 ===== Examples ===== ===== Examples =====
  
Line 166: Line 174:
  
 ==== Opening AI File ==== ==== Opening AI File ====
 +
 +You should open your city script file and select a logo folder before you open an AI.xml file. While it is not necessary, it will prevent any unexpected errors from occurring.
 +
 +To Open an AI file, click on the Open AI List button ({{ :modtools:aieditor_2_editorv2.png?linkonly |#2 in this picture}}). Navigate to where the existing AI.XML file is. If you wish to open an AI file in an existing map or mod please see [[[[modtools:file_locations|File Locations]] for more details on the location of these files.
  
 ==== Adding New AI ==== ==== Adding New AI ====
 +
 +To add an AI company to the list, simply fill out all the data on the left hand side and click the "Add AI" button ({{ :modtools:aieditor_2_editorv2.png?linkonly |#14 in this picture}}).
 +
 +AI Companies must have unique IDs (which should automatically be taken care of), unique names under 26 characters long, a HQ ID in an existing city within the City.xml files for a map, and a .dds logo file. Any failure to meet those conditions will result in ingame errors and possibly crashing, 
 +
 +==== Editing Existing AI ====
 +
 +Select the AI from the list you wish to edit. Edit the data on the left. Then click the "Add AI" button ({{ :modtools:aieditor_2_editorv2.png?linkonly |#14 in this picture}}).
 +
 +If you're adding new logos to an AI company, please be sure you include the dds files in a zip file. See [[modtools:aieditor#Saving AI File| Saving AI File ]] for more details.
  
 ==== Removing AI ==== ==== Removing AI ====
 +
 +Simply select the AI company you wish to remove from the list, then click the "Remove AI" button ({{ :modtools:aieditor_2_editorv2.png?linkonly |#15 in this picture}}).
 +
 +Removing an AI in the middle of the list will automatically re-ID all AI ID's above the removed company. Any AI companies owned by the removed company will now be owned by themselves.
  
 ==== Saving AI File ==== ==== Saving AI File ====
  
-//After you have saved your AI.xml file. You will need to compress all of the logos into a single .zip file. There must not be any folders inside of the zip. Just place the files directly into the zip without any sub-folders. We address this more in//+Weither you're saving your work for future use, or you're ready to use it in the game, you will save the AI.xml using the same button. To save an AI.xml file, simply click the "Save AI List" button ({{ :modtools:aieditor_2_editorv2.png?linkonly |#3 in this picture}}). Navigate to where you wish to save the the file and hit save. 
 + 
 +If you're saving for use in a new map or mod (or adding a new file to the map/mod), then the location where you save it will not matter. As the [[modtools:make_a_map_editor|Map Data Tool]] and [[modtools:make_a_mod_editor|Mod Data Tool]], will automatically place the script files where they need to go. 
 + 
 +However, if you're editing an existing map or mod AI.xml file, you must save the new AI file over the old one. 
 + 
 +After you have saved your AI.xml file. Before using using the AI in the game, you will need to compress all of the logos into a single .zip file. If you're editing an existing map or mod, you must use the zip files already created. See [[modtools:file_locations|File Locations]] for details where these zip files are. If creating a new map, use one .zip file for all AI logos. If creating a mod, you will have to share zip files with other additional mod content. 
 + 
 +There must not be any folders inside of the zip file. Just place the files directly into the zip without any sub-folders. The game will not read anything inside of a folder in a zip file. 
 + 
 + 
 +==== Testing New Logos In Game ==== 
 + 
 +The game has a built in logo tester system. Start a new game with the mod, map, and AI.xml file you wish to test. Click safe in the Office to go to the Financial Room. Hold down ctrl and hit the "L" button. This will pull up a list of all the Logos used in the game.  
 + 
 +If the game crashes, then you are most likely missing a logo or one is miss named. [[modtools:Reading_Log_File|Check your Log Files]] to see which file name is giving you problems. 
 + 
 + 
 + 
 +\\ 
 +\\ 
 +===== Troubleshooting ===== 
 +Common things that can go wrong when editing AI files: 
 + 
 +== Game Crashes When Checking Stocks == 
 +Most likely you're missing a logo file in your Logos.zip or you miss named the logo filename in the AI editor. (Thus the filename is wrong in your AI.xml file) [[modtools:Reading_Log_File|Check your Log Files]] to see which file is missing and add it to the .zip. 
 + 
 +Also be sure to test all the logos in the AI.xml file using "Ctrl-L" while you are in the Financial room. This will save you a lot of trouble in the future. 
 + 
 +== None of the Changes I Made are in the Game! == 
 +Any changes to the AI require you to start a new save game before they take effect. Be sure to start a new game. If you are creating or editing a mod. Make sure you've selected the mod from the external Settings Editor. 
modtools/aieditor.1494690794.txt.gz · Last modified: 2022/02/15 17:58 (external edit)