• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Asset - Scripts Autotiles Helper [FREE]

Homunculus

Member


AutoTiles Helper is a small set of scripts and resources that will help you create and automate a seamless tiling system based on a total of 47 tiles.

Features

  • Automatically get the correct tile images based on the adjacent tiles
  • Generate a complete tileset from a compressed one (see images). No need to draw every single tile!
  • Fully documented and commented
  • Includes a comprehensive sample project
  • By changing the provided data structures, you can define your own tile order

Resource link: Autotiles helper - Markeplace
Documentation:
Function reference, getting started and installation
Tileset expander utility: Download (exe)
Price: Free!

Version 2.0.0
  • Improved and streamlined scripts
  • Tile order now matches the one from GMS2
  • The sample project has been improved and simplified
  • New online documentation.
  • Downloadable exe version of the sample project, to be used as a stand alone utility if you just want to expand compressed tilesets and test run them (see link above).
 
Last edited:

Homunculus

Member
EDIT: fixed in current version as of 24.09.2016

I was recently reminded about a problem with a specific GM:S update, that causes problems with this asset.

If you are having troubles displaying the correct tile with autotile_get_index, change lines 23 to 26 of the script as follows:

Code:
northWest = place_meeting(x-size,y-size,object_index) & west & north;
northEast = place_meeting(x+size,y-size,object_index) & north & east;
southWest = place_meeting(x-size,y+size,object_index) & south & west;
southEast = place_meeting(x+size,y+size,object_index) & south & east;
For more info check the archived forum topic: http://gmc.yoyogames.com/index.php?showtopic=671648
 
Last edited:
First of all - thank you for this great extension.
The feature to expand compressed autotiles is great, and the rest of the work really helps so much.

But it takes me a bit to find this workaround here, and it seems, that in the actual Gameplayer Version from Steam (1.4.1757) is stil the bug, so this workaround is needed.
Do you have openend a bug request, or is it maybe after all works as designed?

Maybe you should reup this asset in a newer version with this workaround inside, cause it is a really great extension and after humble bundle, there is maybe lot of people who tries this, and think, that this not works, and "throw it away" - and such a good work earns better ;-)

best regards
 

Homunculus

Member
Yeah you are actually right, to be honest I didn't do it until now because I refuse to accept that bugs like this stick around so long, especially considering that at the time I saw it listed in the open issues on mantis (not on my notice in any case, it was already there).

I just uploaded version 1.0.1 to include this fix
 
M

Marko Raos

Guest
Heya!

This is an excellent tool and perfectly suited for the new autotile feature in gms2... However, the order of tiles in the exported file does not conform to the format used in GMS2. This is a bit of a problem since then you have to remap all the tiles by hand while looking up which one goes on where etc... which is amazingly time consuming and tedious.

I already tried to change/remap the tile_map.json file but all I managed to achieve through my efforts is no change in the exported tileset whatsoever and garbled tiling within the program itself when testing the tileset.

What am I doing wrong?
 

Homunculus

Member
I just uploaded version 2 of the asset!

Changes:
  • Improved and streamlined scripts
  • Tile order now matches the one from GMS2
  • The sample project has been improved and simplified
  • New online documentation.
Also, there's an exe version of the sample project that can be used if you just want to expand compressed tilesets and test run them. Download here (exe)
 
S

SirSoul

Guest
Getting this error when trying to get the auto tiling to work.
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_tile:

global variable <unknown built-in variable>(-1610512735, -2147483648) not set before reading it.
at gml_Script_autotile_get_index (line 12) - tile_map = global._autotiles_data[? "tile_map"];
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_autotile_get_index (line 12)
called from - gml_Object_obj_tile_CreateEvent_1 (line 2) - image_index = autotile_get_index();
 
S

SirSoul

Guest
I have it in the room creation code.
Code:
autotile_init("autotiles/autotiles_data.json");
expanded_tileset = autotile_expand(bk_autotile,8);
autotile_get_index()
my room creation code

I have now solved this problem by playing around a bit, Thank you for the help :)
 
Last edited by a moderator:
J

john5879

Guest
Hi
can an expanded tileset be imported as a sprite and tileset in GM2? Because I'm doing that but it inserts a transparent tile in the top left, which screws things up :
 

Homunculus

Member
Autotiles in GMS2 are required to have an empty cell in the top left position, that’s why the tool outputs the tilesets like that
 

konkrz

Member
@Homunculus
Sorry, I don't know if I should post in this old thread or make a new one but I could use some help so I will try here for now.
The asset you made looks perfect and the compressed tileset is extremely useful. I am,however, finding difficulty implementing it in my own project.
What I can't figure out is how to make it assign sprites to the instances already in the room, though it seemed simple enough at first.
I tried keeping only the parts of the code that I thought was needed (no luck) and then I tried putting all your objects in the room.
Shouldn't adding autotile_get_index and update_adjacent_tiles in the obj_tile code be enough for it to work?
It doesn't though. sprite _index returns -1.
I really want to use this asset and I would greatly appreciate if you ore anyone else could help.
I am on 2.3 and (obviously) not very experienced.
 
Top