Token Lights Ignore Cached Walls: A Foundry VTT Bug

Alex Johnson
-
Token Lights Ignore Cached Walls: A Foundry VTT Bug

Are you experiencing issues with token-based lights not respecting your painstakingly created cached walls in Foundry Virtual Tabletop (VTT)? You're not alone! This is a known issue that many game masters (GMs) are encountering, and it can be frustrating when you're trying to create immersive and realistic lighting effects for your players. Let's dive into the details of this problem, explore potential causes, and discuss possible workarounds to get your lighting back on track.

Understanding the Problem: Cached Walls and Token Lights

In Foundry VTT, cached walls are a fantastic feature that allows you to optimize the performance of your scenes, especially those with complex wall configurations. When you cache walls for a light source, Foundry pre-calculates how the light interacts with those walls, significantly reducing the processing power needed to render the scene in real-time. This is particularly useful for lights that cover large areas or have intricate shadow patterns.

Token lights, on the other hand, are light sources that are directly attached to tokens. This means that the light emitted by the token moves with the token as it explores the map. Token lights are essential for creating dynamic and realistic lighting, especially in dark or dimly lit environments. They allow players to see what their characters see and add a layer of suspense and immersion to your game.

The problem arises when you try to combine these two features. Ideally, you should be able to create a token light, cache the walls for that light source, and enjoy the performance benefits of caching without sacrificing the dynamic nature of the token light. However, as many users have discovered, token-based lights often fail to respect cached walls. This means that the light may pass through walls, create incorrect shadows, or simply ignore the wall data altogether. The result is a visually jarring experience that can detract from the overall quality of your game.

Why Are Token Lights Ignoring Cached Walls?

The exact cause of this issue is not always clear, and it may be related to a combination of factors. Here are some potential explanations:

  1. Caching Incompatibility: The way Foundry VTT handles caching might not be fully compatible with the dynamic nature of token lights. Cached data is typically static, meaning it's designed to work with light sources that don't move. When a light source is attached to a token, its position is constantly changing, which may interfere with the cached wall data.
  2. Update Conflicts: Foundry VTT is a complex piece of software, and updates can sometimes introduce unexpected bugs or conflicts. It's possible that a recent update has inadvertently broken the interaction between token lights and cached walls. Checking the Foundry VTT forums and community channels can help you determine if this is a widespread issue related to a specific update.
  3. Module Interference: Foundry VTT's modularity is one of its greatest strengths, but it can also lead to conflicts between modules. If you're using any modules that affect lighting, walls, or token behavior, they may be interfering with the way token lights interact with cached walls. Try disabling modules one by one to see if any of them are causing the problem.
  4. Scene Complexity: In scenes with a very large number of walls, lights, or tokens, the caching mechanism may struggle to keep up, leading to inconsistencies. Simplifying your scene by reducing the number of elements may help resolve the issue.

Workarounds and Solutions

While a permanent fix for this issue may require a code update from the Foundry VTT developers, there are several workarounds you can try in the meantime:

1. Avoid Caching Walls for Token Lights

This might seem counterintuitive, but the simplest solution is often to avoid caching walls for token lights altogether. While you'll lose the performance benefits of caching, you'll ensure that the light interacts correctly with the walls in your scene. This is especially viable in smaller scenes with fewer walls where the performance impact is minimal. To do this, simply ensure the "Cache Walls" option is disabled in the light source configuration for your token light.

2. Use a Static Light Source with Token Attacher

Instead of using a token light directly, you can create a separate, static light source and then use a module like Token Attacher to attach the light to the token. This allows you to cache the walls for the static light source while still having it move with the token. This approach can provide a good balance between performance and accuracy.

Here’s how to do it:

  • Create a regular light source in your scene.
  • Configure the light source with your desired settings and cache the walls.
  • Install and enable the Token Attacher module.
  • Use Token Attacher to attach the light source to the token.

3. Adjust Light Source Settings

Experiment with different light source settings to see if you can improve the interaction with walls. For example, increasing the "Light Radius" or adjusting the "Angle" of the light may help it better detect and interact with walls. Additionally, ensure that the "Wall Transparency" setting is appropriate for your scene. Lowering the wall transparency can sometimes help light penetrate walls more accurately.

4. Simplify Wall Geometry

Complex wall configurations can sometimes cause issues with light rendering. Try simplifying the wall geometry in your scene by reducing the number of wall segments or using simpler shapes. This can improve performance and reduce the likelihood of light passing through walls incorrectly.

5. Optimize Scene Performance

General scene optimization can also help improve the interaction between token lights and cached walls. This includes:

  • Reducing the number of tokens in the scene.
  • Optimizing image sizes and formats.
  • Disabling unnecessary modules.
  • Closing any unused browser tabs or applications.

6. Update Foundry VTT and Modules

Make sure you're running the latest version of Foundry VTT and all your modules. Updates often include bug fixes and performance improvements that can resolve issues with lighting and wall interactions. Regularly check for updates and install them as soon as they become available.

7. Report the Issue

If you've tried all the workarounds and are still experiencing problems, consider reporting the issue to the Foundry VTT developers. The more information they have about the problem, the better they can address it in future updates. Be sure to include details about your system, the modules you're using, and the specific steps you're taking that lead to the issue.

Community Insights and Discussions

The Foundry VTT community is a valuable resource for troubleshooting issues and finding solutions. Many GMs have encountered the token light and cached wall problem, and they often share their experiences and workarounds in online forums and Discord channels. Take some time to search for relevant discussions and see if you can find any helpful tips or suggestions.

Conclusion

The issue of token-based lights not respecting cached walls in Foundry VTT can be frustrating, but it's not insurmountable. By understanding the potential causes of the problem and trying the workarounds discussed in this article, you can often find a solution that works for your game. Remember to stay up-to-date with Foundry VTT updates, optimize your scenes, and engage with the community for support and inspiration. With a little patience and effort, you can create stunning and immersive lighting effects that enhance your players' gaming experience.

For further reading on Foundry VTT lighting and performance optimization, you can check out the official Foundry VTT documentation: Foundry VTT Wiki. This website provides in-depth information on all aspects of the software, including lighting, walls, and performance settings. Good luck, and happy gaming!

You may also like