[Request] 4-direction tile passage editor

I am looking for a tool that allows you to


1. load an image of a map


2. Set the grid size (eg: 32x32)


3. Set the passage settings for each tile


4. Export that data somehow


This tool will be used to define tile passage settings for each tile on the map for RM.


The reason for using such a tool is to visually set up passage settings rather than type things in notepad or something.


8-dir support would be cool as well.
Very nice idea! If I had time I'd work on this with you, but it'd be a script to run within RM, not an external tool.


How do you plan to override the passage settings and save the data, without having it reset every time you open the map in the editor? Saving it to a separate file?


Is it JUST a case of overriding the flags on the map so they're set up manually rather than being taken from the tileset? Or is there more to it? Did you find out how to modify the map drawing functions in the Tilemap class, or is that not necessary (* for over player still behaves the same as it currently does)?
Yes, the passage settings will be stored externally.


Yes, the passage flags will be set up manually for each and every tile, so that you have finer control over your passages, if you choose to use a passage map. Plus you don't need to duplicate tiles just because you want two of the same tile to have different passage settings (cause there is a serious lack of tileset space for Ace and VX)


The logic for the passage checks are all available in the ruby scripts, and conveniently all in one method defined in Game_Map, so it would be easy to change it. In fact, that is what I did for my collision maps script.


The * tiles will behave as usual, and in fact you can have the * tile effect along with 4-dir passage settings.
So you want this to work with VX as well?


My big question is ... why aren't YOU writing this script yourself? Is it that you don't want it to be done as a script, that it's out of your comfort zone, or are you just flat out with other things?


Would you WANT it to be done in some external tool, or are you happy (or would you prefer) if it's a development-only script you can use right in the engine?


You've no idea how much this is tempting me!
What I'm looking for is a GUI tool; a proper way to set up tile info for each and every tile on your map, WITHOUT using hacks like terrain tags or region ID's.


It could be something really simple (in design) like a grid with 4 arrows and you just click on the arrows to toggle them on or off.


There are scripts for using collision maps and height maps to create more advanced maps; if these were to be done with terrain tags or region ID's, you're already out of development tools.


What's important is to be able to import and export data so users don't need to deal with text (or binary) files themselves. Separate scripts would be written for each engine to work with the data file.


As for why I'm not doing it myself, well, I don't have much motivation to write such a GUI tool right now and am not sure how to do it either lol
So would something like this be suitable?


Script 1: development tool only for setting passabilities


- add script to game


- play game


- hit hotkey to go into 'set passability' mode


- map passabilities shown, which you can update


- export to file


Script 2: included with released game


- on map load, checks to see if passabilities have been overridden for this map


- if so, load overridden passabilities


- if not, use default passability processing


My question about why don't you do it yourself, is because I don't think I could come up with anything better than you could on your own.
Script 1: development tool only for setting passabilities


- add script to game


- play game


- hit hotkey to go into 'set passability' mode


- map passabilities shown, which you can update


- export to file


Script 2: included with released game


- on map load, checks to see if passabilities have been overridden for this map


- if so, load overridden passabilities


- if not, use default passability processing
That's a good idea.


That would be the general process I will be using for doing passage checks.


If you can create an in-game editor that allows users to easily change passage settings, that would be a good start.


I never really thought about how I might do it using an RM game as a passage editor.


Once we have the whole thing working, people might come across things that they believe can be improved and then go about trying to come up with a better solution or to improve the existing solution.


My reason for using an external tool is so that you just need to create the tool once and it will be usable for all 3 engines (since all you need is an image of your map for the most part). The second script that actually checks passage settings will need to be customized for each engine but that's the easy part.
Alright - I'll see what I can do with that then. Do you have a timeframe?
I'd like to implement it before the end of the month while it's on my mind.


If you have some ideas on how the exported data will look I can use that as dummy data to demonstrate how the script works while the editor is still a WIP.


I haven't come up with any ideas how to structure this information, but it doesn't need to be generic or anything. The format will be specifically for 4-dir passage settings, and then after seeing how it looks we can probably move on to 8-dir, and then generalize it to "the general format for storing individual tile info"
Unless you see a reason not to, I would put it into an .rvdata2 file (probably Passages.rvdata2) as a hash with the map id as the key, and a 2d table as the data, sized by map width x height, where each cell is in a similar format to the tileset flags data (after I double check to make sure that IS where the passabilities are held).


The file extension will obviously be different for VX and XP.
Let's go with that. Sounds straightforward enough and we're pretty much just copying code when doing the passage settings.


After a working tool/script is available, we can worry about adding support for different types of export formats (because not every language can handle ruby's serialization very easily)
What uses are you planning to have for this? I was just assuming it'd be used in the maker itself.
The problem with using just rvdata2 is that it is basically ruby's own serialization format. And it's binary.


This means that if I wanted to write an application in, say, Java, I would need to then figure out how I'm going to export the passage settings to ruby's format. It isn't an issue if all of my development was done in Ruby, but for a lot of people that likely isn't the case.


If you had a text file or something that wasn't unique to ruby, it would be much easier for other languages to support.
But why would you want other languages to support it? What would you do with it that you'd need to use it outside of RM? I'd assumed the requirement was to allow you to individually edit tile passages on the map, so when you're playing the game it'll use those tile passage settings rather than the default ones from the tileset. I just don't see what the requirement is to edit it outside of RM (which is why I'm saving it in a format that's easier/faster for RM to use).


If you wanted to edit it outside of RM for some reason, you'd need not only an exporter, but an importer as well.
But why would you want other languages to support it? What would you do with it that you'd need to use it outside of RM?
Because there are many developers out there that are probably more experienced with other languages for certain types of applications. If I prefer to write java applications, I might write the passage map editor in Java rather than Ruby. This allows non-ruby developers to contribute tools.

For example, PK8's icon index utility is not written in RM, or ruby, but it achieves it purpose. I don't know what anyone would do with it outside of RM, but the format used (eg: an image) is not specific to RM.

This is all within the context of exporters.

I could say let's all use JSON to store passage settings like this

{ "1,1": { "up": true, "left": false, "right": false, "down": false }, "1,2": { "up": true, "left": false, "right": false, "down": true }}Which is very verbose of course, but is pretty easy to parse and you could even do it in notepad.There should be no requirement that RM (or even ruby) must be used to create this file; it may be easier to do it in RM for some and not for others.

And for prototyping purposes, it would be sufficient to just store it as tables in a hash in a file called "passages.rvdata2".

If you wanted to edit it outside of RM for some reason, you'd need not only an exporter, but an importer as well.
You would need an importer for the passages.rvdata2 file as well. Storing it in ruby's Marshal format just makes it much easier to write the importer because all you need is to Marshal.load and you've imported it (whereas storing it in JSON or some other format would require you to build the table during the import step)
Is this okay to be closed now, Hime?
Should be fine since you have developed the requested tool.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/request-4-direction-tile-passage-editor.17949/