After a long struggle with getting this system up and running without butchering the performance, I’ve managed to implement a fog of war system inside of a minimap system.
The test above was conducted with 150 different FOW-generating units. The minimap also teleports you when you click on it to a place in workspace that corresponds to the place in the minimap.
The visuals look crude because those systems are only meant to prove that this technology works and will obviously be improved as time goes on and my project nears completion.
Awesome stuff. Really looking forward to seeing how it progresses.
Out of interest, what kind of entity counts can the system sustain without dramatically reducing performance? Obviously 150 entities is a lot of units already, and especially when you consider the wider context of the game’s design, you might never want to go any higher. But I’m definitely curious about how far you can push the limits with what you’ve got at the moment.
Thank you a lot for your warm words. It took me 2 days to figure this out. I plan on changing the minimap, however it’s mostly visual changes.
Thank you for your interest. So my first version of this used a crude approach. I basically swapped the descendants of the workspace every second. That was obviously performance-heavy because it included thousands of parts - every single second. Then I had a brilliant idea on how to optimize it. The minimap automatically detects changes in the workspace and relays that information to the ‘fake workspace’ in the minimap. Then it applies those changes to affected parts. So instead of swapping thousands of parts, it only swaps a few dozen on average.
Let me first thank you for your interest in this.
It doesn’t as much depend on the amount of units that reveal the fog of war but more of how quickly the fog of war is revealed by said units. For instance you could have 1000 units, but if they are all in the same place and never reveal any more tiles, or only reveal them at a slow pace, then the performance won’t be affected. At least the minimap won’t affect the performance per se. Although I think that if there are 300+ units that move around the map very quickly, then the stutters will become major. This is because there are small stutters with 150+ units moving like in the video. Those stutters aren’t major and they are incredibly short, but they appear.