Tiled como editor de mapas en GNU/Linux
Publicado: Sab, 05 Oct 2013, 14:27
Bueno, como algunos ya sabréis por el hilo de la Churrera Installer andaba buscando alternativas de algunos de los programas usados que solo están para Windows sustituyéndolas por alternativas que corran nativamente en GNU/Linux y D_Skywalk comoento Tiled.
Pues bien, esta mañana lo he estado probando y la verdad es que no esta mal, quitando que no tiene una opción del Mappy, y es poder poner guías para dividir la pantallas del juego, si bien abajo te dice en que casilla estas (por ejemplo 16,0, por lo que ya sabrías que estas en la segunda pantalla de arriba)
Para hacer la prueba he creado una de las pantallas del juego del tutorial y guardado al formato nativo (.TMX, que no es mas que un fichero en formato XML) y exportado a un fichero en formato JSON. Esto es una muestra del archivo generado:
TMX (lo he recortado un poco, que son muchas lineas):
$this->bbcode_second_pass_code('', '
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="15" height="10" tilewidth="16" tileheight="16">
<tileset firstgid="1" name="mappy" tilewidth="16" tileheight="16">
<image source="mappy.bmp" width="256" height="16"/>
</tileset>
<layer name="Capa de Patrones 1" width="15" height="10">
<data>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="7"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="7"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
...
</data>
</layer>
</map>
')
JSON:
$this->bbcode_second_pass_code('', '
{ "height":10,
"layers":[
{
"data":[8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 8, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
"height":10,
"name":"Capa de Patrones 1",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":15,
"x":0,
"y":0
}],
"orientation":"orthogonal",
"properties":
{
},
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"image":"mappy.bmp",
"imageheight":16,
"imagewidth":256,
"margin":0,
"name":"mappy",
"properties":
{
},
"spacing":0,
"tileheight":16,
"tilewidth":16
}],
"tilewidth":16,
"version":1,
"width":15
}
')
La parte importante en ambos casos esta dentro de data, que esta dentro de layer (Tiled permite múltiples capas)
Como se ve guarda un numero correspondiente al numero del tiled usado, siendo leído de izquierda a derecha y de arriba hacia abajo.
Yo creo que se puede usar Tiled en lugar de Mappy en Linux, y crear un conversor en Python que coja uno de los 2 formatos que comento (si bien prefiero JSON por que es mucho mas sencillo de usar en Python) y que crease directamente el archivo .h listo para ser usado.
¿Que opináis?
Pues bien, esta mañana lo he estado probando y la verdad es que no esta mal, quitando que no tiene una opción del Mappy, y es poder poner guías para dividir la pantallas del juego, si bien abajo te dice en que casilla estas (por ejemplo 16,0, por lo que ya sabrías que estas en la segunda pantalla de arriba)
Para hacer la prueba he creado una de las pantallas del juego del tutorial y guardado al formato nativo (.TMX, que no es mas que un fichero en formato XML) y exportado a un fichero en formato JSON. Esto es una muestra del archivo generado:
TMX (lo he recortado un poco, que son muchas lineas):
$this->bbcode_second_pass_code('', '
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="15" height="10" tilewidth="16" tileheight="16">
<tileset firstgid="1" name="mappy" tilewidth="16" tileheight="16">
<image source="mappy.bmp" width="256" height="16"/>
</tileset>
<layer name="Capa de Patrones 1" width="15" height="10">
<data>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="7"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="8"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="7"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
<tile gid="1"/>
...
</data>
</layer>
</map>
')
JSON:
$this->bbcode_second_pass_code('', '
{ "height":10,
"layers":[
{
"data":[8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 8, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
"height":10,
"name":"Capa de Patrones 1",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":15,
"x":0,
"y":0
}],
"orientation":"orthogonal",
"properties":
{
},
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"image":"mappy.bmp",
"imageheight":16,
"imagewidth":256,
"margin":0,
"name":"mappy",
"properties":
{
},
"spacing":0,
"tileheight":16,
"tilewidth":16
}],
"tilewidth":16,
"version":1,
"width":15
}
')
La parte importante en ambos casos esta dentro de data, que esta dentro de layer (Tiled permite múltiples capas)
Como se ve guarda un numero correspondiente al numero del tiled usado, siendo leído de izquierda a derecha y de arriba hacia abajo.
Yo creo que se puede usar Tiled en lugar de Mappy en Linux, y crear un conversor en Python que coja uno de los 2 formatos que comento (si bien prefiero JSON por que es mucho mas sencillo de usar en Python) y que crease directamente el archivo .h listo para ser usado.
¿Que opináis?