• Breaking News

    Deciding when to update my quadtree terrain Hey everyone, I'm designing a game which uses a quadtree system for creating and rendering terrain. There's nothing special about it - just create a single root tile covering the whole area, traverse the tree from the root and, using the camera position, split/merge cells to move the detail around where it's needed. I'm happy with how it works, but I'm trying to come up with a better way to decide when I actually need to traverse the tree. Right now I'm using brute force and doing it every single frame, which seems like overkill as the camera isn't moving very quick. It seems like a waste of CPU time to force updates that regularly. I also tried doing the same thing but on a background thread, but this wasn't ideal either as it just seemed to lock up and I was only seeing the terrain update every 10 seconds or so. Plus I find that threading with more complicated stuff like this is a great way to take something that I understand, and turn it into a mess of hidden problems! I guess I could put a timer on and update every ~second, possibly using a background thread to create a brand new terrain tree and swapping it out with the current one when it's ready (so I know for sure there aren't any conflicts with the terrain that I'm using and drawing), but that doesn't seem like a very intelligent way of doing it either. Does anyone out there know a better way to decide when I should re-traverse and update my quadtree terrain? Thanks for the help! https://ift.tt/eA8V8J

    Hey everyone, I'm designing a game which uses a quadtree system for creating and rendering terrain. There's nothing special about it - just create a single root tile covering the whole area, traverse the tree from the root and, using the camera position, split/merge cells to move the detail around where it's needed. I'm happy with how it works, but I'm trying to come up with a better way to decide when I actually need to traverse the tree. Right now I'm using brute force and doing it every single frame, which seems like overkill as the camera isn't moving very quick. It seems like a waste of CPU time to force updates that regularly. I also tried doing the same thing but on a background thread, but this wasn't ideal either as it just seemed to lock up and I was only seeing the terrain update every 10 seconds or so. Plus I find that threading with more complicated stuff like this is a great way to take something that I understand, and turn it into a mess of hidden problems! I guess I could put a timer on and update every ~second, possibly using a background thread to create a brand new terrain tree and swapping it out with the current one when it's ready (so I know for sure there aren't any conflicts with the terrain that I'm using and drawing), but that doesn't seem like a very intelligent way of doing it either. Does anyone out there know a better way to decide when I should re-traverse and update my quadtree terrain? Thanks for the help!

    from GameDev.net https://ift.tt/32nPXcy

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728