Sea units
Jul 20 2009, 3:50 pm
By: Jesusfreak  

Jul 20 2009, 3:50 pm Jesusfreak Post #1



Is there a better way to make air units that can't go on land? So far I know of 3 ways, but each has some serious flaw:

1.) Line the coast with locations, and when a unit tries to go to the locations, it's moved back to another location.
Pros: Does not require a location to be centered on the sea unit, thus you can have more than one of each unit.
Cons: Uses craploads of locations, and is rather unprofessional. Also, the comp would probably be too stupid to go around the locations.

2.) Have two locations centered on the sea unit (one that constantly follows it and another that moves to it when it's moved out of it), and have a ground unit constantly be moved to the first location by triggers. If the unit is over sea or impassable terrain, nothing happens. If the unit goes over walkable land, the unit is moved to the location, which activates a trigger that orders the sea unit back to the second location, which should still be in the water terrain.
Pros: Doesn't use a lot of locations and is rather simple to trigger.
Cons: Can only be used for one of each unit since it requires a location to be centered on the unit. Also does not account for sea doodads and tiny islands (or cliffs that might be close to shore).

3.) Have one big location over the areas of water. Then uncheck "Low Air" on the location properties. Make a trigger that performs whatever action (probably moving the sea unit to another location or maybe killing it, depending on the circumstances) when the sea unit goes to that location. Now, since "Low Air" is unchecked, the sea terrain is not part of the location. However, according to the tutorial by UnholyUrine, dirt IS part of the location, so the trigger while fire when the sea unit goes on it.
Pros: Very simple to make, doesn't use many locations, and can work with as many units as needed.
Cons: Unfortunately, UnholyUrine's tutorial wasn't completely accurate. Dirt IS low terrain (like sea terrain) and is therefore NOT part of the location. This is for every tileset, according to both my experiences and this tutorial: http://doodle77.dyndns.org/tutorials.php?id=416
So this technique actually only works when the coast is lined with high dirt or some other high terrain. I suppose I could just use the high water trick (to make the coast high dirt) and then blend it with the dirt, but that'd make the coast a vantage point for archers and such over inland areas (since units on low terrain can't see units on high terrain unless they attack them and ranged units on low terrain will often miss shots against units on higher terrain), which wouldn't make a whole lot of sense.

Anyone got any other ideas that might work for making air units that won't cross land?



None.

Jul 20 2009, 3:55 pm JaFF Post #2



How many units do you need this to work for?



None.

Jul 20 2009, 3:56 pm Jesusfreak Post #3



I'm not sure how many there will be, but it will be more than one at a time for the comp. All that really matters is if there's more than one, I think, since all the methods I know either work for any number or only for one.



None.

Jul 20 2009, 5:49 pm Falkoner Post #4



If you place burrowed locations around the island and center a location around each unit "in the ocean" you can detect when there's a burrowed unit under them.. :/

Another method would be to use extended terrain to make the edges touching the water be high dirt, which is a different elevation than water, so if you used this blend(I apologize for the broken images) you can simply put a single large location over your island and set its elevation to high air, then if any of the ocean-going units are detected, they must be on the coastal edges, or the high dirt.



None.

Jul 20 2009, 7:47 pm Jesusfreak Post #5



I mentioned both of those already.
Quote
If you place burrowed locations around the island and center a location around each unit "in the ocean" you can detect when there's a burrowed unit under them.. :/
It has to work for multiple units, so I can't do anything that involves centering locations.
Quote
Another method would be to use extended terrain to make the edges touching the water be high dirt, which is a different elevation than water, so if you used this blend(I apologize for the broken images) you can simply put a single large location over your island and set its elevation to high air, then if any of the ocean-going units are detected, they must be on the coastal edges, or the high dirt.
Yes, but that might hurt gameplay by making the coast a vantage point for ranged units.



None.

Jul 20 2009, 8:00 pm Kaias Post #6



What you could try is outlining the water edge in, for example, P12 Observers, and then make an inner outline in P11 Observers. Cycle through the P12 Observers looking for 'sea' unit in range and if they are center a location on the violator then send it back to a P11 Observer in range.

This would be a more last resort method, though, because it could get a bit messy. However, if you tried enough you may be able to get it to work well.



None.

Jul 20 2009, 8:06 pm Jesusfreak Post #7



Hmm, I had thought of lining the coast with units, but I didn't put it because I thought it was too much like the moving unit to the location method... but that's a pretty good idea actually, I never thought of cycling through the units... although that may cause trigger lag and I'd almost certainly run out of units (seafaring is going to play a somewhat big part in my map, so the coast isn't exactly going to be tiny). I might be able to do it though...

Is there a way I can make it so that the AI will automatically go around land, or do I have to manually order them with triggers?



None.

Jul 20 2009, 8:15 pm Madroc Post #8



Quote from Jesusfreak
Quote
If you place burrowed locations around the island and center a location around each unit "in the ocean" you can detect when there's a burrowed unit under them.. :/
It has to work for multiple units, so I can't do anything that involves centering locations.
Instead of centering a location on the actual ship, cycle through each of the burrowed units on the coast, checking if there is an air unit there each cycle.

Then if there is an air unit there during a cycle, move the ship to some random location off the screen, create a devourer at the burrowed unit, then create a second devourer (it will spawn in a different place than the first devourer), and check if it is over water by moving a burrowed unit to that devourer. If it isn't water, create another devourer (it should spawn in a different place than the first devourer), and check if it is water again. Run this trigger until one of the devourers is over water. Then remove all the devourers and move your ship there.

This'll make it so that if your ship goes over the coast, it is moved back into the water near where it hit land. Flawless, right?

Edit oh I didn't see that you had responded to kaias's post. But my system is better because it'll require less units, right? Well anyways, yeah it'll probably require a lot of burrowed units unfortuately. A way to make it so that computer units don't hit land would be to make invincible marines all along the coastline instead of burrowed units, so the computer runs away from the coasts. Likey? :P




None.

Jul 20 2009, 8:18 pm Jesusfreak Post #9



Well, almost flawless. It might cause trigger lag, but my bigger concern is that I won't have enough units to place... also, does it have to be devourers? Devourers were going to be one of my sea units XD.



None.

Jul 20 2009, 8:22 pm Madroc Post #10



Oh well the fact that devourers are square is pretty important :P I'm not sure there are any other square flying units that will work :( you could try tho. A way that you could cut down on units to place is by making the detection location be fairly big, like a 3x3, so that way you wouldn't need burrowed units (or marines, take a look at my edit on my last post) so often. Or you could even use like 11x11s in SOME places where the coast is straight, just put the units farther away from the coast. You could use different units (and triggers) for different sizes of locations.. right? Man that sounds like it could be cool :P
And yeah, trigger lag could be a problem, I don't think I've ever had that many triggers running at the same time, you'd need like hundreds or thousands.. :P




None.

Jul 20 2009, 8:28 pm Kaias Post #11



Lol, you could outline the coast with rescuable invincible corsairs. If the player ever owns a corsair center a location on it, give the unit to Neutral and the corsair to a computer until it leaves the location (corsair fire will push it away) and then give the units back. Its impractical but it'd work and have virtually no trigger load.



None.

Jul 20 2009, 8:31 pm Madroc Post #12



Quote from Kaias
Lol, you could outline the coast with rescuable invincible corsairs. If the player ever owns a corsair center a location on it, give the unit to Neutral and the corsair to a computer until it leaves the location (corsair fire will push it away) and then give the units back. Its impractical but it'd work and have virtually no trigger load.
Lol nice. Well you'd probably have to do my devourer trick, because a player could override the corsair fire by spam clicking. That way you wouldn't have to use corsairs either. But you probably would have way too many units and there's no way to make a unit rescuable again is there?



None.

Jul 20 2009, 8:33 pm Jesusfreak Post #13



That's brilliant... but do rescuables respond to comps? Bleh, that wouldn't work anyways, I can't sacrifice a player just to be a rescuable... :(



None.

Jul 20 2009, 8:40 pm Madroc Post #14



Darn.

Well do you think it would reduce lag enough to only cycle through units on the coast like every 1/3 trigger cycle?




None.

Jul 20 2009, 8:45 pm Jesusfreak Post #15



I don't know how I would do that and that might make it so that the sea units could get through D=. And there's still the problem of too many units being used up.



None.

Jul 20 2009, 9:00 pm Madroc Post #16



I could tell you how to do it without letting units through, but there still might be too many units in your map. Well if I were you I would try to find a happy compromise between trigger lag, location use, and too many units being used up. That is, unless someone can think of something else (which I doubt since this issue has come up many times before).

Well, how many ships do you plan on having in the water at the same time? Cuz if you have only 10 or so, then you could fairly easily center a location on each one and check to see if its on land by moving a zergling every few trigger cycles. 15 might be stretching it because of the lag of moving units to unmoveable places.




None.

Jul 20 2009, 9:06 pm Jesusfreak Post #17



I'll probably have somewhere between 5 and 20 in any given body of water, but that's completely irrelevant. There's no way to center a location on more than one unit of the same unit. You can center a location on a devourer and a scout, but not on 2 devourers or 2 scouts.



None.

Jul 20 2009, 9:30 pm Madroc Post #18



Yes, you can, sorry for not explaining it, here's how. Let's say there is 1 scout. Center a location called "pixel 1" on it. Set a death count of "scouts in play" to 1. Now let's say someone makes a scout, or a scout is created by a trigger or something. Detect that there are more scouts than death counts of "scouts in play" (with binary countdowns), then give the scout at the "pixel 1" location to neutral, and center a new location ("pixel 2") on the new scout, then give the scout at "pixel 1" location back to the player and add one to the death count "scouts in play." Wa-lah. Now if another one is created, center "pixel 3" on it. You can detect which location is to be centered by how many scouts there are in play. If one scout dies, re-cycle the locations so that there are no more scouts in play than there are locations centered on scouts. It also works if you create 2 scouts at the same time, it just takes 2 trigger cycles to do it. Only symptom is that whenever a scout is created or destroyed, every other scout is unselected, which is usually not a big deal at all. And also that you can only have as many scouts in play as locations you wish to assign to them.

I made a map based on this technique if you want to see it.




None.

Jul 20 2009, 10:10 pm Jesusfreak Post #19



Wow, NICE... but what if two scouts cross eachother's path? Will the locations know to stay with their scout, or will they both stick to one of the scouts?



None.

Jul 20 2009, 10:24 pm Madroc Post #20



Oh right, I forgot to mention that part.. Come to think of it, I can't think at all of how I did it in my other map.. I remember it took me a really long time to think of a solution to that problem tho.

Well, maybe I can remember what I did later (I've got to go to work now) but I think it would work to set a death count to 1 whenever two scouts are in 1 pixel location, and then re-cycle the locations when there are no longer 2 scouts in any pixel location and that death count is set to 1 (and then set the death count back to 0 again)? That would work right? The only reason I'm doubting myself is that it was just confusing as hell when I was trying to figure out how to do it.




None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[05:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[05:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: RIVE, graciedmoss