Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 6 users and 206 guests online.

Online users

  • GambitUK
  • Theace
  • marhawkman
  • Nick194
  • Santiago
  • crazydog

Languages

  • English English
  • French French

Browse archives

« Août 2008  
Lu Ma Me Je Ve Sa Di
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Home » news » blogs » Gideon's blog

List of AI Script Files (AKA, Road Map to Madness)...

Submitted by Gideon on Wed, 2007-10-24 12:58.

For my first blog entry, I thought I would post a list of the stock AI script files, and what they do. To help new scripters find their way around the files.

If you see a word enclosed by %'s then this is a wild card. For instance, %mod_name% means whatever name you give your mod. So, that would be "BadassMod", not "%mod_name%".

This blog entry will not be going over the details of each file. Each file is generally complex enough to warrant its own blog entry (some of them might warrant several).

Well, enough of that Emo crap, on with the list!

Directories:

SE5EmpireScripts -- Contains files used to compile the AI. Files compiled from this directory go in each empire's directory under Gametypes\%mod_name%\Empires\%race_name%

SE5MainScripts -- Contains files used to compile event actions which occur at the end of a round. Currently holds Intel events, and everything BUT Intel events. Files compiled from this directory go in Gametypes\%mod_name%\Data

Files:

SE5EmpireScripts:

Every race has one set of the following two files. When you compile, you compile these two, and they reference all the others.

%race_name%_Main_Script.txt -- This file is processed every round on the AI's turn. References many other files, and performs some processing on its own. Contains much information as to how the AI does things, like what percentage of a ship is weapons, and how many of each type of colony to build.

%race_name%_Setup_Script.txt -- This file is processed ONCE, at the creation of the game. References many other files, and performs some processing on its own. Variables used in or by this file or files included by this file are not persistent for use by anything else, but it can be used to set external values in the game database (like what Racial Abilities a race has), which ARE persistent after they are set.

-------------------------------------------

All of the files with the words "GlobalConstants" in their title are used to set constants which are called up by other script files, but which can be used outside of individual functions, and are persistent across whatever files call them (so they are Global...clever, no?). Constants have a fixed value, and should not be changed like a variable. No processing is performed in these files, think of them as ingredients that other files use to do things. There is no strict rule regarding this, but it is best to stick to the established design ethic, as it will help keep you from getting lost.

Script_AI_GlobalConstants.txt -- Defines general constants. The data in this file is largely present in other GlobalConstants files, so this file is rarely used, if ever.

Script_AI_GlobalConstants_Components.txt -- Defines constants for use with components.

Script_AI_GlobalConstants_DesignTypes.txt -- Defines constants for use with ship and unit design types. (Attack Ship, Troop Transport, etc.)

Script_AI_GlobalConstants_General.txt -- Defines constants for general use, such as colony types.

Script_AI_GlobalConstants_Politics.txt -- Defines constants for use in politics.

Script_AI_GlobalConstants_RacialTraits.txt -- Defines constants used to call up racial traits.

Script_AI_GlobalConstants_Tech.txt -- Defines constants used to reference technologies.

Script_AI_GlobalConstants_VehicleSizes.txt -- Defines constants used to reference ship and unit sizes and types. (Frigates, Destroyers, etc.)

-------------------------------------

The rest of these files do the grunt work for the AI. This is where things get down and dirty.

Script_AI_ColonyType.txt -- Controls how the AI assigns a type to a colony. (Mining Colony, Farming Colony, etc.)

Script_AI_Construction.txt -- Handles the construction of all things by the AI.

Script_AI_DesignCreation.txt -- All ships, stations, and units are designed through this file.

Script_AI_EnemyAnalysis.txt -- Analyzes enemy empires. Currently is empty and unused.

Script_AI_GlobalResearch.txt -- Is used by %race_name%_Setup_Script.txt to set up initial research for the AI, before game start.

Script_AI_GlobalSettings.txt -- Controls many very important settings for the AI, including, but not limited to: Vital ship stats (how much life support is required, etc), how many of each vehicle (bases, ships, AND units) the AI wants, and the disposition value of each action and treaty taken by the player and the AI.

Script_AI_GlobalVariables.txt -- Defines variables which can be called on and set by any other file. The values in these variables is persistent between files and functions, hence the Global title.

Script_AI_Intelligence.txt -- Controls how the AI spends its Intel points, and on whom it spends them.

Script_AI_Lists.txt -- Generates lists for other files, such as the objects a race can see, its colony list, the list of visible enemy units for a race, etc.

Script_AI_Orders_Planets.txt -- Controls what orders are given to planets and objects in a planet's cargo bay.

Script_AI_Orders_Ships.txt -- Controls what orders are given to ships and objects in a ship's cargo bay.

Script_AI_Politics.txt -- Manages the disposion of each AI towards each other and the player. Also deals with Alliances. This file is grown enormously in complexity in the last few patches.

Script_AI_Research.txt -- Controls how the AI researches things during the game turn, NOT during setup before a game.

Script_AI_Restricted_SolarSystems.txt -- Defines and manages Solar Systems with the Restricted flag. Currently empty and unused.

Script_AI_StateChange.txt -- Changes the state of the AI between Explore and Expand, Infrastructure, Attach, Defend, and Not Connected. State is used by other files to help control AI action.

=====================================

SE5MainScripts:

There are Constants files here, as well. These are not shared between each file, though they could be.

Script_Main_ExternalEvents_Const.txt -- Defines constants for use by Script_Main_ExternalEvents.txt.

Script_Main_Intelligence_Const.txt -- Defines constants for use by Script_Main_Intelligence.txt.

--------------------------------------

These next two files are the ones you compile. They reference the constants files above here.

Script_Main_ExternalEvents_Const.txt -- Controls all random events in the game universe. Is processed at the end of the game turn, after all players have had their turns.

Script_Main_Intelligence_Const.txt -- Generates events based on Intel (like espionage and sabotage). Script_AI_Intelligence.txt controls how the AI spends its Intel points, this file generates results based on how the AI spent those points. I think this is processed at the end of each players' turn, but I could be wrong.

» Gideon's blog | login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Captain Kwok's picture
Mod Designer

Re: List of AI Script Files (AKA, Road Map to Madness)...

Submitted by Captain Kwok on Wed, 2007-10-24 13:12.

Feel free to append to the SE:V wiki on this subject:
http://wiki.spaceempires.net/index.php/AI_and_Script_Editing_%28SEV%29


Space Empires Depot | SE:V Balance Mod

» login or register to post comments
Mod Designer

Re: List of AI Script Files (AKA, Road Map to Madness)...

Submitted by Gideon on Wed, 2007-10-31 18:49.

Ahhh, I forgot there is a wiki. I'll have to swing by there and see if they have answers to some of my questions.

"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod
or there:

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • Bigger Map as in Bigger :)
  • Editing max systems in settings.txt
  • Wepons Mod
  • some stuff I use without support for AI - Crew
  • Known SE5 v1.74 Bugs

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • Space Empires V 1.74
  • SE:V Version History 1.01 to 1.07
  • A 4 player or more PBW...
  • Even more demo problems
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
(c) Strategy First, Inc. All rights reserved.