What's the template for auto tiling?

Discussion in 'Programming' started by Ealonex, Jul 4, 2016.

  1. Ealonex

    Ealonex Guest

    When I tried to autotile with any and all suggestions on doing so, they never come out properly. This is an example of one of my autotiles (64x64). What's the correct size for auto tiles?
    Edit:
    Ah, and I'm trying to make my character automatically go infront and behind trees and such. No idea how to make it work right.
     

    Attached Files:

  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,899
    There is no "correct" way to autotile. The images you use will depend on the tile script that you are calling. For example, the one I have on the Marketplace uses 47 tiles (48 if you include the "empty" tile). But I've seen some that use 9 and 16...

    As for the in front and behind thing, set the tree depth in the create event to:

    Code:
    depth = -bbox_bottom;
    Then place the same code in the Player step event. ;)
     
  3. Ealonex

    Ealonex Guest

    Ahhh thank you so much for the depth issue!
    So for an RPG game, how many would I even need? I sometimes feel like I'm missing a part even though I also have this other one version that actually works better. It's frustrating because I see all these other games with seemless tiles and they seem to have corner pieces or individual pieces that I don't have (like one grass in the middle of dirt)
     

    Attached Files:

  4. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,899
  5. Ealonex

    Ealonex Guest

    [​IMG]
    Yea this is exactly what I mean though. How do I draw out my tileset? example is that I don't have the number 0, 1,2,4,5,8,10 tiles anywhere on my tileset.

    instead, I have four 15s and two 7, 11, 13 and 14

    sidenote: i'm making an rpg game
     
    Last edited by a moderator: Jul 4, 2016
  6. Ealonex

    Ealonex Guest

    Can someone please help?
     
  7. Zodaris

    Zodaris Member

    Joined:
    Jul 2, 2016
    Posts:
    103
    For that picture you posted, the black edges are the open sides. Meaning 0 is a lone block, 1 is hanging below another block by itself, etc. The method for how to apply that tileset is in the link Nocturne gave you: http://blog.cowboycolor.com/binary-auto-tiling-in-game-maker/
    For an RPG though, I'd suggest putting the code in the create event instead of the step like what that guy did for his game.

    The video Nocturne shared is one that I personally love and use. It takes 47 tiles (48 is you count the blank empty space one). Links are in the description for that video. Download the tileset template to guide your tileset making, and the script is also downloadable. Just "plug and chug" as my math teachers used to say.
     
  8. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,839
    with the image you posted a tile looks up the size of a tile, if a tile is there you add 1 to the count
    you look right, you add 2
    you look below, you add 4
    you look left you add 8

    if you have a tile up and right that is 1+2 = 3 that give tile 3
    if you have a tile left and down that give 2+4 = 6....
    if you have atile right and up, 8+1 = 9
    each tile does this and they change their image according to their surrounding.

    room_start, tile_obj.
    image_index = 0;
    image_index += (collision_point(x, y-16, tile_obj,0,1)!=noone)*1;
    image_index += (collision_point(x+16, y, tile_obj,0,1)!=noone)*2;
    image_index += (collision_point(x, y+16, tile_obj,0,1)!=noone)*4;
    image_index += (collision_point(x-16 , y, tile_obj,0,1)!=noone)*8;
     
  9. Ealonex

    Ealonex Guest

    I tried this and got this:
    [​IMG]
    I also got that last time too, so i gave up on it for a little bit. The tiles above were placed normally btw.
    But do RPG games need 47 wholes sprites? I'm working on a project for myself and I wouldn't call it the smallest thing ever. I think the only reason I wouldn't try this one just yet would be 1: It for some reason doesn't work for me and me specifically (and this happens alot), so I'll feel so burnt out on spending so much time on 47 little pictures. Two, I don't know of any rpg game that uses this method either? I'm not sure how the game looks like with so many sprite (presumptuously better but I need to be able to actually see that first.)
     
  10. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,839
    My code should work. you need the 16 tile version as per the image you posted.

    BTW, A note to people who make tutorials. post a sampler tileset that effing makes sense. that image is not tileset extractable. I spend more time fixing it than anything else

    https://www.dropbox.com/s/ef4hnaetmndso51/autotile.gmz?dl=1
     
  11. Zodaris

    Zodaris Member

    Joined:
    Jul 2, 2016
    Posts:
    103
    Depends on the art style you're going with. If you're going for very simple, then 16 will be fine. But for anything RPG Maker level and better, I'd say 47. For most tiles, it's not too bad to make that many. You just make the base tile (the one that is in the middle). Make 47 copies, then just go through erasing the correct edges on each one. Maybe touch it up a bit here and there. Takes no more than a few hours per set (maybe shorter, I had a bunch of unique walls when I did it last so a few hours for me.) and it's actually quite relaxing once you get going. Picking a favorite podcast to listen to while you do it could be helpful.

    Also, for an RPG I wonder if you even need auto-tiling. Here is a great resource for making maps with tiles if that's all you need: Tiled
     
  12. Ealonex

    Ealonex Guest

    Okay so I saw that project and damm, I get it now. I will very likely make tilesets this way for the time being.
    actually yea I can totally see it being relaxing. I just dont want to spend hours drawing it in the wrong format so can I have a picture template to look at please? like the 0-15 green blocks from the tutorial. Sidenote, I don't actually see rpg maker games with 47 tiles tileset??? They'd look pretty good I assume tho. Shaun spalding's tileset thing does not look like it works with rpg games.
     

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