Introduction in AI programming
I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
1, 2
posted on June 24th, 2011, 3:07 pm
Currently the only two ways are via the ODFs, or plopping units in via the Map Editor and checking their ODF name. Eventually the guide will have a list of all ODFs 

posted on June 24th, 2011, 3:13 pm
Dominus_Noctis wrote:Currently the only two ways are via the ODFs, or plopping units in via the Map Editor and checking their ODF name. Eventually the guide will have a list of all ODFs
Ok... hmm... I will see, which is the most efficient way to get this stuff

posted on June 24th, 2011, 4:55 pm
Well, now I have another question 
When I look at the ODF-File, there are for example 4 files of the Klingon Chor Class:
kli_chorY.odf
kli_chorYS.odf
kli_chorZ.odf
kli_chorZS.odf
So, I know that in the build-list I have to use the name "kli_chorZ". But what is the different between this odf-files? Why there are listed 4 versions of the Chor? Can anybody help?

When I look at the ODF-File, there are for example 4 files of the Klingon Chor Class:
kli_chorY.odf
kli_chorYS.odf
kli_chorZ.odf
kli_chorZS.odf
So, I know that in the build-list I have to use the name "kli_chorZ". But what is the different between this odf-files? Why there are listed 4 versions of the Chor? Can anybody help?
posted on June 24th, 2011, 5:00 pm
The S Chors are the starting units that are constructed. Z and Y indicate the avatar Chors 

posted on June 24th, 2011, 5:08 pm
Dominus_Noctis wrote:The S Chors are the starting units that are constructed. Z and Y indicate the avatar Chors
Ahh... thx! (should read this FO ODF Nomenclature - The Hitchhiker's Guide to Fleet Operations ) ^^
posted on July 11th, 2011, 12:16 pm
Last edited by Nerd0001 on July 12th, 2011, 9:07 am, edited 1 time in total.
Well last days I tried to find out, how the AI and build lists work. In the documentation, there is mentioned:
"ODF name", build amount,base location, max build, techlevel,
So if you add a ship like this:
"fed_saberZ", 3,0, -1, 0,
the Saber will be build, until the amount of 3 is complete. If the AI lost 1 Saber, he will produce 1 again, to reach the build amount. So if you put this line in the build list, the AI wants to create and hold 3 Sabers all the time! If you look at your build lists, you used every time -1 (which means: build it, and hold it all the time). For buildings it might be reasonable, but not for ships (only if you like to have a stock of ships... like mining ships all over the match).
Instead you should use the line like this:
"fed_saberZ", 3,0, 1000, 0,
This means, the AI build a Saber until he reached the maximum ship amount of 1000 Sabers. And of course, the AI will never reach 1000 Sabers at one time. So if you use this lines, you can make a more individual AI.... like:
"fed_akiraZ", 3,0, 1000, 0,
"fed_intrepidZ", 2,0, 1000, 0,
"fed_excelsioriiZ", 4,0, 1000, 0,
"fed_saberZ", 5,0, 1000, 0,
"fed_intrepidZ", 3,0, 1000, 0,
The second point is, that the "base location" doesn't work fine. The AI builds storage docks not near the home base... Furthermore the Dilithium-Moon is for the AI no ressouce point, so he will only build stocks near the Tritanium-Moon. This is already mentioned in the FleetOps guide. That makes the AI ressouce management very complicated...
With the above mentioned "1000" you can create a better build list in the early game phase... I already make my own Federation Build Lists. If you use -1 in a later part of the game, you can manage/create a little better AI.
"ODF name", build amount,base location, max build, techlevel,
So if you add a ship like this:
"fed_saberZ", 3,0, -1, 0,
the Saber will be build, until the amount of 3 is complete. If the AI lost 1 Saber, he will produce 1 again, to reach the build amount. So if you put this line in the build list, the AI wants to create and hold 3 Sabers all the time! If you look at your build lists, you used every time -1 (which means: build it, and hold it all the time). For buildings it might be reasonable, but not for ships (only if you like to have a stock of ships... like mining ships all over the match).
Instead you should use the line like this:
"fed_saberZ", 3,0, 1000, 0,
This means, the AI build a Saber until he reached the maximum ship amount of 1000 Sabers. And of course, the AI will never reach 1000 Sabers at one time. So if you use this lines, you can make a more individual AI.... like:
"fed_akiraZ", 3,0, 1000, 0,
"fed_intrepidZ", 2,0, 1000, 0,
"fed_excelsioriiZ", 4,0, 1000, 0,
"fed_saberZ", 5,0, 1000, 0,
"fed_intrepidZ", 3,0, 1000, 0,
The second point is, that the "base location" doesn't work fine. The AI builds storage docks not near the home base... Furthermore the Dilithium-Moon is for the AI no ressouce point, so he will only build stocks near the Tritanium-Moon. This is already mentioned in the FleetOps guide. That makes the AI ressouce management very complicated...
With the above mentioned "1000" you can create a better build list in the early game phase... I already make my own Federation Build Lists. If you use -1 in a later part of the game, you can manage/create a little better AI.
posted on July 11th, 2011, 2:09 pm
Yup, that's correct - not using -1 makes the FO AI more competitive in long games as I understand it, as well as allows one to control how the ships come out (which order, and thus, making sure build time/cost is well accounted for).
posted on July 11th, 2011, 11:53 pm
Last edited by dragonmalice on July 11th, 2011, 11:55 pm, edited 1 time in total.
In "Aidef.h", there is a setting: "#define MAX_ELEMENTS" - which is the maximum number of lines in the build lists. If you exceed it, it will cause a game crash.
However, if you set it nice and high, you can make the list very long (not sure of the upward limits, but I've had endgame lists of hundreds of ships built 1 and 2 at a time).
Anyhow, the "-1" is very useful throughout the list for structures, miners, contructors, etc., but not so much for the combat ships that will go out and die. It just bogs things down and can prevent you from ever seeing the endgame (especially if the AI isn't working with unlimited resources). If you test and play through some games, I think you'll find that any high number has a similar effect - I usually keep the build loops limited to only 2-3 repeats until the endgame (when you're building nothing but ships).
Probably becuase I just haven't taken the time to experiment fully, I've also had the best luck with just setting all the tech levels to 0 and using the build limit to control when something stops building.
Keep in mind that, for some reason, the AI aways gets to a point where it's beaten. If you destroy enough of the core structures, it won't rebuild regardless of whether it has the resources or necessary construction units. It's not unusual to pull up the debugger, and see that the build list is calling for a Starbase, has plenty of resources and a construction ship, but says no producer is available.
I haven't seen an AI in Fleet Ops or stock A2 that didn't have this problem - then again, maybe no one else gets a kick out of stomping the AI down to nearly nothing just to let them rebuild again
However, if you set it nice and high, you can make the list very long (not sure of the upward limits, but I've had endgame lists of hundreds of ships built 1 and 2 at a time).
Anyhow, the "-1" is very useful throughout the list for structures, miners, contructors, etc., but not so much for the combat ships that will go out and die. It just bogs things down and can prevent you from ever seeing the endgame (especially if the AI isn't working with unlimited resources). If you test and play through some games, I think you'll find that any high number has a similar effect - I usually keep the build loops limited to only 2-3 repeats until the endgame (when you're building nothing but ships).
Probably becuase I just haven't taken the time to experiment fully, I've also had the best luck with just setting all the tech levels to 0 and using the build limit to control when something stops building.
Keep in mind that, for some reason, the AI aways gets to a point where it's beaten. If you destroy enough of the core structures, it won't rebuild regardless of whether it has the resources or necessary construction units. It's not unusual to pull up the debugger, and see that the build list is calling for a Starbase, has plenty of resources and a construction ship, but says no producer is available.
I haven't seen an AI in Fleet Ops or stock A2 that didn't have this problem - then again, maybe no one else gets a kick out of stomping the AI down to nearly nothing just to let them rebuild again

posted on July 12th, 2011, 12:08 am
Last edited by dragonmalice on July 12th, 2011, 12:11 am, edited 1 time in total.
For the base location thing, it's a mixed bag. Since you know the locations are defined by the resource locations, you can either:
Choose to keep everything at location 0, which can make for a nasty base to take on if your AI can work off of a couple moons.
or
Keep building mining stations at new moons like a player would, and have the AI build lots of defense stuff at those locations. You can't force the AI to place the structures intelligently, but if you build a bunch of turrets and a couple of bases at each location, something's gonna end up in a good spot. If you spread out the ship yards as well, the result is that most locations tend to have a defense fleet as well (except for right after sending attack waves).
Since we're talking single player, you can also make your own maps to try to influence the AI. If you start the AI at a location with a moon (location 0), and put another moon behind that location (and closer than any other moons), you can bet that the second moon is going to be location 1. Build your heavy defenses at location 0, then put the research and sensitive stuff at location 1. Take it to extremes, and you can get the AI to build a perimeter around the other stuff by having a circle of moons and building at each of them. The more saturated the map is with moons, the more "random" the AI construction seems to get.
Choose to keep everything at location 0, which can make for a nasty base to take on if your AI can work off of a couple moons.
or
Keep building mining stations at new moons like a player would, and have the AI build lots of defense stuff at those locations. You can't force the AI to place the structures intelligently, but if you build a bunch of turrets and a couple of bases at each location, something's gonna end up in a good spot. If you spread out the ship yards as well, the result is that most locations tend to have a defense fleet as well (except for right after sending attack waves).
Since we're talking single player, you can also make your own maps to try to influence the AI. If you start the AI at a location with a moon (location 0), and put another moon behind that location (and closer than any other moons), you can bet that the second moon is going to be location 1. Build your heavy defenses at location 0, then put the research and sensitive stuff at location 1. Take it to extremes, and you can get the AI to build a perimeter around the other stuff by having a circle of moons and building at each of them. The more saturated the map is with moons, the more "random" the AI construction seems to get.
posted on July 12th, 2011, 6:51 am
we have made some small improvements to the ai. In the next patch, the AI will be able to recover from a complete loss, given it still has a construction ship, if course
posted on July 12th, 2011, 9:07 am
Are there also plans, to manage the "moon detection"? If the AI knows, that the Dilithium moons are also ressources, it is possible to improve its ressource management.... Do you have some information about that problem, so I can work on this?
1, 2
Reply
Who is online
Users browsing this forum: No registered users and 2 guests