mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
10.82k stars 1.72k forks source link

Support RPG Maker map files #1889

Open bjorn opened 6 years ago

bjorn commented 6 years ago

This would be mainly to help people move away from RPG Maker, that have already done a lot of work on their maps. But if combined with saving to RPG Maker map format, it could also simply offer people an alternative for the built-in map editor.

Of course, there are many versions of RPG Maker and generally no documentation about their map formats is provided. But there's bound to be resources online written by people who have already tried to reverse-engineer the map format.

EJlol commented 6 years ago

RPG Maker XP uses the ruby marshal format. To further understand the format you will need to know 2 things, the ruby class definitions and which order the objects are saved. Both these things are easily accessible after purchasing RPG Maker XP, and it would not surprise me if someone documented it on the internet somewhere. If not, I may be able to document it for you. I believe VX and VX Ace kinda use the same method to save the mapfile, just with different class definitions. (though I do need to check that to be sure). I don't know much about MV though. They use javascript instead of ruby, so I assume they use a completely different save file.

Koopa1018 commented 6 years ago

How do you intend to handle autotiles? Doesn't seem like Tiled has quite the feature set to make that easy to handle, at least on the user side. It's almost got it with the Terrain brush, but that can't do single-tile spots of terrain. Granted, I haven't quite figured out Wang tiles yet, so that might have potential.

EDIT: Oops, completely forgot about automapping. That'll almost certainly do. (Would be nice to have it auto-generate the rulemaps for that, though.)

EJlol commented 6 years ago

Actually the autotiles that RPG Maker uses are not really suitable with Tiled without any tileset modifications. RPG Maker splits the tiles in several parts, and then combining them again to get the correct tile, whereas Tiled is unable to do that. To be able to do that you have to create a 16x16 grid on a 32x32 tileset, effectively quadrupling the size of the map... Where as the terrain, wang and automapping can be used in some ways for autotiling, they cannot split and combine tiles. For 2000/2003 and XP it is not a huge problem if autotiles aren't supported cause they aren't used a lot, however VX and VX Ace are mostly based on autotiles (again I don't know anything about MV). This may make it more difficult to support VX and VX Ace.

Koopa1018 commented 6 years ago

Indeed, RM does do that. A potential workaround that I can see (which has some serious flaws): have Tiled do the tileset modifications for you. For each autotile in a set, create an additional tileset image containing every useful combination of autotile parts, and then pull from that set when converting the map to .tmx. This would definitely keep the map size un-quadrupled, but you would have to store all those extra images created...which would be awkward and would probably offset the space saved by a smaller map file, especially for VX/A maps. That may be a necessary evil, but hey, not my place to say. ;) It would also be pretty awkward to design such a system to be able to save back to the RM map formats, I would guess.

In any case, I wouldn't call autotiles "not used a lot." Sure, certain sets in XP mostly work without, but leaving out autotiles would break (or rather, make very ugly) the following in XP and 2K/3 alike: paths, dirt patches, dark spots of grass, the void beyond the interiors of houses, dungeon hazards (ice, pits, lava, etc.), more than half of the average world map (mountains, forests, poison swamps, snow...), water (for world maps and close-up scenes both)....

On that note, water tiles in 2K/3. One center tile, two possible border sets (edges, inner and outer corners), a "deep water" set that has to fit inside the center tile (including corners, inner and outer), times three animation frames each (larger files, if the image-per-tileset method is used), and none of this in the conventional autotile format. If you guys decide to go ahead with RM2K/3 map importing but skip water tiles, I completely understand.

Regardless, if I hadn't already made the switch from RM to Tiled, and was still considering, discovering that an official map importer couldn't do autotiles would be a serious blow against the program in my mind.

bjorn commented 6 years ago

Probably 32x32 tile RPG Maker maps would import as 16x16 tile Tiled maps, so that the autotiles can be handled correctly. The support for autotiling compatible with RPG Maker could be provided with another tool (#1022).

Koopa1018 commented 6 years ago

Ah, okay. That works.

no-identd commented 5 years ago

See also #1421 & #1602

no-identd commented 4 years ago

1421 has now gotten closed as #2708 by @phlosioneer has landed. This still has a catch tho, to quote @bjorn:

I think the main catch right now is that automatic updating of the meta-tileset image will only be triggered when its map file is changed. Changes to any images or other meta-tilesets referenced by the map file will not trigger such an update.

(I don't think a follow up issue exists for this yet, but I assume one will soon arise.)

However, either way, how much closer does that bring this issue (#1889) to finding a resolution? 🤔

Koopa1018 commented 4 years ago

It seems that the EasyRPG Project already has an open-source tool to convert RM2K/3 maps to some sort of XML format. The code is under an MIT license, but may depend on an .INI-loading library that's under the New BSD license.

No idea if the code works at all, or if it's even worth considering as a potential source.

bjorn commented 4 years ago

@no-identd This issue is about saving and loading RPG Maker maps. As such it is pretty much unrelated to meta-tilesets so that feature gets us no closer to resolving this one.

@Koopa1018 Thanks for the reference to EasyRPG! I don't see the immediate relevance of the tool converting RPG Maker data files to/from XML, but their liblcf may definitely prove useful for loading RPG Maker 2000/2003 maps.

Koopa1018 commented 4 years ago

You're welcome. Honestly, I was expecting EasyRPG to have some custom map format, and that the map-loading code would be the only thing usable~

And regarding metatiles: they would improve the autotile experience, wouldn't they? Make it so that the user can map with native-resolution tiles, rather than half-resolution?

On Wed, Jan 29, 2020 at 1:12 AM Thorbjørn Lindeijer < notifications@github.com> wrote:

@no-identd https://github.com/no-identd This issue is about saving and loading RPG Maker maps. As such it is pretty much unrelated to meta-tilesets so that feature gets us no closer to resolving this one.

@Koopa1018 https://github.com/Koopa1018 Thanks for the reference to EasyRPG! I don't see the immediate relevance of the tool converting RPG Maker data files to/from XML, but their liblcf https://github.com/EasyRPG/liblcf may definitely prove useful for loading RPG Maker 2000/2003 maps.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bjorn/tiled/issues/1889?email_source=notifications&email_token=AHE3DRZAI73HVNE4MFRXYRDRAE25XA5CNFSM4ERY6E7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKGKJ2A#issuecomment-579642600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHE3DR7KKOL3UIM4I7JORYLRAE25XANCNFSM4ERY6E7A .

bjorn commented 4 years ago

And regarding metatiles: they would improve the autotile experience, wouldn't they? Make it so that the user can map with native-resolution tiles, rather than half-resolution?

I've commented about that here: https://github.com/bjorn/tiled/issues/1022#issuecomment-579632966