- Title: How to use Tiled To Binary Converter files with Gamemaker Studio
- Description: This tutorial shows how to use binary files created with my tool "Tiled To Binary Converter" with Gamemaker Studio. This method should also work for large rooms.
- GM Version: Studio
- Registered: No
- File Type: .gmz
- File Size: 1.2MB
- File Link: http://www.gamephase...TiledBinary.gmz
- Required Extension: -
- Required DLL: -
- Tags: tutorial, tiled, help, guide
I have created a versatile (and free) converter for Tiled maps that saves binary files of the tile layers and object groups. The tile layers can also be compressed using run length encoding. I also created the necessary scripts for Gamemaker Studio that reads these files to data structures so it's very convenient to use.
The tool supports all compression types of the tmx file format used by Tiled (uncompressed, base64, gzip and zlib). Also all object types are supported (tile, rectangle, ellipse, polygon and polyline) and custom properties are also included.
Read more about and download Tiled To Binary Converter here:
You can save the files directly to the "datafiles" folder in your project folder and add these as "Included files" in GMS. When replacing files you just save over the files with the converter tool, no need to include the files again in GMS.
Using the imported data is quite straightforward since data structures (ds_grids, ds_maps and ds_lists), are created when using my scripts. The only scripts you should need to edit to your liking are "create_tile_layers" and "create_objects". You can also entirely skip using those two scripts and use the data structures however you like.
Below you can download the Gamemaker Studio scripts and example, the Tiled map I used for the demo and the documentation for the data structures created.
To use the scripts in your own projects, just import the scripts and call the scripts like below in the room create event (or somewhere else).
// Load the map global.tile_map = load_map("map.bin"); // Load all the objects from Tiled to a list global.list_objects = load_object_list("objects.bin", 8); // 8=tilewidth // Create the tile layers create_tile_layers(global.tile_map, bg_tiles, 8, 8); // 8=tilewidth,tileheight // Create the loaded objects create_objects(global.list_objects);
All the scripts are licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
I hope you find this useful, you should be able to create large rooms by using this method. I'm using a custom drawing technique myself for a room that has 1000x1000 tiles (8000x8000px big), works really well.