Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Big maps 2D

Discussion in '2D' started by SuricatoTI, Mar 11, 2015.

  1. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    I'm developing a 2D game with third-person view that stay vision over the character. I created a phase that consists of 60 x 60 quads to form the ground and obstacles. The problem is that it was too heavy, takes too long to start the game. Is there any way to control this rendering? Is there any easier or more correct way to do this? How do you make big scenes?

    Thank you all.
     
  2. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
  3. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    Thank you. I'll post here some pics from my project. But I don't think that 60 x 60 sprites should be hard to show, if you think in starcraft, warcraft the maps was bigger and the game wasn't so haevy.
     
  4. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    oh, I wasn't asking for more details on your game... just saying I don't know all the details of how to use LoadLevelAsync to help solve this issue.
     
  5. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    Yes, i understand, but I thinked that if I show more details you or someone else could give me a tip. :)

    Thank you again.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    LoadLevelAsync isn't really the way to solve this problem. You can create a system that avoids creating an object for every tile, or buy one from the asset store.

    --Eric
     
  7. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
  8. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You seem to have missed that this topic is about a 2D game made out of tiles. Splitting a tiled world into multiple levels is not a good solution.

    --Eric
     
  10. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Can you explain why?
    Ori is also a 2D game and reuses a lot of assets.
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There's generally no real reason to break a tile-based level into multiple parts, which just makes things harder to work with. The OP talks about 60x60 quads, which is easily do-able in one level as long as you use a more optimized approach rather than using a GameObject for every tile.

    --Eric
     
  12. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Yeah, multiple scenes does seem like a complex way to go about it. The dev's that built Ori had to build their own multi scene editing workflow... sounds pretty intense :)
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Also you would end up with the same problem (poor performance) once you loaded more of the map, unless you got rid of the old stuff, in which case you might as well just use a proper tile system anyway.

    --Eric
     
  14. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    60x60 sprites only describes one part of the equation. If your entire game world is composed of only 60x60 tiles it seems like each one may be huge? What is the size of these sprites?
     
  15. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Except the OP did not really say "poor performance". He said "takes too long to start the game". :p
    But I hear you. I'm making a 2D game as well, and the world might get pretty large. But my game is not tile based, I'm using Ferr2D. I expect that I will find logical places to break it up into scenes but I haven't gotten that far yet.
     
  16. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    I'm putting images of the game for a better understanding.

    This is the sprites



    And this is all the world
     

    Attached Files:

  17. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, that's what I'm talking about. So my advice stands.

    --Eric
     
  18. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    Eric5h5, could you direct me to some asset store system that I could use for this project?
     
  19. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    The sprites have 32x32 pixels.
     
  20. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Yeah I wouldn't expect a 60x60 map of 32x32 tiles to produce any noticeable delay in starting the game. My current game has a map area covering 128 screens with 90,000+ tiles (per map layer) and there is no noticeable delay in starting the game on my 2008 laptop.

    What kind of delay are you seeing (seconds/minutes?)?
    Is the delay on desktop or mobile or both?
    Are you manually building a level out of these 3,600 tiles by placing game objects in a scene? Or are you using some kind of map structure perhaps loading data from XML?

    Answering these questions may provide enough information for people to help.
     
  21. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    You need look no further than his signature ;)
     
    Last edited: Mar 12, 2015
  22. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    It takes something about 12 seconds to open. :O
     
  23. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    I just tested in unity and I contructed the world there, unsing quads, one by one.
     
  24. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    For some reason I cannot see signatures when viewing the forums on my cell phone. Anyway, I guess maybe that is a lot of GameObjects to have in a scene... 3,600 plus whatever non-tile GOs you have? I don't know because I don't design with the Scene Editor. But still I could see as a scene grows in size it taking longer to load in Unity but I would expect the delay to be much reduced in the actual build of the game. 12 seconds seems like a huge delay outside the editor.

    Just to clarify... when you say "open" do you mean when you open (load) your project in Unity, when you press Play in the Unity Editor or when you open (launch) your game executable?
     
  25. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    SuricatoTI was asking Eric for an asset recommendation. Eric is the author of SpriteTile and it is linked in his sig...

    SpriteTile: efficient tile system that works seamlessly with Unity 4.3 sprites
     
    GarBenjamin likes this.
  26. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Oh yeah. My bad. ;)

    SpriteTile is an awesome system. It is what I use and recommend.
     
  27. blizzy

    blizzy

    Joined:
    Apr 27, 2014
    Posts:
    775
    You might also want to look at 2D Toolkit.
     
  28. SuricatoTI

    SuricatoTI

    Joined:
    Mar 11, 2015
    Posts:
    12
    GarBenjamin, 12 seconds when I push the play button :)