TD Blockage system, any suggestions?

Inflicted

Currently inactive
Reaction score
63
okay im looking for the simplest method possible, but i have a TD with like mazing and all that.

i want so that the creeps run around the towers and through to the endzone.

BUT if a player blocks and the creep is unable to reach the end i need some sort of method to make towers become destroyed so that it is able to get through.

the method could be that the creeps attack or that its triggered destruction.
only problem i have with them attacking is that i dont want the creeps to destroy the whole maze, just the part they cant get through.

any suggestions? all comments are apreciated except the "negative" ones. thanx

---------

sorry for editing just wanted to show my current blocking system i made, it works but i dont like how it works so much, lil inefective.

i triggered it so that an invisible unit is made that runs through the maze, and if it cant get to the endzone in 30secs then 4 random buildings *explode*.
only prob is that 30secs is long, and they could like block for 25seconds and then open to let through or whatever and then theyv killed the wave cos they are immobile.
i thought of maybe making the time shorter, but if someone has a long maze it might not be able to get through in less time than that.

so im open to any fresh ideas :)
 

Sevion

The DIY Ninja
Reaction score
424
You could do it the way LTW does it.

Have a "Referee" run through and do a periodic check that if its current order is "Stop", order it to attack the nearest player's tower and move to the end again. (And order units around it to move too so they don't get stuck).
 

Moridin

Snow Leopard
Reaction score
144
I was actually thinking of making a pathing system in GUI for this :p.

Well, a typical suggestion is to have a kind of maze runner unit, move through the maze and if he can't get through the tower nearest to him gets destroyed (opening the maze up a little more). However, I don't really recommend this (because I personally have exploited similar systems in such a way that I can get past it).
 

Tyman2007

Ya Rly >.
Reaction score
74
Well, there is a method.. Simple to codeS Maybe.. The way a maze blocking system would work is using "Chains".

The only way that if there's a block is if the chain of the towers reaches from one side to another. When you build a new tower, the chain will try and detect if the length of the tower chain is greater than or equal to the distance between side A and side B. Here's some examples.
figure that each S is the size of 100.

S = blank piece
S = wall
S = valid tower placement
S = invalid tower placement (Blocker)

SSSSSS
SSSSSS
SSSSSS
Here's our maze, or "Pipe". the distance from side A to side B is 400.
Let's build a tower.

SSSSSS
SSSSSS
SSSSSS

Building that tower started a new chain because there are no towers touching that tower diagonally, vertically, or horizontally. Let's build another one.

SSSSSS
SSSSSS
SSSSSS
this is where some systems make a mistake at, but when we built another tower, the tower we built is not connected to the chain. A new chain is created. So far, each chain is a distance of 100.

SSSSSS
SSSSSS
SSSSSS
building that new tower had connected the 2 chains. There is only 1 chain now. Seeing as how we're measuring from left to right, the distance is 200, although there are 3 towers.

SSSSSS
SSSSSS
SSSSSS
The new tower I built had added an additional 100 to the chain. The length of the chain is now 300.

SSSSSS
SSSSSS
SSSSSS
When we built that new tower, it added an additional 100 to the chain. Seeing how the distance between the 2 sides is only 400, and we have a chain the size of 400, the tower that was freshly built has to be the blocker and is in turn destroyed.

Using this method we can create a few triggers.. One to check when the tower is built, one to check the length of the chains, and one to decide what to do with the new tower.
 

Romek

Super Moderator
Reaction score
963
Related Thread
Tyman2007 explained it a lot like I did in that thread (though that thread has some other related discussion).
 

Sevion

The DIY Ninja
Reaction score
424
>_>

Lots more code for something so simple. A runner will suffice... But do with it what you will. It's your map.
 

Don

Rise with the Fallens!
Reaction score
52
Simply allow 1 attack for your ''Wave units'' and order them to simply ''move'' from one region to another. If they can't find any way to get there, they will destroy a tower. Then, you can recall the order with hashtables with the event ''a unit dies'' and condition ''unit is a structure=true''. That's what I do when I make TDs and it works really fine :p
 

Inflicted

Currently inactive
Reaction score
63
ty for all suggestions.

um Tyman2007 could you possibly give a demo map cos im sorta understanding what your saying, but i'm not to sure how to trigger it to destoy a building.

the creep attacking thing does work, but i dont like the fact that it could attack the wrong towers or destroy all of them, ag its just very messy. I'd rather have a system that sells or destroys the 'blocking' tower. referee works but its the same kindof problem.

thanx tho
 

Romek

Super Moderator
Reaction score
963

Inflicted

Currently inactive
Reaction score
63
ah the system is perfect. but i only have one problem, my maze has an entrance and and ending that has a smaller part to go through, how would i make it so that if its blocked upwards or just the entrance it would destroy the building?

like this:

S - empty spot
S - entrance/wall
S - tower
S - tower that should be destroyed if built

SSSSSSSS
SSSSSSSS
SSSSSSSS
SSSSSSSS

or likewise at the top, another prob could be doing it downwards like:

SSSSSSS
SSSSSSS
SSSSSSS
SSSSSSS
SSSSSSS
SSSSSSS

if you understand what i mean, its quiet a problem.

---

any suggestions?

---

EDIT: ah i found a long method that works, just made a whole lot of triggers/regions and said if there is a unit in that region then the boolean variable would become true, and check so everytime a building is constructed. if all are true, destroy the building. this works, but will take long for all 10 players.

is there any other methods that might be simpler?

---

EDIT again: problem with that, check second image. i cant seem to provent that. any ideas?
 

Rushhour

New Member
Reaction score
46
What about something like an "ant algorithm"? When a new tower is constructed, start at the Start , where the creeps spawn.

Then you need to move from this point into every four directions and create new points there. The offset should be half of the minimum tower size. Will need some experimentation.
From each of these points do the same in again each four directions (well, do not go in the direction the point came from).
Always check if these new points are already part of your growing system. If they are blocked by something stop going on from this point.

Well and as soon as one path reaches the target you know (the shortest) path and you could also highlight this with some cool special effects :D

I could later try to code something like this in jass, maybe overthink the concept,... but I got no time now, sorry ;) have a try
 

Rushhour

New Member
Reaction score
46
I got something working.. but right now it needs some seconds to calculate since I overrun the operating limit, and starting new threads is only possible with a small pause...

also the hightlihting of the path doesn't work as I want it right now^^

will do it the next days after work
 

Rushhour

New Member
Reaction score
46
Could you please describe how your pathing will look like? So if the place where players build towers is surrounded by cliffs/unpathable objects, ...

It's difficult if not impossible to build an algorithm that is 1. fast (since the operation limit is easily overrun) and 2. efficient and accurate for every situation.
 

Inflicted

Currently inactive
Reaction score
63
it has cliffs around the area, i put pathing blockers so that the units cant run through the area that is unbuildable.

it looks like those "diagrams" that i have shown on previous posts, but not exactly proportional dimentions.

i will put up a screenshot when i get home later.
 

Inflicted

Currently inactive
Reaction score
63
Sorry for double post, dont think i can edit and add a pick with my rep :/ lol

here's the pic, i can get dimentions too if necesary.
 

Attachments

  • TD_Pic.jpg
    TD_Pic.jpg
    118.7 KB · Views: 297

Strilanc

Veteran Scripter
Reaction score
42
If players can build during the rounds, detecting no-path situations is not enough. Players can open/close opposite exits to keep runners going in circles without ever fully walling. In that case it's best to ignore detecting walls and instead detect runners backtracking.

I used to play Cube TD and I would abuse the open/close technique whenever things got desperate.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top