Closed MaxIsJoe closed 4 years ago
After a quick google search and some reading on reddit i found out two solutions
The first solution is Thoughquake where he recreates a visibility system that's almost identical to BYOND's out of the box system and he explains it well in this video https://youtu.be/vQ1UGbUlzH4?t=1273
The second solution is by @fahall which is a solution that looks a bit more modern and can fit with the new movement system that's not snapped to a grid, https://github.com/fahall/godot_2d_visibility
Both solutions come with their pros and cons and I'm unsure which I should go for, This will be postponed for a while until I get some feedback or find whats the more performance friendly.
As of commit 63d6263 the FOV system has been implemented, it uses Godot's light system after I understood how the thing works. There are some rough edges here and there but they can be fixed later.
From now on anyone works on maps will need to draw walls and floors on two different tilemaps and set the wall's light mask layer to 2 and disable 1.
Performance is a bit undesirable for low end hardware but hopefully in Godot 4.0 this will be improved, for now anyone with a toaster like me can just press F4 to disable this system completely until we found a solution.
The original TWC game had the standard way of handling visibility that was provided by the BYOND game engine, this method allowed the walls to be visible but what's behind them isn't visible.
Trying to recreate this using Light2D and LightOccluder2D is impossible as there is no way to easily create a light occluder polygon that doesn't hide the walls themselves and at the same time does not effect performance.
It's clear that Godot's built in solution isn't effective enough and I should probably look for alternative solutions or wait for the new improvements for the 2D renderer for Godot in 4.0 that's coming next year.