0
\$\begingroup\$

I want to start a new 2D top-down project in Unity and want to figure out how to organize my background (one big file or a lot of files joined together).

So how big can a background file get in Unity?

The target platform is Windows.

\$\endgroup\$
  • 2
    \$\begingroup\$ What is your background? A static image that you want to display? (Sky, background landscape, etc). Your world? (No interaction, build from multiple elements)? Some level to navigate through? For most the answer should be Tiles, for the rest it is usually enough to have to as big as a single screen. \$\endgroup\$ – Zibelas May 18 '20 at 11:10
  • 1
    \$\begingroup\$ It should be my world (navigate through but no interaction except the walls). \$\endgroup\$ – Gener4tor May 18 '20 at 11:20
  • \$\begingroup\$ This looks like a question you can answer for yourself trivially by making larger and larger files until Unity refuses to import their full resolution. What do you need from us that you can't figure out yourself? \$\endgroup\$ – DMGregory May 19 '20 at 10:00
  • \$\begingroup\$ @DMGregory: This is only true if the max file size is not dependent on other variables (like the target platform, my own computer, some property of the game project and so on) \$\endgroup\$ – Gener4tor May 19 '20 at 11:00
  • \$\begingroup\$ Which is information you didn't give us in your question. We won't be able to tell you anything about how Unity behaves on your target platform if you don't tell us your target platform. \$\endgroup\$ – DMGregory May 19 '20 at 11:32
1
\$\begingroup\$

Since it is for your actual world, you want to go by tiles. That means you have a sprite sheet and build your world of multiple of small pieces by it.

There are a lot of tutorial on how to build them out there, the documentation has a few examples as well (https://docs.unity3d.com/Manual/class-Tilemap.html) and for prototyping you can find a lot of free assets out there as well.

Usually a tile is 16x16, 32x32 or 64x64px per tile, bigger would be highly unusual and impractical.

A tile map sheet (multiple of your tiles), are packed together in one file and they can get as big as needed, though normally you don't want to have tiles in it that you dont actually use in your level.

In case you want to create a realistic street network as from your screen shot link, check out this good answer How to generate a city street network?

Since your city is static, you will get the best result if you handcraft it with segments. Compared to using one big image for all streets, it will make it easier to fit your buildings in or if you want to change later part of the streets. You can still use tiles for most of the straight and curves (which will speed up your building process a lot). For more complex curves you might want to take a look at splines.

\$\endgroup\$
  • \$\begingroup\$ If I understand this correctly: if I do it this way everything has to fit into a squared grid? This is not what I want. \$\endgroup\$ – Gener4tor May 18 '20 at 12:26
  • \$\begingroup\$ well, yes and no. A tile itself is squared, but it does not need to be completely filled and can have therefore any shape. Do you have an example for one scene if you have something else in mind how your scene should look like? \$\endgroup\$ – Zibelas May 18 '20 at 12:40
  • \$\begingroup\$ Think of some black and white street map like this: clipart-library.com/clipart/681933.htm (without the street names and stuff). \$\endgroup\$ – Gener4tor May 18 '20 at 14:00
  • \$\begingroup\$ If you need to generate streets like that, you may want to take a look at Voronoi diagrams. They produce patterns that look like the street you have in mind. \$\endgroup\$ – Zibelas May 18 '20 at 14:33
  • \$\begingroup\$ @Gener4tor I would not import these from image files but rather generate the graphics from individual street objects (or building objects, depending on what makes more sense in the context of the game). That way you already got the gameplay-relevant data structures for them. \$\endgroup\$ – Philipp May 19 '20 at 10:54

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.