ID:1030583
 
I am trying to think up a way to restrict the players view to only the /area he's in at the current time. When he exits that area, it becomes non-visible to him and the new area he enters now becomes visible.

I can't think of an elegant way to do this and I'll admit I hadn't picked up DM in quite a few months.
In response to NNAAAAHH
NNAAAAHH wrote:
http://www.byond.com/developer/Forum_account/ VisibilityGroups

Thanks for the suggestion.

Still would like to hear other possible solutions as I feel this might be too bandwidth intensive or perhaps memory intensive.
Set your view to a single tile 1x1...

Hide the rest of the view except the middle on the screen by covering it up...do whatever you want...but it shouldn't be hard....
In response to Superbike32
Superbike32 wrote:
Set your view to a single tile 1x1...

Hide the rest of the view except the middle on the screen by covering it up...do whatever you want...but it shouldn't be hard....

What?
Maybe your missing what I said but you want to hide all but where hes standing(the area hes in...but that can be done by adding black squares over everything else on the users hud, or just make the view size 1x1 so they only see where their standing...

I am not sure why such a view of basically one tile would be useful even... you could use darkness and make everywhere but he stands dark...

There are many ways to accomplish things like this if i'm understanding what you want to do correctly.
In response to Superbike32
Superbike32 wrote:
Maybe your missing what I said but you want to hide all but where hes standing(the area hes in...but that can be done by adding black squares over everything else on the users hud, or just make the view size 1x1 so they only see where their standing...

I am not sure why such a view of basically one tile would be useful even... you could use darkness and make everywhere but he stands dark...

There are many ways to accomplish things like this if i'm understanding what you want to do correctly.

I want only the /area the mob is in visible. Area's can be any size (not just 1x1) according to how you draw them on the map. I'm talking about the actual built in /area datum.

If you're still confused, I'll try and explain it this way. Imagine playing Zelda on SNES and being able to see "on the other side of walls" even though you weren't in the room that side of the wall contained. Its not a perfect example because Zelda just locked the camera, and that won't solve my problem (I want to completely black out /area datums that you're not currently inside).
Other than maybe pre-set points that change your view or using opacity, etc....there's no built in way to hide other /areas specifically...

You could loop through and add an image() and use override to hide it....you could use opacity so they don't see past walls....but realistically there would be no good way, there's no way to just black out or make invisible(likely I assume that user only its blacked out for even) every area except where their at.

image() is almost the only way to get different views for people in your scenario, I mean invisibility, darkness, infared, etc...I mean there's a lot of available stuff to you but there's no one good answer...

The thing is, you just have to try for yourself & see what works best, or what you like the most, because nobody knows more than you how you want it to work or what you'll live with even if you don't get it to work exactly how you planned.
In response to Superbike32
Superbike32 wrote:
Other than maybe pre-set points that change your view or using opacity, etc....there's no built in way to hide other /areas specifically...

You could loop through and add an image() and use override to hide it....you could use opacity so they don't see past walls....but realistically there would be no good way, there's no way to just black out or make invisible(likely I assume that user only its blacked out for even) every area except where their at.

image() is almost the only way to get different views for people in your scenario, I mean invisibility, darkness, infared, etc...I mean there's a lot of available stuff to you but there's no one good answer...

The thing is, you just have to try for yourself & see what works best, or what you like the most, because nobody knows more than you how you want it to work or what you'll live with even if you don't get it to work exactly how you planned.

Yeah, I sense I will have to compromise some sort of design limitations for level creation here in order to make this work...
In response to Superbike32
More explanation on the problem:



I should also mention that the "look and feel" is supposed to resemble more like "you can see everything on your current level" type of feel as opposed to the realistic sight range of roguelike type games. For example, Final fantasy 6 exploring. You walk around and you can see as far as your screen lets you, but you can't see rooms that are on the other side of doors.
In response to FIREking
Put opaque objs on the borders?
In response to Kaiochao
Kaiochao wrote:
Put opaque objs on the borders?

But then you'll actually lose sight within the level you're in / on. Read closer, I said the level's will take complex shapes and we don't want "sight occluded around corners" I only want sight occluded where I specify. The level should look like FF6 type (top down, can see everything except beyond doors). But I still need the ability to place a room right next to a door without the user being able to see that room. This will get more and more complex than I can explain in a single paragraph. Its to be future proof so that rooms and things can be added without being able to be seen in the future.
OK let me explain then, if their as you say, I might recommend overriding Move() so that it looks for things that shouldn't be visible, things in range that fall in another group, then image() that and override the old image so it disappears...now...image() links to actual objects, like traps so if traps move or whatever so does the image along with it, if its npc's, the image() is connected to the object, so it moves with it.

You want to link with image() to whatever objects you want to hide & use override so they can't see it...now for objects that move can cause a problem, so you need where-ever they move to be linked up as well to call an update for images on players in range so they wont end up seeing it unless it itself moves to another area...

This would be the best way to achieve the effect you want, because your not going to want to loop through everything for that room and hide it using image() but it becomes manageable when your dealing with view and Move() since it's not trying to take into account everything in the game...

If problems arise viewing something because it's not quick enough to hide it as you move, try making it a few tiles bigger than view that it looks for objects to hide...so you have some safety room...

But this should ultimately be quick enough & get the desired effect.
In response to Superbike32
Superbike32 wrote:
OK let me explain then, if their as you say, I might recommend overriding Move() so that it looks for things that shouldn't be visible, things in range that fall in another group, then image() that and override the old image so it disappears...now...image() links to actual objects, like traps so if traps move or whatever so does the image along with it, if its npc's, the image() is connected to the object, so it moves with it.

You want to link with image() to whatever objects you want to hide & use override so they can't see it...now for objects that move can cause a problem, so you need where-ever they move to be linked up as well to call an update for images on players in range so they wont end up seeing it unless it itself moves to another area...

This would be the best way to achieve the effect you want, because your not going to want to loop through everything for that room and hide it using image() but it becomes manageable when your dealing with view and Move() since it's not trying to take into account everything in the game...

If problems arise viewing something because it's not quick enough to hide it as you move, try making it a few tiles bigger than view that it looks for objects to hide...so you have some safety room...

But this should ultimately be quick enough & get the desired effect.

Not sure if that's very elegant but I'll give it some thought.
In response to Superbike32
I might have to just cave and use opacity, but here's more explanation:

Is there any way to specify an atom as not able to be hidden by opacity obstruction? If there is, I could just set every turf inside the area to whatever that is and then use opacity on the outer edges. That would allow me to put rooms at least 1 space away from each other.

Edit: Nevermind, that wouldn't work because then if a 2x2 room was next to another 2x2 room, the turfs in the opposing room would be set the same way and therefore would be able to be seen.
Hmm... This might sound strange, and this is a rather quick thought, but what about making it so areas get a darkness overlay that is removed when entered and re-added when exited? That way whenever you exit blue to enter green, you see green but blue goes black.

There is probably a few ways to do this, it's more so the general concept I am suggesting since it could work. Just not sure how elegant it would be. I haven't worked with areas in a while, either, so I am not 100% sure its possible; please forgive me if it's not lol.
In response to Toddab503
Toddab503 wrote:
Hmm... This might sound strange, and this is a rather quick thought, but what about making it so areas get a darkness overlay that is removed when entered and re-added when exited? That way whenever you exit blue to enter green, you see green but blue goes black.

There is probably a few ways to do this, it's more so the general concept I am suggesting since it could work. Just not sure how elegant it would be. I haven't worked with areas in a while, either, so I am not 100% sure its possible; please forgive me if it's not lol.

Would work in single player. Not multiplayer.
Not feasible with Images because there would be too many in the world.
In response to Toddab503
Simple answer is to just waste space (don't put rooms next to areas that can be seen. Lock camera whenever possible, and use little tricks to hide anything left over.

Long answer is yet to be supplied.
Still hoping for a solution on this, one that doesn't use images.
Page: 1 2