Search Unity

Farm Heroes Saga's GIANT map, how?

Discussion in 'General Discussion' started by Kelde, Jan 10, 2014.

  1. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Hey guys!

    So im sitting here,wanting to paint a huge map for our game,wondering if a phone can even take the size.

    then i opened Farm Heroes Saga and the worldmap is around 16 fullscreen landscapemodes in height...how is this done?

    this is not even everything, couldnt find one,this is like half the map.
    $9ecaf9be275b3353b209af9fbc2291bd.jpg


    Is it one gigantic image, or is it simply images stacked ontop of eachother? The entire map contains custom grapchis all the way so there isnt any reused textures, it looks diffrent from bottom to top.

    I also noticed Candy Crush uses a simular approach but with more simple graphics.

    I really wanna make our gamemap look good,and go along with our style wich looks like this:
    $mainmenunewile.png

    Thanks in advance, hope theres some painless solutions out there!
     
  2. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    382
    You tell that huge? Oh well... ;)

    Just several images stacked, that's it.
     
    Last edited: Jan 10, 2014
  3. Paddington_Bear

    Paddington_Bear

    Joined:
    Dec 9, 2012
    Posts:
    274
    Yes and no.
    The image (map) you see is actually a collage of backdrops, props (trees, farmhouses etc) and characters. So no, its not just one unbroken image (few phones can crunch that amount of image data as easily as the method CCS and FHS use allows for.
    You'll notice that some images (especially characters) are re-used (flamingos, bulls and so on). This further helps reduce file-size and boost performance.

    Hope that helped,
    Good luck with your painting!
     
  4. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    well for a phone game its huge, and the one i posted is like half of it. OK so its stacked, ur sure? How is this for performance? Th entire map is exactly 16 fullscreens, 1280x800'ish x 16....that number scares me.
     
  5. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    As a painter, i can see that none of them are reused, they might look the same but they are not. Almost nothing on this map has been repeated, if any. Either these are alot of images cut and stacked, or its a background image (the map) with textures form an atlas(all the decor) lined out.

    I was pretty sure this wasnt a single image, just wondering if its fullscreen images stacked. Im guessing they pianted the entire thing as one piece and sliced it up, stacked it back into the game.
     
  6. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    If it were broken into slices, each using an ALHPA texture and an indexed-palette shader, it would consume 1/4 the memory and still have lots of colors.

    Also it could be a compressed texture?

    Size-wize if you can't see it all at once it can be spooled from byte arrays in main memory to a single screen-sized texture.
     
  7. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Ok just checked candy crush, its insanely long, much longer than this. Whats the best way to go about doing this where the map is entirerly handpainted like most rpg games are?
     
  8. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    I'd imagine its painted as one huge image, sliced into stacked tiles, and then loads/unloads the current, next and previous tiles as you scroll (or just the current and next/current and previous, if you're at the beginning/end).
     
  9. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    yeah i was kinda wondering the same. Ive seen some questions about large worldmaps on phones in general, no solid answers tho. I did see Hippo from the forums telling a guy to import it as a mesh, since the guy was gonna use something like 4096x4096 wich is crazy big, and it was a handpainted image.

    Im gonna paint the entire thing first tho, it will be around 4-5 fullscreens, then we will take it from there i guess. We were gonna do the standard mobile game level layout where u have "world" then "levels" inside it lined up like angry birds, but im not a fan of that so we will avoid it if we can.
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's not the case, but even if it was, that would increase the size. Because in addition to the 100% unique background, you'd need the data for all the sprites as well.

    It's just a bunch of stacked images. You can load/unload them as needed, and hardware-wise there are limitations on the texture size (typically 2048x2048 though it may be larger on newer devices).

    --Eric
     
  11. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Tiles. The trick is just that for performance is that you have to load and unload it from memory as you are scrolling. I haven't tried it on Unity, but in ObjectiveC (and Air) we have done massive maps, and you basically load into memory (and unload) the tiles a couple in advance on each side. Trying to load them all at once is a device breaker. Not sure what the best approach in Unity would be, probably something similar.
     
  12. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Indeed, on retina iOS devices it is 4096x4096. But practically speaking, not a difference as the art all is double size anyway. ;)
     
  13. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Nice info, appreciate it also guys! Load and unload sounds reasonable for sure as we have to atleast stack 5 1280x800, now.....i got a craploads to paint!
     
  14. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    Break the thing into 2048 x 1400 block sizes.


    When the person scrolls up, load the bottom part. When the person scrolls down, load the top part.
    In doing so, only 2 of the images is loaded at any one time. The rest are freed from memory.


    Kelde, I wait to see your artwork! Your artwork puts many of the $50+/hour artists to shame as they cannot reach your kind of quality.
     
  15. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    How exactly do you load/unload them? Do you use a Resource folder?
     
  16. Dabeh

    Dabeh

    Joined:
    Oct 26, 2011
    Posts:
    1,614
    Just spliced up and loaded as you need them. Why not do a test? Shouldn't take long to do a small test. No need to over-engineer and use palette shaders etc unless it's necessary.
     
  17. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Yeah we are gonna test this and check how it affects my S3, its getting kinda old now.

    Fingers crossed
     
  18. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,971
    Can you really have non square images, that are not square of 2?

    I mean, in the end unity will split it that way, right? Or do videocards support any texture size now :-0
     
  19. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    I think we have tons of them, especially decor textures. We just choose non power of 2 = none, and it works sofar. EAsy fix if it becomes a problem. I think unity makes sure it works even if they are odd numbered textures?
     
  20. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    I thought non square images don't compress in unity, so if you're using compression then you'd have to rethink things?
     
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Non-square images not compressing only applies to PVRTC, which probably would not be used for this anyway.

    --Eric