Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Terran AI Script Problems
Terran AI Script Problems
Jul 21 2016, 8:25 am
By: Sie_Sayoka  

Jul 21 2016, 8:25 am Sie_Sayoka Post #1



I've been messing with AI scripts for the past few days and it's been horrible. I'm unsure what exactly is needed for the script to perform properly. Here are 2 test maps. In the first one the script works flawlessly. In the second, it just spams marines. Both of the scripts use the custom AI (I could not get the insane AI to work for some reason). Both bases are provided with minerals and vespene gas.

Also I have been able to run Zerg insane AI without any problems. I'm unsure as to why Terran is having this problem.

What factor(s) cause the script to bug within the second map and how can I fix this?
What factor(s) are needed to perform a flawless insane AI script for Terran?

Attachments:
ai test.scx
Hits: 5 Size: 54.13kb
zombies.scx
Hits: 6 Size: 168.85kb



None.

Jul 21 2016, 3:44 pm CecilSunkure Post #2



The Terran AI (I'm assuming insane) may be looking for a place to lay down an Academy or Factory, and the Brood War script itself is just straight up failing to find a spot. Try tweaking the terrain, and try giving them a little more space to exist. Maybe someone else will have more suggestions, but these are the things I would try first.



None.

Jul 21 2016, 4:00 pm NudeRaider Post #3

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Wrong race in the map description. If you run an AI script that's for a specific race, the player must have the correct race. What it does is try to zergling rush, but since he's terran the only unit he can produce is marines, so it will do it until it created the 6 or however many zerglings the script says, which can never happen. So it just always stays at that stage of the AI script.




Jul 21 2016, 4:32 pm DarkenedFantasies Post #4

Roy's Secret Service

Move the Start Locations away from Player 5's base (to Player 7's base for example), that fixes the problem for me.

Except Player 5's own, which should preferably be placed directly under his Command Center.




Jul 21 2016, 4:46 pm CecilSunkure Post #5



Oh good point. I do recall that I always placed start location directly under starting Command Centers or Hatcheries. IIRC some of the actual campaign maps do this.



None.

Jul 21 2016, 5:09 pm DarkenedFantasies Post #6

Roy's Secret Service

Yeah, I always place the Start Location under the main base's town center as well—and the location for the AI Script. However the problem on this map was the proximity to the other Start Locations. I can place Player 5's Start Location anywhere on the map and the AI will play out correctly, as long as it's at least 34 tiles apart from any other Start Location.




Jul 21 2016, 5:53 pm Sie_Sayoka Post #7



Thanks for the answers guys.

Quote from NudeRaider
Wrong race in the map description. If you run an AI script that's for a specific race, the player must have the correct race. What it does is try to zergling rush, but since he's terran the only unit he can produce is marines, so it will do it until it created the 6 or however many zerglings the script says, which can never happen. So it just always stays at that stage of the AI script.
P5 is the correct race.
Move the Start Locations away from Player 5's base (to Player 7's base for example), that fixes the problem for me.

Except Player 5's own, which should preferably be placed directly under his Command Center.
Very good suggestion. I'll test this out.
Quote from CecilSunkure
The Terran AI (I'm assuming insane) may be looking for a place to lay down an Academy or Factory, and the Brood War script itself is just straight up failing to find a spot. Try tweaking the terrain, and try giving them a little more space to exist. Maybe someone else will have more suggestions, but these are the things I would try first.
I'll try this if the start locations don't work.

Both worked flawlessly!

Post has been edited 1 time(s), last time on Jul 21 2016, 9:31 pm by Sie_Sayoka.



None.

Aug 3 2016, 7:55 pm Sie_Sayoka Post #8



Is there a way to limit the unit types that an AI will use without breaking it? I tried to disable production of air units but the AI seems to break. I need the AI to only send ground waves.



None.

Aug 3 2016, 8:11 pm CecilSunkure Post #9



I think you can disable the ability to construct a starport in the settings. Either that or make the starport really expensive. If the AI script itself relies on the ability to make air units it will break no matter what, so there may be no solution. Just gotta try stuff out.



None.

Aug 3 2016, 11:03 pm noobscrub Post #10

le LITERALLY me when im ex dee while driving face xdddd

just put the suicide AI script and make triggers where whatever ground units you want appear in zones too far where the player can't reach (burrowed if possible) in the time you want.

or you can either try this:

*put a hidden building for the enemy player near your base
*put an allied marine that will shoot at it constantly
*make sure the structure has lots of hispoints or either make it's hp go back to 100% everytime with triggers

this might make the AI become agressive and would force him to make as much anything they can produce in that location for an unlimited ammount of time. be sure to put lots of production buildings depending on how much agressive you want it to be.

i haven't tried this myself so im not sure if that works btw.



xd

Aug 4 2016, 12:37 am Sie_Sayoka Post #11



Quote from CecilSunkure
I think you can disable the ability to construct a starport in the settings. Either that or make the starport really expensive. If the AI script itself relies on the ability to make air units it will break no matter what, so there may be no solution. Just gotta try stuff out.
I tried both of those. Broke both times :( I wonder if there's a way to trick the AI into thinking that it sent a successful aid raid.
Quote from noobscrub
just put the suicide AI script and make triggers where whatever ground units you want appear in zones too far where the player can't reach (burrowed if possible) in the time you want.

or you can either try this:

*put a hidden building for the enemy player near your base
*put an allied marine that will shoot at it constantly
*make sure the structure has lots of hispoints or either make it's hp go back to 100% everytime with triggers

this might make the AI become agressive and would force him to make as much anything they can produce in that location for an unlimited ammount of time. be sure to put lots of production buildings depending on how much agressive you want it to be.

i haven't tried this myself so im not sure if that works btw.
This doesn't work as the defense script is different from attacking. The units will just move towards the building without grouping or coordinating.

The best way I could find to do this is to remove/kill the air units. It needs to be outside of their base or they will keep on building. The location should preferably be near the target base so that they register that they sent out a force and can move onto the next wave.

Post has been edited 1 time(s), last time on Aug 4 2016, 3:01 am by Sie_Sayoka.



None.

Aug 4 2016, 4:32 pm NudeRaider Post #12

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Yeah you gotta work around it somehow. AI scripts depend on sending waves of specific unit until they continue the next script phase. If they need to build, send the wave off or have them reach a certain point is beyond my knowledge, but you should be able to find that out by testing - as you already begun to. Make triggers that destroy the units soon as they get close to their target.

Knowing more about your map, specifically why you need to avoid air may help us give you better advice. Suggestions:
- make air units super weak and super cheap, so it won't matter that they sent them.
- move air units away as soon as they're produced.
- use a different AI script and trigger additional ground waves if needed.




Aug 4 2016, 4:43 pm CecilSunkure Post #13



You could also try removing the air units and then immediately refund the price of construction. You can try setting the construction time of air units to 0. Try starting the AI player out with some air units that are confined to a box somewhere hidden in the map, this way the players never see these units. I recall the AI moves individual air units around most of the time, so perhaps the rest of the script will still run if the AI sees that it at least controls and can order the air units (even though you confine them to a hidden location).

Just some more ideas.



None.

Aug 4 2016, 5:04 pm noobscrub Post #14

le LITERALLY me when im ex dee while driving face xdddd

just use the suicide ai script senpai

or.... make your own AI ( ͡ ͜ʖ ͡)



xd

Aug 4 2016, 5:22 pm CecilSunkure Post #15



Wat. I don't think making a script is something that can be done in .scx files :(



None.

Aug 4 2016, 6:10 pm noobscrub Post #16

le LITERALLY me when im ex dee while driving face xdddd

no it's not possible in a map editor sadly, it's more complex than that if you want to make your own AI.




he just should use a suicide ai script tbqh

action triggers>run ai script>random suicide script

Post has been edited 1 time(s), last time on Aug 4 2016, 6:46 pm by noobscrub.



xd

Aug 5 2016, 10:01 am Sie_Sayoka Post #17



Thanks for the suggestions everyone.
Quote from NudeRaider
Knowing more about your map, specifically why you need to avoid air may help us give you better advice. Suggestions:
- make air units super weak and super cheap, so it won't matter that they sent them.
- move air units away as soon as they're produced.
- use a different AI script and trigger additional ground waves if needed.
I need a 'support' computer for allies and enemies. The Terran AI will provide a more defensive role making expansions and defending them and other key areas. The Zerg AI will attack unpredictably as opposed to the other 'dummy' computer to provide some surprise for the player. The Zerg AI will have to be fairly aggressive which is why I'm using the insane expansion AI. The map is ground based and having flying units reaching inaccessible areas for ground will break the map.

I'll test out moving air units and see if that changes its behavior.

Quote from CecilSunkure
You could also try removing the air units and then immediately refund the price of construction. You can try setting the construction time of air units to 0. Try starting the AI player out with some air units that are confined to a box somewhere hidden in the map, this way the players never see these units. I recall the AI moves individual air units around most of the time, so perhaps the rest of the script will still run if the AI sees that it at least controls and can order the air units (even though you confine them to a hidden location).

Just some more ideas.
Removing them just causes the AI to keep on producing. It seems that it's set on creating a specific composition of units for the next wave and if it doesn't have it, it will just keep on producing.

I'll try pre-placing units but keeping them off in a corner may cause the AI to think that the specific wave never reached its target and fail to create the next wave.
Quote from noobscrub
just use the suicide ai script senpai

or.... make your own AI ( ͡� ͜ʖ ͡�)
Maybe it will clear the current wave that its trying to do. I'll test it out.



None.

Aug 5 2016, 7:37 pm NudeRaider Post #18

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Sie_Sayoka
Quote from NudeRaider
Knowing more about your map, specifically why you need to avoid air may help us give you better advice.
I need a 'support' computer for allies and enemies. The Terran AI will provide a more defensive role making expansions and defending them and other key areas. The Zerg AI will attack unpredictably as opposed to the other 'dummy' computer to provide some surprise for the player. The Zerg AI will have to be fairly aggressive which is why I'm using the insane expansion AI. The map is ground based and having flying units reaching inaccessible areas for ground will break the map.
Still quite vague.
How about making the locations that may only be entered by ground units ground only?

Or move or destroy the air units that come close to those locations. You might even make them "jump over". Like air units approach the no fly zone from the left, so teleport them to the right of the no fly zone, and optionally give a patrol command to an enemy base




Aug 6 2016, 10:42 am Sie_Sayoka Post #19



Moving units causes their attack force to center on the destination location. This somewhat works as the computer will create other attack forces.

Pre-placing units causes similar behavior.

Using strategic suicide script doesn't help. The computer breaks from not being able to create air units so the ground forces that it does make are meager.

Thanks everyone for the help. I'll just stick with removing air units near the targets it's good enough for my map.



None.

Aug 6 2016, 6:23 pm CecilSunkure Post #20



Well since removing air units weakens the AI's strategy, maybe you could try spawning additional ground forces in their base to compensate for the loss of the air units, in hopes the AI would use these in their raids.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:44 pm]
Ultraviolet -- 1337 ejaculator
[10:29 pm]
ejac1337 -- derp
[07:08 pm]
Slyence -- Well shucks ..
[2021-11-26. : 4:02 am]
O)FaRTy1billion[MM] -- Slyence
Slyence shouted: I could've swore I used to have a colored username.
probably, they did get reset at some point
[2021-11-26. : 4:02 am]
Apos -- :wob:
[2021-11-26. : 12:01 am]
UndeadStar -- 🦃 Just saw a new news 🦃
[2021-11-25. : 6:04 pm]
Slyence -- Meme x2
[2021-11-25. : 12:39 pm]
Moose -- meme
[2021-11-25. : 12:25 pm]
Slyence -- I could've swore I used to have a colored username.
[2021-11-24. : 10:56 pm]
RdeRenato -- xd
Please log in to shout.


Members Online: Roy, KrayZee