Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two-way VBL/terrain walls #2755

Closed
adyoungblood opened this issue Jun 19, 2021 · 75 comments
Closed

Add two-way VBL/terrain walls #2755

adyoungblood opened this issue Jun 19, 2021 · 75 comments
Assignees
Labels
documentation needed Missing, out-of-date or bad documentation feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)

Comments

@adyoungblood
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When setting up new maps with Fog of War enabled, I am always forced to choose between obscuring the art of the walls with accurate VBL, or creating VBL that approximates what should be there, while showing as much of the actual walls as possible. Also, I have to put an X across objects such as pillars or tall boxes, which gets the job done, but looks ugly.

Describe the solution you'd like
Terrain walls, straight out of Foundry.

Describe alternatives you've considered

  • Doing what I've always done (which works, sorta)
  • Allowing players to simply see the whole map
  • Manually removing the FoW from the walls I wish the players to see (time consuming)

Additional context
Let's say I have my test subject Agatha the hag standing in the Yawning Portal, looking towards the bar wall.
image
In the GM view, I can see the wooden wall that blocks her vision. However, in the player view, the wall is simply a fog-colored rectangle:
image
I would rather she (and by extension, my players) be able to see the nice wall art underneath.

Additionally, on a map such as this one
image
it's rather difficult to place VBL that is accurate to the map. but also reveals what's back there (specifically, the place where the outer wall merges with the inner wall).

@adyoungblood adyoungblood added the feature Adding functionality that adds value label Jun 19, 2021
@emmebi
Copy link
Collaborator

emmebi commented Jun 19, 2021

A few things which you can try here:

  1. use a VBL/MBL in the middle of the wall to block the movement and the line of sight
  2. put a VBL on the whole wall, and then reveal it using the Fog of War tool; this requires some effort, but provides some good results.

@adyoungblood
Copy link
Contributor Author

adyoungblood commented Jun 20, 2021

I've typically gone with the first method, although the second method does seem rather appealing now that you mention it. Nevertheless, I believe that terrain VBL (and perhaps more advanced VBL in general, although that's a separate topic) could be useful to most users.

@adyoungblood
Copy link
Contributor Author

Well, nevermind. According to Craig's message, the codebase is too tightly coupled with Swing to make this possible. Plus, no one wants to work on the Swing code anyway, least of all me! If anything, this just made me a firm supporter of the web-based client. Closing this issue now.

@rkathey
Copy link
Contributor

rkathey commented Jun 22, 2021

In my opinion, this should be reopened. Just because we're not doing it today doesn't mean we're not doing it. :)

@thelsing
Copy link
Collaborator

I think so too.

@cwisniew
Copy link
Member

I agree

@cwisniew cwisniew reopened this Jun 23, 2021
@kwvanderlinde
Copy link
Collaborator

I made a proof-of-concept for terrain VBL on this branch. The defining feature of this implementation is that vision can "enter" terrain VBL but can't "leave" it. It is by no means complete as it just treats all VBL as terrain VBL.

A few more things would need to be done to get this fully and properly implemented:

  • Storing terrain VBL separately from VBL.
  • A GUI method for drawing terrain VBL separately from VBL.
  • New macro functions for drawing terrain VBL like the ones for drawing regular VBL.
  • Implementing token terrain VBL, if that is desired.
  • Merging terrain VBL with VBL during pathfinding, for when AI is configured to pathfind around VBL.
  • ... ?

I also haven't spent any time optimizing the implementation, so performance isn't great in some situations. But it is plenty usable in simple cases.

@cwisniew
Copy link
Member

cwisniew commented Sep 14, 2021

I made a proof-of-concept for terrain VBL on this branch. The defining feature of this implementation is that vision can "enter" terrain VBL but can't "leave" it. It is by no means complete as it just treats all VBL as terrain VBL.

Welcome to the Hotel California...

A few more things would need to be done to get this fully and properly implemented:

  • Storing terrain VBL separately from VBL.
  • A GUI method for drawing terrain VBL separately from VBL.

This is where being able to select VBL and modify its attributes would come in handy as well, but that is probably more of a pipe dream for phase 2 or 3 of this. But if you are looking at storing these VBL types separately and need to make some changes to how its stored then its worth keeping this in mind.

  • New macro functions for drawing terrain VBL like the ones for drawing regular VBL.

Since the VBL macro functions accept their arguments as a "JSON" string it will be easy enough to add this as a parameter so new functions would not needed.

  • Implementing token terrain VBL, if that is desired.

I think that it would be desired as that would allow people to see more of the token doing the blocking. It would probably make sense for token VBL to be this new see into but not out of type by default too. Although I that can wait as its worth getting the rest in even without that as a first step.

  • Merging terrain VBL with VBL during pathfinding, for when AI is configured to pathfind around VBL.
  • ... ?

I also haven't spent any time optimizing the implementation, so performance isn't great in some situations. But it is plenty usable in simple cases.

What sorts of situations does performance suffer?

@kwvanderlinde
Copy link
Collaborator

Here is an example I simpified:
2755-simple-slowdown (copy).rpmap.zip

On 1.9.3, dragging and dropping the token anywhere is a snappy operation. But on my feature branch there is a noticable though small delay when dropping. I'm also now realizing the delay is there whether or not I have terrain VBL enabled, so this is probably just due to some poor handling of geometry on my part.

@kwvanderlinde
Copy link
Collaborator

I've udpated the toolbar with a toggle for terrain VBL vs regular VBL. The icons are reused from another toggle as creating new icons is beyond my skill set.

Terrain VBL is stored separately from regular VBL and has its own associated topology trees used for FoW calculations. Each island in the topology tree also stores a flag for whether it is terrain VBL or regular VBL, and FogUtil uses this flag to determine its behaviour. This way, if we somehow change it to a single topology tree for both kinds of VBL, FogUtil will continue to work with minimal changes to calculateVisibility()

I also spent some time on performance and found that I was using JTS quite suboptimally. That's been fixed, thankfully wasn't too hard. Next steps are updating the VBL functions, adding token terrain VBL, and updating pathfinding to account for terrain VBL.

Here's what it looks like right now. There's the new toggle button. When selected, terrain VBL can be drawn and erased:
image
Terrain VBL is cyan to distinguish it from the blue VBL:
image
Vision enters the terrain VBL but not the regular VBL. Note the white border is at the back of the terrain VBL but at the front the regular VBL:
vision-differences
Both types of VBL can overlap:
image
In this case, regular VBL effectively takes precedence since it always blocks vision:
overlapping-terrain-and-regular-vbl

@kwvanderlinde
Copy link
Collaborator

My first take on token terrain VBL is implemented. I decided to have tokens only have either regular VBL or terrain VBL. Or rather, that the token itself should either count or not count as terrain when it comes to VBL. New tokens will default to being terrain, while existing tokens (including existing imports) will not be counted as terrain. This is controlled by a checkbox in the VBL tab of the Edit Token dialog. If this is undesirable, I can separate regular VBL from terrain VBL at the cost of some more code duplication.

And for a showcase, here's a simple room with a pillar and a rock acting as terrain. Please mentally fill in something fancier.
token-terrain-vbl-showcase-simple

Macro functions for token and non-token terrain VBL are yet to come. If anyone wants to try it out, my feature branch is up-to-date with everything I've showcased so far.

@kwvanderlinde
Copy link
Collaborator

Support for terrain VBL has been added to macro functions now. And with that, I think it is complete in terms of functionality, though there are still some loose ends to take care of.

I've opened a draft PR for some better visibility into the changes and to accept some early feedback. There are a few specific questions I have at this point:

  1. Is there a better name than "terrain VBL"?
    • I like the term itself, especially for users familiar with Foundry's terrain walls, but it could potentially be mixed up with other things.
    • From a user perspective, it may be that it is mixed up with terrain modifiers as found on tokens. Especially if talking about terrain token VBL.
    • In the code, MBL is often called "terrain topology". Using "terrain VBL" may be a source of confusion and be a maintenance burden.
  2. Is there a better interface for drawing/erasing terrain VBL vs regular VBL?
    • Considering that terrain VBL is basically a third independent kind of topology, maybe it makes sense to incorporate it into the existing selector somehow? Might be a little unweildy as there would be five states (MBL only, MBL/VBL, MBL/terrain VBL, VBL, terrain VBL).
    • Perhaps we could go the other way and split the topology mode toggle into one selector for VBL (off/regular/terrain) and another one for MBL (off/on)?
  3. Any desire for tokens to carry both regular and terrain VBL at the same time?
    • Implication of supporting both would be that token could not be categorized as terrain tokens or a non-terrain token, but all tokens can have either kind of topology.
    • Personally I don't see a need for this, but I'm open to being disagreed with 😄
  4. (relates to question 3) Is it good to handle VBL transfers as described in feature (4)? I.e, the token must match the type of VBL being transferred to/from the map.

@kwvanderlinde
Copy link
Collaborator

I've managed to answer some of my own questions after actually trying to use the features for a while.

  1. Still an open question.
  2. Having a separate selector for terrain vs regular VBL is not very enjoyable. For now I've instead added to the existing VBL/MBL selector so it also now supports terrain VBL and combined MBL/terrain VBL.
  3. Yes. E.g., for a background token that represents an entire building, or floor of a building, it would be useful to have all kinds of topology. Relates to Allow tokens to carry MBL, like they can with VBL. #2730.
    • This could involve more serious GUI changes in addition to storage of multiple topologies on tokens.
  4. Basically answered by (3). If we treat terrain VBL and VBL and entirely distinct topologies, each will have its own option for transfers independent of the others.

@cwisniew
Copy link
Member

I've managed to answer some of my own questions after actually trying to use the features for a while.

  1. Still an open question.

I think it needs a better name as when I read "Terrain VBL" I am certainly not thinking about using it for nice walls/doors as newish user... But I am not sure what name "see into VBL" sounds even more terrible. One Way VBL? Single Direction VBL?

  1. Having a separate selector for terrain vs regular VBL is not very enjoyable. For now I've instead added to the existing VBL/MBL selector so it also now supports terrain VBL and combined MBL/terrain VBL.

It sounds like that is probably the best way of doing it as it sounds like it would be less painful to jump between the two

  1. Yes. E.g., for a background token that represents an entire building, or floor of a building, it would be useful to have all kinds of topology. Relates to Allow tokens to carry MBL, like they can with VBL. #2730.

    • This could involve more serious GUI changes in addition to storage of multiple topologies on tokens.
  2. Basically answered by (3). If we treat terrain VBL and VBL and entirely distinct topologies, each will have its own option for transfers independent of the others.

@kwvanderlinde
Copy link
Collaborator

I think it needs a better name as when I read "Terrain VBL" I am certainly not thinking about using it for nice walls/doors as newish user... But I am not sure what name "see into VBL" sounds even more terrible. One Way VBL? Single Direction VBL?

Not walls/doors, but perhaps pillars and other obstacles. Which is really what it is for. There are real downsides to using terrain VBL for walls (at least interior walls) as players can see down the entire length of any such wall. VBL generally remains the best tool for interior walls.

Here's my attempt at brainstorming some other names:

  • semi VBL
  • permissive VBL
  • posterior VBL
  • partial VBL
  • penetrating VBL
  • passive VBL
  • viewable VBL
  • transparent VBL
  • revealing VBL
  • perceivable VBL
  • examinable VBL

I'm kind of partial to something like "perceivable VBL", but not sure how to make that sound more natural.

@Azhrei
Copy link
Member

Azhrei commented Sep 21, 2021

I'm partial to "One Way VBL", as it's the most descriptive (although not really accurate, since if you're on the other side of it, you can see out — it's not really "one way" in that regard. (Unless you think driving the wrong way on a one way street is okay because you're only going "one way". 😉)

I'm also a little concerned about picking a name that implies how it should be used. For example, 1WVBL is no good for a large hill. As you point out, it's really for smaller objects, such as pillars, columns, or items in which the GM wants the players to see the great art work involved, but which should otherwise be considered solid.

I'm also wondering about tokens placed next to 1WVBL — can the artwork of the token pierce the solid VBL? If so, a player could see into a pillar and tell there's another token on the other side.

@kwvanderlinde
Copy link
Collaborator

I'm also wondering about tokens placed next to 1WVBL — can the artwork of the token pierce the solid VBL? If so, a player could see into a pillar and tell there's another token on the other side.

Yes it can:
image.
But I don't see this as really any different than piercing a thin VBL wall:
image

@Phergus Phergus added documentation needed Missing, out-of-date or bad documentation macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) labels Sep 30, 2021
@FullBleed
Copy link

I can't believe this feature is sneaking in under the radar... this has been desired for a very long time!

Perhaps we could go the other way and split the topology mode toggle into one selector for VBL (off/regular/terrain) and another one for MBL (off/on)?

I personally quite dislike the selector as it is now... and adding more toggle states to it makes me cringe. I actually like the above suggestion since MBL isn't vision related at all. It is its own thing and I think it should be treated as such.

I'm actually cool with Terrain VBL, but it's not entirely accurate (I just don't see characters and monsters as being "terrain".)

1-way/2-way VBL, brings up syntax debates. i.e. :

A one-way mirror, also called two-way mirror (or one-way glass, half-silvered mirror, and semi-transparent mirror), is a reciprocal mirror that appears reflective on one side and transparent at the other.

Reciprocal VBL seems too technical.

But I think "Hollow VBL" is decent. As in having the VBL toggle be : Off/Solid/Hollow.

@Phergus
Copy link
Contributor

Phergus commented Oct 3, 2021

Merged PR #2976 into feature branch feature-terrain-vbl.

Running from the branch and I don't see the new toggle button. Haven't investigated further.

@kwvanderlinde
Copy link
Collaborator

Merged PR #2976 into feature branch feature-terrain-vbl.

Running from the branch and I don't see the new toggle button. Haven't investigated further.

I've changed it to use the existing VBL/MBL toggle. So it's now a 5-state instead of 3-state button.
image

@kwvanderlinde
Copy link
Collaborator

An interesting possibility has been brought up in Discord. Right now, vision can "enter" TVBL but can never "exit" TVBL. The suggestion is to change TVBL so that:

  1. if the token is outside of TVBL, vision can "enter" TVBL but not "exit" it.
  2. if the token is inside TVBL, vision can "exit" TVBL.

Or, to put it another way, vision would be able to cross a TVBL boundary once but not two or more times.

So the question is: should we modify TVBL to behave this way, or should we keep it as-is? I'm partial to changing it, but both behaviours are desirable for different reasons.

@cwisniew
Copy link
Member

cwisniew commented Nov 2, 2021

As you said both are desirable, standing on top of a house vs standing in large pit, one you expect to be able to see beyond the VBL, the other you don't expect to be able to see beyond the VBL. Barring adding elevation into the mix, what is required is an "inside out terrain VBL" -- yes I am completely aware that name sucks. @kwvanderlinde how easy is it to add a "see out" attribute to the current terrain VBL so that it can act either way?

@kwvanderlinde
Copy link
Collaborator

As you said both are desirable, standing on top of a house vs standing in large pit, one you expect to be able to see beyond the VBL, the other you don't expect to be able to see beyond the VBL. Barring adding elevation into the mix, what is required is an "inside out terrain VBL" -- yes I am completely aware that name sucks. @kwvanderlinde how easy is it to add a "see out" attribute to the current terrain VBL so that it can act either way?

Well, it's relatively easy to add yet one more topology mode. It would basically be duplicating most of the internal changes already made for TVBL and adding yet another toggle to the UI. The algorithm in FogUtil would need only a slight adjustment to work with either kind.

The problem adding attributes to topology is that topology is that it's flat, i.e., it doesn't come in discrete, well-defined and easily manipulated chunks. Instead each point on the map is either covered by a given topology or it isn't. So as far as I can see it's not really feasible to simply tag a piece of topology as behaving one way or another. That would require some higher level of control.

@cwisniew
Copy link
Member

cwisniew commented Nov 2, 2021

As you said both are desirable, standing on top of a house vs standing in large pit, one you expect to be able to see beyond the VBL, the other you don't expect to be able to see beyond the VBL. Barring adding elevation into the mix, what is required is an "inside out terrain VBL" -- yes I am completely aware that name sucks. @kwvanderlinde how easy is it to add a "see out" attribute to the current terrain VBL so that it can act either way?

Well, it's relatively easy to add yet one more topology mode. It would basically be duplicating most of the internal changes already made for TVBL and adding yet another toggle to the UI. The algorithm in FogUtil would need only a slight adjustment to work with either kind.

If its relatively simple then this might be the best solution as I am sure no matter which option you chose it wont take someone very long to ask how they get it to do the other one :) For the buttons we could have something like the following for the 3 types of VBL

_   _
 \_/            See into but not out of (e.g. pit) hmm does this mean that this type of terrain VBL
                should allow seeing through both sides if you are outside of it (probably)
  _ 
_/ \_           See out of but not past (e.g. top of hill)

 _ _ 
|   |           Blocks vision completely (you cant tell but this is actually an expertly rendered
|_ _| 			wall masquerading as simple ASCII art).

This way the icons represent things people would be familiar with and hopefully then "what is terrain VBL" would need less explaining. I am sure someone on discord will be able to produce something that looks way nicer than my ASCII art :)

The problem adding attributes to topology is that topology is that it's flat, i.e., it doesn't come in discrete, well-defined and easily manipulated chunks. Instead each point on the map is either covered by a given topology or it isn't. So as far as I can see it's not really feasible to simply tag a piece of topology as behaving one way or another. That would require some higher level of control.

Yeah this sounds a lot more complicated, something that is desirable in the future but out of reach in the short term.

@melek
Copy link
Collaborator

melek commented Nov 2, 2021

I was wondering if selecting a Terrain VBL shape and changing the "mode" of that shape would work. You could use a pattern to differentiate it.

I meant to mock up how it might look but got busy. The downside is you need a selection capability and you wouldn't be able to overlap the types. Maybe that's a good thing though if you don't want to define overlapping terrain vbl and "inside out" vbl.

Am I understanding that "inside out" is like looking over a pit, you can see in and over it when outside the shape, but if you are in it you can't see outside?

@kwvanderlinde
Copy link
Collaborator

@cwisniew I like your breakdown of the options. I also wouldn't mind using the terms pit and hill as it gives a concrete idea of how to use them. And I would say that seeing across a pit, not just into it, makes sense. Also, using the term "wall" for regular VBL might disuade using these new VBL options for things like walls where they aren't generally useful.

For comparison, the current implementation is like pit-combined-with-hill in the most restrictive way. I.e., it's like a pit in that one can see into it but not out of it, but it's also like a hill in that you into it but not across it. And (assuming my brain isn't failing due to lack of coffee), a nice property of your breakdown is that the current behaviour could still be achieved by overlapping pit VBL and hill VBL.

In terms of implementation, it's almost trivial to modify the current TVBL into "hill VBL". "Pit VBL" would be easily added as an analogue - I think it's case work is actually simpler yet than with hill VBL.

@wolph42
Copy link

wolph42 commented Nov 2, 2021

I like where this is going and also the terminology. However I think that he current TVBL is NOT 'hill VBL'. TVBL is something you can look into but not beyond. 'Hill VBL' is something you can stand inside off and look out of. Now they do sound similar but im not entirely sure they are, so it would be good to do some mental exercises.

That said, here's a wrench to throw into the system: there's also the use case of the cliff (similar to hill but just a bit different) which basically employs one way VBL, that is (assuming higher ground is left, lower right) you can look from left to right, but you can't look beyond the VBL from right to left. Other application would be one way mirror.
Now if you make a circle of that OWVBL you have a different type of 'hill vbl', where you can see from the top, but you can't see whats on the top. Dito with the pit, but the direction the other way round.

To put it differently OWVBL achieves the same as the 'advanced' TVBL, but is only 1 VBL type and it has more use cases (e.g. with cliffs and one way mirror).

Main reason for making this point is that (assuming that TVBL could be used for hill/pit) adjusting the current TVBL might be an easy win as the implementation is fairly simple, in the long run we would be shooting ourselves in the foot as there's a better alternative...but then we either have incompatibility issues or yaVBLt.

O and before I forget: TVBL should be area only (so no 'hollow shapes') and OWVBL should be lines only (so no 'filled shapes')

@Phergus
Copy link
Contributor

Phergus commented Nov 2, 2021

Completing the truth table of VBLs based on the three identified characteristics:

See Into - the map and any normally visible objects or tokens inside of the VBL polygon can be seen.
See Out - a token (with vision) inside of the VBL can see within and out of the area normally.
See Over - does not block vision passing through to other side.

Type See Into See Out See Over Comment
Wall N N N The current VBL.
V2 N N Y This is Deep Pit.
V3 N Y N Sort of a 1-way mirror.
V4 N Y Y Some sort of darkness field?
Terrain Y N N Current Terrain VBL and perfect for denoting solid objects on the map that block vision.
Pit Y N Y More a low spot but Pit works as a designation.
Hill Y Y N TVBL plus See Out
V8 Y Y Y No. Just no.

How many VBL types do we really want?

The current Terrain VBL has a definite and common use case that is currently covered by a combination of Token VBL with Visible Over FoW and is not the same as the Hill type.

@wolph42
Copy link

wolph42 commented Nov 2, 2021

Ill have to disagree with that. OWVBL is not covered by any of those types. V3 somewhat emulates it but its definitively something different.

But thats beside the point. You are right in asking how many is enough.

If we look at our biggest competitor (FVTT) they have everything that MT currently has + OWVBL. (So VBL, MBL, TVBL and OWVBL) they structured it completely different but thats what it boils down to.

So in that regard I'm inclined to say: those 3 types (MBL is not a vision type).

else have a look at this: https://www.encounterlibrary.com/guides/adding-walls-doors-and-windows-foundry-vtt/

@Phergus
Copy link
Contributor

Phergus commented Nov 2, 2021

Ill have to disagree with that. OWVBL is not covered by any of those types. V3 somewhat emulates it but its definitively something different.

Disagree with what? I didn't say anything about your notion of OWVBL because it's not likely to happen with the current VBL system. VBL has no way to denote blocking direction. Read Kenneth's comments from above:

The problem adding attributes to topology is that topology is that it's flat, i.e., it doesn't come in discrete, well-defined and easily manipulated chunks. Instead each point on the map is either covered by a given topology or it isn't. So as far as I can see it's not really feasible to simply tag a piece of topology as behaving one way or another. That would require some higher level of control.

@wolph42
Copy link

wolph42 commented Nov 2, 2021

Disagree with what?

I disagreed with that your table covers all VBL situations. But you never claimed that to begin with so.... moot point.

The problem adding attributes to topology is that topology is that it's flat, i.e., it doesn't come in discrete, well-defined and easily manipulated chunks. Instead each point on the map is either covered by a given topology or it isn't. So as far as I can see it's not really feasible to simply tag a piece of topology as behaving one way or another. That would require some higher level of control.

I have to say that I read that part before but simply didn't understand it and did not make the connection to this specific part of the conversation.

So if I understand correctly, adding the "see out" and "see over" VBL is relatively simple. Adding actual OWVBL is not. Hence for the short term we could decide to add those 2 variants but stay away from OWVBL.

Does that sum it up correctly?

And then the next question would be: do we want all those options?

@Phergus
Copy link
Contributor

Phergus commented Nov 2, 2021

So if I understand correctly, adding the "see out" and "see over" VBL is relatively simple. Adding actual OWVBL is not.

I don't want to put words in Kenneth's mouth but from my understanding of how VBL is implemented and from what he said I believe those are a true statements.

Hence for the short term we could decide to add those 2 variants but stay away from OWVBL.

Yes but...

And then the next question would be: do we want all those options?

That's the important question. My opinion is that we definitely don't want all of those types of VBL but is 3 or maybe 4 enough? Say we go with 3 while replacing Terrain with Hill:

Type See Into See Out See Over Comment
Wall N N N The current VBL and mandatory.
Pit Y N Y More a low spot but Pit works as a designation.
Hill Y Y N TVBL plus See Out

Hill is mostly a substitute for Terrain but if it was used on a big rock or tree a token could be moved/dropped into the Hill VBL area and see out in all directions whereas the intent would have been to have the rock/tree image be visible but blocking LOS. Something within it should be blind which we don't want for a Hill.

Pit VBL only kinda sorta works for pits. You can't see the bottom of a pit nor what's in the pit unless you are standing right at the edge looking down. It does pretty good for shallow depressions however. Visually the V2 (Deep Pit) would be cooler as the FoW for it wouldn't be cleared until a token was actually in the area or manually cleared by the GM.

But this brings up a bit of an issue with the 2nd characteristic of See Out. There is the unstated assumption that it means See Within as well but those could be separate. You need See Out and See Within for Hill but for a pit you really only want See Within and See Over only. The last thing we need is to double the number of possible VBL types and make it even more complex for users.

It all sounds so simple until you start looking at all the cases.

@FullBleed
Copy link

I think we should go with Terrain, Pit, Hill for now. Give users a chance to use it and our intrepid macro writers an opportunity to see what corner cases they might be able to address with the new capabilities should the needs arise. If Melek can make lib:elevation do what it does we just can't underestimate what the possibilities may be once this is in the wild.

On a tangent...

Since I do not fully understand the underlying structure, it's hard to address this next point... but as I understand it, VB is really just a (potentially) complex shape. And once you connect two pieces, it becomes one shape which complicates all the options above immensely. Thus it seems to me that if the full boundaries (as it were) are going to be pushed, we need better segmentation so various planes of any shape can perform differently than other planes (maybe even be able to add vision and/or property related interactions to individual planes instead of relying on the shape to determine a universal behaviour.) So the question I'm wondering is whether there just needs to be a second, more segmented type of VBL available eventually if we really want to get further into the rabbit hole than this?

@kwvanderlinde
Copy link
Collaborator

So if I understand correctly, adding the "see out" and "see over" VBL is relatively simple. Adding actual OWVBL is not.

I don't want to put words in Kenneth's mouth but from my understanding of how VBL is implemented and from what he said I believe those are a true statements.

This is accurate. It's a bit of case work, but wouldn't require revamping the VBL system. True OWVBL, on the other hand, would be quite different.

And then the next question would be: do we want all those options?

That's the important question. My opinion is that we definitely don't want all of those types of VBL but is 3 or maybe 4 enough? Say we go with 3 while replacing Terrain with Hill:

The only thing to add to this is that Pit overlaid with Hill gives the current TVBL behaviour (i.e., See Into, but not See Out or See Over). So we get a fourth possibility for free. Which is also why I'm in favour of aiming for those two in particular.

But this brings up a bit of an issue with the 2nd characteristic of See Out. There is the unstated assumption that it means See Within as well but those could be separate. You need See Out and See Within for Hill but for a pit you really only want See Within and See Over only. The last thing we need is to double the number of possible VBL types and make it even more complex for users.

Assuming by "pit" you mean what you called a "Deep Pit", yes that is accurate (note that See Into also implies See Within, so a regular Pit is symmetric with Hill). But if we go through the your full truth table it's not hard to convince ourselves that it only makes sense to toggle See Within in less than half the cases. E.g., Wall with See Within can already be done with hollow VBL, and Wall without See Within can already be done with filled VBL. Also, any case with See Into or See Out would just be weird if we allowed turning off See Within.

@FullBleed
Copy link

The only thing to add to this is that Pit overlaid with Hill gives the current TVBL behaviour (i.e., See Into, but not See Out or See Over). So we get a fourth possibility for free. Which is also why I'm in favour of aiming for those two in particular.

This is interesting... overlaying types to get different results... this seems like it could be... "interesting."

But it begs the question managing different, overlapping VBL. It's sounding more and more like we might need a VBL Explorer (similar to the Draw Explorer.)

@wolph42
Copy link

wolph42 commented Nov 2, 2021

The only thing to add to this is that Pit overlaid with Hill gives the current TVBL behaviour (i.e., See Into, but not See Out or See Over). So we get a fourth possibility for free. Which is also why I'm in favour of aiming for those two in particular.

ok makes sense. and do you also agree that we then should remove the 'line/hollow' vbl from the TVBL? As they have not function and are only confusing leading to people using it wrong and not understanding why it does not work...

This is interesting... overlaying types to get different results... this seems like it could be... "interesting."

I don't think thats what he meant. there will be two types in the end hill and pit each with their own 'quirks'.

@Phergus
Copy link
Contributor

Phergus commented Nov 2, 2021

@kwvanderlinde agree with everything you said. I mostly brought up the See Within issue for completeness because someone else would have if I didn't. :)

The one case that seems to be in demand still would be VBL with See Out only for those cases where tokens with vision are behind the one-way mirror observing the interrogation room. Or to put it in fantasy terms, archers hiding behind an illusionary wall that only they can see through.

@wolph42
Copy link

wolph42 commented Nov 2, 2021

The one case that seems to be in demand still would be VBL with See Out only for those cases where tokens with vision are behind the one-way mirror observing the interrogation room. Or to put it in fantasy terms, archers hiding behind an illusionary wall that only they can see through.

or a cliff!

@melek
Copy link
Collaborator

melek commented Nov 2, 2021

I think I was one of the people that suggested how terrain vbl's combination of behaviors could simulate different kinds of terrain. I've created a use case scenario in pictures, my example has 4 use cases for terrain:

  • columns (non-mountable terrain)
  • pits (doesn't block vision unless you are in the shape, then it acts as vbl at the boundaries)
  • hills (doesn't block vbl if your vision originates in 'Hill' terrain VBL - a wrinkle is whether or not being in one 'Hill' vbl shape will also let a token ignore other 'Hill' shapes? Both have merits)
  • perches/bushes/cliffs (behaves like normal vbl, but can see outside if vision originates inside that shape - this one is problematic, since for bushes you want other terrain vbl to block vision, for perches/cliffs you would want to see over some like "hills" - I'd start with bushes, since though these features can simulate elevation effects I think a planar use case fits how maps are most often made)

Here is my scenario in images

1.11.0a3 setup with current TerrainVBL:

Rogue's view:

Allied view:

Enemy views:


To implement the UI, I think selecting contiguous shapes and having a drop down in the toolbar to select their behavior would work.

Then a pattern or special stroke on the shape perimeter that is different opacity could differentiate it, and selecting out would reveal the type in the toolbar selector.

When nothing is selected, the toolbar selector could set which kind of terrain behavior you are drawing, and if you join shapes the currently selected terrain type of assigned to the new shape.

If stroke decorations are possible, I think paper-map like conventions could work:

  • triangles pointing out for hills,
  • triangles pointing in for pits,
  • arrows / Vs out for one way vision outward
  • no decoration for one vision way inward (current/ default behavior)

Whatever is done, I wouldn't expect any of this until a user interface is created where it can be differentiated without a bunch of additional colors, likely in 1.12+.

I'll note the potential is huge if you could set elevation like priorities on shapes and overlap them to create topographic style maps with terrain vbl - but that is a tantalizing idea, not a serious suggestion (yet).

@Phergus
Copy link
Contributor

Phergus commented Nov 9, 2021

With new changes the current code has issues opening up older campaign files (pre terrain VBL) presenting a "Could not load campaign" error message even though the maps are loading. Switching maps brings up:

java.lang.NullPointerException: Cannot invoke "Object.toString()" because "this.topologyTypes" is null
	at net.rptools.maptool.model.Zone$TopologyMode.toString(Zone.java:206)
	at net.rptools.maptool.client.AppPreferences.setTopologyDrawingMode(AppPreferences.java:1318)
	at net.rptools.maptool.client.swing.TopologyModeSelectionPanel.setMode(TopologyModeSelectionPanel.java:111)
	at net.rptools.maptool.client.ui.MapToolFrame.setCurrentZoneRenderer(MapToolFrame.java:1582)
	at net.rptools.maptool.client.ui.ZoneSelectionPopup$ZoneItem.actionPerformed(ZoneSelectionPopup.java:127)

Example campaign from 7/4/21:
20x20 Cave Test.cmpgn.zip

@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented Nov 9, 2021

Yep, I forgot to test that after refactoring. Should be simple to fix, I'll put up a PR today.

The problem is that I've used the same field name for something that is structurally different.

@Phergus
Copy link
Contributor

Phergus commented Nov 30, 2021

No additional issues reported during alpha testing. Closing.

@Phergus Phergus closed this as completed Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation needed Missing, out-of-date or bad documentation feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)
Projects
None yet
Development

No branches or pull requests