Results 1 to 2 of 2

Thread: Masking Fog of War/Line of Sight on a 2D Map

  1. #1

    Lightbulb Masking Fog of War/Line of Sight on a 2D Map

    Presently, the property of an object which blocks line of sight seems to be its collider (specifically, it seems that any collider which passes through the same y-coordinate as the origin of an object which is set to reveal fog will obscure that revealing object's vision).

    This is very intuitive for 3D maps, but it also means that there is no practical way to prevent players from seeing through walls etc. on a 2D map, as any barrier to vision must also be a barrier to the movement of tokens and minis. Putting invisible walls everywhere only works if the pieces can be fit through small gaps between them- and doesn't work at all for terrain that should obscure vision, but also be navigable (a thicket of trees, for example, can either be a thicket you can walk into OR a thicket you can't see through, but not both).

    Here are a few potential solutions:

    1. Allow object collision to be disabled

      Whether this takes the form of an "allow collision" checkbox in an object's properties (which would require that the object be locked first, so as not to fall out of the world) or a sister tool to the Joints tool that would allow one or more objects to phase through one or more other objects (a la Garry's Mod), there are plenty of additional uses for selectively ignoring object collisions beyond its implications on the fog of war system, as well as a fair amount of demand.

    2. Implement a dedicated "Fog Mask" subtool

      This could be something similar to the line tool, only it would presumably be put in the "Hidden Zones" section of the Tools menu; much like the lasso select tool in image editors, you could draw successive lines, each starting at the previous line's endpoint, and close the shape at the end to carve out an area within the fog zone to never be revealed—and which would act to block vision, as colliders do (but not to collide). This would likely be the most intuitive implementation for users to, uh, use (IDK I can't think of a better way to phrase that right now) but could also take the most work to implement.

    3. Separate vision occluders from physics colliders

      Using a separate collider to obstruct vision, and only vision, would not only allow for the enhanced fog behavior I'm looking for, but it would also allow for physics objects that do not affect vision, which could be very useful— this leaves it up to the individual whether they'd rather, for instance, allow vision up a hill or staircase, and also allows for easier decoration, without driving a need to check fog after every new object (although some object behavior settings already exist which are capable of opting an object out of vision calculations). The vision collider could be cloned from the physics collider by default, which would prevent this change from breaking any maps which already use the fog of war as it is currently implemented. Finally, these colliders' properties could be exposed via the API, allowing for some pretty cool scripting opportunities.

    It would be really great if any of these could be implemented with a one-way option, as well; not being able to see into a room, but being able to see out of it, would allow for some compelling tactical decisions (though I also understand that "sidedness" could be tricky to implement with these suggestions).

    Finally, thank you for making such a great program! You all deserve even more recognition for such a contribution. I wish you all a safe and happy 2019.
    Last edited by elegy; 01-04-2019 at 01:32 AM.

  2. #2
    I just came here to to make the exact same suggestion! however i have another potential solution (that may be easier/faster to implement)

    It could be possible to make the fog of war only give vision to a fog revealing object if it is inside the fog of war area itself, then you could overlay multiple fog of war areas to section off different rooms, naturally you would want this to be a toggle on the fog (default off), as a side effect of doing it this way is that it would allow for one way viewing, one of the few limitations of this is that it would be difficult to achieve the same effect for a map without rectangular rooms, a cave for example, i would personally rather a dedicated "Fog Mask" tool as you suggested as it would be the fasted and most user friendly option, but this solution might be something the devs can quickly throw in before implementing a more dynamic solution.

    in any case thanks for making this thread as it goes into much more detail then if i had, also i agree with your disposition of the devs, i keep getting surprised by how polished parts of the game are

Similar Threads

  1. Fog of War - line of sight paint obstcales
    By Albyricus in forum Suggestions
    Replies: 1
    Last Post: 11-13-2018, 07:11 AM
  2. Notebook - last line
    By Cerne13 in forum Bug Reports
    Replies: 0
    Last Post: 12-01-2017, 10:21 AM
  3. Add a Command Line.
    By Mark in forum Scripting Suggestions
    Replies: 0
    Last Post: 02-28-2017, 11:11 AM
  4. Metric line
    By Darkhog in forum Suggestions
    Replies: 1
    Last Post: 08-03-2016, 07:04 AM
  5. Line of Sight
    By Cyric in forum Suggestions
    Replies: 0
    Last Post: 05-27-2015, 05:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts