Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE [ARCHIVED]

creating tileset definitions

faust.twi
Sunday, May 5, 2013 - 05:06

do they still should be created manually? i mean i have hundreds and maybe thouthands of tiles. should i really calculate and describe every single tile?..

  • Log in or register to post comments
ryan.dansie
joined 12 years 2 months ago
Sunday, May 5, 2013 - 06:22
ryan.dansie's picture

What tiles are you using? Are they available on oga?

As for the definition file, if the tiles are equal size and positioned in a uniform way, excel or open office could be utilised to quickly create hundreds or thousands of rows, incremented by a particular amount each time. It would not be so easy with different size tiles, unless they are arranged by size.

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Sunday, May 5, 2013 - 06:32

i use tilesets from the mana world and dew tilesets from here and deviantart.

most of them are 32x32 but from time to time size changes. i can avoid it by creating many layers but isn't there any automated way to export tiled maps to flare?

  • Log in or register to post comments
Clint Bellanger
joined 15 years 8 months ago
Sunday, May 5, 2013 - 08:17
Clint Bellanger's picture

Someone could write a utility that generates Flare tilesetdefs from a Tiled tmx file. But one doesn't exist yet.

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Friday, May 10, 2013 - 23:04

one fox gave my a semi automatic python script. so i use bash commandto get list of images' resolutions

identify * | cut -f 3 -d' '

and script for calculating

step = input('Step: ')
count = 1
y1=0

fo = open("./tilesetdef", "rw+");

while(1):
        x1 = 0
        x2 = step
        y2 = step
        imagex = input("Wight: ")
        imagey = input("Heght: ")
        dimx = imagex/step
        dimy = imagey/step
        i = 0
        j = 0
        while (j < dimy):
                while(i < dimx):
                        s = 'tile={},{},{},{},{},0,0'.format(count,x1,y1,step,step)
                        fo.write(s+'\n')
                        count+=1
                        i+=1
                        x1+=step
                x1=0
                x2=step
                y1+=step
                y2+=step
                j+=1
                i=0

 

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Saturday, May 11, 2013 - 05:37

well, export maps for flare is real hell. i made 1st map few weeks and looks like i will export it even longer.

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Saturday, May 11, 2013 - 11:40

convert *.png -append output.png

creating one tileset from many.

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Sunday, May 12, 2013 - 05:33
dorkster's picture

I've created a script to generate a tilesetdef and image from an existing Tiled map file:

https://github.com/dorkster/tilesetdef-generator/blob/master/tilesetdef-...

Run the script in the same directory as your map file and images with:

./tilesetdef-generator FILENAME.tmx


It doesn't pack tiles, so it's a bit inefficient in that regard. Nonetheless, it should still do the job.

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Wednesday, May 22, 2013 - 07:36

 File "script.py", line 6
    tileset_w = 0
            ^
IndentationError: expected an indented block

that's what i get whan try use it

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Wednesday, May 22, 2013 - 08:20
dorkster's picture

Strange, I'm not noticing any whitespace errors. If you copy/pasted from the Github page, try downloading the raw file instead: https://raw.github.com/dorkster/tilesetdef-generator/master/tilesetdef-g...

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Wednesday, May 22, 2013 - 09:29

thanks. now i got

 

Traceback (most recent call last):
  File "./tilesetdef-generator.py", line 99, in <module>
    main()
  File "./tilesetdef-generator.py", line 44, in main
    for prop in root.find('properties').findall('property'):
AttributeError: 'NoneType' object has no attribute 'findall'

 

btw, when i tried to make map manually i got black screen (except minimap that shows collision level correctly) though i'm sure i did all right. is there any limits to tilesets?

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Wednesday, May 22, 2013 - 09:37
dorkster's picture

It looks like you didn't add the tileset property to the Map Properties in Tiled. In Tiled go to Map -> Map Properties. Then create a new property with the name tileset and make the value the filename of the tilesetdef (ex: tileset_dungeon.txt).

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Wednesday, May 22, 2013 - 09:50

thanks a lot for help. but i don't understand tile x and y offset. i made it 0,0 because i thought that tiles don't have offset. they really should be 16,16?

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Wednesday, May 22, 2013 - 09:54
dorkster's picture

This page does a better job of explaining tile set definitions than I can: https://github.com/clintbellanger/flare-engine/wiki/Tile-Set-Definitions

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Wednesday, May 22, 2013 - 10:10

index is the unique (to this tile set) integer index for this tile. This index is used in map layers (background and object). Indexes from 1 through 1023 are allowed

 

so i can use only 1023 tiles? O_o_O

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Wednesday, May 22, 2013 - 10:22
dorkster's picture

Yes, but 1023 is more than enough for our uses. Each of Flare's tilesets contain less than 300 unique tiles. If 1023 isn't enough for you, you might be able split up your tilesets by theme/location (like we do with cave/dungeon/grasslands).

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Wednesday, May 22, 2013 - 11:36

flare game has just 3 tilesets while i have about 40-50 and common size of tileset is 512x512 that means 256 tiles 32x32

1st map - center of big city (173x144 tiles) contain few buildings, castle, district for wealth citizens, park, bazaar small arena.

it's impossible now :(

  • Log in or register to post comments
dorkster
joined 12 years 10 months ago
Thursday, May 23, 2013 - 21:54
dorkster's picture

Good news! That wiki page is apparently incorrect. The amount of tiles you can have is "unlimited" according to this commit: https://github.com/clintbellanger/flare-engine/commit/ac024815a714b67c8f...

  • Log in or register to post comments
ryan.dansie
joined 12 years 2 months ago
Friday, May 24, 2013 - 05:20
ryan.dansie's picture

There is a hard coded 256 value used in the pathfinding code (while calling the find neighbour function). This would cause a limit but it could be easily changed to use the map width and height instead of the hard coded values.

  • Log in or register to post comments
ryan.dansie
joined 12 years 2 months ago
Friday, May 24, 2013 - 05:21
ryan.dansie's picture

Sorry ignore my post. Just realised that you were not referring to map size.

  • Log in or register to post comments
faust.twi
joined 12 years 1 month ago
Friday, May 24, 2013 - 08:25

sweet. i still have engine to make game ^_^_^

  • Log in or register to post comments