Hello Guest

Author Topic: Atlasing a very large project?  (Read 4847 times)

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Atlasing a very large project?
« on: April 05, 2013, 09:26:05 pm »
Hi, I just want to know how to go about doing this before I get in too deep with the wrong solution.
I'm planning to create a platforming game with graphics scaled for 720p. This game will contain a lot of levels, enemies, backgrounds, etc.
each background piece itself will be 1280x720.

I've started working on the game, and with a partial first level complete my atlas is already 21 mb and uses almost half of my 2048x2048 allotment (even with a diced background)
this is a tiny fraction of how much artwork the game will have. should I already prepare to split into multiple atlases?
I know 2dtk can manage multiple atlases but I don't think I have a choice in where the sprites end up on the atlases. I imagine with a large game I would divide them by game area. Persistent sprites such as the main character would always be loaded, but I would cycle different atlases depending on what area of the game I'm in (tutorial, area1, area2, etc)

thoughts?

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: Atlasing a very large project?
« Reply #1 on: April 05, 2013, 10:50:35 pm »
would I be better off creating separate sprite collections for each area of the game? and letting each collection manage their own atlas?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Atlasing a very large project?
« Reply #2 on: April 05, 2013, 11:04:26 pm »
I would organize it like the way you have right now (sprite collections per area, and perhaps even per layer of sprites, bg, fg, mid sprites, so on), but take it a bit further, and have all the player sprites + animations in one atlas and so on.

If you have full screen background pieces, and they don't have significant amount of 0-alpha regions, then perhaps you could just load them in using Resources.Load, and use runtime sprite collections to create them at runtime. One advantage of this is that if you store the files at .png.bytes in your project, you will be able to keep them as PNGs, and save a fair bit of disk space. Obviously this will come at the cost of runtime load speeds, but as everything else that is just something to balance.

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: Atlasing a very large project?
« Reply #3 on: April 05, 2013, 11:53:28 pm »
I assume unity will smartly load the atlases/materials as it needs?
for example if one game scene only consists of images from one collection/atlas, the others will never be loaded into memory?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Atlasing a very large project?
« Reply #4 on: April 06, 2013, 12:07:36 am »
Yes that is correct.
Which is another reason to keep them nicely and logically partitioned.

paulhocker

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
    • SpockerDotNet LLC
Re: Atlasing a very large project?
« Reply #5 on: April 06, 2013, 06:52:10 pm »
if your backgrounds are not too complicated, maybe you can consider building them at runtime -- for example if you had a blue sky with clouds and a sun, pull the clouds and sun out into seperate sprites, and then you just have to create a blue background and put static sprites in the scene.