Collision Maps
This script allows you to replace your tile passage settings with a collision map. Collision maps are optional; a map can use the default tile passage settings. However, you can only choose between one or the other.
The collision map is straightforward: it is an image the size of your map. Anywhere that is colored red is cannot be passed. The collision map can be created in any image editor of your choice.
This is a very simple collision map and only supports two passage settings: Passable, not passable.
Download
DLL Version: Script – Demo
Required: CollisionMaps.dll
Non-DLL version: Script
Doesn’t require DLL, is more compatible, but might be slower.
You might want to use the Collision Map Overlay to see the collision maps right on your screen
Installation
Place this below Materials and above Main.
Place CollisionMaps.dll inside your project’s System folder
Usage
Setting up Passage Settings
If you want a map to use a collision map, note-tag it with
<collision map>
It will automatically use the associated collision map.
Currently you are unable to specify or change which collision map is used.
Creating Collision Maps
To create your collision maps
- Take a mapshot of your map and open it in an image editor.
- Create a layer on top of your image, which will be your collision map
- Anywhere that is not passable will be red. Anywhere that is passable will be black.
- Save the collision map and place it in the Collision Maps folder with the appropriate filename
This tutorial describes how you can create collision maps using Graphics Gale.
Storing your Collision Maps
By default, the collision maps are stored in the following folder
Graphics/CollisionMaps
The name of each collision map matches the name of the map as follows
map001 map002
And so on. You can customize these in the configuration if needed.
Hello, I have a small issue with this… I made a collision map that’s a bit complex, and it uses precision of pixels (not 32), then I tried using it, but it doesn’t work at all, the character just keeps traspasing everywhere… Can you help me solving this?
Awesome script, is it compatible with any script that has pixel movement?
It is only with his own pixel movement script: https://himeworks.com/redirect.php?type=script&name=pixel_movement
Enjoyed reading through this, very good stuff, thankyou .
Hello, Hime! I’ve tried to contact you via email and Twitter but didn’t get any response yet so im trying it here. I have the same issue with the DLL of the CollisionMaps Script as other people here in the comments section. The script doesn’t work on Windows 10 Home Edition and maybe some others too. I’ve tried oj three different PC’s. On Windows 7 64bit it works (at least for me). Here is a screen of the error im getting:
On the rpgmakercentral forum there was the same DLL problem with another script which got solved by the member estriole by recompiling the DLL. Heres the Link: Thread Link
I also know someone who would like to fix that issue but he would need the DLL code.
So.. could you PLEASE help solve this either by trying it yourself or uploading the DLL code so others can try it? I really love this script and wouldn’t want to miss it in my game. Greetings, Marcel
…?
Does this work in conjunction with a Pixel Movement script, to make Pixel Passability?
Pixel movement scripts would need a patch to work with this script since it changes the way passage settings are stored. If you like the idea of using collision maps you might check out this script: http://forums.rpgmakerweb.com/index.php?/topic/34088-quasi-movement/
I tried using the link but it didn’t work. All the download links were down. Could you tell me how to patch it? So it could cooperate with it the script? Thanks!
unfortunately, Quasi removed his entire RMVXA script collection from the internet after deeming it obsolete and assuming all users migrated to RMVXA :/
So we lost what was probably the best and most featureful movement system on the stablest of RPG Makers, but oh bummer!
Have you tried to check if it’s in Archeia’s script repository?
Hi,
Found your script amazing. (exactly what i looked for) After a little adaptation, it works fine with RM-VX.
Just a question, in the way your code is done, is it possible to add a third color to the collision map so that color means that the last sprite on the pile at this coordinates is a star tile (the player pass under the sprite).
The way it is currently setup, it basically hardcodes it so that black is 0, and non-black is 1. It would be better if users can specify which colors will be assigned what number. I don't know how you would specify that the player will pass under a sprite though.
Well, it's not a problem, your code is still very useful. By adding some parts to it i was able to use a second map for superposition. (It's under testing with RM VX)
here is the rought code
https://github.com/Hime-Works/Requests/issues/209
I've moved the code to an external location because it really stretches the comments. Maybe you want to use a pastebin or something else?
Thanks, after I posted, lokked for the edit button for a long time ^^.
I don't know what is a pastebin… All i know is that, i want to control the blit order of sprites with an outside map.
I think using a separate map is a good option. I don't know whether there is a way to control whether a sprite should be drawn over a particular map tile, or under it, with only a single map.
Another question : In your .dll, the algorithm needs to detect if color or black for each 32×32 pixcel square.
Is it possible to do this test on the pixcel in the middle of the square?
It is not obvious from the documentation but in the configuration you will see a tile height and tile width option. The table already stores a pixel representation of the bitmap. It's just the width and height that controls how the lookups are made.
So… if I put
Tile_Width =5
Tile_Height = 5
the dll wil check a 5×5 pix square every 32 pix or every 5 pix?
That depends on how your map grid is set up, which by default is 32×32. So if you have a script that makes you move 5 pixels per step, then a 5×5 setup will mean the collision lookups will check the appropriate coords in the table.
Hey Hime I’m Having trouble with collision maps its tell me runtime error load library : System/CollisionMap.dll on line 103 could u help me thanks.
Did you download the dll and put it in that folder?
Hi Hime! I’m having the same problem! And I’m sure the file is in the right folder! Any suggestion? Thanks
There are two System folders: Graphics/System and one in the project’s root folder. I can’t think of any reasons why it would have an error trying to load the library (unless it actually can’t load the library, instead of not being able to find it)
Hi Hime, thanks for the reply. 🙂
Actually I’m pretty sure that is the right System folder (not the one in Graphics). It’s the one where RGSS301.dll is. And if i delete RGSS301.dll and start the game it crashes complaining about its absence, so I’m sure that’s my project’s folder.
I was thinking of a problem in loading the library too. Some compatibility issue with the OS? I’m running on Win7 Ultimate x64, emulated on VMWare (I’m a Mac user).
Hmm I’m not sure what the problem could be since I’ve never tried running RM in a VM. Maybe you can try posting it in one of the forums and see if someone else might have an idea what’s going on.
Hmmm. I’ve been thinking about it a fair bit and I think I’ll figure it our for myself.
I’m curious as to the actual function of the .dll is in this script?
Load the image and populate a table with 1 or 0 depending on whether it is passable or not..
I’m thinking of doing something more complicated along these lines. Could you remake the .dll to instead give the rgb results at the pixel? I intend to use that value to allow you to also reference each individual value for different reasons. The idea was red would be passable(255)/not passable(0), green would be regions(intervals of 4) and blue would be custom (ie. void or cliff from victor pixel movement v1.3 or to activate a switch or event remotely).
I don’t know how to work with most of the ruby data structures so I only use tables. I can put the RGBA values in a table.
Hi Tsukihime, great script as always.
i wanna ask u about these collision map, it worked perfectly, but the collision placement seems miss a bit, sorry if i cant explain it better. when i place a box and add a collision map, the collision is missplaced, can u help me?
You will need to provide more information. Use pictures.
i’ve sent u an email with attachment, mind for checking ur email please 😉
This script only provides the collision settings for the map. You need a different script that will actually do proper pixel movement that checks the pixel collisions.
Well, no pressure. Here and there I try getting into coding, and to me it seems super hard, it always goes over my head. So, thanks for your info.
I heard that this game manage to implement pixel collision, but they haven’t responded to me yet, And they give no clue as to how to they accomplished it. http://rpgmaker.net/games/3082/images/38623/
I could probably do it if I get around to doing pixel movement. There are some things I don’t like about existing implementations.
Hmm. Maybe you can help then. I’m using a parallax map, and the only way to give my player places to walk, is to lay down some transparent 32×32 tiles. I do have a pixel movment script… but…. is there another way to create places for my player to walk? I’m new to this still.
I’m using the Free Movement Area 91 script.
The problem is your pixel movement script likely does not know about the collision maps and doesn’t use it.
Do you know of a pixel movement script that would work with your collision script?
No, as most of the movement scripts were written months ago. I’m not sure if anyone has written any movement scripts recently that would use pixel collisions.
Hmm I must be doing something wrong. I’m trying to use this with a parallax map i created. Do I have to name my custom map map001 as well as the collision map?
The collision map should have the same name as your map name (eg: map001.png will be assigned to map 1). Note that this script doesn’t provide any pixel checking, so you will need another script to actually use pixel collisions. The original purpose of this script was just so you don’t need to rely on tiles for the collisions.
Oh I see. So it will only be able to detect 32×32 squares?
That depends on your movement script. This script provides pixel-precise collision settings.
Do I place the collisoin map .dll in my Windows/System folder? cant find a “system folder” in rpg maker’s folder.
In your game project’s System folder.
Ah thanks for the reply.