HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Terrain Height=Visiblity Modifier

04-13-2007, 03:02 AM#1
Banana
I'm trying to figure out whether I can modify the terrain so that if a raised terrain is greater than a default cliff height (128, correct?), make the map treat it as cliff height of +1 for visiblity purposes. This is to prevent units from being able to see everything on top of a plateau that's obivously much higher than they are.

Looking at natives and functions, I can see where I can get height of a given location, so that's a starting point. However, there seems to be nothing where I can modify cliff level (and search indicates that this may not be possible), or some kind of simple modifier without having to checking every unit's height and modifying its sight which would just bog down everything.

Any suggestions?
04-13-2007, 03:26 AM#2
Toink
Add sight blockers :P
04-13-2007, 03:35 AM#3
Banana
Well, of course if this was here and there, I'd have done that already. ;)

But I want to enforce the visiblity rule globally, which LoS blocker wouldn't be ideal for this sort of behavior.
04-13-2007, 03:37 AM#4
Toink
The only thing you can do is use the blizz cliffs. Raise and Lower tool were not meant to make cliffs.
04-13-2007, 03:37 AM#5
Rising_Dusk
LoS blocker is probably the most surefire way to do it though.

Other than that, you can't change cliff height in-game.
You can crater and deform stuff, but the terrain returns the same cliff and Z values.
(Craters also dont impact visibility)

My suggestion is that if you need the blizz-cliff visibility, use a blizz-cliff and then just stack doodads over it to make it look better.
Otherwise there's really not much you can do.
04-13-2007, 05:15 AM#6
Dil999
Wouldnt it be Possible **Possible** to make a cliff tile so that if you lower it to flat it looks like, say, a rock tile? Then you have invisible cliffs with your fancy one-way-sight.
04-13-2007, 07:31 AM#7
Pyrogasm
Make regions on top of your plateaus and use these functions?
Trigger:
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Fog of War across (Playable map area)
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black Mask across (Playable map area)
04-13-2007, 11:04 AM#8
Rising_Dusk
Fog modifiers would be too tricky to get to work.
They also don't "block" vision, they just give/remove it for a certain area.
04-13-2007, 11:11 AM#9
Pyrogasm
Yes, but you could constantly create them if need be.

Say, for example, that you set it up as 2x2 (yellow grid) square plateau, and then created a repeating timer/trigger that checked to see if there was a unit in the region.

If there is, then don't create the modifier for the owner of the unit; if there isn't, create it for each player.

Workable, maybe?
04-13-2007, 11:27 AM#10
Rising_Dusk
You would need to do massive amounts of calculations to get all nonvisible areas of the map every half second or some really short period.
Then you'd need to dynamically create masses of these fog modifiers dispersed evenly across said region, load them to an array, and either move/recreate every interval.

Remember, you could see "past" the modifier, so you'd need lots of modifiers to ensure you blocked all areas passing units *might* see.
Functionally, the modifier would have to be placed differently based on what vision you needed, which makes finding *where* to place them very tough.
So even in the case of a single non-visible mountain, it would be a lot of work.
I'd much rather use a blizz cliff than a mass of code.

Not to mention -- If you had lots of these mountains, you'd be stressing the processor when a blizz cliff removes all need for code.
It's just smarter to not try to fight it with fogmodifiers.

Quote:
Fog modifiers would be too tricky to get to work.
I wasn't kidding.
04-13-2007, 11:30 AM#11
Pyrogasm
Aw fuck it: you win.


I didn't think about where units might be able to see that aren't in that region/rect...
04-13-2007, 12:07 PM#12
Banana
There's also another problem with LoS blockers or modifiying visiblity: Suppose a unit was standing on a blizzard cliff and there was a hill (raised terrain) that is higher than the unit. Because the unit is on cliff x+1 while the hill is cliff x, unit gets to see everything on the hill. Vice versa, the unit on the top of unit cannot see the cliff plateau, which would be weird.

That said, there is a solution, albeit only partial solution: I'd go and use ramps then shape the terrain to my desire, making sure that it doesn't raise above cliff x+1 below the topmost part of ramp (where I assume the visiblity will be blocked). This will work for where I have sloped hills where I can fit in three medium grids wide for ramps among the way.

However, if I wanted the raised cliff to go up more than one cliff height, the solution wouldn't work as I'd be only able to fit in one ramp (I'm pretty sure I can make it so that two bottommost rows of ramp can be flat among with the ground, while allowing the topmost row of ramp to be raised to whatever height and still block the visiblity as necessary). Perhaps anyone else have a suggestion for this specific situation?