2
\$\begingroup\$

I'm writing a grid-based 2D game in Unity3D that would ideally use grid sizes of around 200x200 or so, with multiple zoom levels, including all the way out. When I tried render a 200x200 grid at the most zoomed-out level where everything is visible, Unity crapped out saying that there were too many vertices to attempt to draw. This makes sense, as it's trying to render 40,000 sprites.

I was wondering, how do games like Dwarf Fortress and OpenTTD manage so many sprites at once on the screen when the map is zoomed out all the way? Are there any general strategies for handling the rendering of a large number of sprites such as this?

\$\endgroup\$
2
\$\begingroup\$

I don't know about OpenTTD, but I'm pretty certain Dwarf Fortress is strictly 2D and doesn't utilize the now common method of drawing sprites to quads.

Granted, the following solution is Unity Pro only, but I can't think of a good solution for the free version.

Essentially, as you zoomed out, you would break up the rendering of the map into chunks and render each chunk to a texture. Then take those textures and render them to the screen. Each chunk would wind up being a single quad, and so you'd be fine on the vertex issue.

| improve this answer | |
\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.