[AI Contest] Mimic AI
Mimic AI by Callex
My entry for the sc2mapster AI competition!
Mimic actively records your build order and army composition as you play, which can then be saved into Mimic's memory for later use. Mimic will then try to emulate your playstyle in subsequent games!
Features:
- Mimic can play as Protoss, Zerg and Terran
- Mimic actively scouts, and cannot attack what it can't see
- Up to 12 players can be controlled by Mimic simultaneously
- The AI can be easily transferred into other melee maps
- Mimic can store up to 30 build orders simultaneously
Instructions:
Playing - By default, Mimic starts with no build or attack orders. If this is your first game against Mimic; build and expand as much as you please. Attack the existing enemy base, and type -save before defeating the opponent. Once the profile is saved, restart the game and Mimic will now know how to build and attack with your race! Alternatively, you can download the MimicAIData.sc2bank file and place it into the Starcraft II Beta\Banks folder. This contains 9 basic profiles to get you started.
Editing - You can change several basic settings within the AI Initialization trigger: 'Gather Rate' determines the mineral yield of the AI. Setting this to 2 will make the AI gather minerals twice as fast, and you can use this to alter the difficulty. Similarly, 'AI Omnipotence' can be toggled on to remove the scouting mechanic; this effectively allows the AI to see the entire map. If you want to choose which players are controlled by the AI, simply add them to the 'AI Players' player group.
Copying - Mimic can be copied into any melee map:
- Open the trigger editor
- Copy the 'Mimic' folder
- Open the destination map
- Paste the 'Mimic' folder into the destination map.
- Click on the 'Melee Initialization' trigger of the destination map, and delete the 'Set Default Melee Options' and 'Start Melee AI' functions.
- On the top toolbar, navigate to 'Map -> Player properties'
- Make all the desired AI players computer controlled
Tournament Mode - You can now battle different Mimic AI's against eachother using the following steps:
- Copy upto four AI data banks into the 'Banks' folder.
- Rename the files: 'MimicPlayer1.sc2bank', 'MimicPlayer2.sc2bank' etc
- Make the first four players computer controlled, or neutral if you want the slot to be empty. (In map -> player properties)
- Set Tournament Mode = true in the AI Initialization trigger.
- As a spectator in slot 5, choose the profiles for each AI. (The map numbers them as they are saved, so typing "-profile 1" will load the first build order saved to the player's bank.)
- Watch your AI's compete against eachother!
If anyone has an AI data bank they would like to upload for everyone else to try out, PM me!
Hi there
The concept of this AI sounds very promising for the custom content I have been adding in my own Extension Mod. I'd love to give it a go, but I've a few questions.
The AI as you state copies and mimics your build orders when you -save at the end of a match. By this process, is it able to build custom units I have added to my Mod? For example, I have added Medics to the Barracks. If I build Medics from the Barracks during a match and -save at the end of it, will the AI build Medics just like I did, since they are available and right there at the Barracks? Or does this concept only apply to currently existing default units? My additional units have the properly adjusted command card, training requirements and everything, so I see no reason it shouldnt work.
Is it possible to add just this AI code to a Mod Extension? I downloaded the Kulas Ravine map you've posted with the AI involved there, but is there a way to add the AI to a Mod Extension so that when the Mod is loaded on any map, it loads the AI too?
I apologize for the lengthy post, but this AI seems ideal for use with my Mod Extension given the number of custom units I have added. If the AI simply copies my own build orders from earlier games, it'd work perfectly.
No I wont be publishing the Mod Extension publicly / taking credit from your work here. I simply play SC2 with my Mod Extension and one friend in regular comp-stomp skirmish matches.
well download latest version and put the map wher ever you want, then open it with the map editor so that you can change race and game speed (the speed will be slow / normal from the start)
how to change race : klick map then player properties in the list, from ther you can pick how many bots (1 - 3), what race they should have and what race you want.
how to change game speed : klick file then preferences from ther you can pick the game speed.
now for in game its easy, if you download the mimic AI data you want to make a folder in documents named Bank and put the mimic AI data file ther or it wont work. then the ai can only learn your build if you save it so when you are done with the build or have won just type -save befor you end the game. (use the normal in game chat)
this is so confusing to get mimic AI to work some one please and that knows more than i do
Callex you made so the AI have to scout witch i just love but it needs more work and i know you are busy. But all im asking for in the future updates of this AI is a more advanced bulding placement, if you play zerg aginst AI terran you can simply rush the base down and win.
And thers the rocks that you sometimes need to destroy to gain access to a expo at high ground / gold expo witch is not targetable by the AI and its just a big minus when it gonna expand to a such expo.
All thats left is to fix buggs that bin found (tho i havent found any or bin looking).
Hello everyone, sorry I've been absent for the past week or so, been busy with UCAS applications and all that rubbish.
Not sure what's happening on the YABOT front; last I heard he was changing the save/load formula, but no clue what the progress is with that. A YABOT collab would handle the issue with UI and deleting/loading specified build orders etc.
As for other maps with this implemented; if anyone wants to PM me with alternate melee maps, I can upload them to the project page for mac users to download.
Those with AI attack issues; it could be due to attack recording problems. Make sure that for each build order you save you have attacked atleast once, with no nearby allied buildings. I don't think it records worker attacks either.
I'll try and get some free time to update this, but as I said, college and university applications have been keeping me quite busy.
I can submit some of my maps with this attached they are in beta test phase, but if you would like me to send you my maps let me know. You need editor to change the ammount of opponents. I have my maps set up as 2 computers allied vs you, he has his map as a FFA you vs comp vs comp vs comp.
Is there anyway for us to choose how many opponents appear? Could you also plz just make this for several maps, from the instructions you give, it doesnt seem that hard, its just that us mac users cant use map editor QQ :( -.- -_- ;( =(
plzzzzzz
I figured it out just edited the triggers in melee init, also changed it to faster which is nice.I hope Callex is bringing a new updated soon, because there are a couple of errors people have reported. Still love the triggers and the set up. Thanks has really helped me test the balance of my map.
I have added this AI to my maps for balance testing, but was curious how I could make the AI's on the same team, they are 2vs2 maps and I need it to be a 2 vs 1 to accuratly test. Is their a trigger preset inside his Thousand's of information or do I just need a new trigger in the melee initalization to set them to allies? Any help would be awesome. I'm a melee map maker not a UMS so triggers and I don't get along to well.
@StimTechniks: I had the same problem, and it turned out to be a simple RTFM for how to use Mapcraft. From the root directory, go into the folder /Applications/Starcraft II Beta and put the Mimic_AI_etc.SC2Map (or Behemoth, or whatever) map file in there. It'll work a lot better. :)
If you want to use the MimicAI Data Bank as well, put it in $HOME/Documents/Blizzard/Starcraft II Beta/Banks.
...Interestingly, the one mao I've found which will work reliably from anywhere on a Mac is YABOT, the hellaciously-neat build order tester.
CALLEX!!! i need your help bro. Im running Snow Leopard and am using Mapcraft to load maps offline. Why wouldnt mapcraft be able to load your AI? like... at all.
"Unable to load map" is the message it gives me.
Yabot, QXC tester, both work, along with all of QXC's terran macro maps. But why the hell not this ai... or Behemoth for that matter.
Plz Callex, surely u can understand how much i need my fix >.< plz help me.
Is anyone else having problems with the protoss AI not changing any gateways into warpgates? I am also getting the TriggerError in 'gt_AIAttackWaves_Func: Divide by zero message but im not using a mac...
i'm loving this.
forgive my ignorance, but is there a way to clear some (and not all) the saved build orders?
For example, i start using a build, then i save it, then play against it, beat it easily, and save that one. Then play with the other race again, improve that build and save that, but i would like the older build order to be cleared so that it won't be among the choices in the build order list since its obsolete.
If you don't have it in the game, i suggest adding it. If you do, i suggest having it clear-able from within the game when its loaded.
Great job, by the way. I was kind of hoping blizzard would do this to begin with, back when they started talking about the computer a.i.s and how they scout.
I'm running on a Mac via mapcraft and having a couple issues:
1) Protoss and Terran will not expand, but Zerg does (altho drone management is very bad) 2) Attack waves are only being sent in the very early game. After that I continually see this error :
TriggerError in 'gt_AIAttackWaves_Func: Divide by zero
I think it would be awesome if you could get your Mimic AI implemented into YABOT!
Hi Callex , i cant watch replay when i play with AI's, so i cant tell you whats not good with Mimic, but the thing i noticed it doesn't place building where i place them . I was playing with terran and he didn't block his entrance.And that build is useless if hes unable to defend against early attacks. I know i am asking the impossible, but it would be nice if Mimic could actually record my building placement.
I want to say that you are the first AI developer that doesn't use vision cheat ,and thats the most human like opponent you can get. I mean... Behemoth is using vision cheat, even GreenTea. So you are officially the first AI developer that implemented scouting, i congratulate you.
Also i have a suggestion for you. Why don't you just focus on build order, and building placement if that's even possible (or make terran and protoss always block entrance), improve scouting little more, and remove unit production recording. Make Mimic uses his resources at maximum when its massing his army. That way he will only follow my build order but will make army of his own by using his resources 100%. And when hes got good army composition, then he'll make a push. Also try implementing some good micro, like Behemoth did (i don't know how much cheat vision affects micro). Basically when he encounters greater army he'll retreat. But you are my favorite developer so far because of scouting thing.
I have question for you, when Mimic is recording my BO does he build at exact time as i did, or when he has enough resources? Same question for army. Does unit pop up at same time i build that unit, or when he has enough resources? In short, does Mimic records every move i make?
Your first breakthrough was scouting, your second would be base entrance blockade. If you manage that you are awesome.
For those having trouble with attacks, here are a few tips on how it works:
Whenever you attack enemy units, the game will check to see if you have any nearby buildings. If you do, then it is considered defensive and is not recorded. Otherwise, the game will pick all units within 10 range of the attacking unit, record them to an attack wave for the AI to use, and then starts a 60 second cooldown timer before another wave can be recorded. Things like proxy pylons and bunker rushes may confuse the AI, and prevent this recording from happening. If you want large-scale attacks, I suggest that when you record waves, cling to your base, and only attack with large armies if you wish to save your build order!
After saving: When the AI uses your build order, it will periodically go through all of the available attack waves, and count the number of units in the wave available compared to the number of units required. If the wave has enough, or nearly enough, then the AI will send the attack wave. Each time a wave is sent, the probabilty of it sending again is reduced, whereas the other waves get a slightly higher probability of being sent.
Currently there is no UI for choosing build orders, but I've been talking with xorpwnz and we MIGHT be able to implement mimic into YABOT, which has a UI for building build orders among many other useful features.
Thanks again for all the feedback and support from everyone.
the bot dont seems to be able to attack the rocks to get its expo. a drone / scv / probe is sent nothing els it doesnt destroy the rocks so u need to fix that and make it attack with more units instead of just 10 to 12 units
Just how do we choose which BO the opponen will use?
For some reason, my AI never pushes out. He builds a bunch of units around his production abilities but then never pushes outwards... I always go to him, but with identical compositions. It's pretty strange.