Staredit Network

Staredit Network -> UMS Assistance -> Dynamic AI
Report, edit, etc...Posted by green_meklar on 2006-11-04 at 16:44:00
This is probably a noob question, but then I'm a noob (as in, 99% of my experience is limited to the Campaign Editor, oh horrors) so I think I'm entitled to ask it.

Okay, so ages ago I had this really good idea for a map, but I didn't get around to making it until recently. The basic idea is that four human players each play as a god over a computer player, and to win they have to cast spells to help their computer to beat the three other computers. Admit it, you're absolutely stunned at my genius, and realize in your awe that this is a concept that will revolutionize not only StarCraft map design but the whole RTS genre, along with the TBS, FPS and MMORPG genres, the whole field of artificial intelligence, fantasy novels, philosophy, theology, 3D artwork, heuristic virus detection, the science of evolutionary biology, popup blockers, psychology, parapsychology, cutting-edge US stealth planes, SETI, quantum physics, the world economy and the taste of breakfast cereal. Well, okay, I was joking about the breakfast cereal. Anyway, so I made the map and set up the triggers, setting all the gods as protoss and two followers each of terran and zerg to make the triggers easier, all this in the Campaign Editor (omg git of teh sen b4 we ban u 4 bein a nub), and started testing it.

While all the spells worked fine, I did notice some problems. After choosing my followers' race as zerg (you do it by putting a worker on a beacon), I noticed that my computer was doing nothing. That is, it mined minerals and sent its overlord around its base, but it never built any new drones. However, the terran computer in the opposite corner was doing just fine. Just to see what was the matter, I tried it again and chose terrans instead of zerg, and they worked fine in my corner too. So, okay, I figured there was some kind of problem with the zerg AI. Put a warning on my map saying not to pick zerg, and decided to fix it later. However, then I tried playing it on battle.net, and one of the other people picked zerg, and they worked this time, while my zerg still did nothing. A little more testing proved that neither zerg nor protoss worked in my corner. So I changed the warning to warn against using that corner.

Then it became a matter of trying to get the AI working. I tried essentially everything. Give them less units, give them more units, give them less resources, give them more resources, move the locations around, set different locations, move the trigger actions around, and after each change testing it to see whether it worked. I did notice that while it did the same thing most of the time, once in a while it would build one spawning pool (I was testing with zerg), but that was it, after that it went back to its mining and never did anything else. Finally, just to see if would have any effect, I set the player (who was terrans by default) to zerg, and again chose zerg.

And it worked perfectly.

Which means that what a computer does is not based entirely on its AI but also partly on what its basic race is set to. Well, this was a bit of a problem, but nothing I couldn't easily circumvent. All I would have to do would be to set the race to user selectable, which meant that in multiplayer the host would have to comply with everyone else's race choices, but that wasn't too important. So I went into the player settings- and discovered that only human-controlled players can be set to user selectable.

To make a long story short: My entire idea of choosing a race at the beginning of the game went out the window.

After a few minutes of cursing Mike Morhaime, Chris Metzen and everyone else who works at Blizzard, I went back in, made a new copy of the map and set it so that the followers are also human players and can choose their race. Thereby reducing my magnificent idea into just one more team map. I haven't tested it yet, but it should work when I do.

Okay, enough ranting. My question to the StarEdit Network people is, do you know of any way to either make an AI (specifically an expansion custom level AI) work properly if it doesn't match the preset race for that player, or set a computer player to a user selectable race?
Report, edit, etc...Posted by Falkoner on 2006-11-04 at 19:00:14
I'm heartless to newbs.

Anyways, here is a list of AI scripts and what they do.
This might be able to help you select a good one, or at least test.

AI List

Blizzard also has a list, but Blizzard is mentally retarded
Report, edit, etc...Posted by Kumano on 2006-11-04 at 19:17:24
Well, if each player is meant to be set to a specific computer, you could just have the player as user selectable, and then create the computers drones/scvs/probes and all that depending on what race the player is, and just make all the stuff the player would use with triggers.
Report, edit, etc...Posted by green_meklar on 2006-11-04 at 20:59:59
QUOTE
shut up spammer.

sad.gif
QUOTE
Anyways, here is a list of AI scripts and what they do.
This might be able to help you select a good one, or at least test.

AI List

Hmm...I guess for starters I'd need an extended editor for most of those. I have SCMDraft, but I haven't figured out how this whole 'editing triggers through text' thing is supposed to work. Also, it doesn't really answer my question, although it's possible that one of those would work for me.
QUOTE
Well, if each player is meant to be set to a specific computer, you could just have the player as user selectable, and then create the computers drones/scvs/probes and all that depending on what race the player is, and just make all the stuff the player would use with triggers.

I'm not sure what you mean. Can you elaborate?
Report, edit, etc...Posted by Kumano on 2006-11-04 at 22:09:11
Ok, if player 1 is the player, and player 2 is the computer that's allied to player 1, make player 1 user selectable. Then have 3 triggers detecting if player 1 has a hatchery, command center, or nexus and create the starting units of that race for player 2 (the computer). Then just redo this for the other players and computers.
Report, edit, etc...Posted by xmrxsiegecopx on 2006-11-04 at 22:27:11
QUOTE(Kumano @ Nov 4 2006, 08:09 PM)
Ok, if player 1 is the player, and player 2 is the computer that's allied to player 1, make player 1 user selectable. Then have 3 triggers detecting if player 1 has a hatchery, command center, or nexus and create the starting units of that race for player 2 (the computer). Then just redo this for the other players and computers.
[right][snapback]583701[/snapback][/right]

That wouldn't work, as the computer will only run an AI script properly if it's identical to its selected race.

The best you could do for the computer player's race and AI script is to set its race to random and have triggers run according to which race is selected, or let the human players have the option of choosing a predetermined computer at the beginning of the game.
Report, edit, etc...Posted by green_meklar on 2006-11-04 at 22:31:13
QUOTE
Ok, if player 1 is the player, and player 2 is the computer that's allied to player 1, make player 1 user selectable. Then have 3 triggers detecting if player 1 has a hatchery, command center, or nexus and create the starting units of that race for player 2 (the computer). Then just redo this for the other players and computers.

I'm not sure you understand my problem. Creating the starting units is just fine, it's the AI that doesn't work properly. Making the computer user selectable only helps if the computer is literally user selectable (as in, it appears that way in the game screen). If that can't be done, then all I'm looking for is a way to make the AI work on a player with a different race from that in the AI.
QUOTE
The best you could do for the computer player's race and AI script is to set its race to random

You can do that in UMS maps? o.O
QUOTE
let the human players have the option of choosing a computer at the beginning of the game.

That's an interesting idea, and I suppose it would be workable, but it's still far from solving my problem.
Report, edit, etc...Posted by xmrxsiegecopx on 2006-11-04 at 22:50:48
QUOTE(green_meklar @ Nov 4 2006, 08:31 PM)
QUOTE
The best you could do for the computer player's race and AI script is to set its race to random

You can do that in UMS maps? o.O
[right][snapback]583706[/snapback][/right]

Yes, you most certainly can using an extended map editor or program. It basically works just as it seems -- randomizing the race for computers -- as AI scripts can be changed accordingly by detecting the starting buildings and units at the start of the map. The drawback is that it isn't as flexible as having the option of choosing the computer's race manually as you can in the melee game modes, but is still more flexible than having predetermined computer races.
Report, edit, etc...Posted by green_meklar on 2006-11-05 at 10:19:48
QUOTE
Yes, you most certainly can using an extended map editor or program. It basically works just as it seems -- randomizing the race for computers -- as AI scripts can be changed accordingly by detecting the starting buildings and units at the start of the map. The drawback is that it isn't as flexible as having the option of choosing the computer's race manually as you can in the melee game modes, but is still more flexible than having predetermined computer races.

Hmm...I'll have a look at that then. Thanks for the help. In the meantime, if anybody has any better solutions, feel free to speak up, it can't hurt. smile.gif
Report, edit, etc...Posted by fritfrat(U) on 2006-11-05 at 10:29:59
Kumano, you can't run an AI script for a computer if that computer is not the correct race. So, creating the buildings doesn't work.

Randomizing doesn't change this, it's still just going to be one of the three races. Random does add more variety to it, though.

These would be my personal recommendations.
1. 2 protoss and 2 terran computers, 1 on each team, and humans simply hop on each side to support. Protoss and terran AI's are in general better than zerg AI's, and it atleast allows a little choice.
2. Make all 4 computers' races random, and make the buildings/run the script accordingly based on how they turn out.
3. Some other combination of zerg/protoss/terran with teams.

But no, there is no way around your problem of running AI scripts for a race other than as it was pre-set. Sorry.
Report, edit, etc...Posted by green_meklar on 2006-11-05 at 10:36:57
QUOTE
Randomizing doesn't change this, it's still just going to be one of the three races.

I thought the idea was that they would be random even in the pregame window, so that whatever race they started as, they'd be set under that race and work properly. If that's not what xmrxsiegecopx is saying, what is he saying?
QUOTE
1. 2 protoss and 2 terran computers, 1 on each team, and humans simply hop on each side to support. Protoss and terran AI's are in general better than zerg AI's, and it atleast allows a little choice.

Well, I sort of didn't want it rigidly set like that, at any rate. Believe me, I had considered setting the races to be the same every time.
QUOTE
no, there is no way around your problem of running AI scripts for a race other than as it was pre-set. Sorry.

Okay then. sad.gif In that case, I just need to get into SCMDraft and see if I can set them to random. Then set up some triggers to detect their race...actually, if it doesn't place units, then I don't know how to do that. Does it place units? And if not, is there a way to do that?
Report, edit, etc...Posted by fritfrat(U) on 2006-11-05 at 10:42:38
I'll clarify. Randomizing doesn't change the fact that you can't run an AI script for another race, it just adds more variety to the race it does make.

And you raise a good point; if it doesn't place units, then you wouldn't be able to ever find out which race it actually is. I'd recommend testing that, because if it does place units, you can just detect whith units it placed and run the corresponding AI script.. if it doesn't place units, I don't know how you'd figure out what race it was. I know I just repeated what you said, but I guess I'm just saying that I as well don't know how to detect race like that if it didn't place units.
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-11-05 at 11:22:29
Well, from the symptoms you describe, I'd guess that you're not using the correct AIScript for the race :/

Make sure you are using a Zerg AIScript if the player chooses Zerg, and likewise for the other races.
Report, edit, etc...Posted by green_meklar on 2006-11-05 at 11:32:40
QUOTE
Randomizing doesn't change the fact that you can't run an AI script for another race, it just adds more variety to the race it does make.

I understand that. The question is whether the race will actually be random the same way a race is random when you set it that way on a melee map, or whether you're just making it spawn the units of a random race based on some randomized switches. The latter is quite easy, but it doesn't solve my problem because you still end up with races and units/AIs that don't match. That's why I'm hoping for the former.
QUOTE
Well, from the symptoms you describe, I'd guess that you're not using the correct AIScript for the race :/

Make sure you are using a Zerg AIScript if the player chooses Zerg, and likewise for the other races.

I'm not that stupid. I checked that pretty much first thing. No, it's set on the right AI script, expansion custom level for the race chosen by the player. And I did try setting it to a campaign AI script instead of a custom level one, and that didn't work either. Hell, I even tried setting the AI script to the wrong race, just to see what would happen (and it turns out the AI is based on both the preset race and the units available, rather than just one or the other).
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-11-05 at 11:48:01
Where do you have your location positioned, and how big is it?
Report, edit, etc...Posted by fritfrat(U) on 2006-11-05 at 13:26:42
Meh, you unfortunately receive a lot of advice from people who don't read everything, green.

Anyways, I went and tested it. If you go into SCMDraft and set a computer player's race to User Selectable, it appears as random in the pre-game screen and it actually creates the 4 peons + building that correspond with that race. Just do triggers such as Current player commands 1 hatchery: Run Zerg AI Script, and you're set.

This isn't quite the level of choice as selecting the computer's race, but I really think it's what will have to do. Either that or preset races, of course.
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-11-05 at 14:14:09
QUOTE(fritfrat(U) @ Nov 5 2006, 02:26 PM)
Meh, you unfortunately receive a lot of advice from people who don't read everything, green.
[right][snapback]583947[/snapback][/right]


Maybe if he hadn't spammed 3 pages of text, it would've been easier.
Report, edit, etc...Posted by PCFredZ on 2006-11-05 at 15:08:17
Attach your map.
Report, edit, etc...Posted by CheatEnabled on 2006-11-05 at 15:18:49
Attachments still don't work, so I don't see the point of attaching. pinch.gif
Report, edit, etc...Posted by Falkoner on 2006-11-05 at 15:30:27
QUOTE
shut up spammer.



QUOTE
Anyways, here is a list of AI scripts and what they do.
This might be able to help you select a good one, or at least test.

AI List

Hmm...I guess for starters I'd need an extended editor for most of those. I have SCMDraft, but I haven't figured out how this whole 'editing triggers through text' thing is supposed to work. Also, it doesn't really answer my question, although it's possible that one of those would work for me.


Lolz, when I said shut up spammer I was talking to some newb that got on and said "NOTHING IMPRESSES ME" or something like that, but it seems someone erased it. Also I would download classic trigedit for scmdraft, it's a plugin for it and it is like the basic trigger editor.

Now onto the real problem.

Okay your main problem is that you need to get the right race of computer for the right race of humans. I think you might just have to either make it 2 player or make it so they cannot change their race. You could also just have everyone the same race. But there is no way to make your map a perfect 4 player map where they can choose their computers races.
Report, edit, etc...Posted by green_meklar on 2006-11-05 at 19:24:32
QUOTE
If you go into SCMDraft and set a computer player's race to User Selectable, it appears as random in the pre-game screen and it actually creates the 4 peons + building that correspond with that race.

Okay, I'll try that as soon as I get around to editing the map again.

EDIT: I tried it, and it seemed to work. Interestingly, my computer (the only one playing zerg) did sort of grind to a halt after about the first 15 minutes, but I don't think it's a related problem. Thanks everybody! smile.gif

Oh, and if you want to download the map, go here, it's the first one in the list.[/shameless advertising] And please don't upload it to anywhere else, I want the original to be under my name in as many places as possible (although primarily here and starcraft.org).
Report, edit, etc...Posted by Cnl.Fatso on 2006-11-05 at 23:20:54
Even if you protect it, odds are that if it's good someone will OSMAP it eventually.

Cue heated argument over protection and unprotection.
Next Page (1)