It's been a while since I last posted here. Here's the problem:
I'm updating the Team Monobattles Mod (http://www.sc2mapster.com/assets/monobattles/) so that the AI can also play along. Basically, each player can only select ONE unit at the start of the game and build ONLY that unit for the rest of the match.
One of the Protoss choices is that famous "Warp Prism". Now obviously, I cannot just have the AI build Warp Prisms and do nothing with them so the idea is for the AI to put on some Photon Cannon pressure.
I thought the way to go about this is for the map author to place a series of "Cannon Placement Points" that mark suitable places for the AI to initiate it's cannon rush. Then, when it gets a Warp Prism, it loads a Probe, transports it to the target, morphs into an activated Warp Prism and have the probe build a pylon and two cannons. Once this is done, the probe slowly inches its way forward with photon cannons and pylons towards an enemy base.
Is there any obvious alternative to this which I am missing? I would appreciate any help you could give.
Klishu
P.S.: There seem to be multiple native AI functions which are not listed in the Trigger Editor. Anywhere I can find a handy list of these?
@Klishu:
Do a priority point creator.
First off, you need two "checkers", one for the warp prism creation, and one for the warp prism idling.
Creation:
When the warp prism is created, check all enemy units. At each enemy unit, create a temporary point (something like Point[X]). Then around that point, make it pick each unit in a range of 5 excluding structures, invuln, etc. Then put that new value in another variable, called AiValue[A]). When it is done filtering units (Set Boolean Executed to true after the loop that picks each unit, and then in the maximum value determining trigger, make a "Wait for Condition(s)" and wait for that variable to become true.
Now, you've finished the first part - finding the density of units. Remember: Density does not mean power, there may be five marines in one spot, and 4 battleships in another, the "AI" will still prioritize the marines. Obviously that's a problem, so we move onto the second part:
Unit custom values (we're going to sue blizzard since it's easier then making your own custom return values). Create a new trigger that runs at .01 game time, and set each unit's custom value (Units that you will be using in your map), to this:
Medivac = (Other value, if biological) *2
Zergling = 1
Marine = 2
Hellion = 3
As you can see, the stronger a unit will be, the higher it's custom value will be.
http://wiki.sc2mapster.com/galaxy/triggers/category-ai/
Edit: Please tell me if you want to utilize this, since it's not even halfway done. If you do, i'll finish it up.
Thanks for your feedback Obliviron but unfortunately, I can't understand how this will help. Mind you, ideas needn't be complex. I'd prefer the ideas be more in terms of how the AI will think and then leave the implementation up to me.
Also, regarding the Wiki link there, those are the list of functions visible in the Trigger editor. Blizzard seems to use some functions in their AI scripts which do not appear in the trigger editor.
@Klishu:
No problem, my idea is simple: Get the highest value of units in an area, and order the ai to build defenses to the closest allied "base". If there's no base, it simply build defenses 10' from them.
Those functions were coded by blizzard for their maps, i don't know if we can use it. Tell me the map and function, and i'll see if i can find it.
Haha made a typo in my first post "sue blizzard".
Ah, now I see what you mean. I reread my post and I see that I didn't actually explain myself very well. Basically, I need to teach the AI how to execute a Cannon Rush assisted by Warp Prisms. I've done defending with Photon Cannons because there's an AINeedsDefending() function that I use to determine whether the AI should build Photon Cannons or not. The hard nut to crack is for the AI to use Photon Cannons offensively.
How do you want them to be used offensively?
As in, slowly moving up to the enemy's base by building more and more towers, or simply running up and massing towers?
Does the AI have maphack vision?
Also, what sort of terrain/layout and how do players develop in general?
It's normal Melee style and the aim is for the AI to start Warp Prisms a Cannon Rush. As I said, the plan is for the map author to mark on the map suitable locations for starting a cannon rush. Take Arakan Citadel, for example. I'd mark the tiny cliffs at the entrances as suitable for a Cannon Rush.
Then, when the AI decides that it is time for a Cannon Rush (which is the moment they get a Warp Prism), they take a probe to one of these marked locations and start building cannons, slowly inching their way towards the enemy.
Hi guys,
It's been a while since I last posted here. Here's the problem:
I'm updating the Team Monobattles Mod (http://www.sc2mapster.com/assets/monobattles/) so that the AI can also play along. Basically, each player can only select ONE unit at the start of the game and build ONLY that unit for the rest of the match.
One of the Protoss choices is that famous "Warp Prism". Now obviously, I cannot just have the AI build Warp Prisms and do nothing with them so the idea is for the AI to put on some Photon Cannon pressure.
I thought the way to go about this is for the map author to place a series of "Cannon Placement Points" that mark suitable places for the AI to initiate it's cannon rush. Then, when it gets a Warp Prism, it loads a Probe, transports it to the target, morphs into an activated Warp Prism and have the probe build a pylon and two cannons. Once this is done, the probe slowly inches its way forward with photon cannons and pylons towards an enemy base.
Is there any obvious alternative to this which I am missing? I would appreciate any help you could give.
Klishu
P.S.: There seem to be multiple native AI functions which are not listed in the Trigger Editor. Anywhere I can find a handy list of these?
@obliviron: Go
Thanks for your feedback Obliviron but unfortunately, I can't understand how this will help. Mind you, ideas needn't be complex. I'd prefer the ideas be more in terms of how the AI will think and then leave the implementation up to me.
Also, regarding the Wiki link there, those are the list of functions visible in the Trigger editor. Blizzard seems to use some functions in their AI scripts which do not appear in the trigger editor.
Ah, now I see what you mean. I reread my post and I see that I didn't actually explain myself very well. Basically, I need to teach the AI how to execute a Cannon Rush assisted by Warp Prisms. I've done defending with Photon Cannons because there's an AINeedsDefending() function that I use to determine whether the AI should build Photon Cannons or not. The hard nut to crack is for the AI to use Photon Cannons offensively.
Klishu
It's normal Melee style and the aim is for the AI to start Warp Prisms a Cannon Rush. As I said, the plan is for the map author to mark on the map suitable locations for starting a cannon rush. Take Arakan Citadel, for example. I'd mark the tiny cliffs at the entrances as suitable for a Cannon Rush.
Then, when the AI decides that it is time for a Cannon Rush (which is the moment they get a Warp Prism), they take a probe to one of these marked locations and start building cannons, slowly inching their way towards the enemy.