loftar wrote:Granger wrote:I think you just evaded my point about caves should be pitch-black.
Not sure how that changes anything, though?
Current rendering, green being the light radius and red being what could be hidden by LOS:
Light radius.jpg
Resulting render where all completely unlit objects could be culled server-side:
Culled.jpg
Granger wrote:Not sure about that, I feel like this could be done on a tile base and cached quite effectively - depending on how you have structured your data.
Feel free to enlighten me, but I don't really see what could be cached. When a player moves around, I don't really see how any information about the last visibility calculation could be reused for the next.
While you have a point that players move around I'm quite confident that they roam the same, unchanged areas most of time, making long-term caching feasible.
The result of LOS calculation, when done based on tiles for simplification, could be stored as a b/w bitmap centered around the point of origin (which is then used to cheeck if objects should be sent to/are accessible by the client) - should compress nicely to disk with a simple RLE for most scenarios and only need to be discarded when LOS relevant objects are modified (cave walls, walls, houses, trees if you want them to block sight). In case you look for a backend to handle such a database (that can easily be called into with C) take a look at
GT.M (GPLv3).
Sure, it would need additional resources (CPU for the calculations and the culling, Bandwidth because of the culling as more objects would need to be transfered, RAM and disk storage space -preferably SSD backed- for the caching), but it isn't out of the technical possibilities these days.
It would benefit from breaking up your (as you stated somehwere) currently single-threaded server into something that you can spread over multiple cores (and preferably multiple machines) while maintaining a single world (seemless handover at the server borders), so you could throw more hardware onto the world (that will distribute to where it's required) when needed - which hopefully will happen (both the 'need' as the 'could' part) at some point in time when the userbase grows some orders of magnitude.
You do not have the required permissions to view the files attached to this post.