Thursday, April 12, 2012

Sight Change

[:1]hey i havent played warcraft for a long time now and even longer i havent worked on maps making so i have to come in again..

now i have a big idea for a new map but i will start with a simple question:

is it possible to make an area 'unrevealed' (i thought it was, but im not sure, and because im not able to start my world editor right now, i have to ask this)

and with this area, i dont exactly mean a region, but for example a triangle?|||Quote:






View Post

is it possible to make an area 'unrevealed' (i thought it was, but im not sure, and because im not able to start my world editor right now, i have to ask this)

and with this area, i dont exactly mean a region, but for example a triangle?




Yes you can change the visibility to set an area back to black mask. And I believe you can make 'triangular-like regions, but it requires some JASS.

See, for example, this group of functions created by my clanmate Shvegait:

http://www.wc3jass.com/viewtopic.php?t=282

http://www.wc3jass.com/viewtopic.php?t=283

http://www.wc3jass.com/viewtopic.php?t=284

These are, of course, not rects (i.e. GUI regions), but 'true' (JASS) regions.|||aww.. but i dont know anything about JASS.. so this is gonna be hard.. ok then ill explain my idea:



i hope you understand what i mean|||I think you are probably going to have a hard time accomplishing what you are setting out to do. I don't know that it is necessarily not possible, but to get it to update in real time for players and have obstacles block los is probably going to require a ton of calculations, so you best start learning JASS, because you probably won't be able to pull it off without a bunch of custom functions.|||eww.. hmm but isnt there a way to just make it every 0,01 seconds black or something? and i only want it to 1 unit, not to all..|||Quote:






View Post

eww.. hmm but isnt there a way to just make it every 0,01 seconds black or something? and i only want it to 1 unit, not to all..




Single player makes it easier to accomplish and more manageable for computers, but will still require that you use JASS regions. One of your options could be to modify your world editor to allow JASS regions in the GUI and then add those functions Shve made (there's a tutorial on doing this sort of thing in the tutorial forum. We've done that with our own editor and it makes things like this a little easier. You'll still have some substantial calculations to black out line of sight visibility and I'm not completely sure how fast the black mask can be manipulated, but it could be worth a shot. If you are making it for multiplayer/bnet gameplay, though, periodics running those sorts of calculations will need to be scaled back.|||Chunk: visibility can be altered locally, so it won't affect multiplayer much.

MP Productions: In the case of trees, if you set occlusion on (???) or something (or maybe its on by default), units won't be able to see behind them (like in those zombie/marine maps). If you can make your other doodads that you want to block vision into tree types (?? will it mess with textures?) you can make them block vision (they can also be mined too, but maybe changing their armor to divine? can change that, but I don't have WE on me so I can't tell)

As for updating vision in real-time, the jass approach which I think would lead to the least computation is to hide everything for that player, then reveal a circle, use scripts to hide the two triangular regions on either side behind and then remove the rest with a single square. If the tree thing I've mentioned doesn't work, you would need to use script to cut out linear segments from the base of the object to the rum of the circle in the direction away from the center, possiblly with circles spaced half a radius away from each other. This would not however work well for objects that aren't square or circular as the shadow width would vary from different angles.|||Quote:






View Post

Chunk: visibility can be altered locally, so it won't affect multiplayer much.




Well, initially I thought he was going to be running one of these for every unit, for example. In which case, the visibility itself might not be problematic, but the calculations involved and the refresh rates required would be.|||Quote:






View Post

and i only want it to 1 unit, not to all..




message length|||Quote:






View Post

message length




Yeah, and look when he posted that, fool. Am I supposed to have read his mind prior to that post? You do understand English well enough to know what initially means, don't you?|||i know.

Why not just, Put the camera BEHIND the character, like 3rd person?

ofc this only works when u only have 1 character, no army|||Adding a 100% black ground fog (low values for linear fog) will make everything black again when no unit is near. Still not only in front of units though, but it may be helpfull to you in some way.|||Quote:






View Post

Yeah, and look when he posted that, fool. Am I supposed to have read his mind prior to that post? You do understand English well enough to know what initially means, don't you?




Okay, okay, calm down. I just skimmed the new posts, I didn't examine every word of them with a microscope. |||Quote:






View Post

Okay, okay, calm down. I just skimmed the new posts, I didn't examine every word of them with a microscope.




Skim better then, or don't make snarky posts when you skim. :P|||Quote:






View Post

i know.

Why not just, Put the camera BEHIND the character, like 3rd person?

ofc this only works when u only have 1 character, no army




yeah thats my second option but i dont really like that because everything will get so complex ingame..|||Hi! It's about 3,5 years ago now, and I still don't know! :P

I just thought about it again, I still would be really glad if someone knows a good way to fix it.

I thought about placing a dummy right in front of the actual unit every 0,01 sec.

Then make the actual unit with occlussion (this is possible, isn't it? so that you can't see through units neither? Like trees?)

Then make sight range of the actual unit about 30 and make sight range of the dummy normal. Now the dummy does the looking for the actual unit, and because the dummy can't see through the actual unit, it will only show the area in front of the unit.

Here a drawing to make it more clear:



The dark blue circle is the actual unit. The light blue circle is the dummy. [not really relevant: the green circle is a tree :)]

As you can see, the actual unit will have a bit more sight than I initially wanted, but this is OK too :) Do you think this will work? And how should I do this withouth huge memory leaks etc?|||nevermind, i already know :)

No comments:

Post a Comment