Question - IDE Isometric tiles

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Ax8472, Dec 10, 2016.

  1. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    Hey peeps, I tried searching for an answer for this before I posted this. Maybe someone can help me....I hope I'm just missing something.

    So I made a few tiles and a tileset. Ar first it was simply a single floor tile, 64 x 32 pixels. However when I try and place it on a tile layer, I seem to have absolutely no control on where these tiles go. I mean, I can only place said tiles in accordance with the tile grid, and the tile grid always corresponds to the size of my tiles. I can't place tiles in between. What's more, I'm not given the option for an offset of the tiles in my room so in the end, I can't seem to get the tiles where I want them to go, without perhaps making a second layer and splitting them in two, and doing two halves of the diamond in two different tile blocks.

    Please tell me this isn't the way it should be, and that I'm missing something? I remember in GMS I could literally place tiles anywhere I wanted on my screen with a simple line of code. Why can't I do that now in the tile room editor on the tile layer?

    Cheers in advance :)

    EDIT: Found a way to offset the tiles (it's in the left hand menu, you can click on the tile layer and select "preferences") but I still can't fill in my isometric diamonds without creating another four layers for each corner to fill in. Capture.PNG
     
    Last edited: Dec 10, 2016
  2. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    263
    It's because of the grid snap settings. There's an icon for it on the room editting area where you can toggle snap and change snap size.
     
  3. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    For instance placement that is correct. Are you sure it's true for tiles though? Because it doesn't seem to work for me.
     
  4. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    I haven't done an isometric tileset yet, but I just published an article on my web site detailing what I've been able to teach myself so far about the way GMS2 works with tiles.
     
  5. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    Cheers man, I don't use tiles often but that was a good read.

    I have found the option of "snap to grid", it simply makes no difference whether it's on or off, it snaps to grid regardless. I've tried holding down buttons like alt (which works in GMS) to no avail. It's either A) a bug or B) Just a feature that's yet to be implemented. I'm thinking the latter. Not sure if I should bother the Yoyo guys with this...
     
  6. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    Thanks! I would like to add a segment on doing isometric tiles, but I have no experience with doing isometric games, and may not get to it for quite some time.

    If you have any feedback on my article, feel free to leave a comment or contact me.
     
  7. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    Try placing them on an Instance Layer instead of a Tile Layer. Then toggle grid off.
     
  8. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    It's impossible, sadly. Where the tiles normally are, it says "No Tile Layer Selected". Has to be on a tile layer. There are ways around it, such as drawing them on a second layer and making new tiles with an offset of zero-alpha, but it just defeats the purpose of having an easy to use tile painter. It's still in Beta though, I'm sure it'll change in time. :)
     
  9. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    Ah...
     
  10. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    This looks like A) a bug to me.
     
  11. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    263
    My suggestion was for using objects, of course a tilemap is flat and it auto snapped to the grid. Tiles are optimized around this.
    One idea: could the tilemap distortion be done with a shader?
     
  12. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    It's documented, tiles must align to grid.

    I get the feeling that the new tilesets are not intended to support things like isometric games (or hexagonal grid systems for that matter). Unless I'm missing something, I don't see how one could easily implement a non-orthogonal tilemap in a Tile Layer as they currently work in GMS2. It's ironic, since the Tile Layer button in the room editor's icon shows an isometric layout :/

    Hopefully YYG will introduce those features down the road. I think it would be a good idea. Until then you'll probably have to make do with sprites in an Asset Layer, or use Background layers.
     
  13. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    But why is there a "snap to grid" option then which seems to do nothing?
     
  14. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    A valid question, which I don't know the answer to. I can't get those controls to do anything. I believe that the grid size of a tile layer is determined by the size of the tiles in the tile set assigned to the layer.

    But I'm speculating. I'll be better to hear from Russell or Mike on this.
     
  15. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    263
    The snap to grid is for instances only. Tiles are grid based...
     
  16. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,160
    Yep, this is true (for instances, assets and backgrounds...).

    Can't you just replicate this on another single layer and offset that layer down and right to fill in the gaps?
     
  17. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    Hey that's not a bad idea, and would only require a single extra layer! Probably the best solution. Will give it a go. If not, then objects it is.
     
  18. Ax8472

    Ax8472 Member

    Joined:
    Jul 15, 2016
    Posts:
    53
    Worked a treat! Thanks guys!!!

    Capture.PNG
     
  19. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    Cool, you got something working :)

    I think this still feels a bit clunky, having to deal with two layers all the time. I imagine if you're checking for the presence of a specific type of tile in one of these layers, you have to double your checks, using OR a lot... plus laying out your rooms in multiple layers, with no provision for being able to auto tile them seems like it'd be a pain. Unless I'm missing something. So I'm not sure how I feel about it, since I haven't actually done it myself, but it seems awkward. This would probably make me lean away from doing isometric games in GMS2. Hopefully YYG will improve things. I'd suggest adding a new feature for "isometric tile layer" as a different type of tile layer, which allows you to lay out your tiles in a single layer.
     
  20. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    That makes sense. A bit confusing though.

    I believe isometric editing will be added. @Mike said something about it here
     
  21. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    Well, I've just thought of something else. What about splitting up your isometric tiles, cutting them in half so that they do fit on the grid in a single layer?

    I'll work up a proper image illustrating my idea... here it is:

    upload_2016-12-11_11-37-54.png

    The idea here is, every isometric tile may have between 0 and 4 neighbors. So you'd need a rectangular tile showing every permutation of these neighboring arrangements, like so:

    1. 1 tile for an empty region with 0 tiles with 0 neighbors.
    2. 1 tile w/ 0 neighbors
    3. 4 tiles with 1 neighbor: up; down; left; right
    4. 6 tiles with 2 neighbors: up-down; up-right; up-left; right-left, right-down, left-down
    5. 4 tiles with 3 neighbors: empty up, empty down, empty left, empty right
    6. 1 tile with 4 neighbors
    So a 17 tile set, assuming I counted all the permutations correctly above...

    So the image above shows 10 of them... you just need to work out a few additional tiles, showing the various combinations of what a tile edge should look like based on the number of filled neighbors there are in the grid.

    For autotiling, I'm not sure but I don't think the current 16 or 47 auto tile maps will work with this, but you could either position them manually, or else custom code something for auto tiling.
     
    Last edited: Dec 11, 2016
  22. Ubu

    Ubu Member

    Joined:
    Nov 3, 2016
    Posts:
    122
    Hmmm, not so sure about this. This means that for every single tile you now need 16 more which is a bit of an increase in resources.
     
  23. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    If you have 1.x, please take a look at the Isomeric demo included in it. This is how isometric games should be done. Only rendering should differ, everything else is basically in a square 2D world.
     
    YellowAfterlife and csanyk like this.
  24. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,123
    Yeah, thats what i figured:
    Keep all logic in square world.
    1. Translate inputs from ISO to Square
    2. Do all logic in square
    3. Draw from square to ISO
    I guess the rendering can be done with two tilemaps like previously mentioned at this point: since the logic could be handeld by another tilemap.
     
  25. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    Yes, just a bit...

    Plus it gets exponentially uglier if you have multiple types of terrain that need to interact with each other...
     
  26. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    Will this also help out w/ hexagonal grid-based games? Or is there a different approach to take with those?
     
  27. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    263
    I think the double layer option is the best. You only need to create a function that does the hard work for you, looking up in which layer the required tile would be. Then you just call the function as if it was a single layer and you have no headaches.
     
  28. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    812
    At runtime, I suppose. But I think during development, being able to lay out all tiles in a single layer, and not having to swap back and forth between them, and having some possiblity for an auto tile function, would be strong arguments in favor of a single layer solution.

    But probably it's better to do it the way @Mike recommends, and follow the Isometric demo.
     

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