I am so happy someone commented here and I don't have to be quite so random when I say that I really wish I knew what a collision map was and what it was for....
I mean, if it isn't really for parallax mapping, then what is its advantage?
I've been having a hard time searching my way into understanding the basic idea here.
If you think of the parallax mapping process, where or how would you specify the passage settings?
Typically, most guides suggest developers to simply draw invisible tiles to mark the passable and impassable tiles, but this typically also does not provide you the fine-grained control that you need, for example if you had non-rectangular areas that players can walk through.
As Andar says, a collision map basically describes passage settings.
The passage settings are pixel perfect, meaning if you had a circular island, you could draw a circle in your collision map and now the player could perfectly move along the edge of the circle without the 32x32 grid constraint, provided that you can change your movement options.
Now, unlike what Andar says, this script is also useful if you're using 32x32 grids.
Because this script changes the way passage settings are checked, instead of checking whether a tile is passable or not,
it instead checks whether the specific tile is passable. Not only that, you can also
change a tile's passage settings on the fly, which I realized just now.
There are, of course, many ways to address specific tile passage settings (eg: invisible events, duplicate tiles, etc.), but given that you cannot stack events in the editor AND you don't have unlimited tileset space, you would probably want to see if there was a way to store this information somewhere else.
If you have seen Shaz's
passage map modding script, it does basically the same thing, except here you simply pull up your favorite image editor and then start marking which portions of the map can be passed and which ones cannot.
One limitation is that you can't really specify directional-based passage settings (eg: 4-dir), but that's because I haven't figured out what would be the best way to do it.
Such a use-case is rather simple to explain; using a Mack-style character graphic (two tiles high), in the inside of a building, the wall(s) in room(s) at the bottom of a map overlap possibly two floor spaces.
In my idea, the main thinking is to "cut out" the tiles where the third color overlaps, and let the player move into that space, then re-paste the cutout part over the top of it. A 32x64 character moving one space under the foreground wall top, will be bottom-half-hidden by what is behind, and top-half-showing in the next map tile above it.
Of course, I understand if we had a mapping system where layers were possible, this would be ever-so-much easier.
I can understand the use case.
Cutting out images and separating them onto a second sprite placed above the player seems easy enough. I don't know how you would actually "cut out" the tiles (while excluding any other sprites over it), but that's where other scripters come in.
The script was designed with boolean values in mind (black = passable, non-black = impassable).
An idea I had was to provide a configuration that looks like this
Color_Map = { [0, 0, 0] => 0, [255,0,0] => 1, [0,255,255] => 2, # ...}So you can basically choose which color will assign which value in the collision table, and then you can write your scripts accordingly.I'd either have to figure out how to pass that table to the dll function call, or do a second pass in Ruby after the image has been parsed...