Search Unity

Voxel RTS Performance Concerns

Discussion in 'Scripting' started by Deleted User, Apr 24, 2013.

  1. Deleted User

    Deleted User

    Guest

    Good evening,

    Consider you're making a cube based minecraft-esque world. However, you want to use a 3rd person camera and have multiple NPCs to move around (standard RTS stuff).

    I have been reading these past few days on strategies for making sure performance is up to snuff with procedurally created voxel cube terrain, but all these articles thus far have been assuming a first person camera (only load faces you can see, load chunks you're moving towards and unload chunks youre moving away from etc). It seems like as soon as you pull the camera back and take an overhead perspective that all goes out the window.

    Has anybody given a thought to this, and if so, can you point me at any techniques I should be researching?

    I do see some voxel rts games either in alpha or WIP (timber and stone for example). In the case of T&S he is showing the entire terrain at once... Granted the terrain is not huge, but it is still sizable. That said, performance doesnt seem to be an issue there, so I was hoping folks would have some insight to share.

    Thanks for any help you might provide and I will keep searching too,

    Have a good one.
     
  2. Rasmus Linden

    Rasmus Linden

    Joined:
    Jan 26, 2013
    Posts:
    10
    But are you sure that 'all goes out the window'? I can't really see why it should... Why do you think it shouldn't apply to an overhead perspective?
     
  3. Deleted User

    Deleted User

    Guest

    I could be thinking about it wrong, and I hope you'll point it out if I am.

    When we move the camera from a single characters eyes and pull it into the sky into a more traditional RTS overhead view, the amount of chunks I can see has to raise dramatically, right? Because not only can I see whatever my selected NPC is seeing, I can see the areas behind him, the areas two screens over where my guys are building a house etc etc. I dont have the luxury of not drawing all the chunks that the current map can see because when looking down from overhead, I can see all of it.

    So you could still say well, only draw the chunks visible in the viewport and then as you start scrolling in any direction, handle that the same way you would as with a FPS character moving in that direction.

    But what about my scenario above? Say guy #1 is in the lower right corner cutting some wood. Guy #2 is in the lower left corner mining some ore. I need to be able to see both guys (even if both aren't active in the view port at once) to populate the minimap and potentially for some AI reasons and such.

    Lastly, you might say well just draw the required chunks for guy #1 and guy #2... and thats just a performance hit you're going to have to take. But it seems even worse, that I would need to draw all chunks for areas my guys have explored, as well as chunks between guy 1 and guy 2 (or else id just see black squares i guess?).

    Does that make sense?

    I would appreciate any guidance or insight others have on this, maybe I'm overthinking it.

    Thanks.