using tiled as a mapmaker for tome

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
marvalis
Uruivellas
Posts: 683
Joined: Sun Sep 05, 2010 5:11 am

using tiled as a mapmaker for tome

#1 Post by marvalis »

Hello there fellow mapmakers and Tome-enthusiasts.
I was looking for some kind of mapmaker to make maps. first I thought I was going to have to code one myself. Lucky for me, I suck at programming so I had to search the web and I found this:
http://www.mapeditor.org/

:D

You can import your own tiles and save the map in CVS format. Then you only have to is edit that cvs file with a macro and you got yourself a nice little map ;).
It is possible to write a plugin for Tiled but I haven't quite figured out how to do that.
Great fun.

Best of all, it works on linux :D.

Screenshot:
Image

Here is a tile set to load:
Image

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: using tiled as a mapmaker for tome

#2 Post by darkgod »

Ohh interresting !
Can it ouput a text file or doesit need a plugin for that ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

marvalis
Uruivellas
Posts: 683
Joined: Sun Sep 05, 2010 5:11 am

Re: using tiled as a mapmaker for tome

#3 Post by marvalis »

Wel, it needs a plugin to create the map in the format you want. The standard options are CSV, XML and base64. I have no idea what format Tome uses, I should have a look at some files.

here is the Tiled wiki page about plugins:
http://sourceforge.net/apps/mediawiki/t ... own_plugin

Examples of other games using Tiled can be found on the wiki main page
http://sourceforge.net/apps/mediawiki/t ... =Main_Page

For now, I have been using it to get a visual idea what a vault might look like when I'm designing it, before I generate the code for tome. It would be nice if we could get it to produce something like this:

Code: Select all

defineTile(',', "GRASS")
defineTile('#', "WALL")
defineTile('X', "TREE")
defineTile('+', "DOOR")
defineTile('t', "FLOOR", nil, {random_filter={name="skeleton mage"}})
defineTile('$', "FLOOR", {random_filter={type="scroll"}}, nil)
return {
[[XXXXXXXXXXX]],
[[X,,X,,,X,X,]],
[[X,X,,,,,,XX]],
[[X,X,,s####X]],
[[X,X,,,#$$#X]],
[[X,XX,,+$$#X]],
[[X,,XX,####X]],
[[X,,,XXXXXXX]],
}
But to be honest, I have no idea how to do this (besides editing the CSV-files with search/replace).

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: using tiled as a mapmaker for tome

#4 Post by yufra »

I am taking a crack at writing a plugin, give me a few hours. :D
<DarkGod> lets say it's intended

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: using tiled as a mapmaker for tome

#5 Post by yufra »

Alright, I have a very basic plugin developed. Unfortunately the plugin architecture for Tiled Qt requires you to compile the plugins with the rest of the program, so you will have to grab the source, apply the attached patch and compile before you can use the export as -> T-Engine4 Map File. It may be better to write a converter for the XML format in the long-term to allow people who cannot compile to still use this tool.

The plugin looks for two properties inside of each Tile, "TERRAIN" and "display". You can set these by right-clicking on the tiles in the Tilesets window and selecting Tile properies. The "TERRAIN" property should be set to the name of the ToME terrain you want this image to translate to, and the "display" is the ASCII character that shows up in the exported lua file. The export will handle both the defineTile and ASCII map portions, but avoid having multiple tiles with the same ASCII character for now since there is no checking in the plugin.

There is also only one layer supported right now, but adding Object/Trap/Actor layers would make sense, too. How many people would use this?

Lastly, here is a quick way to create a tilemap from a bunch of images in a single directory. It uses the ImageMagick software package so make sure you have that installed.

Code: Select all

montage -border 0 -geometry 32x32 -tile 4x3 *png tilemap.png
EDIT: You need the source from the repository, not the 0.5.1 release for the plugin to work.
Attachments
plugin.patch.gz
(1.78 KiB) Downloaded 166 times
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: using tiled as a mapmaker for tome

#6 Post by darkgod »

I'll definitively use this!
It's so much better than Jave ...

OPS: You needthe dev version to make the patch work! Bad yufra! :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: using tiled as a mapmaker for tome

#7 Post by yufra »

I have a new version of the Tiled T-Engine4 plugin. I have attached a tarball that contains the first patch (from my previous post) as well as two new patches, and they must be applied in that order. In this version you can have four layers named Terrain, Object, Actor, and Trap. The two properties that need to be defined for each tile are "display" and "value". One of the additional features of this version is that the value property can be either the define_as string ("FLOOR") or a Lua table filter ({type="skeleton"}). If it is the define_as string be sure to include the double quotes, eg. "FLOOR".

The ASCII character in the map will be taken from the highest layer, and there is automatic handling if for example you have the same Actor tile on two different terrain tiles. This section could be made a bit smarter since right now the code just runs from ASCII 32 to 126 looking for a character that has not been used yet. Let me know if there are any problems or if you have any suggestions for future versions.
Attachments
tengineplugin.tar.gz
(3.45 KiB) Downloaded 182 times
<DarkGod> lets say it's intended

Post Reply