0
\$\begingroup\$

I want to create one large tilemap, and want objects placed on it like multiple blades of grass and trees. I want the tufts of grass and tree objects to be placed based on specific placeholder tiles on the one tile map (to make pathfinding easier). Now, if I were to populate the entire map with these individual objects (especially, individual blades of grass), I feel like it would slow things down and be unsustainable. My thought is that I could review the tiles that are within the scope of the camera view, and add the objects temporarily, so that I'm not filling the entire map with blades of grass or trees, but only the current camera view.

To do this, I would find the camera positions, iterate through the tiles on the tilemap within the camera view, and apply the objects onto said tiles, and delete those objects anytime the camera changes. Is this a reasonable solution to what I want to do, or am I missing something that would make this whole process easier?

\$\endgroup\$
3
  • \$\begingroup\$ As I explain in this Meta post, just about any game development solution that makes enough sense to you to explain to a stranger is worth a try. It has at least the potential to work adequately. And more often than not, the determining factor of whether it meets your needs comes down to details of your implementation - not the high-level description. When you try this, do you encounter any specific hurdle that you need help overcoming, or observe any specific performance problems that we can help you solve? \$\endgroup\$
    – DMGregory
    Aug 1 at 20:31
  • \$\begingroup\$ Have you profiled your scene to determine that there is actually a performance problem? Are the built-in tilemap culling features not adequate for your game? \$\endgroup\$
    – Kevin
    Aug 1 at 23:32
  • \$\begingroup\$ @DMGregory This is wise. I will move forward and give it a try! \$\endgroup\$ Aug 2 at 9:53

0

You must log in to answer this question.

Browse other questions tagged .