| 06-15-2003, 03:26 AM | #1 |
I'm curious if anyone has come up with a really good way to handle pathing in tower defense maps. As far as I can tell there's no easy elegant solution. I've seen alot of maps where people just make a set of regions and continuously order the units en masse from region to region, or sometimes iterate through them one by one. What I'm wondering is if anybody can come up with or has come up with a way to make a pathing solution that satisifies the following: 1. Units don't get stuck, especially at the start 2. If there's no way to get by, the units are smart enough to attack (just had a revelation that someone should try: tiny acquisition ranges) 3. A crapload of regions is unnecessary. Preferably only two: the start and the end. |
| 06-15-2003, 06:03 AM | #2 |
bump, sorry, forum is pretty busling and this went down fast |
| 06-15-2003, 06:18 AM | #3 |
The crap load, you idiot, is put in to one cataloge and doesn't bother you once you've done it. "Waypoints" - With maybe 10 triggers in it. Actually you could make it all in one trigger even "If unit enter unit enters unit enters unit enters" Ect, till you have all. "If entered region is = X and entering unit is owned by player X do order entering unit move to 'next region'" Anyhow, the bug at the beginning where they get stuck is because idiots can't trigger right. Don't come tell me something else. Have you seen Cube Defence? Wintermaul is bugged in this way just because it doesn't move the unit instantly when they spawn, this is easily fixed. You can create units and then move them to first waypoint in the same trigger. The thing about attacking, that can be fixed in numerous ways, just think up a trigger that tells the unit to become agressive if it stands still for a long enough period. NOTE: HAVE SMALL REGIONS AS WAYPOINT. Allowing smooth movement Regards Dead-Inside |
| 06-15-2003, 04:03 PM | #4 |
Nothing is easier than a basic trigger with many waypoints. The acquisition problem is an obvious one, though some people can forget it. There is only one problem : Region comparison won't work properly. Why ? Simply because GUI trigger regions aren't regions, they're of the Rect type. This is a know issue confirmed by Brett Wood from Blizzard. I would recommend using a distance comparison between the entering unit and the center of the entered "region" Regards |
| 06-15-2003, 11:07 PM | #5 | |||||
Quote:
You obviously can't read. I said without a crapload of regions. I mean then, without a crapload of regions. I already have one way of doing that uses a crapload of regions, and you are correct, it does not bother me, but say I wanted to make a series of maps. It would be a bother to make the crap loads over and over again would it not? Or perhaps, I'm just asking in the sake of saving other mappers time, and perhaps, you should piss off because I can out map/trigger you anyday. Quote:
Can you actually code? Do you know what an array is? I'm already doing this. And if you were as smart as you claim to me by giving me the title 'idiot' you'd realize you only need one event too. Quote:
You sound as if you believe you're not in this 'idiots' category. Quote:
You could also just make the initial region bigger/overlap. Quote:
That's too much of a pain to do on the individual level. You can't extract the current timed life of a unit, so you'd have to store the number of seconds its been in their flying height (ground units are unaffected by changes in flying height) which would stop me from being able to use flying units, unless perhaps I used small decimal changes -- but even that would become noticeable. Prop window angle wouldn't work because it can't store values greater than 360. Movement speed can't be used because it has a gameplay effect. Vertex coloring would look odd. Not to mention there's no boolean check for if a unit is standing still, so now I'm going to have to extract the position of every unit and store it in an array, then periodically store it again, and then compare the two to see if the positions are the same. Wait, that won't even work, because most of the time when the unit is stuck they're moving back and forth between several points. So I'll need to setup boundaries where they need to have moved a certain minimum distance to become aggressive... Before you go around calling people idiots, try not to be an idiot. I just read the least elegant, stupidest solutions ever proposed before the war3 mapping community. IMHO you should be banned -- for being an idiot. |
| 06-15-2003, 11:18 PM | #6 |
Guest | all i have to say is.... detaAngel ownz u |
| 06-16-2003, 12:05 AM | #7 | |
Quote:
Can you at least *try* not to be a discourteous jerk when replying? It doesn't take much energy, it makes you look older than 14, it's polite, and especially with someone who's been here at least as long as you have, it's, at a minimum, tactically wise. |
| 06-16-2003, 02:56 AM | #8 |
dataangel : To go back to the original question, i would like to know why you dislike the idea of waypoints ? do you plan having a very complex pathing like a circle one ? If not the method works like a charm especially with iterating them. About storing the creeps position in the waypoint serie they follow, as well as the player they were dedicated for, i store it all in mana (you could also use Point Value for this). Disabling Mana regen, giving a unit max mana equal to the bigest region number in an array. example : *Player 1 waypoints : WayPoint[10]=Spawn1 WayPoint[11]=WP1_Player1 WayPoint[12]=WP2_Player1 --- WayPoint[1X]=Arrival1 *Player 2 waypoints : WayPoint[20]=Spawn2 WayPoint[21]=WP1_Player2 WayPoint[22]=WP2_Player2 --- WayPoint[2X]=Arrival2 etc for all players. Then everytime you have a unit spawning, give it 10xPlayerNumber+0 mana (Spawn region) and order it to move to WayPoint[10xPlayerNumber+1] Then test if a unit enters its "legal destination" then add 1 to its mana and order it to move to Waypoint[Mana Of(Entering Unit)] Works a treat, trust me. As for the attack part, i have only managed to get it fully working with adding this trigger : Events : A unit owned by *owner of the creeps* is given an order with no target Actions Order unit to move-attack to WayPoint[Mana of(Ordered Unit)] Please give it a think and tell me if that method would be appropriate for what you need. Regards |
| 06-16-2003, 07:54 AM | #9 |
True, but if he'd use his brain he wouldn't be here in the first place. I mean, okay sure it is okay to ask about a good way to path. But saying that "a crapload of waypoints aint good" is... Plain stupid... Anyway, I'll try to be nicer from now on... Hmm... There is a reason for everything. Regards Dead-Inside |
| 06-16-2003, 09:48 AM | #10 | |||
Guest | Quote:
Do they get stuck because so many are being spawned at one time so that they have a hard time working getting around each other? If so, perhaps stagger the spawning by a few milliseconds. Very easy to do in JASS but in WE you'll need a periodic trigger that you turn on when you want the units to start pouring out. Another thought is that you can create all the units at once, set their orders at once and pause them all. Later when you want them to start their journey, unpause them. Maybe also unhide them if you wanted them to be hidden initially. Quote:
Changing the acquisition range doesn't sound good to me at first glance because it would unfairly advantage players setting up a blockade. Only the first few rows of attackers could "see" the players to attack. But your point is that you don't want the units to wander off chasing some enemy unit and forgetting their task forever right? I've noticed that when a unit can't move to a position he's been told to go to due to other units blocking it will go back to it's guard position (where he spawned I suspect)...Which might mean he cuts across an area you were trying to path him acround. Avoind this even if the acquisition range was low is impossible since an exploit is an exploit and someone will find it :) The only way I can see to prevent this is to have a preiodic event keeping the units "on target". ChrydGod's suggestion is one of the better ones I know of for this. Very practical if the units do not use mana. If your units use mana then with JASS you can use other attributes but there is always a compromise. e.g. I use FlyHeight for ground based units but of course the compromise is in not using air units... I also have used TurnSpeed - compromise is slight variations in unit turn speeds (hey difference between 0.500 and 0.509 is not much but it gives me a few values to use) Other solutions do not scale well - meaning that if you have hundreds of units spawning over the lifetime of the map then you'd run into memory problems. Well that's my experience anyhow... Quote:
Well you need a crapload of something to mark the waypoints. If it's a straight line to the destination then no waypoints needed. If there are alternate paths to the destination and you want a particular path to be taken then you will need some form of waypoint identifier. I have used hidden units instead of regions for this (tents actually). This has an advantage of being able to move the waypoint easily (I dislike moving regions in the WE and of course in JASS they are not regions at all but rect's). In any case I'm usually only after a point (location) anyhow so a rect is not really necessary. Using JASS I make sure that at runtime, all of my custom tent units (named Waypoint 01...Waypoint 40) are hidden and loaded into an array for ease of use. The map designer can move the waypoints around on the map as much as they like and the triggers will still work. The triggers all do the same thing. They set a global to a value representing the waypoint then call a single trigger which decides what to do. Again JASS makes this easy because you can have efficient branching (if..then..elseif...). Lastly a method I have not used as yet but have been meaning to is to create a region in JASS and simply use a trigger that when a unit leaves the region, force it back onto it's next target. Note that in JASS, a region is made up of 1 or more rect's. A rect is a rectangle and this is what you create when you create a "region" in the WE. So imagine several WE regions all joined together...in this way you could have a region representing the path of the units to easily detect any that stray, but it won't in itself prevent backtrackers or lazy ones that just want to stop... Anyhow its way late and I've spammed your thread enough with ramblings :) Cheers |
| 06-17-2003, 10:31 PM | #11 |
Guest | I've been looking at this again in the last couple of nights to try and come up with a decent system for TD/FOTA style unit pathing. What I have come up with is nothing earth shattering and at present you can't use just WE to do it all - you have to customise the war3map.j file a little. My next job will be to try and make the scripts standalone so that all the map designer need do is place the custom units I've called waypoints on the map. If anyone is interested in results then I'll post here. |
| 06-17-2003, 10:40 PM | #12 | |
Quote:
You're sooooooo lucky I ain't moderator anymore ;) And before you call it "plain stupid" again, look at my possible reasons for why it would be inconvinient. And frankly, you shouldn't be calling it stupid anyway when you have no idea what the motivation behind it is... that's just.... plain stupid. |
| 06-17-2003, 10:44 PM | #13 | |
Quote:
That's an interesting way of doing it, does that work even when arrangements of towers are made where the unit keeps patrolling between two points? (I'm assuming your detecting a stop order) |
| 06-17-2003, 11:41 PM | #14 |
Guest | Ok for the pathing i would suggest just using regions another way may include using just points. Now for the unit attacking if its stuck thatz easy to do. In the trigger that tells it to move from region to region tell it to just MOVE then if it breaks the movement cause there is no way through then it will start attacking. (The unit has the ability to attack your towers but since yout old it to move on through its ignoring them. But i know if you can't get through something that order eventually will get canceled. |
| 06-18-2003, 12:40 AM | #15 |
Guest | I think that a big problem with ordering units to Move To is that the units miss out on attacking along the way... That's fine for TD (and I know that this is a TD thread) but there is a problem when you are trying to make more of a DOTA style map. The solution I am experimenting with does involve giving orders regularly as well as when units reach a waypoint. This way, I can control whether to stop the units from straying form the path in order to attack some unit that is attacking them, but every x seconds (15 is good) all units are ordered to attack their original target again. This works well but I have to determine whether the overhead for odering all of the units every 15 seconds is worth paying. I tested it on a simple map with 4 waypoints in a square each pointing to the next corner. Units spawn every 5 seconds and go to WP1. Once there are a dozen or so units in their endless loop I sent my hero in to fool them into chasing. As long as the enemy player can see your hero, some of them will never ever break off chasing... Others do break the attack and seem to return to their guard position. The system I am devising will be customisable for any of these methods of moving...but at present it's not able to be done through the WE....working on that bit.. |
