About AI in map editor

Hey.

I’ve got the maps for the campaign of Starcraft 1 & Brood War and I’m currently in the works of trying to edit them a little bit for personalising reasons.
Basically my aim is to try and get what would be player 2 to be an AI that works against the enemy/enemies of a given map, but so far that struggle has proven difficult purely and simply, because I know next to nothing about how to make the AI do certain things - or anything for that matter.

I’m aware that you got the AI scripts you can make run with them, but generally in some missions ( or most missions ) there’s pre-set buildings and units, but the AI never uses them. The most I’ve managed is to have them mine minerals, but that’s the extent of what they’ve done.

So my question is ( sorry it took that much text to get here ):
How do I make the AI work with pre-set buildings and units? I don’t need them to act like a player would per se, but just akin to how they would on any normal maps as if you were playing… say 1v1 against a bot, but with a bot ally.

You could look at Terran 2 as an example. Zerg enemy, the map has you ( the player ) and your co-op partner ( the bot ). How would I go about having them try and use what they have and can build and train to go look for the enemy and try take them down?

Thank you and sorry for the wall of text.

You would have to look :eyes: up for the triggers on the map you want to edit. The AI for computer players is set in the triggers.
Specifically, the name of the trigger is Run AI Script on Location.

I have went over to the Run AI Script in Location and tried that, but that only seemed to make the AI mine minerals and move a few units back, but that’s about it.
I checked through both the triggers and with the locations as to how has it been made for the enemy AI - as in how do they do their things like building or training units and the like - and I see little difference. They have their HQ’s ( Zerg Lairs, Hives etc. ) inside a Location and then using the Run AI Script on Location to set them as “Zerg Campaign Difficult” at location X.
Likewise I put my AI ally’s Command Center inside a Location and set it as “Terran Campaign Difficult” at location Y and all they did was mine minerals. There were even Refineries right next to them, but they completely ignored them.

I’m not sure if the AI’s ally status with the enemy makes any difference ( I think for some reason my ally AI might’ve been allies/neutral with the enemy ), so I’m gonna test that out to see if it makes any difference.

Yes, AIs for computer players are allies by default, no matter what Force they belong to. You need to set them as enemies of each other. Set them as respective enemies.

I forgot to come report the results.
The plus side is that yes, my AI ally did indeed fight the enemies.
The minus side is that they were very dumb about it.

Currently the AI only uses the workers they are given at the start, but will not make any new ones. Additionally they will only harvest certain resources ( if both of our bases are close enough, as they are in Terran 3 and 6 for example. ) I’ve noticed that SCMDraft 2 has an AI Town Locations button, which seems to bring up a yellow square ( of varying sizes I’ve seen on what is meant to be my town ) with bunch of lines connecting to resources, which of course are what the AI would use to determine which resources they’re going to harvest, which is of course why it would ignore some resources despite being right next to them.
How would you go about modifying this town thingy? I tried to look around and google, but in vain. Using Terran 3 as an example again, when I put on the AI Town Locations, it would point my CC to majority of the resources and even the Refineries owned by my AI Ally, so despite owning those Vespene Geysers, the AI would not use them.

So I’m left with two questions:

  1. How do I have my ally AI create more workers to efficiently harvest the resources around them, rather than just use what they are given initially, and to then use the buildings they have to efficiently build up an attack force which they’d use to fight the enemy with?

  2. How do I go about changing/modifying the yellow AI Town Locations square for my ally AI when our bases are close by, so that my yellow square would not take up resources the AI should realise to harvest?

Answering your questions:

  1. You have to change the AI script to one that trains workers. It could be Campaign Insane or Custom. Those scripts make stronger attacks and take expansions as well.
  2. The problem is where you put the Start Location for each player. Mining areas are affected by Start Locations. You will have to separate the Start Locations in that base or rearrange the resources.
  1. I’ve tried the Insane one just now and yes, it seems to have trained workers and units, though did nothing against the enemy with them. They did harvest the resources, but I was pretty much still left to deal with the enemy on my own. Maybe a part of this reason was because the AI jam packed the base full of buildings, though even then didn’t do much even when there was space to move. It did attempt an expansion a few times, but only with workers, bringing no troops to protect or fight for the expansion. I’m not sure if that’s just BW though. I did try the “AI Harass Here” in the Run AI Script at Location, but that seemed to do little to move them.

  2. That’s fair enough. Since it’s the Campaign maps, I’ve not really wanted to touch the Start Locations in order to avoid messing something up, but that’s good to know, thanks.

1 Like

You guys can find the map editor? I don’t see it in the launcher or game.

1 Like

I’m not using StarEdit ( the games own map editor ), instead I’m using SCMDraft 2, which is essentially like StarEdit, but better. I believe there’s a pinned thread on the forums if you want it.

Alternatively you can get StarEdit as well and I believe there’s a thread for that, too if you really want to use the classic map editor.

is there a way to may the AI a higher difficulty in editor? i was hoping the remastered version would give an option for this. shame it doesnt include the editor either.

i have the original games discs though so no worries.