Tilelayers default to wrong size
by Tom Spilman · in Torque Game Builder · 06/07/2006 (2:19 am) · 7 replies
When you drag in a tile layer into the LevelBuilder it comes in almost at 1/4 scale:

You can see a tile layer here along with a 128x128 sprite and tile. Everything needs to default to their relative scales.

You can see a tile layer here along with a 128x128 sprite and tile. Everything needs to default to their relative scales.
About the author
Tom is a programmer and co-owner of Sickhead Games, LLC.
#2
Our work flow is to build your tile map then bring the layers into level builder to decorate out with sprites. So it's critical that by default tile layers and sprites are the correct relative size to each other.
When i create a new image map in LevelBuilder from the png with the tiles in it, it asks for the size of the cells... 128 in this case... but it never asks for the final sprite size. It does some sort of behind the scenes calculation which seems to be related to pixel size. Some testing shows that it seems to be something like..
This makes 128 pixel tiles come out as 16 TGB units. Is this constant of '8' exposed to the user anywhere?
The tile map builder seems to always default to 4x4 for tile sizes. Now armed with the image map builder constant it, i know that i need to set the tile size to 16x16. Once i do this the tile layers do appear in the LevelBuilder as the correct size.
Hopefully all this will be clearer with the upcoming new tile map tools.
06/07/2006 (7:09 am)
Ok... so i looked closer at this issue and it's just one of knowing the magic going on behind the scenes.Our work flow is to build your tile map then bring the layers into level builder to decorate out with sprites. So it's critical that by default tile layers and sprites are the correct relative size to each other.
When i create a new image map in LevelBuilder from the png with the tiles in it, it asks for the size of the cells... 128 in this case... but it never asks for the final sprite size. It does some sort of behind the scenes calculation which seems to be related to pixel size. Some testing shows that it seems to be something like..
pixel size / 8 = TGB Units
This makes 128 pixel tiles come out as 16 TGB units. Is this constant of '8' exposed to the user anywhere?
The tile map builder seems to always default to 4x4 for tile sizes. Now armed with the image map builder constant it, i know that i need to set the tile size to 16x16. Once i do this the tile layers do appear in the LevelBuilder as the correct size.
Hopefully all this will be clearer with the upcoming new tile map tools.
#3
I guess you just mean the default camera size. The camera by default is set to show 100x75 world units. With your camera window set 800x600 pixels. I mostly decide on a fixed screen resolution and then set the camera size to this resolution so that I have 1 pixel = 1 TGB unit.
06/07/2006 (8:09 am)
Quote:This makes 128 pixel tiles come out as 16 TGB units. Is this constant of '8' exposed to the user anywhere?
I guess you just mean the default camera size. The camera by default is set to show 100x75 world units. With your camera window set 800x600 pixels. I mostly decide on a fixed screen resolution and then set the camera size to this resolution so that I have 1 pixel = 1 TGB unit.
#4
You seem to say that the default size of a frame in TGB units when dropped into the scene depends on the camera settings? Or am i interpreting this wrong?
This is like the size of my DIF going from 10 meters to 100 meters based on my 3d viewport settings!
Oh... i just tested this and it's exactly how you say. Wow... this seems overly complicated to me.

That is the same sprite drag'n'dropped on to the scene under 3 different camera sizes.
Coming from someone working on a TGB content pack... this may cause users confusion and extra difficulty using content.
How it is now means that you should never change your camera settings once you start building a level (maybe even your whole game). Else you'll be resizing stuff manually to get it back into the same size as the rest of the content you've already added to your level.
IMO when you add a sprite or any content to the scene it's TGB units should not be influence by camera size.
06/07/2006 (9:52 am)
Ok... now i'm confused.You seem to say that the default size of a frame in TGB units when dropped into the scene depends on the camera settings? Or am i interpreting this wrong?
This is like the size of my DIF going from 10 meters to 100 meters based on my 3d viewport settings!
Oh... i just tested this and it's exactly how you say. Wow... this seems overly complicated to me.

That is the same sprite drag'n'dropped on to the scene under 3 different camera sizes.
Coming from someone working on a TGB content pack... this may cause users confusion and extra difficulty using content.
How it is now means that you should never change your camera settings once you start building a level (maybe even your whole game). Else you'll be resizing stuff manually to get it back into the same size as the rest of the content you've already added to your level.
IMO when you add a sprite or any content to the scene it's TGB units should not be influence by camera size.
#5
06/07/2006 (9:57 am)
If you change your camera size just be sure to change your design resolution size to scale properly with it... the way it is set up with design resolution is fairly ideal (in fact Mark M. in the office basicaly said that this was a must for the tool a couple months back and I beleive he was correct).
#6
06/07/2006 (10:02 am)
That's what datablocks are good for. If you want your sprites to always have the same size (in TGB units) create a datablock for them.
#7
Will ponder this all further... thanks for the posts Michael and Matt! :)
06/07/2006 (10:32 am)
Hum... talked to Matt a bit more and sort of understand the reasoning to have a combination of camera setting and design resolution control the size of art being added to the scene, but it still seems like it's two variables when there should be one.Will ponder this all further... thanks for the posts Michael and Matt! :)
Torque Owner Michael Woerister