Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: AI Scripts For Attacking Computer
AI Scripts For Attacking Computer
Jul 10 2023, 12:34 pm
By: ResolutionBlaze  

Jul 10 2023, 12:34 pm ResolutionBlaze Post #1



I'm making a campaign map that is essentially a pre-brood war campaign for zerg. You play as a cerebrate to reawaken the broods after the Overmind's death caused a psionic 'paralysis' on the living cerebrates.

For this map the goal is to cut through Daggoth's brood and get to him to reconnect his psionic commands to his brood before the Protoss cut through and kill him. Unfortunately I'm having troubles finding the right script.

I'm new to mapmaking, so trying to find the right script is very intimidating for SCMDraft 2 since there's so many. But my goal is to have the Protoss use the bulk of their forces to kill specific hives, with pauses between to let the player have time, while also harassing the player whenever possible.


Every script I use however, usually prioritizes the human player over the computer player. Meaning they spend no time trying to actually get to Daggoth and more time trying to kill you. I've used every campaign difficulty script. I've used locational script for "AI Harass Here" and "Order" triggers. However the Order trigger is finnicky and half the time they don't even wipe out the entire base. With the Harass trigger, the computer just sends Probes to the location and no other unit, until they run out of probes, then they just sit in base.

I'm absolutely stumpted. I'm not sure how to resolve this without making a bunch of specific scripts for the AI to kill each area of buildings.

Attachments:
Capture2.PNG
Hits: 3 Size: 12.53kb
Capture3.PNG
Hits: 2 Size: 691.2kb
Capture4.PNG
Hits: 3 Size: 524.5kb



None.

Jul 10 2023, 1:00 pm Ultraviolet Post #2



Your best bet without jumping into modding AI scripts is going to be to make liberal use of the Order action. Be sure to order the computer units to patrol (rather than attack) to wherever you want them to attack as the attack command doesn't operate in the same way that it does for a player controlling units. The default AI scripts that come with the game are not designed to do what you're looking to do.

Here's a few links that may help with your understanding of AI scripts:

http://www.staredit.net/topic/5517/
http://classic.battle.net/scc/faq/aiscripts.shtml
https://docs.google.com/document/d/1g5s0_tk7pcnVBqDiCgLWNgnuoNVu8TatXtROrWZ2JGU/edit
http://www.staredit.net/topic/291/#19
http://www.staredit.net/topic/13823/




Jul 11 2023, 6:31 am TheHappy115 Post #3



My experience with AI is somewhat limited too but I've done a fair amount of "forced" attack manipulation without the use of EUD triggers (which aren't very beginner friendly).

Important Things:
- Most AI scripts are generally very "weak" unit attacks with massive delays. Campaign AIs are generally an exception as they attack more often and usually with higher numbers. (Side Note: Easy and Hard Zerg AI are basically identical, which is probably a bug/oversight from Blizzard's size)

- The AI often is expected to start with multitude of resources, bases, and possibly some tech structures. If certain requirements are not met, they can stall trying to perform an "impossible task.

- Ensure the AI script matches the Computer's Race. This is important (I originally thought it didn't matter)

Weird Things I noticed:
- Sometimes, certain AIs really bug out (I have no idea why. This is extremely rare, but sometimes the AI can get stuck in a loop. You may want to test the same thing multiple times if this happens) This can also be due with supply limit stuff too (and is most likely to happen with Insane AI)

- The AI targeting attack waves seem somewhat "random." I don't know how it chooses but the AI will seem to "randomly" select an enemy target, and then proceed to clear the area of structures. If they don't attack certain locations, it could be because there are no enemy structures in that location. Furthermore, beware of invulnerable structures as some attack waves may get stuck "attempting" to kill said invulnerable structures and just stack on top of it.

Things You Can Do:

Easy Way: Create a set of units at a location and order them to patrol to an area. Once the area is clear, tell the same units to go to the next location. If you want, you can either use multiple AIs (Such as the Base is owned by CPU 1 but that "forced" attack wave is CPU 2 with "created" units ordered to attack a location and so on). Can also use "Hero" units with same stats as the normal units as substitutes instead.

Moderate Way: Create certain units with "animations" (like unburrow from a location) and then order them to attack a location. Also create a "town" location of the desired spot to attack and Center a Location onto the structures on that "town." Order units to patrol to that location. This effect makes it so units will then attack to the new location until all the structures in the "town" location are destroyed (leaving none behind).

Hard Way: Create units with animation (or no animation) at production facilities under CPU 2 command. (Whether its Hatchery, you can unburrow units, or create Marines at a barracks). Create a countdown timer that instead "randomly" generates a unit (such as every 20 seconds, 75% chance to produce marine, 25% firebat) and add incrementing counter for each time this happens. Add a second random trigger where at desired counter, there is a 50% chance the units will attack and reset the incrementing counter. Ensure CPU 2 is same color as CPU 1 (so you can't tell difference). Attack pattern can follow "moderate" way of attacking (however, you can have the origin point of where the units gather mixed by creating 4 different attacking positions too). Ensure that when the structure is destroyed, the spawn trigger is disabled. You can also set a counter for the "patrol" commander to prevent the AI units from "freezing" or "stutter stepping" in an unnatural way.

I've done with before with scouts, where originally the scouts would just attack immediately when created. Then I modified it to a incremental counter where the scouts would bundle up until 5 or so rounds of scouts were made. After 5 attack waves, the amount of scouts (or rate of spawn) would increase to 7 - 8 scouts and even sometimes 4 scouts and a carrier, and their attack position came from 4 different angled positions on the map to make it feel more like an AI attack wave. I will mention this process can be slightly tedious.

Hope these "bootleg" suggestions help. These were my own solutions to problems I had. If you are unsure what "counters" are, you can look up Death Triggers. Most stuff that I've found on StarEdit // Wikis can be useful (although I only read them AFTER I figured them out myself already)



None.

Jul 11 2023, 7:31 am IlyaSnopchenko Post #4

The Curious

Campaign AIs indeed choose targets randomly, whereas "melee" AIs (I put it this way because any AI can be made to behave like this, not just the actual melee scripts) attack whoever is closest, and they are usually persistent.

Never, ever disable units, upgrades and tech that the AI is going to require. It will most likely just freeze.

Give the AIs every building they might need because not all campaign AIs build everything they might realistically need, and if they do build, sometimes the order is wrong or something is still missing; the vanilla campaign scripts are particularly spotty in this regard.

Easiest solution (in the long run) is to just write the scripts you need.
Fail that, there are some moderately good AI scripts in Brood War, though they are mostly for the Zerg. However, unless you write your own, there is no reliable way of making them attack a particular target.



Trial and error... mostly error.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[04:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
Please log in to shout.


Members Online: Roy