[Register] [757383 Members] [90535 Online; 666 Members, 89869 Guests]  
Star Trek: Armada 2
File Search






 The Files
 » File Browser
 » File Search
 » Submit Files
 » File Permissions
 » Reviews and you!
 » Achilles Mod Surgery

 Star Trek Armada II
 » Cheats
 » Downloads
    - Demo
    - Maps
    - Mods
    - Media
    - Patches
    - Ships
    - Stations
 » Screenshots
 » Overview
 » Story
 » FAQ

 Star Trek Armada
 » Cheats
 » Downloads
    - Demo
    - Maps
    - Mods
    - Patches
    - Ships
 » Overview
 » Story

 The News
 » Latest News
 » News Archive
 » Submit News

 The Tutorials
 » Milkshape 3D Hardpoint
 » Map Editor Tutorial
 » Custom Music Tutorial
 » AI Files for beginners
 » Joint rotation on MS3D
 » Submit Tutorial
 » More Tutorials

 The Community
 » Links
 » Armada Forums
    - General Discussion
    - Modding & Editing
    - Problems & Help
    - Clan Forums
 » Submit PotD
 » PotD Archive

 The Site
 » Latest Poll
 » Site Rules
 » About
 » Staff
 » Rules
 » Apply To Volunteer
 » Contact





  AI Files for Beginners Tutorial
This Page has been viewed 20,349 times
When you are modding armada2 you will find there are two main areas, programming and arty stuff. The arty stuff is more about talent in my opinion and is difficult to learn (I can't do it). I can however mod programming files odf etc. as these are easier to learn and don't require as much talent. Though programming is generally simple, one area of it confuses nearly everybody (including me) and that area is know as the AI. This area is really quite complex as you are programming how you want the computer to play against the player. The best AIs use all the ships and stations available to it, gets them built quickly and has a strong economy to support them. The best AIs do all this without following a predictable pattern.

So how do you do it?

Ok most AI files are AIPs. Each race has 5 plus files for any missions the game has. You have to make any changes to all 5 files for it to work, as they are just slight variants of each other for the AI to vary it's strategy.
Here is here is the first part of the federation_instant_action_build_list.aip.

//
// Borg_Build_List.aip
//
// Contains a default build list for the klingon AI
//
// edited by the Nord

// Load up the basic structures...
#include \"aipdef.h\"

// This aip needs to play by the rules
int checkTechnologyAvailable = 1;

Way_Better_Build_List_Element the_build_list[MAX_ELEMENTS] =
{
//---------------------------- ----------------------------------------

This section you can ignore except for this bit

int checkTechnologyAvailable = 1

By default the AI isn't effected by techtrees so it can build Akira class vessels without a Research Facility ect. When this line is present the AI checks the techtrees before trying to build a vessel. I personally delete this line and make the AI build the required building before moving on to dependant ships anyway.


After this you come to the build list. This is the order in which the AI constructs ships and stations. This is the bit we can do stuff with. The AI follows this list to the letter and this list is used by the AI no matter it's difficulty level (Hard AIs get resource gathering and combat bonuses but still build the same ships).

Ok here is the start of the federation_instant_action_build_list.

//
// Syntax: \"ODF name\", number to build, base to build at, max number from this line, min tech level
//

//
// Phase I. Base & Yard
//

\"fbase\", 1,0, -1, 1, // starbase
\"fconst\", 1,0, -1, 0, // construction ship
\"fconst\", 1,0, -1, 0, // second construction ship
\"fscout\", 1,0, -1, 0, // scout
\"fmining\", 1,1, -1, 0, // mining stations
\"fturret\", 2,1, 4, -3, // basic mining defense
\"forbital\", 1,1, -1, 0, // build an orbital station
\"ffreight\", 2,0, -1, 0, // mining freighter - two freighters for each station
\"fyard\", 1,0, -1, 0, // basic shipyard
\"fdestroy\", 2,0, 4, -2, // Defiant

The first column is the name of the odf used. You first notice that the first thing it tries to build is a starbase. This is because the list defines what the AI is supposed to have so if you changed the start units but not the AI file the AI would try and build any of the units you changed.

The first number is how many of the odf the AI is supposed to have which doesn't need explaining.

The second number is location to build the odf at. 0 is the AIs "main base" or starting position. 1 is the nearest dilithium moon to the AI. (The orbital processing facility is built at the planet nearest the moon) 2 or more are subsequent dilithium moons in order of priority (The AI will ignore the nearest moon if it can go a bit further and find an infinite moon)

The third number is how many times to repeat the line if the odf from the line is destroyed for example this is a line in the file:

\"fdestroy\", 2, 0, 2, 0, // Defiant

The AI will build two Defiant Class ships and then if one of them are destroyed it will replace it with another one meaning that in total the AI can build four Defiant Class ships.

If the number –1 is there the will replace it an unlimited number of times which is why the starter units are on the list.

The next column I will come back to.

The AI moves on to the next line when it has started all of the line above. Look at this extract:

\"fturret2\", 3,0, -1, 0, // torpedo turret
\"ffrigate\", 1,0, -1, -4, // Aegean

If you have 3 construction ships and an advanced shipyard the AI will start the turrets and then start the Aegean so the AI doesn't have to wait for the line above to be finished.

\"fbattle\", 4,0, -1, 0, // Sovereign
\"fcruise2\", 2,0, -1, 0, // Steamrunner (Artillery)

Suppose the Al has 2 of each type of shipyard it will start building 2 of the sovereigns but as it hasn't started all of the line it can't move onto the next line. This means the standard shipyards are left doing nothing slowing down the AIs fleet building.

This is a way round this

\"fbattle\", 2,0, -1, 0, // Sovereign
\"fcruise2\", 2,0, -1, 0, // Steamrunner (Artillery)
\"fbattle\", 2,0, -1, 0, // Sovereign

The AI will start two sovereigns then two Steamrunners and when there is space at the advanced shipyards the other two are built. (if the AI has enough resources…wink

The fourth number is very confusing but if you are really ambitious this is how you use it.

The fourth number represents a technological barrier to stop the AI building weaker ships when it builds certain things (usually stations). This makes sure the longer you play the stronger the ships against you get. This is actually cannon as NX class ships are not built in the 24th century when Defiant class ships are cheaper, more powerful and faster.

Look at the first entry:

\"fbase\", 1,0, -1, 1, // starbase
\"fconst\", 1,0, -1, 0, // construction ship
\"fconst\", 1,0, -1, 0, // second construction ship
In the fourth column there is a one this means that the AI thinks that this is the start of tech level one that ends when an entry with 2 in the column appears. Now entries with a zero are unaffected by this but entries with a negative number are. The number –1 would mean that the AI would stop replacing the ship after tech level 1.

Here is an example:

//
// Phase II. Research
//
\"fresear\", 1,0, -1, 2, // basic research
\"fcolony\", 1,0, 4, 0, // colony ship
\"fdestroy2\", 2,0, 4, -2, // Defiant
\"fcruise1\", 2,0, -1, -2, // Akira

//
// Phase III. Advanced Shipyard
//

\"fyard2\", 1,0, -1, 3, // advanced shipyard
\"fgalaxy\", 3,0, -1, -4, // Galaxy (Battleship)

When tech level 2 ends the AI will stop replacing the Defiant and Akira class vessels, regardless of column 3. This stops the AI wasting resources. The galaxy will be built in tech level 3 but can be replaced in levels 3 and 4 but will stop being replaced in level 5.

So a positive number decides when a level starts, a negative number decides what level something is restricted to and 0 means it is unaffected.

Ok now you know how AI files work. With this you can make the AI use any ships you add to the game or you can completely rework the AI into a stronger more interesting player.

Average User Rating: 7.9
Number of Votes: 15


User Comments  
The following comments are owned by the user that posted them. Armada 2 Files is not responsible for their content.

Total comments: 11 | Last comment: 09-28-2011 at 09:02

 #1 - 10-31-2005 at 03:20
AdmarilRyan
From: (Lincoln)
Joined: May 9th, 2005
Posts: 664
I didn't realise I submitted this is March 2004! Hangon... I hadn't even started modding in March 2004! that is strange.....

also there has being a weird error...

"fyard2", = "fyard2"

you have to ignore the random backslashes

 #2 - 10-31-2005 at 07:06
AdmarilRyan
From: (Lincoln)
Joined: May 9th, 2005
Posts: 664
ur this is very strange I put

"fyard" = "fyard"

I think I need to go lie down!

 #3 - Bookmarked this great page..... - 05-23-2007 at 13:07
DScottHewitt
From:
Joined: February 10th, 2007
Posts: 28
Since the Admiral pointed me to it in my thread about this.....




Scott

 #4 - Awesome! - 05-23-2007 at 17:41
Chiletrek
From:
Joined: March 3rd, 2003
Posts: 1028
Hello:
Even though I learned some of the AI editing by following the Norway Class minimod (and how the author added that ship to the AI), I find this tutotial both good and useful.
Thanks for the tutorial smile

 #5 - Laymens terms needed - 06-06-2007 at 11:27
Lee2006
From: (Fresno)
Joined: April 29th, 2006
Posts: 2
I don't know what it is but I don't understand it. You need to write this up from the understanding that a person has no knowledge but wants to learn how.. U get it? I mean I don't. Make it so a child could understand. For ex.. How do I even open up the files needed to change the cpu, where are they located? Give examples, help put the readers mind into the editing mode and establish and build on the fundementals. This tuturial is for novices but I am a beginner thank you.

 #6 - 06-17-2007 at 15:36
AdmarilRyan
From: (Lincoln)
Joined: May 9th, 2005
Posts: 664
#5 right...not quite sure what your problem is.

If you can't even find the files, they are in the AI/AIPs directory.
If you really can't get that far then I'm afraid no tutorial on the subject will help you.

AI modding is perhaps the most difficult part of modding Armada 2, I am one of very few modders who have mastered it (well, mastered aspects of it), generally most won't even touch it. When I wrote this I should perhaps have explained that this is for beginners to AI modding, not beginners to modding overall. A basic understanding of concepts like odfs and techtrees are needed before this will make sence to you.

 #7 - 05-14-2008 at 15:18
dEjavU001
Joined: May 7th, 2008
Posts: 35
Hello...... I'm trying to tweak the game AI for the Romulans in instant action because unlike the cardassian race(that I moded into using Dominion ships as well)the AI builds a variety of different ships but the romulans end up building only(rbattle2)warbirds throughout the duration of the game without any other variety of other classes of ships(maybe a science vessel now and again).....please help me out here.I dont understand whats causing this glich. i try to brush up on the inner workings of the AI but I dont know how to open the files in question....HELP ANYONE!!!

 #8 - 05-14-2008 at 15:25
dEjavU001
Joined: May 7th, 2008
Posts: 35
...........is there anyone left in the Armada II community..............did I come a little too late..

 #9 - 05-17-2008 at 06:50
Freyr (Staff)
From: (FileFront Network Administrator)
Joined: December 23rd, 2004
Posts: 784
There are plenty of people still left around, but there are thousands of pages on this site, and the comments section is meant to be for comments on the file, rather than communication between people.

If you drop a message in the forum :-
http://forums.filefront.com/star-trek-armada-ii-136/?=

Then it will get noticed within a reasonable time frame and people will be able to respond to it.

 #10 - how can i create my own race? - 08-18-2008 at 13:15
Darkrenamon
From: (Bremerhaven)
Joined: November 15th, 2007
Posts: 8
i want create a race. can you write a tutorial for this?

 #11 - 09-28-2011 at 09:02
Quarren_X
From: (Georgia)
Joined: February 16th, 2009
Posts: 103
haha that sounds like a handy tutorial to have, If I seen one like that I would hit it up!



When posting comments, you must follow these rules:
  1. No "Yay I got First Post!" posts, no exceptions and no matter what other content the post has!
  2. No Pornographic Material. Any sexually oriented imagery or links to such content will not be tolerated.
  3. No Warez or Illegal Software. This includes linking to software, posting about it, and suggesting to get it.
  4. No Cursing or Swear words. We encourage you to use our comment sections as a forum to debate files, news, etc., but please use proper adjectives to express yourself. We will not tolerate abuse upon another member or author.
  5. No Attacks / Retaliation of any kind against a member, or group of members.
  6. Please do not advertise for other sites or forums here.
  7. Maximum of 3 smileys per regular member.
The high interactivity of this site should be considered a luxury, not a right. If you cannot follow these simple rules, you can and will be warned or banned from the comments, site or the entire network for any period of time.
Now enjoy yourself and behave!



  • Register: To get your own Username, click here!
  • Forgot your password? click here!
  • You can use UBB here!
Username:     Password:  
Remember my username and password
Comment Title:
Your comments for this Document please:


 Latest Files
 » Cardassian station p..
 » Premonition Class (F..
 » Cardassian ship pack
 » SOD Exporter 3ds.. (1.4)
 » Miranda Class / post..
 » klingon stationpack 2
 » Goa'uld cargo sh.. (1.1)
 » Systems Commonwealth..
 » Ambassador class sta..
 » Systems Commonwealth..

 Latest News
 » Weekly Poll Results ..
 » Important Site News
 » Weekly Poll Results ..
 » Weekly Poll Results ..
 » Weekly Poll Results ..
 » A2 Explosion and Ord..
 » Megadroid's Mission ..
 » We Need PotDs.
 » Star Trek: Armada 1 ..
 » A2 GameObject comman..

 The Network
 » Gaming News
 » Game Demos
 » Game Patches
 » Trailer Videos
 » Gaming Forums

 Game Portals:
 » Age of Empires 3
 » Aliens vs Predator 2
 » America's Army
 » ArmA 2
 » Armada 2
 » Battlefield 1943
 » Bridge Commander
 » Brothers in Arms 2
 » Call of Duty 4
 » Command & Conquer
 » Company of Heroes
 » Crysis
 » Counter-Strike: Source
 » Dawn of War Series
 » Day of Defeat: Source
 » Diablo 3
 » Doom 3
 » Elite Force
 » Enemy Territory
 » Fallout 3
 » Far Cry 2
 » F.E.A.R.
 » Flight Simulator X
 » GTA San Andreas
 » Half-Life 2
 » Halo
 » Jedi Knight 3
 » Knights of the Old Republic
 » Left 4 Dead 2
 » LOTR: Battle 4 Middle Earth
 » Medal of Honor
 » Operation Flashpoint
 » Quake 4
 » Red Faction: Guerrilla
 » rFactor
 » Silent Hunter 4
 » Sins of a Solar Empire
 » Soldier of Fortune 2
 » S.T.A.L.K.E.R.
 » Star Trek: Legacy
 » Star Wars Battlefront 2
 » Star Wars Empire at War
 » StarCraft II
 » Starfleet Command III
 » Supreme Commander
 » Team Fortress 2
 » The Elder Scrolls IV
 » The Sims 2
 » TrackMania United
 » Unreal Tournament 3
 » Warcraft III
 » World of Warcraft
 » X3: Terran Conflict

You got served by in 0.131 seconds using 8 MySQL queries and 14 includes
Copyright © 2012 FileFront, Inc. All rights reserved.
Design by Jos Jongejan aka Pro-Filer & Blumenkohl. Use of Armada 2 Files materials is subject to certain Terms & Conditions.
TM & © 2012 Paramount Pictures. All rights reserved. Star Trek and related marks are trademarks of Activision, Inc. All rights reserved.