Hello. Me and my friends like to play these things called "Marine Battles" on a map that I made. Most of the time, we can only get 3 people and it is a 4 person map. We would like to have an AI that would play with us. I have made it so that you could not build any buildings or units that are unnecessary. (Such as Reapers or Starports). I tried to make an AI by myself, and it would get the upgrades needed and everything, but it would not build any more than like 50 marines. We usually end up with about 200 marines, and we can easily beat the AI. If anybody could help me make the AI make more marines, it would be greatly appreciated. Thank you.
I do apologize for the bump but I am adding detail which might otherwise go unnoticed.
You can modify the melee AI build compositions to be of any size. For example I have a demo map where the cheating AI will think nothing of building 170 marines and sending them around in a huge ball.
To do this you need to extract the AI files from the expansion mod (Eg Swarm or Liberty) and then import them into your map using the import manager. You can then modify the pure Galaxy AI scripts any way you want, including adding or removing build orders.
In this case you would want the TriggerLibs/Terran/Terran.galaxy file and its accompanying imported files. If you go ahead and write your own custom AI you do not need the associated imports as those are purely there to add functionality for every difficulty level. Unless you want difficulty to be configurable and that the AI does different things at different difficulties you should be able to get away with just hard wiring in a single difficulty file.
Generally the AI works as a form of state machine with some extra background "stuff" for unexpected occurrences. Each AI has 3 stages (early, middle and late) which determine build orders and army composition. Each stage has multiple states which determine the build order the AI uses. Each build order consists of simply setting stock (how much of something it wants to own) in the order you want it to build and the AI will deal with placement and things.
An example of such a build order which I have tested and does work.
By the end of this build order the AI will own 170 marines and an optional resource base. It will try to build 15 Barracks and give them each a Reactor however this may fail due to a lack of placement area near the main base. It will also build enough supply depots to make sure that 200/200 is achieved. By altering the order to have fewer barracks to start with and before all supply depots one could have marines out earlier instead of towards the 5-7 minute mark.
Since this code is called periodically one can add conditional logic to the build order. For example additional supply depots could be ordered above everything else but only when needed . Like wise Barracks could be ordered on demand based on the availability of minerals (if 500 minerals are spare then order another barracks as production is not matching resource income).
Splitting the barracks and depots into conditional checks for how many of each they own will separate the blueprint for base construction, resulting in tighter building placement and higher likelihood of it creating all of the desired structures.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello. Me and my friends like to play these things called "Marine Battles" on a map that I made. Most of the time, we can only get 3 people and it is a 4 person map. We would like to have an AI that would play with us. I have made it so that you could not build any buildings or units that are unnecessary. (Such as Reapers or Starports). I tried to make an AI by myself, and it would get the upgrades needed and everything, but it would not build any more than like 50 marines. We usually end up with about 200 marines, and we can easily beat the AI. If anybody could help me make the AI make more marines, it would be greatly appreciated. Thank you.
Add the marines to an attack wave, store the wave for later use, then train 50 more.
Suggest it build more marines all the time. That is how the melee AI does its army compositions.
If you need implementing help feel free to drop me the map and I will look into the problem.
I do apologize for the bump but I am adding detail which might otherwise go unnoticed.
You can modify the melee AI build compositions to be of any size. For example I have a demo map where the cheating AI will think nothing of building 170 marines and sending them around in a huge ball.
To do this you need to extract the AI files from the expansion mod (Eg Swarm or Liberty) and then import them into your map using the import manager. You can then modify the pure Galaxy AI scripts any way you want, including adding or removing build orders.
In this case you would want the TriggerLibs/Terran/Terran.galaxy file and its accompanying imported files. If you go ahead and write your own custom AI you do not need the associated imports as those are purely there to add functionality for every difficulty level. Unless you want difficulty to be configurable and that the AI does different things at different difficulties you should be able to get away with just hard wiring in a single difficulty file.
Generally the AI works as a form of state machine with some extra background "stuff" for unexpected occurrences. Each AI has 3 stages (early, middle and late) which determine build orders and army composition. Each stage has multiple states which determine the build order the AI uses. Each build order consists of simply setting stock (how much of something it wants to own) in the order you want it to build and the AI will deal with placement and things.
An example of such a build order which I have tested and does work.
By the end of this build order the AI will own 170 marines and an optional resource base. It will try to build 15 Barracks and give them each a Reactor however this may fail due to a lack of placement area near the main base. It will also build enough supply depots to make sure that 200/200 is achieved. By altering the order to have fewer barracks to start with and before all supply depots one could have marines out earlier instead of towards the 5-7 minute mark.
Since this code is called periodically one can add conditional logic to the build order. For example additional supply depots could be ordered above everything else but only when needed . Like wise Barracks could be ordered on demand based on the availability of minerals (if 500 minerals are spare then order another barracks as production is not matching resource income).
Splitting the barracks and depots into conditional checks for how many of each they own will separate the blueprint for base construction, resulting in tighter building placement and higher likelihood of it creating all of the desired structures.