League-of-Foundry-Developers / torch

Simple torch module for Foundry VTT
10 stars 16 forks source link

Dragonbane - none of the lights work as intended #68

Open StormDarkwood opened 9 months ago

StormDarkwood commented 9 months ago

The torch is supposed to have a radius of 10 meters but the module shows a radius of 40 meters. The flashlight and the oil lamp have a radius of 10 meters, the module shows 6 meters radius. It also happens with the candle, it is supposed to have a radius of 4 meters and the module only shows 2 meters radius.

torch

discuit commented 9 months ago

Was just coming to mention this myself.

discuit commented 9 months ago

Additionally, should the default values for bright & dim light radius in the Torch settings override the item values? As currently, if I select torch, it uses the values in the settings, not a Dragonbane "value". Thanks!

lupestro commented 8 months ago

Some of the errors came in with a PR that I merged that divided all the radii by two. I suspect, in retrospect, that the submitter was tripped up by the 2m grid that Dragonbane uses and was specifying values in grids rather than meters. I'm a little hampered by not having any sources for information myself, since I don't play the game and haven't invested cash in it, and so having to accept, at least initially, information provided by people who do use the module. I figure, mostly through exchanges like this one, it will all sort itself out.

I can restore the original radii. The original had 4m/4m for Tallow Candle, 10m/10m for Torch, Oil Lamp, and Lantern. Are these correct? Confirm and I can have a correction in the next update.

I'm still seeing a single source of error around, specifically, the Torch. The large area for that makes no sense at all. I'll look into that as part of this issue. [@discuit is correct, btw. Until I get this sorted, either set the values in the config for torch to 10 and 10, or set the name in the config from "torch" to some nonsense like "toqqq" and you'll get expected behavior restored.]

In the course of testing, I did find another interesting situation. If the user starts with an actor that has no inventory, adds Torch, Oil Lamp, Lantern, etc. to the inventory, and then clicks the button on the HUD, what comes up at first isn't any of the items, but a hard-edged default of some kind, probably drawn from the configuration settings. That shouldn't happen. It should pick one of the items from their inventory. Workaround: If the user right clicks to get the list of sources and clicks the torch, then they get the expected item. I'll make this a separate issue and build a PR around it.

Thanks for all the good feedback. Together, we make this stuff better.

StormDarkwood commented 8 months ago

The original had 4m/4m for Tallow Candle, 10m/10m for Torch, Oil Lamp, and Lantern. Are these correct?

Tallow Candle 4 meter radius (2 meter bright and 2 meters dim light) . Torch, Oil Lamp and Lantern 10 meters radius (5 meters bright and 5 meters dim light) () is my opinion

Thanks for your time.

lupestro commented 8 months ago

Sure - If the RAW don't use bright/dim, we usually keep it all bright by specifying the overall radius for both. (Basically, you can see or you can't.) I'll get those out along with a fix for the bug where it picks up the radii from the wrong place and perhaps the "No Source Selected" bug at the same time.

As a workaround in the meantime, the following should be usable as an Additional Light Sources file to get your games back up where they should be:

{
    "dragonbane": {
        "system": "dragonbane",
        "topology": "standard",
        "quantity": "quantity",
        "sources": {
          "Lantern": {
            "name": "Lantern",
            "type": "equipment",
            "consumable": false,
            "light": [
              {
                "bright": 10,
                "dim": 10,
                "angle": 360,
                "alpha": 0.1,
                "color":"#f9f06b",
                "animation": {
                  "type": "torch",
                  "speed": 5,
                  "intensity": 5,
                  "reverse": false
                }
              }
            ]
          },
          "Oil Lamp": {
            "name": "Oil Lamp",
            "type": "equipment",
            "consumable": false,
            "light": [
              {
                "bright": 10,
                "dim": 10,
                "angle": 360,
                "alpha": 0.1,
                "color":"#f9f06b",
                "animation": {
                  "type": "torch",
                  "speed": 5,
                  "intensity": 5,
                  "reverse": false
                }
              }
            ]
          },
          "Torch": {
            "name": "Torch",
            "type": "equipment",
            "consumable": false,
            "light": [
              {
                "bright": 10,
                "dim": 10,
                "angle": 360,
                "alpha": 0.1,
                "color":"#f9f06b",
                "animation": {
                  "type": "torch",
                  "speed": 5,
                  "intensity": 5,
                  "reverse": false
                }
              }
            ]
          },
          "Tallow Candle": {
            "name": "Tallow Candle",
            "type": "equipment",
            "consumable": false,
            "light": [
              {
                "bright": 4,
                "dim": 4,
                "angle": 360,
                "alpha": 0.1,
                "color":"#f9f06b",
                "animation": {
                  "type": "torch",
                  "speed": 5,
                  "intensity": 3,
                  "reverse": false
                }
              }
            ]
          }
        }
    }    
}

(I didn't test that file live - I just dashed it out - but I did test the updated sources.json I clipped it from. Let me know if it gives you any problem.)

If you want to tune your additional sources from using 10/10 and 4/4 to using 5/10 and 2/4, feel free to suit to taste. Recall that, as in Foundry in general, the dim value is measured all the way from the center - it isn't only the additional distance beyond the bright.

lupestro commented 8 months ago

Interesting side-note - if you take the 20 ft/ 40 ft for DnD and many others, you get 6.66/13.33 yards. That's roughly a dim region of about 3 m either side of a roughly 10m radius, so that's another way of thinking about converting a 10m on/off radius to dim/bright regions - 7/13 or maybe 8/12, with the middle of the dim at the stated radius - you can see a little beyond it but not well. If you were going to cap at 10 as per RAW, you might then do 7/10. 5/10 could be too limiting. Anyway, food for thought.

wilcoxon commented 8 months ago

I was just coming to report the Dragonbane ranges are all half of what they should be but it looks like the update above (10/10 and 4/4) fix it. I look forward to the next release that will correct this...

lupestro commented 5 months ago

This afternoon, I finally shipped the adjustments I made back in November, fixing the Dragonbane stuff back the way it should be. The changes are in 2.11.1. The big change in this release was setting up github actions that should make releasing stuff less of an error-prone chore. With easier, cleaner releases, I'm far less likely to procrastinate on the endgame this dreadfully in the future.

Let me know if the new release solves the issue for you.