Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Can someone help me with Ai
Can someone help me with Ai
This topic is locked. You can no longer write replies here.
Mar 6 2010, 8:17 pm
By: m.0.n.3.y  

Mar 6 2010, 8:17 pm m.0.n.3.y Post #1



Ok, so i've made a game called System Strike [LW], that is based off of NudeRaider's Desert Strike. I've, for the most part, completed the entire game and have created a beta. I have created my own Ai but it's not that great, and the units just stand there a lot of times.
Here's some of the Ai problems:
--When units are created, they sometimes just stand there for up to 10+ seconds
--Science vessels need to stay where the battle is, instead of patrolling to the enemy base and just sitting there
--Siege tanks sometimes go to a random corner, siege, and then don't move

Those are the main problems, if someone could find a way to fix them, it would be great!
Comment if you want to help. (and of course you'll get credit in the map :D )

Link >> System Strike [LW]
thanks guys

Post has been edited 4 time(s), last time on Mar 7 2010, 7:17 pm by m.0.n.3.y.



None.

Mar 6 2010, 8:34 pm Vrael Post #2



What do you mean by create an AI? Like, order melee units to the front and ranged units behind to increase their effectiveness? Or just fix the units that stand around? Basically, to fix the units standing around, just add some extra locations and have a death count timer issue a patrol order every few seconds for the correct players in those locations, and that should fix that problem.



None.

Mar 6 2010, 8:52 pm m.0.n.3.y Post #3



i mean just fixing the units that just stand around/making them more effective/making tanks work properly/making science vessles follow the action etc... i've already done what you've suggested and it still doesn't work right, that's why i need someone else to more or less create the ai for me

NudeRaider, you should help me, cause your awesome!

Post has been edited 1 time(s), last time on Mar 6 2010, 9:06 pm by m.0.n.3.y.



None.

Mar 8 2010, 1:42 pm LegacyWeapon Post #4



Don't run AI Scripts for the computers. It may mess up your patrol orders.

I'm also very confused as to why you use a "Wait" action when you clearly understand death counters.

The reason why they don't move immediately is because the patrol order isn't constantly running. You need it to order every few seconds or else they won't attack each other as well.



None.

Mar 8 2010, 2:08 pm NudeRaider Post #5

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

http://www.staredit.net/?p=shoutbox&view=791

About the problem of units just standing there: Maybe your creation triggers run for a few trigger loops and the order only comes at the end of the first loop? So the last created units have to wait for the next order.




Mar 14 2010, 9:50 pm m.0.n.3.y Post #6



Alright so I fixed the wait triggers and replaced them with death counters. The units standing there is fixed.
So my next question is how to make it so science vessles follow the fight.
Example: O = Base X = A battle going on --- = The Map

O----X----O
The triggering is set up so the units patrol to the enemy base, because on the way there, they'll attack any enemy units they meet. But if there is a battle happening in between the two bases: the X, I want science vessles to hover over the battle, instead of flying over it and going straight to the enemy base. If they fly over the battle and go straight to the enemy base, it defeats their purpose because they wont detect any cloaked units. So how do I make them follow the battle?

@NudeRaider: So I divide the battlefield up into different sections? Is there also a way to center a big location on enemy units and just have the science vessle go there?



None.

Mar 14 2010, 10:14 pm NudeRaider Post #7

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

Well the thing is it will center on the leftmost unit. This might be appreciable for the left player as it centers on their enemies' first units, but not for the right player. Maybe center on his own units for the right player?




Mar 14 2010, 10:30 pm m.0.n.3.y Post #8



Oh ok, so just center a location on the right players units. And have both players science vessles patrol to them.
thanks



None.

Mar 15 2010, 4:53 am Lanthanide Post #9



If the right-player happens to have a sci vessal as the left-most unit, then it'll effectively freeze in place until another right-player unit overtakes it, or it is killed by the enemy. This may be desirable though, as it'll stop the sci vessal from rushing off ahead into (almost) certain doom.

Likewise this will cause the left-player's sci vessal to rush up to the right-player's, but go no further. Almost like a sci-vessal mating ritual or something.



None.

Mar 15 2010, 11:13 pm m.0.n.3.y Post #10



Quote from Lanthanide
If the right-player happens to have a sci vessal as the left-most unit, then it'll effectively freeze in place until another right-player unit overtakes it, or it is killed by the enemy. This may be desirable though, as it'll stop the sci vessal from rushing off ahead into (almost) certain doom.

Likewise this will cause the left-player's sci vessal to rush up to the right-player's, but go no further. Almost like a sci-vessal mating ritual or something.

Well see I made it so the science vessle ai only works if there are other units in the battlefield. So if there is a lone science vessle it wont stand still, but follow the normal path and go straight to the base. But having it stand still might actually be what I need haha

---Another question:
If I give units to player 1 (who is a human), but player 1 leaves the game before the units are given, when the units are given, will they be under player 1's control or are they under Neutral Player or something like that?

Post has been edited 1 time(s), last time on Mar 16 2010, 3:54 am by m.0.n.3.y.



None.

Mar 16 2010, 5:37 am NudeRaider Post #11

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

Generally you NEVER should give units to a specific human player (e.g. Player 1) because when you do when the player is absent the units are still given to the so called ghost player. I forgot its exact behavior but I think it's similar to giving to P9-11.

To avoid this make them "grab" the units for himself.
So instead of saying
P8 (computer)
Condition: whatever
Action: Give units owned by P8 to P1

you do
P1 (human)
Condition: whatever
Action: Give units owned by P8 to Current Player

Current Player is generally your friend to avoid a whole bunch of bugs. Use it!

Post has been edited 1 time(s), last time on Mar 16 2010, 4:27 pm by NudeRaider. Reason: typo




Mar 16 2010, 6:12 am Lanthanide Post #12



Quote from NudeRaider
Current Player is generally your friend to avoid a whole bunch of bugs. Use it!
And introduce others if you aren't careful.

Yes it is very powerful, but you need to be careful when using it.



None.

Mar 16 2010, 4:29 pm NudeRaider Post #13

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 Lanthanide
Quote from NudeRaider
Current Player is generally your friend to avoid a whole bunch of bugs. Use it!
And introduce others if you aren't careful.
Such as?

Your statement as it is doesn't provide useful information. Elaboration is necessary to get the mapmaker in need of help to understand what he has to care for.




Mar 17 2010, 3:03 am m.0.n.3.y Post #14



Quote from NudeRaider
Generally you NEVER should give units to a specific human player (e.g. Player 1) because when you do when the player is absent the units are still given to the so called ghost player. I forgot its exact behavior but I think it's similar to giving to P9-11.

To avoid this make them "grab" the units for himself.
So instead of saying
P8 (computer)
Condition: whatever
Action: Give units owned by P8 to P1

you do
P1 (human)
Condition: whatever
Action: Give units owned by P8 to Current Player

Current Player is generally your friend to avoid a whole bunch of bugs. Use it!
Ok so to elaborate on this a little more, I am using this function to auto-ballance the game if someone leaves. In this map, players mine minerals, and when an ally leaves, it will auto-ballence (or atleast make it more ballenced) by creating extra miners for the remaining players. So what I was thinking of doing was:
---P1 leaves game
Create 2 Drone at location X for P2
Create 2 Drone at location X for P3

And have a separate trigger move the units from location X to the respective players bases.

If for example, P3 was not playing, I would destroy the units for P3. So I was wondering, if P3 was absent, and 2 Drone were created for P3 at location X, if the units would be created for P11 or Neutral...or whomever. If so, I would simply remove Drones owned by Neutral Player at location X.



None.

Mar 17 2010, 5:10 am NudeRaider Post #15

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 NudeRaider
Generally you NEVER should give units to a specific human player (e.g. Player 1) because when you do when the player is absent the units are still given to the so called ghost player.
What I meant with this is that they are given to Player 1, which is called a ghost player when he's not here.

But why not
[Human Force 1]
C: P12 brings at least 1 "I'm here" to 'check P1-3'
A: Create 2 drones at 'X' for Current Player

I don't know your condition to detect P1 leaving, but this is what I would do because it's 1 trigger that detects any leaver of Force 1.
And the action implicitly just creates units for active players. Still works when a 2nd player in that force leaves.

The clean-up trigger would look like this:
P8 (Computer)
C: P12 brings at least 1 "I'm here" to 'check P1-3'
A: Remove all [any unit] for P12

This trigger also cleans up for Force 2 leavers. The important thing is that it's owned the last Player slot and that he's always there.


Quote from m.0.n.3.y
If for example, P3 was not playing, I would destroy the units for P3. So I was wondering, if P3 was absent, and 2 Drone were created for P3 at location X, if the units would be created for P11 or Neutral...or whomever. If so, I would simply remove Drones owned by Neutral Player at location X.
Again, NEVER create units for specific players. You're just asking for bugs and messes.
Do it like this:
[Human Force 1]
C: Always
A: Center 'create' on [buildings] owned by Current Player
A: create 2 Drones at 'create' for Current Player
A: create 1 "I'm here" at 'check P1-3'

1 Trigger for 3 players and no bugs or wrongly created units or whatever. Just clean working and all that thanks to using Current Player.
And if your map starts out blank so you can't center on buildings/units you'll have to split it up, but STILL use Current Player to avoid creating units for ghost players:
Player 1
C: Always
A: create 2 Drones at 'start P1' for Current Player
A: create 1 "I'm here" at 'check P1-3'

Player 2
C: Always
A: create 2 Drones at 'start P2' for Current Player
A: create 1 "I'm here" at 'check P1-3'

Player 3
C: Always
A: create 2 Drones at 'start P3' for Current Player
A: create 1 "I'm here" at 'check P1-3'

Note this is where I create my "checker unit" that reports me when a player leaves (given to P12) in the above trigger.

Post has been edited 1 time(s), last time on Mar 17 2010, 5:17 am by NudeRaider.




Mar 17 2010, 11:50 pm m.0.n.3.y Post #16



Ok so your trigger worked...kind of. When someone left, it only created the drones for one of the players on the team
My triggers went like this

Force 1
Con: Neutral, bring, at least, 1, CheckUnit, CheckLocationP1-3
Force 2, command, at most, 1, refinery
Act: Create, 1, Drone, current player, X
Remove, CheckUnit, neutral player, CheckLocationP1-3
Preserve

what's going on here?



None.

Mar 18 2010, 5:21 am NudeRaider Post #17

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

You combined the "leaver detect/create drone" trigger and the cleanup trigger.
The first player of the force runs the trigger, removes the P12 unit and makes the condition untrue for the next player.
As I said you have to move the remove P12 unit part to a computer player, so you can make sure it runs only after all other players have executed their triggers.

Keep in mind that triggers for forces and All Players are split. StarCraft creates a copy of that trigger to everyone belonging to that group. And triggers are run player by player. First ALL triggers of P1, then all of P2's triggers, etc.




Mar 18 2010, 5:42 am m.0.n.3.y Post #18



Quote from NudeRaider
You combined the "leaver detect/create drone" trigger and the cleanup trigger.
The first player of the force runs the trigger, removes the P12 unit and makes the condition untrue for the next player.
As I said you have to move the remove P12 unit part to a computer player, so you can make sure it runs only after all other players have executed their triggers.

Keep in mind that triggers for forces and All Players are split. StarCraft creates a copy of that trigger to everyone belonging to that group. And triggers are run player by player. First ALL triggers of P1, then all of P2's triggers, etc.

So keep the trigger as it is, except remove the "Remove p12 Unit" From the trigger and create another trigger for it? This is doubed as the clean up trigger right? And then put this clean up trigger at the bottom of the list?

Also, i was wondering if you wanted to play this with me sometime soon, tell me what you think, maybe give me some pointers :innocent:



None.

Mar 18 2010, 4:19 pm NudeRaider Post #19

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

You missed the important part: Give the cleanup trigger to the last player slot which has to be a computer (usually P8). Putting it to the end of the list won't do any good since - as I explained - the triggers are run player by player and NOT in the order you see in the trigger list.

Oh and sure we can playtest some time. Just contact me via AIM and we'll find a time. The coming weekend should be fine. Just keep in mind that I'm on GMT+1.




Mar 20 2010, 6:41 pm m.0.n.3.y Post #20



Quote from NudeRaider
You missed the important part: Give the cleanup trigger to the last player slot which has to be a computer (usually P8). Putting it to the end of the list won't do any good since - as I explained - the triggers are run player by player and NOT in the order you see in the trigger list.

Oh and sure we can playtest some time. Just contact me via AIM and we'll find a time. The coming weekend should be fine. Just keep in mind that I'm on GMT+1.
Alright thanks, got it! Yeah, im in standard mountain time...and aparently there's a 6 hour difference between our time zones ;p. So just mssg me whenever you wana play this weekend.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
Please log in to shout.


Members Online: jun3hong, Ultraviolet, Roy