1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Game Mechanics what's the relation of the sprite size with the tile size?

Discussion in 'Game Design, Development And Publishing' started by Sevorih, Aug 30, 2019.

  1. Sevorih

    Sevorih Member

    Joined:
    Jul 25, 2019
    Posts:
    4
    Hi, I've been new to this journey of making games. But in some tutorials on the internet I've heard some people talk superficially about this topic, when they always have their player sprite in the same size as their tiles. Is there any specific reason for that? Can I make a diferent size tileset from my player sprite size in a easy way?
    Really curious about the answers, thanks in advance for whoever tackle this topic!
     
    ParodyKnaveBob likes this.
  2. Greenwitch

    Greenwitch Member

    Joined:
    Aug 30, 2019
    Posts:
    38
    Well, it all depends what you wanna do with it. Generally, it doesn't matter. Maybe you wanna make a rogue-like dungeon crawler where your sprites have to sit perfectly within each square? In that case, why the heck not. It's all back to however you see it fit.

    But in terms of other things, no, it's irrelevant. You can make your sprite any size you want as well as your tileset.
     
    ParodyKnaveBob and Sevorih like this.
  3. JackTurbo

    JackTurbo Member

    Joined:
    Oct 19, 2016
    Posts:
    824
    Also depends largely on your art style and perspective. In my game for example most my characters are around 1 tile wide but between 1.5 and 2 tiles tall (although their collision masks are just slightly smaller than one tile).

    But then I'm not using grid based movement or anything.

    Like most things in game dev there are multiple approaches and which is best will largely depend on the specifics of your own project
     
    ParodyKnaveBob and Sevorih like this.
  4. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,881
    There's plenty of reasons:
    • Having characters take up roughly 1-2 tiles makes collision checking much easier, since you can get away with checking just their corners for collision with the tiles most of the time. Characters that are much bigger than a tile easily can get a tile stuck inside them if you just do this, on the other hand.
    • This also applies to secondary uses of collisions, like pathfinding and finding valid positions to spawn randomly-spawned objects.
    • Having tile sizes be pretty big means you can more easily measure distances in the level editor, instantly seeing if a jump is possible or not just by counting how many tiles big it is.
    • Having tile and sprite sizes correspond to each other makes it easier to have a consistent graphical style among all your assets.
     
    ParodyKnaveBob and Sevorih like this.
  5. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    Besides the above mentioned things, I just want to say that you should at the least make sure that you are using the same size pixels for everything. Tile size compared to sprite size isn't near as important. This is an issue because if you are making pixel art stuff you don't want to be scaling stuff very much because having different pixel sizes clashes bad usually.
     
    ParodyKnaveBob likes this.
  6. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    576
    I decided to go with a method from DIablo 2. Tiles are larger(160x80) but split into regions of 5x5 for collision checks. No graphic is wider than a full tile and large objects like gates won't clip with the player character(depth is checked on the 5x5). This also reduce the seams and you can draw nicer large patterns for floors etc.
    http://paul.siramy.free.fr/_divers/dt1_doc/
     
    Yal likes this.
  7. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    422
    I usually find it better to have the tile set be slightly smaller than the characters then use two tiles for doors and narrow hall ways so they don't look huge but are big enough things don't get stuck trying to walk though.
     
  8. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,881
    That's a cool piece of trivia! I know several NES games used similar "macro tiles" because 8x8 tiles were too small and saving a whole level's worth of them would use up too much memory, but I didn't know it stuck around back in early PC days as well.

    Slightly related, bunched-together assets made from several small individual assets are making a resurgence these days, but it's more to save level designer's time than to save memory:
     
    YanBG likes this.
  9. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    576
    Yeah i just found it, while trying to model stone walls like in D2, it's a pretty simple but nice trick, because i already had issues with the regular 64x32(or 96x48 whatever) because some of my props were larger and were clipping or if smaller made the empty space of the tile not passable. Walls on the outer edge of the tile are now here, tbh this was possible with my older tile mechanic(there were different sprites for inside/back of the house) but the collision is only as much as the wall is thick:
    [​IMG]
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice