using Unity I have an open world (infinite) which is proceduraly generated in chunks. In this world I want to proceduraly load objects/trees/grass by raycasting them around the player position and unload them when the player is far.

My questions are :

  • What is the most optimized way of loading/unloading large quantities of objects around a player ?

  • Since I'd like players to be able to interact/come back to objects, I'm thinking of using a blue noise seed to load objects, and unloading them by replacing them with an empty. Is that common practice ?

I've looked in a lot of places for ressources but couldn't find much, I'd really appreciate any kind of link to tutorials, videos, pseudo-code ideas and common practices for open worlds as I am not very experienced in video game design, but mildly familiar with code.

Thanks !

  • 3
    \$\begingroup\$ "What is the most optimized way to do X" questions almost never yield good answers. There simply is not a book of optimal solutions we can go look up into. All we can do is think of some solution, but who knows if it's the most optimized possible. And also: who cares? What matters is "is it optimized enough for this game's needs?" The same goes for "is this common practice?" - it doesn't matter if you're the only person in history who's ever done it this way. If it works for you, it works. So please, don't wait for the blessing of "optimal" or "common" - as the slogan goes, just do it. \$\endgroup\$ – DMGregory Apr 30 '20 at 3:57
  • 3
    \$\begingroup\$ Literally any way you can think of is worth a try for your first stab at a problem. So, go do it with blue noise if that sounds good to you. If it works, great! If it doesn't work, share your attempt at a solution, and explain to us where it goes wrong - where you got stuck, where the output differs from what you want, where the performance falls short of your goals. Then you can focus answers on solving that specific issue. I elaborate more on why you should prioritize trying your idea over asking for validation first over on Meta. \$\endgroup\$ – DMGregory Apr 30 '20 at 4:04
  • \$\begingroup\$ thanks :) this is great advice \$\endgroup\$ – Asymetr Apr 30 '20 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.