Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: eri0o on Tue 03/12/2019 22:13:35

Title: Tiled and AGS
Post by: eri0o on Tue 03/12/2019 22:13:35
Hey, just curious if someone ever looked into this.

Tiled is a map editor that is free and open source, and available here: thorbjorn.itch.io/tiled (https://thorbjorn.itch.io/tiled)

The only hack I know is using a tileset like this.
mask_blocks.tsx
Code (xml) Select

<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.2" tiledversion="1.2.1" name="mask_blocks" tilewidth="16" tileheight="16" tilecount="5" columns="5">
<image source="mask_tileset.png" width="80" height="16"/>
</tileset>


mask_tileset.png
(https://futureflashbackgame.com/AGS_FORUM_RESOURCES/helping_topics/mask_tileset.png)

And then loading it on Tiled and using it to draw the walkable areas in your map (click to expand image)

(https://i.imgur.com/VkgP3Nq.png) (https://i.imgur.com/j2v7pYo.png)

And later exporting the layers as images and importing the masks drawn there (in the example, walkable areas)

Tiled though has some other useful stuff, like drawing polygons and creating points that can have special means - these are particularly useful.

Anyway curious if someone has ever looked into using Tiled and AGS and maybe even done some stuff with it.
Title: Re: Tiled and AGS
Post by: Khris on Wed 04/12/2019 09:09:38
I wrote something that is able to import Tiled iso maps: https://drive.google.com/file/d/1BA0jVNBVBwliroJHBtrJeAXeKxOLHUMd/view?usp=sharing
(source for 3.4.0, WASD to move the character)

It includes a basic XML parser. The iso graphics required depth tiles because I wanted the character to be able to freely walk about. It's a mess though, and I abandoned it :)

[imgzoom]https://i.imgur.com/eQErwIW.png[/imgzoom]
Title: Re: Tiled and AGS
Post by: eri0o on Wed 04/12/2019 11:59:40
Wait , you wrote a xml parser in AGS Script? :O

(The script is not packed in the rar)
Title: Re: Tiled and AGS
Post by: abstauber on Wed 04/12/2019 12:36:15
I also experimented with importing files from external tile editors, but I learned that loading a complex map took up to 20 seconds with 100% CPU utilisation. So I wrote an exporter for Mappy to create binary files. Reading binaries just look a fraction of a second.

In the long run I ended up creating my own map editor in AGS script. And of course I ran out of time with my platformer project ;)
Title: Re: Tiled and AGS
Post by: Khris on Wed 04/12/2019 13:37:51
It's in there, just not as separate module. It's XMLParse.ash/c in the main folder (and part of the game).

I never made any speed tests but my map isn't that complex, it has only 6kb.