Getting rid of the cracks? Tile Images…

About Monkey 2 Forums Monkey 2 Programming Help Getting rid of the cracks? Tile Images…

This topic contains 9 replies, has 4 voices, and was last updated by  c0d3r9 9 months, 1 week ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #15037

    therevills
    Participant

    I’m having a bit of issues with cracks in my tile maps, any ideas of how to fix it?

    Place the image in assests folder or just download the tiletest.zip 🙂

    #15041

    Pakz
    Participant

    This from discord. Make sure the spritesheet image is with the power of 2. So width and height 256*256 or 512*512. Textures and opengl thing.

    #15042

    Ethernaut
    Participant

    Just tried using my SpriteTools Atlas class, and it fixes the problem by working its magic behind the scenes…

    https://github.com/DoctorWhoof/spriteTools

    Minimal changes to your code, and unchanged texture file.

    #15043

    therevills
    Participant

    Tried the power of two by increasing the image (tileset2.png) to 256×256, but still had the gaps. I thought Monkey did that for you?? Maybe I’m thinking of BMX or MX1?

    Ethernaut’s code does get rid of the gaps, but the seamlessness is not quite right now but better than the gaps 🙂

    #15046

    Ethernaut
    Participant

    This is what I get when doing the tiling by hand in Photoshop:

    Seems pretty close to what the Atlas did! 🙂

    For tilemap  work, check out “Pixel Edit“. It’s super simple, but has some killer features, like painting directly on the tile while you see the result in a tile map, etc.

    <edit> If you zoom in, there’s indeed an odd edge interpolation going on… will investigate!

    #15047

    Ethernaut
    Participant

    Argh, found a bug on my end! Will fix…

    #15048

    therevills
    Participant

    I’ve been using Pyxel Edit now for a while, it is awesome 🙂

    Argh, found a bug on my end! Will fix…

    Cool – I’ll keep an eye on your fix!

    Thanks for helping 🙂

    #15049

    Ethernaut
    Participant

    Ok fixed!

    Instead of copying neighbor pixels, I copy the values from the other side of the tile (i.e. gap on the left edge of the tile gets the color values from the right edge).

    On top of that, I also fill the pixels at the intersection of the gaps now, which something I didn’t do before because I’m lazy! 😛

    Updated here:
    https://github.com/DoctorWhoof/spriteTools/blob/master/source/atlas.monkey2

    #15050

    therevills
    Participant

    Looks perfect! I’ll test some more soon! Thanks a lot!

    #15051

    c0d3r9
    Participant

    with https://www.codeandweb.com/texturepacker

    its possible to add a pixelborder to each tile on the spritesheet.

    only a little tip

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.