• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Survival TD Mix

Status
Not open for further replies.
Level 10
Joined
May 20, 2008
Messages
433
Not too long ago I came up with an idea to mix a Survival map and TD map. This would revolutionize TD's everywhere. Here is the basic outline of the game-play:
-You would, at the start, either build a maze, or construct a defensive barricade (same buildings for both options, just a metal decision)
-You would have to prevent either of 2 units from being killed (your builder or town hall)
-The game would send enemies at you that would follow your maze to your guy, or destroy your defense by attacking it (in theory, until a certain point, but this is unclear/not an issue)

Here's my question: Is it possible to get the game to recognize your strategy through triggers?
For example, if you build a defensive wall, the enemy would attack your offensive towers then kill your guy, at the same time if another player has a maze, the enemies would walk through without attacking anything.
NOTE: the enemies have a radii of 32 (2 squares). If I include a slow tower, one would think it is unable to reach your guy and attack your towers. Solutions (if I lower the radii, then they would run through your gaps, and your builder must have a radius of 16 and not fly)?

As a second question: How would you denote a resurrecting target? Like when a unit is revived (through resurrection) it would head back to attacking to your unit. I've gone through each event/variable/condition there was, and they continue to attack all nearby units, then stop.
 
Level 8
Joined
Jun 26, 2010
Messages
530
A player that already built a maze can build a tower? Vice-versa is true? If both awnsers are no, that would be simple. Make a trigger that runs when a unit builds another, and acording to the built unit, set the strategy for the mobs spawned to that player.

Your second question is not clear, you want the revived unit to attack the unit who killed it? Like revenge? AFAIK you can do that storing the killing unit and it's respective killed unit in variables.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Here's my question: Is it possible to get the game to recognize your strategy through triggers?
For example, if you build a defensive wall, the enemy would attack your offensive towers then kill your guy, at the same time if another player has a maze, the enemies would walk through without attacking anything.

Ofcourse it is possible. JASS seems to support everything needed to do this. However the question is, will it be reliable or usable. Due to the lack of low level interaction with the game you can not impliment ultra efficent AI routeins meaning that performance of your trigger system is a key problem. Ofcourse you can always optimize and simplify but doing that might comprimise its reliability.

Solution 1
Maze solution pathing problems are noutoriously slow with computers and JASS will emphisise this. You basically have to move a unit to each pathing square and check its responses to see the pathing of that square. The native will only return terrain pathing and as such buildings and destructables will not be counted but the unit test always works. The problems are that there is the op limit meaning you will have to force separate code threads inorder for it to be instant, that WC3 triggers are single threaded meaning that you can not use the conventional stack fetch approch to speed up the routein on modern systems with multi cores and that the player numbers involved will mean repeating it multiple time consexutivly.

You basically asign it the problem of going from spawn point to end area. If this is in a straight line it is pretty easy but if it is in a complex route you will have to do each move segment separatly. As the lines should be straight without a maze, you start by advancing 1 pathing unit at a time towards the move desternation. If you hit something unpathable then you start branching out moving around wall surfaces and trying every direction possible. You need to cache which tiles have already been visited as to prevent the algerthim mindlessly rechecking checked branches. A good thing would be to probably kill off any pathing branches which deviate too far away from neighbouring a wall to reduce search scope. The physics of a maze mean that eventually by following a wall you will reach the end. Additionally once it hits the shortest route path again (the one orignally used) it then piorities on that search and going straight again. Also terminate searches that hug natural walls that are progressing in the wrong direction, this will prevent it searching the entire wall for a possible path to the end. If it reaches the move target then it is logically a maze. If all searches fail (end up with no more non duplicate search possibilities) it will then be a wall, thus attack.

Solution 2.
This is far more simple but also abusable. Every few minutes / seconds / whatever send a windwalked (no unit collision) invisible dummy to walk through the maze. If it eventually stops or hangs around an area for too long (pathing bugged) it is a wall. If it makes it to the end then it is a maze. Unlike the above method which can be done instantly (well, processor wise it will take a while but game wise it will pause until complete) and so can be run on every tower sell / build to update the condition instantly, this has a delay based on the send frequency allowing the player to alter his wall maze to fool it which could result in a maze (letting stuff through) turning into a wall but because there is a buffer time before the units stop arriving at the desternation and during that time he could have maze creeps walking into a wall.

Various methods exist to improve the efficency of both ways. Including detecting sudden abnormalities with checker movement for solution 2 and buffering working routes in method 1 meaning that calculations only need be made to areas which have been subject to some form of change.

You are probably limited to solution 2 cause it is extreemly simple compared with solution 1 which is probably as difficult as one can get as far as solutions go. However in the long term solution 1 would probably be better as it means no moving dummy units and also garunteed accuracy.
 
Level 10
Joined
May 20, 2008
Messages
433
To clarify some things (in case some people still don't understand): think of a survival map (where you build a defense) and a Tower Defense (where you construct a maze). You are given a unit that can build towers and walls, and you decide how you want to play the game (by playing it like a TD or a survival map). I should note that for the better part of the game, you will only face 2 enemies at a time.

@SoulBurn: Its like a normal TD, you can build towers whenever you get money.
My second question is this in a nut shell: When a unit dies and revives (the ability resurrection), I want it to attack your worker, but everything the editor has on this topic doesn't work.

@Dr Super Good: Unfortunately, I have yet to learn JASS.
1) I have no idea on how to go about this, though it is the solution more likely to succeed.
2) If I create a unit without collision size, it would head through any opening. The enemies have a pathing equal to 2 squares, while you and your workers have a path of 1 square. If I give the dummy unit the collision size of 2, it would interfere with any workers or builders trying to get by (which could lead to a fake wall). If I give your builder and workers the "fly" movement, you can easily break the game by moving them off a cliff. Point: although it would probably be the better choice, it wont work under this maps conditions.

Also, in a map I found online, it had some system that would cancel/destroy any construction blocking the path (it was a mazing contest, and I haven't checked to see if its protected or anything). Would a system like that work in detecting what you did?
 
Status
Not open for further replies.
Top