AI Questions
Mar 31 2009, 7:46 pm
By: JaFF  

Mar 31 2009, 7:46 pm JaFF Post #1



The situation:

A city with randomly spawned, randomly wandering zombies. They must walk around as zombies usually do, but once close to an enemy, will immediately attack without exceptions. There are groups of survivors with barricades scattered around the map.

The questions:

I want the zombies to walk around randomly but be very aggressive at the same time. Junkyard Dog can handle the first part just fine, however, the second part is not as easy: I tried applying Random Suicide and Random Strategic Suicide, but they don't produce the required result. random suicide makes them target players more than caertain computer units and Random Strategic Suicide makes some units freeze (however it is perfectly fine in choosing its targets). I need some script that will combine the absence of target choosing prejudice of Random Strategic Suicide and the stability of Random Suicide.

My second problem is to make the defenders 'hold position' behind their barricades. Every time they go chasing a zombie that runs past their post they stop after killing the zombie and don't want to return back. I can't do the usual "order/move back when he leaves his place" because there are far too many defenders possible, there will be squads moving around and there will be some randomly pre-placed groups. Therefore I need some "be less aggressive" AI. Though there might not be a need for such a script/system if I make the zombies agressive enough in all cases, I am considering this as a backup plan.

Any help would be greatly appreciated.



None.

Mar 31 2009, 7:50 pm ForTheSwarm Post #2



1. I'm not certain if this is what you want, but:
First, cycle a location through every zombie.

Under the zombie player(s):

Code
Foes bring at least 1 any unit to "Zombie".

Center location "Attack" on 1 any unit owned by Foes at "Zombie".
Order all Zombie at "Zombie" attack to "Attack".
Preserve Trigger.


Now Zombies will move to attack the left-most enemy unit nearby.

Post has been edited 1 time(s), last time on Mar 31 2009, 7:56 pm by ForTheSwarm.



None.

Mar 31 2009, 7:56 pm JaFF Post #3



Quote from ForTheSwarm
1. I'm not certain if this is what you want, but:
First, cycle a location through every zombie.

Under the zombie player(s):

Code
Foes bring at least 1 any unit to "Zombie".

Center location "Attack" on 1 any unit owned by Foes at "Zombie".
Order all Zombie at "Zombie" attack to "Attack".
Preserve Trigger.
This is the worst solution possible. Giving orders 'stuns' units that are already atacking for a short period of time, cyclying through all zombies will cause them to stop any previous orders as well, not to mention the awful lag I'd get from cycling through all the zombies.



None.

Mar 31 2009, 8:51 pm Ahli Post #4

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

How many units does the player have?
if the player has only 1 hero unit, you can center a location on the hero unit and let all units around patrol to the hero.

for the computer behind the barricades:
you can make locations in front of the barricades and let the zombies patrol to the computer units




Mar 31 2009, 8:53 pm ForTheSwarm Post #5



Quote from Ahli
How many units does the player have?
if the player has only 1 hero unit, you can center a location on the hero unit and let all units around patrol to the hero.

Then they wouldn't be aggressive towards the computers behind barricades.



None.

Mar 31 2009, 9:19 pm JaFF Post #6



Quote from Ahli
How many units does the player have?
if the player has only 1 hero unit, you can center a location on the hero unit and let all units around patrol to the hero.

for the computer behind the barricades:
you can make locations in front of the barricades and let the zombies patrol to the computer units
The player has one unit only, but that's not going to work:
-In case of a thin wall separating the player and the zombies, the zombies will try to reach the player and may fail, which can cause them to act stupid. If I make the location small enough, that's not gonna help much, as it will only lure zombies that are obviously close to the player, which would make them less agressive.
-If a zombie is already attacking a player and is given another command that suggests to do the same thing, it will pause for a short period of time.

As for the barricades, I would like a less location-intensive solution. I know this will work OK, but I'd like to find something mroe elegant.



None.

Mar 31 2009, 9:20 pm ForTheSwarm Post #7



How many barricades are there? If there aren't too many, you could place a burrowed unit under each one, and cycle a location through each burrowed unit/barricade. Have a trigger making all Zombies within the location attack the location.

Post has been edited 1 time(s), last time on Apr 1 2009, 2:08 am by ForTheSwarm.



None.

Mar 31 2009, 9:38 pm Lethal_Illusion Post #8



Quote from JaFF
My second problem is to make the defenders 'hold position' behind their barricades. Every time they go chasing a zombie that runs past their post they stop after killing the zombie and don't want to return back.
I'm not positive, but I think if you order a unit (in this case a defensive unit) to patrol to its own current position, it'll always return to its original spot after chasing an enemy unit. This (if it works) would be convenient because you could cycle through all defensive units once at the beginning of the game and order them to patrol to their current position.

I'm not sure how to solve the first problem without some type of scanning system.



None.

Mar 31 2009, 11:00 pm NudeRaider Post #9

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

Preplaced non-hero units will automatically return to their starting position after following the enemy for a short distance.




Apr 1 2009, 2:04 am Pyro682 Post #10



If the players are surrounded by only 1 barricade (Meaning there aren't multiple separate bases), you can have the zombies ally everyone but the barricade owner, and then when you detect a part of the barricade destroyed, you can have the zombies unally everyone.
:hurr: - Random smiley.

Another idea is that you can give the zombies at the wall to a computer player that has JUST the wall unallied, and then when the wall isn't there anymore, give it back to the original computer so that they can continue on killing the players.

If the players aren't in 1 surrounded, baricaded, and unified base,
I beleive that you may be able to get the effect (I beleive) by using a combination of AI scripts. I'll see if I can figure out the combination soon. Expect a test map.

Post has been edited 3 time(s), last time on Apr 1 2009, 9:18 pm by Pyro682.



None.

Apr 1 2009, 9:06 am JaFF Post #11



Quote from Lethal_Illusion
Quote from JaFF
My second problem is to make the defenders 'hold position' behind their barricades. Every time they go chasing a zombie that runs past their post they stop after killing the zombie and don't want to return back.
I'm not positive, but I think if you order a unit (in this case a defensive unit) to patrol to its own current position, it'll always return to its original spot after chasing an enemy unit. This (if it works) would be convenient because you could cycle through all defensive units once at the beginning of the game and order them to patrol to their current position.

I'm not sure how to solve the first problem without some type of scanning system.

Quote from NudeRaider
Preplaced non-hero units will automatically return to their starting position after following the enemy for a short distance.
OK, I am planning on having both hero and non-hero defender units anyway, so I guess the only thing I can do is use as less heros as possible, be careful with the hero units and use patrol commands where possible.



None.

Apr 1 2009, 9:18 pm Pyro682 Post #12



Hmm, I've been trying, and I can't seem to get it... Maybe I was dreaming about this combination... Sorry. Anyways, Is the giving solution viable?



None.

Apr 1 2009, 9:54 pm JaFF Post #13



Yeah, it just requires more trigger work and a bit more units/locations in my case.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[01: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.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
Please log in to shout.


Members Online: NudeRaider, Ultraviolet