Results 1 to 10 of 14

Thread: Tilemaps and autotiles

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Here is an old "guide" that I made for my current game project some years ago.

    Wallset_Wall_Explanation.jpg

    The tiles aren't used quite exactly the same way. It was more meant for walls instead of your typical RPG map tiling. However it shows all the checks to select a tile from a list of 47 individual case scenarios you would encounter.

    The basic idea was to check your 4 cardinal directions and if a wall (or in your case tile of the same type) was detected in 2 tiles beside a corner it would check that corner too.

    Not sure if this would be of any help, but it sort of relates so it might give you other ideas of just confuse. Enjoy! lol
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2
    Hm, that chart helps a lot. Thanks!

    @Super Vegeta, sure, post it!

  3. #3
    I will try to post my idea of how to solve this shoretly I hope.

    Anywhay in my idea you have numerical property which tels you which sprite you need to use for that tile. Since you are afecting this number by changing seperate bits of this numerical variable (each bit represents each side and each corner) there will be no need to use any logical system for constantly figuring out which sides/corners of your current sprite are neighboring to other wall sprite for instance. Since the system uses 8 bit integer (byte) for determining autotile you have 256 posible options for each cell.

    Now I'm currently testing different aproaches for changing seperate bits of this numerical variable to see which is best and safest. I'll try to make it thread safe so it can be easily used in multithreading applications.

    I hope I will be able to write you full solution example this weekend.

  4. #4

    Source code of a sample program generating a pseudo-random map and drawing it using the descibed method: http://svgames.pl/trash/autotiles.zip
    Uses SDL, SDL_image, OpenGL and Sour (included).

  5. #5
    Seems you can save some memory with that technique, but there is a downside. That is performance, for drawing 4 times as many tile-patterns, than you would with full tiles.

    In this thread http://www.pascalgamedevelopment.com...ll=1#post88337
    i ended up with 32 unique tile-fades. It should be enough for most games. But i moved on to shader-based fading...

  6. #6
    Thanks, SV. It's too bad you don't use RM anymore . Anyway I've decided that I'll just write autotile breaker which would break tiles into all 47 possible graphics. It'll make then tileset made from static tiles. Will give much more flexibility when designing maps at the cost of automatic placement . Thing of placing autotiles in RM with shift key.

  7. #7
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    I had tried to make a RPG Maker clone for a project of my own many years ago. (using Delphi 5 or 7) I had even made a near exact clone of Dragon Quest 1 (with a reenactment cutscene of the battle taking place at "destroyed the town of Hawkness") with semi-accurate battle stats too. So I got to work with and get a feel for the autotile system. Actually I took at a lot of inspiration from that engine.

    Super Vegeta's system is a pretty good one. Covers all cases and is compressed to the point of no overhead of assets. Fading from one tile pattern to the next is a challenge and makes graphics content a bit heavier the number of terrain or pattern combinations.

    If you are looking to reduce the number of pre-drawn tiles that you need, you could try using a transparency mask that is designed to fade one tile pattern over another. Essentially you'd be drawing in alpha. Not an easy task, but I'm sure there are tutorials out there. The trick is to make an alpha fade pattern that isn't a linear gradient, but a bit nosier and at the same time seamless with each other alpha fade tile.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •