How do Maze Tower Defense maps work?

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
i want to make a td map but i want an open area where players can place towers anywhere and creeps make their way around them, so players can build paths and mazes, but i'm not sure how to make it so that the players cannot just block off an area entirely, i mean i can have unbuildable checkpoints for the creeps but what stops the player from just building around it?
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
I have never made a map like this so I do not know how this should be done. But here are some triggers I tried, that work.

Create enemies and order them to move. Iff a path is available they will move there. If not they will walk as close to the target as possible and will stop moving. They will now automatically attack. This is standard behaviour of warcraft 3 units. They will stand like 1-2 seconds idling before starting to attack. I think this is a very good and simple solution. The alternative would be to check for yourself if a path is available, which is hard to make and not very efficient.

So this system would simply cause the creeps to destroy towers of yours to open a path.
  • Spawn
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 2 (Blue) at (Center of Region 001 <gen>) facing Default building facing degrees
      • Set p = (Center of Region 000 <gen>)
      • Unit - Order (Last created unit) to Move To p
When they have killed a tower you reorder them to move.
  • Move Again
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Set p = (Center of Region 000 <gen>)
          • Unit - Order (Picked unit) to Move To p
The triggers are just for showing the idea. They contain leaks of course.
 
Level 8
Joined
Jul 29, 2010
Messages
319
I have never made a map like this so I do not know how this should be done. But here are some triggers I tried, that work.

Create enemies and order them to move. Iff a path is available they will move there. If not they will walk as close to the target as possible and will stop moving. They will now automatically attack. This is standard behaviour of warcraft 3 units. They will stand like 1-2 seconds idling before starting to attack. I think this is a very good and simple solution. The alternative would be to check for yourself if a path is available, which is hard to make and not very efficient.

So this system would simply cause the creeps to destroy towers of yours to open a path.
  • Spawn
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 2 (Blue) at (Center of Region 001 <gen>) facing Default building facing degrees
      • Set p = (Center of Region 000 <gen>)
      • Unit - Order (Last created unit) to Move To p
When they have killed a tower you reorder them to move.
  • Move Again
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Set p = (Center of Region 000 <gen>)
          • Unit - Order (Picked unit) to Move To p
The triggers are just for showing the idea. They contain leaks of course.
Thanks for the help :D
 
Level 12
Joined
Dec 11, 2014
Messages
665
The above won't work if a lot of units get "stuck" because then they will destroy the amount of towers equal to the amount of "stuck" units. So you can pretty much get your whole maze obliterated. The one way I found that is really efficient is used in my map remake, but the problem with it (A lot of people don't like this) is that it uses Waits. If you can replace those waits maybe with timers then great, I tried but it just didn't seem to work. You can make waits really short if you give units a fast first attack (no blendtime and similar)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,273
i want to make a td map but i want an open area where players can place towers anywhere and creeps make their way around them, so players can build paths and mazes, but i'm not sure how to make it so that the players cannot just block off an area entirely, i mean i can have unbuildable checkpoints for the creeps but what stops the player from just building around it?
The units eventually stop trying to go to the waypoint and they usually go on a rampage of destruction killing 1 tower. If you are kind you can refund killed towers.

Some nerdy people made path finding algorithms that can detect blocks by manually tracking pathability. When a tower is trying to be/is placed that will block pathing to a waypoint it can be cancelled. Such systems are not easy and I only recommend people interested in computer science even attempt it.

StarCraft II has an inbuilt path checker which can be used to test for blocks. Sad WC3 does not have such a convenience function...
 
Level 8
Joined
Jul 29, 2010
Messages
319
The units eventually stop trying to go to the waypoint and they usually go on a rampage of destruction killing 1 tower. If you are kind you can refund killed towers.

Some nerdy people made path finding algorithms that can detect blocks by manually tracking pathability. When a tower is trying to be/is placed that will block pathing to a waypoint it can be cancelled. Such systems are not easy and I only recommend people interested in computer science even attempt it.

StarCraft II has an inbuilt path checker which can be used to test for blocks. Sad WC3 does not have such a convenience function...
Wow that sounds insane, I only know html and python, i wouldn't even know where to begin building an algorithm for warcraft, let alone actually implementing it , sounds like it'd be an interesting project though.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
I implented such a system, though it does not work perfectly at the moment. Warcraft 3 automatically interrupts the alorithm if it takes too long.
I will try to increase the alorithm's efficiency in a few days.
I was also thinking that it might be possible to calculate positions that would block the path and placing destructible that make these positions unbuildable.
But I don't know how you would calculate these positions efficiently.
 
Status
Not open for further replies.
Top