AI Creation

Talk about anything related to old versions of Armada.
1, 2
posted on September 25th, 2011, 8:13 pm
I think I have a small understanding on how the AI works in Armada II. I have saved many different tutorial on the AI to try and help figure it out but I have come up with an easy way to actually make an AI file.

I use an existing Stock AI file and just rename the units in it or copy whats there and extend it.

Right now, I have created only one AI File and I also copied its contents to the other 5 required AI files for that race. I haven't offically even started a match against them yet because of all the other testing work that I have started doing for the other races, so playing against my strongest and deadliest race, the Borg, will have to wait.

One thing I was wondering though, with the Max Buildable # through the 1.2.5 Patch,  "If there is a Max Build # assigned to certain ships or stations, will that affect the AI and how it plays? Or is it only work for the Human Player?"

Attachments

[The extension has been deactivated and can no longer be displayed.]

posted on September 26th, 2011, 1:36 am
When you copied the data to the other 4 AI files for the race, you didn't copy the entire thing did you? Just the names overriding the existing names but leaving the number entries alone? If not you've screwed up the AI as each one is different due to being for a different purpose, such as defence, offence etc.

That mistake is made by so many, and while I don't have a firm understanding of the AI, Freyr and even Terra_Inc are better with that, I do know enough to know each one is different and needs to be edited manually.
posted on September 26th, 2011, 2:28 am
Last edited by jetnova16 on September 26th, 2011, 2:52 am, edited 1 time in total.
Majestic wrote:When you copied the data to the other 4 AI files for the race, you didn't copy the entire thing did you? Just the names overriding the existing names but leaving the number entries alone? If not you've screwed up the AI as each one is different due to being for a different purpose, such as defence, offence etc.

That mistake is made by so many, and while I don't have a firm understanding of the AI, Freyr and even Terra_Inc are better with that, I do know enough to know each one is different and needs to be edited manually.



Actually, I did copy over all the information from the AI file that I edited to the other 5, I was told by Freyer to do that with AI that was put on the A2Files forums for the Cardassian Full Race Replacement Mod. From the AI file titled "cardassian_build_list" and to copy and bring the information over for building of ships ans stations to the the other 4 AI files. Ever since then, the Cardassian Race has been playing just fine.

It is funny that you say that about the AI though because some mods that I have installed also added their ship to the AI and the information that they told to add for each AI file for the given race was the same. One line of code and the Read Me files said to add it to all five AI files for that race.

I have been following Tutorials on the AI and haven't seen anything about differences even mentioned either.

Any ways, it isn't like Freyr is going to help me out with working on the AI or even give me any advice on it. I sent him an e-mail before looking for help and also contacted him through the A2files messaging system, both times I never got a reply. I bet I'll get the same treatment from anyone I attept to ask.
posted on September 26th, 2011, 7:49 am
jetnova16 wrote:I have been following Tutorials on the AI and haven't seen anything about differences even mentioned either.


Jetnova, the AI switches build lists during the game.

Elapsed time        Cycle                Personality                Build List              Probable cause                                                               
0S (0.00)              0                      hard_agressive          offensive list        Start                                                                               
48S (0.48)            2802                hard_exploration        instant_action      enemy discovered                                                           
154 (2.34)            9112                hard_agressive          offensive list        either enemy base discovered or starting scout lost?         
2505S (41:45)      133779              very_agressive            endgame              all enemy resource collection destroyed   


This is a copypasta from Freyr's article on personality parameters. As you can see, the AI changed its personality and build list during the game. If you write the AI protocols in the right way, you can use that to allow the AI to react to changes in the game. Let's say you want lots of artillery and heavy-hitters only in your endgame fleet, then put them only into the endgame file, and they will be built only during the endgame (well, whatever the engine thinks is endgame).

If you want to write a good AI, just go ahead and try to do one from scratch. It helps a lot to just try things out, Anyway, if you want a really good example of a modern AI, try this. http://armada2.filefront.com/file/Merciless_Klingon_AI_for_the_stock_game;110297
posted on September 26th, 2011, 9:51 pm
Terra_Inc wrote:Jetnova, the AI switches build lists during the game.

This is a copypasta from Freyr's article on personality parameters. As you can see, the AI changed its personality and build list during the game. If you write the AI protocols in the right way, you can use that to allow the AI to react to changes in the game. Let's say you want lots of artillery and heavy-hitters only in your endgame fleet, then put them only into the endgame file, and they will be built only during the endgame (well, whatever the engine thinks is endgame).

If you want to write a good AI, just go ahead and try to do one from scratch. It helps a lot to just try things out, Anyway, if you want a really good example of a modern AI, try this. http://armada2.filefront.com/file/Merciless_Klingon_AI_for_the_stock_game;110297


When it comes to the AI Terra_Inc, I want the AI to build all the possible ships in the mod in the order that they are in by Era. Also, I am posting in a .ZIP file the Hirogen AI, it is from a full race mod that I have decided not to use in my mod but the ships and stations are still available, the thing is if the AI is different, how come all the information in these AI files are exactly the same? I haven’t edited them or anything. If there are any differences, they aren’t easily spotted because I have compared the files side by side and line by line. Unless I am missing something, they are the same.

The AI files you suggested that I download, I did. I have even just finished comparing the “Klingon_build_list” to the “Klingon_defensive_list” and the build units, their numbers and their positions in the AI files also match. I See No Changes What So Ever checking the coding line by line. I have taken a screen shot as evidence to prove my point,  the two AI Files are side by side and you can see that the text in that section matches exactly, the same is said for the rest of the file (some of the “//” text is taking second lines above because of the size the documents are in).

As for my AI:
1) I want the AI to build its ships following the correct Eras process, as in from the Enterprise Era to the Distant Future. This type of thing wasn’t working in the Birth of the Federation Mod for Armada II and they didn’t know why, I believe it has something to do with the AI and how some have drastically changed the files, I have in fact looked at the stock Federation AI files and they compare to each other perfectly, the only differences are really on the top of the files before the units the AI can build, other than that , what is buildable is exactly the same right down to the last number in each row.

2) Also since I am seeing it in every AI file that I look at, I want the AI to have access to every u
nit in every AI file. So if it really does switch between the files, it still has everything and the option of having the exact same number it could have in another AI file.

Attachments

Hirogen AI.zip
(5.2 KiB) Downloaded 276 times
Screen Shot Showing Both Klingon AIs Side By Side - Clearly Identical.jpg
posted on September 26th, 2011, 11:05 pm
I would trust Terra in this Jetnova, he knows more than the two of us combined in this. He also did the COE AI for me as I was planning on releasing the mod without a working AI.

Plus he has done the Modder Toolkit, a group of programs created just for modding, so I would take his advice on this as he does know more than a little of what he is talking about.
posted on September 26th, 2011, 11:40 pm
Last edited by jetnova16 on September 26th, 2011, 11:43 pm, edited 1 time in total.
Majestic wrote:I would trust Terra in this Jetnova, he knows more than the two of us combined in this. He also did the COE AI for me as I was planning on releasing the mod without a working AI.

Plus he has done the Modder Toolkit, a group of programs created just for modding, so I would take his advice on this as he does know more than a little of what he is talking about.


I know Majestic.
But seeing is also believing and what my own two eyes are telling my is that the AI is idential in every file for each race.

Even stock AI files look the same.

I have the Modder Toolkit, but there isn't anything there on making a good AI. I almost have an idea if someone could impliment it, an AI creation Calculator like tool. Put in the amount of the ships you want build and it gives you the coding.

I have already attempted making an AI file from scratch before and the game wouldn't build anything, thus I came up with the way that actualy looks like the stock ODF files. The one AI I created from scratch followed the tutorials that I used to the letter and yet they didn't work.

I haven't tested the Borg AI that I attached yet, but well I was testing as another race they did send hips at me that weren't starting units.

*****
Why can't Terra_Inc created me an AI file for the BOrg? All the units that they have are listed in the AI file that I attached.

Heck, if someone could make you an AI for your mod that you were going to release without one, why can't tehy do it for those that need help with the AI?
I think if people did that, they might just get more action in the A2 Community in my opinion. Especailly after following the tutorials, I would feel better having someone else make the AI than taking the easy way out just because it ends up matching the stock ODF files in comparrison.
posted on September 27th, 2011, 7:38 am
Terra did it as a personal favour as we're good friends and he wanted to see the mod complete with an AI.

Currently he has a lot on with University/College with seminars and such last I heard so doesn't have a great deal of time.

Asking nicely can sometimes you get a better outcome than complaining that a member of the community is helping someone other than yourself. That's where you went wrong a year ago on MSFC and A2Files. I can understand your frustration but I'd hope you'd learn from your mistakes as I don't think you would want members here to stop helping you due to this kind of attitude. I am trying to help you here, not bring up the mistakes of the past.
posted on September 27th, 2011, 3:13 pm
Jetnova, most people do not care to optimize their AI, they just want to have one. Setting up an adaptive AI as Freyr suggests in his article on personality parameters is an option, not mandatory.

The Merciless Klingon AI actually contains different buildlists. Take a look at the attached screenshot comparing the offensive and defensive lists. You will see that they are quite different.

jetnova16 wrote:I have the Modder Toolkit, but there isn't anything there on making a good AI. I almost have an idea if someone could impliment it, an AI creation Calculator like tool. Put in the amount of the ships you want build and it gives you the coding.

The Toolbox was designed to help modders with everyday things that can be automatized. The tool you suggest would only spare you the typing work, you'd still need to think about the sequence and timing and techtree dependencies (provided that your AI doesn't cheat, as the stock one does.)

jetnova16 wrote:Why can't Terra_Inc created me an AI file for the BOrg? All the units that they have are listed in the AI file that I attached.

As Maj stated, I am currently up to my ears in university work. Writing and optimizing a good AI can take weeks if done correctly, and doing it correctly also means to just let it run and see how it builds stuff. I hope you understand that I can't just go and write one. :sweatdrop:

Attachments

ai shot.png
posted on September 27th, 2011, 7:53 pm
Terra_Inc wrote:Jetnova, most people do not care to optimize their AI, they just want to have one. Setting up an adaptive AI as Freyr suggests in his article on personality parameters is an option, not mandatory.

The Merciless Klingon AI actually contains different buildlists. Take a look at the attached screenshot comparing the offensive and defensive lists. You will see that they are quite different.
The Toolbox was designed to help modders with everyday things that can be automatized. The tool you suggest would only spare you the typing work, you'd still need to think about the sequence and timing and techtree dependencies (provided that your AI doesn't cheat, as the stock one does.)
As Maj stated, I am currently up to my ears in university work. Writing and optimizing a good AI can take weeks if done correctly, and doing it correctly also means to just let it run and see how it builds stuff. I hope you understand that I can't just go and write one. :sweatdrop:


Ok, I noticed that now that AI is different, then again that was created by another person not the Armada II developers. I don't see any differences in Stock AI Files. Maybe that is why you say it cheats. I haven't ever noticed the AI cheating, it seems fair to me, and then again, I have tactics that not even the merciless AI has gotten around. (Almost every Federation ship has Transphasic Torpedos for a special weapon. and the construction ships are even working well cloaked.

I need an AI that won't rely on itds starting units and can also get aroound multiple construction ships or starbases being able to build something that is also buildable from another ship or facility.

Is there anyone that you could recommend here that can at least help me with the AI, maybe check them over or after I say complete the "insert race here"_build_list.aip create the other files so that they work like the one you posted? I understand the "insert race here"_build_list.aip the best for creating it.
posted on September 27th, 2011, 9:10 pm
Last edited by Terra_Inc on September 27th, 2011, 9:14 pm, edited 1 time in total.
jetnova16 wrote:Ok, I noticed that now that AI is different, then again that was created by another person not the Armada II developers. I don't see any differences in Stock AI Files. Maybe that is why you say it cheats. I haven't ever noticed the AI cheating, it seems fair to me, and then again, I have tactics that not even the merciless AI has gotten around. (Almost every Federation ship has Transphasic Torpedos for a special weapon. and the construction ships are even working well cloaked.

What I meant with cheating is that the stock AI (as far as I know) does not adhere to the techtree, that mostly means it can build stuff without researching it. It doesn't normally use that though, since the buildlist was written according to the techtree, but the flag is there. The stock AI was never finished - if you check the AI folder, you will see that there is an empty one called "Neural". This was supposedly intended to become a neural AI, but was never completed.

jetnova16 wrote:I need an AI that won't rely on itds starting units and can also get aroound multiple construction ships or starbases being able to build something that is also buildable from another ship or facility.

I doubt that can be done with the AI. What you need to do is have separate ODFs - for instance, if your starbase can build Venture scouts, have an ODF named fscoutSB.odf (the name is completely irrelevant, I just made that one up) that just imports fscout.odf and is built by the starbase instead of the fscout.odf. They will be the same ship, but handled under different names. Then you can control via AI whether the fyard or starbase should build it.

jetnova16 wrote:Is there anyone that you could recommend here that can at least help me with the AI, maybe check them over or after I say complete the "insert race here"_build_list.aip create the other files so that they work like the one you posted? I understand the "insert race here"_build_list.aip the best for creating it.

While I can't write a complete AI for you, I can always look over stuff you've written and check it. It's just an offer - if you actually get an AI written (and possible working), maybe I can take a look at it for you. Really depends on how much time I have at that moment, but looking over it shouldn't take too long. I could probably try and get matching offensive and defensive AIs done as well, based on your work, but don't expect wonders from them, as I won't have the chance to optimize them. Optimization is what makes an AI clever. Then again, the pure writing in itself isn't much work , so you might be able to do it yourself. :ermm:
posted on September 27th, 2011, 9:36 pm
Terra_Inc wrote:What I meant with cheating is that the stock AI (as far as I know) does not adhere to the techtree, that mostly means it can build stuff without researching it. It doesn't normally use that though, since the buildlist was written according to the techtree, but the flag is there. The stock AI was never finished - if you check the AI folder, you will see that there is an empty one called "Neural". This was supposedly intended to become a neural AI, but was never completed.


By any chance what does Neural mean? Is it stand for a neutral AI?
Is it possible to have an AI for a non-playable race? I have some ships labled under the coding:
Code: Select all
race = "norace"
This was only for the fact that I decided not to use them as part of the races in my game, but I was hoping that they could build. These races are the Xindi (the Aquatic Dreadnought, The Xindi Insectoids' destroyer, the Xindi Reptilian battlecruiser, I also have 2 Borg spheres set as their planet destroying weapon, 1 is a proto-type, the other is a full version), and then there is also the Suliban. Both races have their own shipyard, only the Xindi don't have a construction ship.

On a side note with asking about an AI for "No Race", would the AI be able to use special weapons that say upgrae shipis? I know I have seen it use Special Weapons but will it upgrade? If not, the AI will be stuck with a Enterprise NX-01 the whole game unless it is destroyed. Lucky nothing requires the Enterprise's to build.

Terra_Inc wrote:I doubt that can be done with the AI. What you need to do is have separate ODFs - for instance, if your starbase can build Venture scouts, have an ODF named fscoutSB.odf (the name is completely irrelevant, I just made that one up) that just imports fscout.odf and is built by the starbase instead of the fscout.odf. They will be the same ship, but handled under different names. Then you can control via AI whether the fyard or starbase should build it.


I guess I can change that so they aren't built or see what happens first with the AI. Maybe it will by-pass carrier ships and go for shipyards and starbases. I just have the Mining Stations (Dilithium Mining Stations) set to also build freighters.

Terra_Inc wrote:While I can't write a complete AI for you, I can always look over stuff you've written and check it. It's just an offer - if you actually get an AI written (and possible working), maybe I can take a look at it for you. Really depends on how much time I have at that moment, but looking over it shouldn't take too long. I could probably try and get matching offensive and defensive AIs done as well, based on your work, but don't expect wonders from them, as I won't have the chance to optimize them. Optimization is what makes an AI clever. Then again, the pure writing in itself isn't much work , so you might be able to do it yourself. :ermm:


I don't mind anyone looking at my AI and checking it over. I am planning on attaching completed AIs in this thread for anyone who wants to check them out and also add their suggestions. In fact, I am going to attach with this thread a .ZIP of all 5 of the Borg AI's that I have. If possible, I'd like some suggestions for bettering it, either through this thread or minor code rewrite sent to my inbox or posted here.

Attachments

Borg AI.zip
(6.33 KiB) Downloaded 325 times
posted on September 27th, 2011, 10:05 pm
jetnova16 wrote:By any chance what does Neural mean? Is it stand for a neutral AI?
Is it possible to have an AI for a non-playable race? I have some ships labled under the coding:
Code: Select all
race = "norace"
This was only for the fact that I decided not to use them as part of the races in my game, but I was hoping that they could build. These races are the Xindi (the Aquatic Dreadnought, The Xindi Insectoids' destroyer, the Xindi Reptilian battlecruiser, I also have 2 Borg spheres set as their planet destroying weapon, 1 is a proto-type, the other is a full version), and then there is also the Suliban. Both races have their own shipyard, only the Xindi don't have a construction ship.

On a side note with asking about an AI for "No Race", would the AI be able to use special weapons that say upgrae shipis? I know I have seen it use Special Weapons but will it upgrade? If not, the AI will be stuck with a Enterprise NX-01 the whole game unless it is destroyed. Lucky nothing requires the Enterprise's to build.

I guess I can change that so they aren't built or see what happens first with the AI. Maybe it will by-pass carrier ships and go for shipyards and starbases. I just have the Mining Stations (Dilithium Mining Stations) set to also build freighters.

I don't mind anyone looking at my AI and checking it over. I am planning on attaching completed AIs in this thread for anyone who wants to check them out and also add their suggestions. In fact, I am going to attach with this thread a .ZIP of all 5 of the Borg AI's that I have. If possible, I'd like some suggestions for bettering it, either through this thread or minor code rewrite sent to my inbox or posted here.


Most of these speculations about nonexistent features are just that - speculations - but I and others assume that the Neural AI was supposed to be a sort of learning AI that changes its behavior during the game. (Most likely using neural networks.) However as you can see whatever it was intended to be did not make it into the game.

norace is there for technical reasons, I think. You know, planets and moons don't have a race. I don't think you can assign any ships or stations to that race. If you want to have a non-playable race, just give it an instantActionSlot of -1, that should make it so you can't select it as race when setting up a game.

The upgrade feature you mention? If it's done via patch 1.2.5, then I seriously doubt that the AI can use it. None of us ever got it to use it. You might be able to do it with the species 8472 evolve command, which the AI can use (I think) but that might be more trouble than it's worth.

On a side note, why would you want to upgrade your NX-1? In canon, the NX-1 wasnt refitted, it was just either trashed or mothballed for the Starfleet Museum (if that one exists in canon). The NCC-1701 was later on built as a completely new ship. I personally prefer to have my hero ships buildable and restricted to one at a time via the patch 1.2.5.
posted on September 28th, 2011, 3:09 am
Terra_Inc wrote:Most of these speculations about nonexistent features are just that - speculations - but I and others assume that the Neural AI was supposed to be a sort of learning AI that changes its behavior during the game. (Most likely using neural networks.) However as you can see whatever it was intended to be did not make it into the game.

norace is there for technical reasons, I think. You know, planets and moons don't have a race. I don't think you can assign any ships or stations to that race. If you want to have a non-playable race, just give it an instantActionSlot of -1, that should make it so you can't select it as race when setting up a game.

The upgrade feature you mention? If it's done via patch 1.2.5, then I seriously doubt that the AI can use it. None of us ever got it to use it. You might be able to do it with the species 8472 evolve command, which the AI can use (I think) but that might be more trouble than it's worth.

On a side note, why would you want to upgrade your NX-1? In canon, the NX-1 wasnt refitted, it was just either trashed or mothballed for the Starfleet Museum (if that one exists in canon). The NCC-1701 was later on built as a completely new ship. I personally prefer to have my hero ships buildable and restricted to one at a time via the patch 1.2.5


I have a few ships set to "norace", I'll have to check them out.

What I meant by Upgrading the NX-01 was in the lines of what is done in Ghost's Federation Compulation Mod with all the Enterprise named starships starting with the Enterprise NX-01 and ending with the USS Enterprise NCC 1701-E. (aka: in soe point down the techtree, the EnterpriseNX-01 is turned into the USS Enterprise NCC 1701, then the 1701-A, 1701-B, 1701-C, 1701-D (1701-D X-Refit), 1701-E). Slowly working through the techtree and also through the eras of Starfleet and Federation history.
posted on September 29th, 2011, 12:43 am
You could use the stock Borg Fusion Cube Command, but change it so only one ship (the NX-01) is required and the outcome is the NCC-1701. However you'll probably have to make it a researchable weapon so to avoid a person getting a NCC-1701-E in the ENT era.

As for getting the AI to use it is anyone's guess.
1, 2
Reply

Who is online

Users browsing this forum: No registered users and 5 guests