Creeps do not attack Barricades

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
720
Creeps do not attack Barricades (Solved)

The problem is that when wave of creeps are spawned and are ordered to attack-move to checkpoint (destroying anything in its path) they do not attack barricades. It happens when I have ranged units on higher cliff than creeps, the creeps just mass up at the cliff wall where those ranged units are shooting at em. All I need to do is to get them to attack barricades (or any other blockades), destroy them and only then attack ranged units (Like in Fortress Survival, like in Aliens 2 and etc.)

Things I have tried:
  • Made barricades with 1-1 damage
  • Set priority of Barricades to 20 and ranged unit's priority to 1
  • Made heavily triggered AI system for creeps, it failed due to high lag spikes whenever fired but it almost made creeps attacking barricades...
  • Made creep classification as "Worker" and then ordered to attack-move to checkpoint.
  • I made Barricades as units with collision to block em off, it was quite success but I noticed that if you build these barricades away deeper in middle passage (lets say... 800 range units from passage's entrance) and archers shooting from start of passage (they are like 100-200 range units away from creeps but between creeps and archers there is cliff wall (archers are on second cliff level, while creeps on first level)), creeps do the same - mass up at cliff wall where on that wall archers are shooting.
  • Made barricades as wards.
  • Made cliff levels equal, added pathing blockers at cliff borders instead. Still no result, creeps massing at pathing blocker line where from other side of that pathing blocker line ranged units are shooting.

Notes:
-Barricades were originally created from "Farm" unit/building.
-Ranged units are just copied from original units (like Wood Archer is copied from Night Elf Archer and etc.)
-Barricades at the moment are classified as mechanical and targeted as mechanical, they are made as units with collision to make em equal to Pathing Map.
-I have 2 types of barricades, one is with 16.00 collision units (1x1 barricade) and other one is with 72.00 collision units (2x2 barricade)


I would really love to hear a working solution since I am doing a projected called Barricade Defense. If there would be no barricades, why should I call it Barricade Defense xD

I hope someone could help me :>
 
Last edited:
Level 14
Joined
Aug 30, 2004
Messages
909
Wow that's a lot of effort. I'm not sure I have the right answer but I have more things to try.

One problem could be that the creeps are being shot, so they turn to attack their attackers. There's no way around that of course, but you could try making the archers invulnerable. That way the creeps should ignore them and might beat on the barricades. You'd have to make the barricades units again (enemies of creep), then detect when the barricades come down and remove invulnerability.
 
Level 10
Joined
Aug 15, 2008
Messages
720
Yea but if you put archers in front of Barricades, and creeps won't pass em. That will be even more imbalanced. It's very bad that there isn't condition to detect if path to certain location is blocked or not =p
 
Level 10
Joined
Aug 15, 2008
Messages
720
I will just quote one of my "What I tried" things.
I made Barricades as units with collision to block em off, it was quite success but I noticed that if you build these barricades away deeper in middle passage...

Creeps actually attacked barricades, ignoring archers shootin at em. But when I built em quite deep into the passage, they start to turn their attention to archers.
 
Level 8
Joined
Jun 26, 2010
Messages
530
First thing, you should say, your creeps are ranged? I'm assuming when you say "mass up at the cliff where the archers are" they are meele creeps that just keep taking damage of the archers, and they are not ranged creeps that go to the cliff atacking you archers.

If you creeps are meele do this:
How the archers won't be attacked anyway, make them invulnerable, them make a trigger that when the barricade is destroyed, they become vulnerable. That should do it.
 
Level 10
Joined
Aug 15, 2008
Messages
720
Here's thing, Barricades can be built anywhere in Area. Same for Archers and units, It's like Legion TD idea combined with some others. That Invulnerable idea can be exploited very easily in so many ways...

Taunt may not work perfectly but IT COULD get creeps closer to barricades. You see, when creeps are like 100 range units away from Barricades, they focus on em automatically, despite who is shooting em.
 
Level 8
Joined
Jun 26, 2010
Messages
530
hmm, tought the barricades were already set in the editor.

  • Untitled Trigger 010
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile*) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack (Random unit from (Units within 512.00** of (Position of (Picked unit)) matching ((Unit-type of (Matching unit)) Equal to Barricade)))

*I'm assuming that Neutral Hostile owns the creeps
**You can use big formulas here to get some nice effects
 
Level 10
Joined
Aug 15, 2008
Messages
720
That Trigger won't work so good. It will order unit to attack barricades which are behind other barricades, and it will make creeps almost useless as they are now. Besides, I already tried heavily triggered system, which picks creeps and with some stuff detects the closest target which must be in same level and etc.

It failed, It almost worked (part of creeps didn't obbey this system and kept massing at cliff walls). Besides, it picks like 2 unit groups per player in game and my map is 6 player map, so if there are 6 players, it's 12 groups per interval and it causes FPS spikes (no matter the periodical event).

I wish for simple solution, I've already tried loads of triggers. Taunt idea is something I haven't tried yet, so I'll try this tomorrow.

Again, these are things I have tried:
  • Made barricades with 1-1 damage
  • Set priority of Barricades to 20 and ranged unit's priority to 1
  • Made heavily triggered AI system for creeps, it failed due to high lag spikes whenever fired but it almost made creeps attacking barricades...
  • Made creep classification as "Worker" and then ordered to attack-move to checkpoint.
  • I made Barricades as units with collision to block em off, it was quite success but I noticed that if you build these barricades away deeper in middle passage (lets say... 800 range units from passage's entrance) and archers shooting from start of passage (they are like 100-200 range units away from creeps but between creeps and archers there is cliff wall (archers are on second cliff level, while creeps on first level)), creeps do the same - mass up at cliff wall where on that wall archers are shooting.
  • Made barricades as wards.
  • Made cliff levels equal, added pathing blockers at cliff borders instead. Still no result, creeps massing at pathing blocker line where from other side of that pathing blocker line ranged units are shooting.


Actually, All I ask is to get some aggro on barricades. TKoK somehow managed to modify creep's aggro and if I could know how it could (maybe) solve my problem.
 
Level 4
Joined
Jul 23, 2008
Messages
99
Ugh i forget the name of event that may help you... Mm... "Unit comes in range..." then the coming unit is an enemy then coming unit "attack" barricades.

I really forget the name... Just remembering "comes in range" event.
 
Level 12
Joined
Aug 22, 2008
Messages
911
Another thing that might help is not to have the barricades as buildings but as wards - or regular units with no movement speed. The collision radius will stop units from going through the barricades.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
So what exactly are you trying to do? Let's say an archer is moving along the passage and it runs into a "hero" (I don't know whether or not you use these types of special units in your map). This "hero" is in front of a barricade. Should the archer that encounters the hero attack the barricade behind the hero, or the hero?

If the hero is behind the barricade, should it attack the barricade or the hero?
 
Level 10
Joined
Aug 15, 2008
Messages
720
Well, In short. I want that creeps take down barricades to get to ranged units/archers but creeps just directly want to attack archers and since path to them is blocked with barricades, they just mass up at cliff wall where ranged units are shooting. If you have played Fortress Survival or Aliens 2, I want THAT effect on my barricades, that creeps take down barricades first, so their path to ranged units isn't blocked.


attachment.php

Right now I am working on Bottom area.

The Archers are usually built on green grass area (cause trim grass gives damage bonus to ranged units). The problem occurs if I build barricades deeper in middle passage.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I haven't played either of those; if I had it would probably give me a more clear picture of what you're trying to do. Would you be able to send me a link where I can download one of the maps you mentioned and get a better idea of exactly how you're trying to get it to work.
 
Level 11
Joined
May 26, 2009
Messages
760
Afaik you have tried pretty much all ways there are. I have played the games you mentioned and followed this dialogue you guys are having. I can't help you without seeing the map and the exact situation. I have created maps with barricades and had problems, but they were usually solved with one of the ways you tested already.

Yours,
Chizume
 
Level 10
Joined
Aug 15, 2008
Messages
720
@Berb They can't move through barricades. I have set Barricade collision quite equal to pathing maps (like 2x2 pathing map is 72.00 collision size, 1x1 is 16.00 collision size and etc.) but since it is collision and not pathing map, their path to archers "shouldn't" be blocked.

@ALiEN95 I did that already and yes if you use archer as barricade itself, they attack that archer. But once I copied archer, changed it's model, changed it's attack and made it's move speed to 0, creeps went apeshit anyway, so it didn't work D:

I might make creeps as ranged units (They will be melee but they will attack with instant invisible missile) to see if that works.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
@ALiEN95 I did that already and yes if you use archer as barricade itself, they attack that archer. But once I copied archer, changed it's model, changed it's attack and made it's move speed to 0, creeps went apeshit anyway, so it didn't work D:

1.)
than see when i it happens
if it happens when you set move to 0 than dont set it to 0,set it to 1,also you can order barricade to stop if it tries to move,or you can web it with dummy unit,or...
if it happnes when you set it to building than dont set it to building
-you should only change damage of attack
2.)
would it help if i can make them automatickly attack the cloasest berricade
(i can make for example,6 creeps go to first cloases barricade,6 creeps go to second cloasest barricade
also,should creeps attack the towers at all,or should they just move to the castle?
 
Level 10
Joined
Aug 15, 2008
Messages
720
Priority does fully nothing. I think Priority is for Melee AI's.

@idodik Yes I tried with taunt, creeps only moved a bit to barricade side but then again, they went apeshit D:

Also, If you build barricades in middle of the path or middle entrance, it works (creeps do attack) but if you build it deeper, then it doesn't. Just FYI.

@ALiEN95 I will try it once I got time. And I will test if something different happens if I give movement speed to barricades, though I don't like it...
 
Level 11
Joined
May 26, 2009
Messages
760
I downloaded the map and tested some stuff back and forth for a few hours now.

  • First of all I'd like to point out a bug/triggering error that is a contributing cause to this issue. The Weak Barricade (the one for 5 gold) does not transform when the round begins - it's still in the off-game state. Note that this is based of the version I downloaded from the link - if you yourself have a later version then excuse me.
  • Let's say we build a few barricades "deeper inside the base", and a few archers on the walls (at the front). Obviously the creep must not realize that there is a higher wall there and try to attack the closest target. Even when the attack speed of barricades are at 0.01 and has massive splash damage to attract as many as possible they run back and forth. Creep act weird when being blocked.
I have the problem myself with a map I'm doing - and I think many other do as well. I'm not sure there is a good solution unless someone wants to create some sort of new AI with another system for priority.

I would as much as Azeroc appreciate to solve this.

Yours,
Chizume
 
Level 10
Joined
Aug 15, 2008
Messages
720
Do not worry! I fixed the problem, it was the movement as ALiEN95 said to check. Setting movement to 0 will result unit's move and patrol orders removed and they (i think) will be like rotating towers.

At last problem is fixed. Thank you all for help.
@Chizume Oh, I just noticed myself. Thanks for notifying me =D
 
Level 11
Joined
May 26, 2009
Messages
760
Aha I see, neat!

But if we let's say want the castle to have the same effect (just as an example for a building which is there from the beginning to the end). Won't it have moved slightly after an hour of gaming?
 
Level 10
Joined
Aug 15, 2008
Messages
720
I have trigger which makes all units to hold position when wave starts (now, including Barricades).

Now I am trying to find way how to stop those barricades facing enemy. When I succeed to make it stop facing enemy units for attacking, creeps do not attack barricades. Soeh... kinda new prob but oh well, should be fixed in no time =p

EDIT: Fixed turning thing. So, I have everything fixed. This thread can be closed.
 
Last edited:
Level 10
Joined
Aug 15, 2008
Messages
720
Yes, of course. That was quite pain in the ass (I tried quite a lot of stuff) and I fixed it only partly. You cannot pause em, you cannot give them attack which doesn't target creeps, you cannot periodically stop em. Basically, anything which kinda interrupts attacking creep (some interruptions like changing range will still make creeps attack barricade, however, barricade still turns when it is attacked) would make creeps not to attack barricades.

The solution I used was that I made barricade's range and acq. range to fully 0 (so it doesn't acquire targets). Then I concluded that barricade only turns when it is attacked, so I made trigger which resets barricade's facing to it's original facing spot. Remember to set turn speed to 0.00 with shift click (with normal click, it sets it to 0.10 as minimum). If you have sharp eye you MIGHT notice it that it turns by 1-4 degrees and then resets. However, I think it's extremely small problem if it turns by few degrees and then resets.
 
Level 3
Joined
Mar 28, 2009
Messages
75
im not sure but i think units attack organic units first, then mechanical and then building, and attack first attacking units. So, to be sure of your creeps attacks barricades, you should make them units (not buildings), organic and add them the attack 1-1 with a range like 500 to attire creeps.
 
Level 10
Joined
Aug 15, 2008
Messages
720
im not sure but i think units attack organic units first, then mechanical and then building, and attack first attacking units. So, to be sure of your creeps attacks barricades, you should make them units (not buildings), organic and add them the attack 1-1 with a range like 500 to attire creeps.

What? I don't get you, I said this thread was solved.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
1.)
are you sure the thread is solved,won´t creeps attack barricades that dont stop their way ?
so player can just builda barricade anywhere he wants at it will work
2.)
you have some serious issues with all those variables and triggers you have,im sure eery map does not need to have more than 20 varables and more than 20 triggers
edit: (if you dont count the timer triggers)

you should have only 1 trigger by variable type
so you have trigger with event "unit dies" for every deaths in your map that need to trigger something

or,you have trigger with event "unit is attacked" for every attack

you would need to take 3-6 days to fix all of that,but if your map will soon be finished leave it as it is
 
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
im sure eery map does not need to have more than 20 varables and more than 20 triggers

You're dead wrong.

you should have only 1 trigger by variable type
so you have trigger with event "unit dies" for every deaths in your map that need to trigger something

or,you have trigger with event "unit is attacked" for every attack

you would need to take 3-6 days to fix all of that,but if your map will soon be finished leave it as it is

It sounds like you don't really know what you're talking about.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
You're dead wrong.
for some big maps maybe....
but for this kind of map map,no...

he has 9 triggers,5 of them is Map Initialization and other 4 is 0.01 game time...
(than can probably be decreased from 9 triggers to 1 or 2)

other....
i saw you use boolean and if/than/else actions wrong

this is a bad way

if boolean = true than
do your actions
else
if boolean = false than
do your actions
else

this is a good way

if boolean = true than
do your actions
else
do your actions
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I can use more than 20 variables in a single script, let alone an entire map.

JASS:
function onSpellEffect takes nothing returns nothing
    local unit caster = GetTriggerUnit( )
    local unit target = GetSpellTargetUnit( )
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real tx = GetSpellTargetX( )
    local real ty = GetSpellTargetY( )
    local integer level = GetUnitAbilityLevel(caster, GetSpellAbilityId( ))
    
    // This is already 7.
 
Status
Not open for further replies.
Top