Preliminary AI Build List.

posted on October 9th, 2013, 3:32 am
Ok so I've experimented with my first attempt at an AI for my Star Wars mod's Rebellion Faction. So far the only thing the AI builds is a single construction ship but nothing else. I have the list going down through techphase 1 at least but nothing is happening. I brought up the AI list debugger and it said 'No producer available' which doesn't make sense because the list tells the AI to build at least two construction ships. But it only builds one and it just sits there. Here is the list itself. Please help.

#include "aipdef.h"

int checkTechnologyAvailable = 0;

Way_Better_Build_List_Element the_build_list[MAX_ELEMENTS] =
{
//Startup
"Reb_const", 2,0, -1, 1,
"Reb_yard", 2,0, -1, 0,
"Reb_mining", 1,1, -1, 0,
"Reb_mining", 1,2, -1, 0,
"Reb_mining", 1,3, -1, 0,
"Reb_mining", 1,4, -1, 0,
"Reb_freight", 4,0, -1, 0,
"Reb_repair", 1,0, -1, 0,
"Reb_corv", 1,0, -1, 0,

//Base Vessels
"Reb_modcorv", 3,0, -1, 0,

//Techphase 1
"Reb_yard", 1,2, -1, 0,
"Reb_turret", 1,1, -1, 0,
"Reb_turret", 1,2, -1, 0,
"Reb_turret", 1,3, -1, 0,
"Reb_turret", 1,4, -1, 0,
"Reb_resear", 1,0, -1, 0,
"RebU_chassis1", 1,0, -1, 0,

//Military Phase 1
"Reb_repair", 2,0, -1, 0,
"Reb_Nebfrig", 2,0, -1, 0,
"Reb_MarauderCorv", 2,0, -1, 0,
"Reb_modcorv", 4,0, -1, 0,
"Reb_bulk", 4,0, -1, 0,

One other question, for making AI for a new faction do I need those other lists that are blank and have them named appropriately? The defensive and aggressive lists?
posted on October 9th, 2013, 4:35 am
I have a very similar problem, but only on one 2-player map. Is this a 2-player map and if so when you're playing is the AI always starting at the same location? If you switch the start locations does the AI then start building ok in the different spot?

If you change your first line to only build 1 con ship what happens? Will the AI still stop after only 1 ship? Does it have enough resources to build both con ships in a row? Puzzled on this one.
posted on October 9th, 2013, 4:47 am
I play a 4-player map haven't tried changing positions though. Even if i change the first line to one ship it builds the one ships then just sits there. It has plenty of resources. I'll play with my settings some and see what happens.
posted on October 9th, 2013, 5:04 am
I changed positions and changed the advanced global build cost settings. It started to work but it needs to build more construction ships. I'm gonna have to play with it to get it to work like I want. (On this map the Federation AI builds a shipyard near the base and at the next resource location. My rebellion AI built two shipyards at the two closest moons to the base.)
posted on October 10th, 2013, 4:03 am
Im using the 4-player map asteroid halma to test the AI. When I put it in the lower left starting position it progresses normally through the build list. But when i put it at the top left, it builds the first two lines (construction ships and corellian corvettes) then stops. The ships that are built don't do anything. I think they got stuck at the top. But I can put the federation ai in the same place and it works just fine. Should I be using a bigger map to test the ai?
posted on October 10th, 2013, 4:13 am
Well, I did some testing on my mod as well due to my similar issues. I went into the map editor and edited that particular map causing problems and moved the planets apart several grid squares and then the AI started building like normal. It apparently just didn't have enough room.

Now mine is stock A2 so yours being FO I'm guessing you would need to move the start position slightly to give the AI more room to build? Also, the federation AI station may have a smaller foot print than your rebel station so maybe the size is causing the problem between the races?
posted on October 10th, 2013, 4:42 am
That could be a problem. But I don't use the map editor for anything. I think I'll just test it on a wider map from now on.
posted on October 11th, 2013, 10:26 pm
SPARTAN078 wrote:
#include "aipdef.h"

int checkTechnologyAvailable = 0;

Way_Better_Build_List_Element the_build_list[MAX_ELEMENTS] =
{
//Startup
"Reb_const", 2,0, -1, 1,
"Reb_yard", 2,0, -1, 0,
"Reb_mining", 1,1, -1, 0,
"Reb_mining", 1,2, -1, 0,
"Reb_mining", 1,3, -1, 0,
"Reb_mining", 1,4, -1, 0,
"Reb_freight", 4,0, -1, 0,
"Reb_repair", 1,0, -1, 0,
"Reb_corv", 1,0, -1, 0,

//Base Vessels
"Reb_modcorv", 3,0, -1, 0,

//Techphase 1
"Reb_yard", 1,2, -1, 0,
"Reb_turret", 1,1, -1, 0,
"Reb_turret", 1,2, -1, 0,
"Reb_turret", 1,3, -1, 0,
"Reb_turret", 1,4, -1, 0,
"Reb_resear", 1,0, -1, 0,
"RebU_chassis1", 1,0, -1, 0,

//Military Phase 1
"Reb_repair", 2,0, -1, 0,
"Reb_Nebfrig", 2,0, -1, 0,
"Reb_MarauderCorv", 2,0, -1, 0,
"Reb_modcorv", 4,0, -1, 0,
"Reb_bulk", 4,0, -1, 0,

Why does it have a Technology level entry? The "1" there indicates that the unit can only be built in tech level 1.
I suggest to not to use any technology levels. Replace it with a "0" and the unit can always be built.
This is what the modding guide (http://guide.fleetops.net/guide/modding/units/artificial-intelligence) says about this:
"0" indicates that the unit can always be built by the AI without any special requirement other than being added into the proper techtree files (if checkTechnologyAvailable is not set to 0).
posted on October 12th, 2013, 1:27 am
@ Ressikan:

Actually his AI as posted mirrors stock A2. In the first line: "Reb_const", 2,0, -1, 1, the last 1 at the end simply means that the Reb_const ship is the start of tech level 1. He can keep building that line even if he gets up to tech level 50 as long as he doesn't use the -1 to mean that that line will not be built "after" tech level 1.

That last number only denotes the tech level and you can build anything in your list at any tech level as long as you don't tell the AI to stop building past a certain tech level with the "-"
Reply

Who is online

Users browsing this forum: No registered users and 5 guests

cron