Game Development Community

Tile layer file format? [closed]

by Max Kielland · in Torque Game Builder · 01/17/2013 (8:36 am) · 5 replies

Where is the documentation on the Tile layer (.lyr) file format?

The tile editor in TGB is way to simple and I'm considering to write my own tile editor for two reasons; to speed up the map level creations and to let players create their own maps.

But in order to do that I need the .lyr file format.

#1
01/17/2013 (9:34 am)
There is no documentation on it that I'm aware of - it's an internal binary format, but once it is in memory all of that information is available to script. Or you could look at the functions that read and write the .lyr data for information on it.
#2
01/17/2013 (9:39 am)
After reading your solution for the tile layer visibility it occurred to me that you could add support for user maps by writing a few script functions to read text data and then using that data to set the tile properties using something similar to your:

// Populate layer with tiles  
  for(%y=0; %y<%layer.getTileCountY(); %y++) {  
    for(%x=0; %x<%layer.getTileCountX(); %x++) {  
      %layer.setStaticTile(%x SPC %y, "TileMapImageMap",getRandom(0,9));  
    }  
  }
Where you specify a specific format for each tile and then just read the file in. If you've ever seen the XNA platformer game kit you know what I mean.
#3
01/17/2013 (9:39 am)
Not even an internal document?
I'm sure that you guys must have documented the file formats...

I was thinking of to writing it in C++ Builder because it goes much faster for me than doing it with Torque.

But maybe Torque would be an easier way to go. It's not like writing a complete game :P

Thanks...
#4
01/17/2013 (9:48 am)
Ohh, I saw your second post just now...

Yes, it occurred to me too when I wrote the code. Maybe I will write an external editor and use an "internal" format to populate the Tile layer, as you also suggested.

Yep, that sounds like a good compromise... and I can use the managed datablocks.cs to keep things in synch.
#5
01/17/2013 (11:18 am)
You have no idea how I wish we had some sort of "internal" docs for some of this stuff. The source is the documentation for far too many things - works for me, usually, but it's pretty tough on most people.