Game Development Community

Can TGB do this? Multiple collision and nearest neighbor

by Caleb Child · in Torque Game Builder · 12/05/2012 (5:16 pm) · 3 replies

I'm considering switching to Torque for a project I have in mind, but there are a couple things I'd want to make sure it is capable of.

One, is it possible to have different layers of collision? Can I have a level set up with different tilemaps on different layers, and let those layers have different collisions, independent from each other?

Two, is it possible to have my textures use nearest-neighbor filtering? Either with the whole screen or as individual textures/sprites. The last time I was looking at TGB, I recall clearly seeing that it smoothed the textures, and I vaguely recall having options for how things are rendered, but I can neither recall if it was an option per-object or for the whole scene, and I do not recall if it simply provided different smoothing options or if it also enabled a nearest filter.

I also can't find the documentation I recall reading; it was very informative and explained how the textures were saved and the difference between a texel and a pixel. I bet I could find a lot of answers to my questions if I could find it.

#1
12/05/2012 (10:37 pm)
1 - yes. You have 32 collision layers available with T2D's collision system. There is a little more information at http://docs.garagegames.com/tgb/official/ under Game Builder->Collision Editor.

2 - Sorry, you lost me there. You can render images a few different ways in T2D, tile maps and sprites being the two that leap to mind first. The document I believe you are referring to is at http://docs.garagegames.com/tgb/official/ in Reference->Reference Overview->Image Maps

Hope that's helpful!
#2
12/05/2012 (10:46 pm)
From the reference page you directed me to:

Quote:
There are two types of filter-modes that you can use, these are:

NONE - No Image Filtering.
SMOOTH - Bilinear Filtering.

It is beyond the scope of this document to detail GPU filtering modes so we'll simply focus on the result of selecting a specific filtering mode.

In "none" mode, the GPU does no filtering. The effects of this don't become apparent if each pixel from your frame gets rendered to a pixel on the screen. You will start seeing this if you either enlarge/shrink the image on the screen; you'll get an effect called pixilation as shown below:

The "None" image filtering is also known as nearest-neighbor. It gets that name because it calculates the pixel's color by finding the closest color, the nearest neighbor. (As opposed to the smooth filter, probobly bilinear, which takes a look at all the texels around it and says "It's probobly supposed to be this color.")

So, yes, it looks like the engine does support what I need. Thank you.
#3
12/06/2012 (5:41 am)
Glad to help, and thanks for the info - The last time I actually looked at that page was when I was trying to get the formatting straightened out and I wasn't really reading it, heh, just remembered the general content. And it looks like formatting issues have crept back in as well. Darn.