Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for autotile (RPG Maker format) #1022

Open
Frozenfire92 opened this issue Jul 12, 2015 · 15 comments
Open

Support for autotile (RPG Maker format) #1022

Frozenfire92 opened this issue Jul 12, 2015 · 15 comments
Labels

Comments

@Frozenfire92
Copy link

@Frozenfire92 Frozenfire92 commented Jul 12, 2015

Tiled is a great tool, especially for those who use Unity or game engines other than RPG maker. With the release of the newest humble bundle I foresee many people like myself wanting to use their new assets with Tiled (and eventually game engines other than RPG maker). It appears that their Autotile format is quite common and works well for compacting things, but makes it difficult to use in Tiled without an external tool.

I think it is within the scope of Tiled to support importing this format and then automatically slicing it up. While the terrain tool works well for some sprites, it doesn't seem to work with this format. There is an existing tool Remex but it only supports the 64x96 pixel image at a time. It would be better to automatically detect the size and split it accordingly (It appears 512x384 is standard)

@bjorn
Copy link
Member

@bjorn bjorn commented Jul 12, 2015

It would definitely be interesting to support this type of terrain, though I have not seen it used outside of RPG Maker so I kind of disagree with the format being "quite common". Outside of RPG Maker, the format used by Tiled is actually quite common. In any case the question comes up a lot, I guess mainly because of the vast library of tilesets available alongside (or made for use with) RPG Maker.

I'm not sure what's the best way to support it. There are some options:

  • Ship a tool like Remex with Tiled. However, it is plain annoying to have to preprocess your tilesets and it needlessly increases the texture size.
  • Build into Tiled some intelligence about how to cut and recombine these autotiles. Unfortunately, when we go this way then this kind of code would need to be added to all libraries and frameworks out there that support Tiled maps.
  • Half the tile size so that Tiled maps can stay simple and compatible with existing libraries and frameworks, but allow the tools to apply RPG Maker stile automapping. This increases the size of the layer data by four and puts the complexity of dealing with the halved tile size in the UI. I guess this last approach is the one used by RPG Maker itself, but I do not know its map format.

In any case, if you want to help me get around to a feature like this, please do consider supporting me on Patreon. The amount of time I have for Tiled directly depends on how many hours I can afford to drop from my job.

@Frozenfire92
Copy link
Author

@Frozenfire92 Frozenfire92 commented Jul 12, 2015

Thanks for the quick response,

Forgive me in being a bit uneducated in the commonality of this format. I think a lot of people like myself have bought the humble bundle and now have a ton of assets in a format for an engine they aren't interested in using.

Ship a tool like Remex with Tiled. However, it is plain annoying to have to preprocess your tilesets and it needlessly increases the texture size.

I think this is the best option. When creating a new tileset the dropdown for type could be Based on RPG Maker tileset which would then auto-detect and split into 64x96 sized chunks to be used by Remex (or the forked code integrated). I think this would make the process much smoother than it is now (cutting the image up and running remex on each individually before loading into tiled)

I thank you for your time you have invested in this project, it is very useful 😄 I will try and have a peek a the code for it and Remex over the next week and look into helping with this feature.

@lefticus
Copy link

@lefticus lefticus commented Jul 12, 2015

I bought the Game Maker Humble Bundle myself and feel compelled to point out that much (most?) of the material in it has a Copyright statement such as:

The graphics included in the Product (the "Pirate Ship Tile Pack") may be used with any of ENTERBRAIN's game development software (include all related titles of "RPG MAKER Series" or "our products") that retains the Company's rights. You cannot use the Resource Pack with other game engines/software. User can create, distribute, or sell their original game by using the Resource Pack only if they meet all the following conditions:

If I read that correctly that means we cannot legally use these tilesets with tools like "tiled" anyhow.

This is now the second Humble Bundle with RPG Maker in it that I've bought and I've seen many copyright licenses similar to this one.

@bjorn
Copy link
Member

@bjorn bjorn commented Jul 12, 2015

Right, that's the deal with RPG Maker's own tilesets unfortunately, so supporting them directly is pretty much only useful for 3rd party tilesets that were painted to be RPG Maker compatible.

@Frozenfire92
Copy link
Author

@Frozenfire92 Frozenfire92 commented Jul 12, 2015

I believe they addressed that here https://support.humblebundle.com/hc/en-us/articles/206156508 . I think limiting assets to a specific engine goes against what humble bundle is about anyhow, I believe all of the assets included in the humble bundle were as you said painted to be RPG maker compatible

@lefticus
Copy link

@lefticus lefticus commented Jul 13, 2015

@Frozenfire92 Ah, thank you. I was pretty confused by that.

@bjorn
Copy link
Member

@bjorn bjorn commented Jul 13, 2015

@Frozenfire92 That's great to know!

@bjorn bjorn added the feature label Aug 24, 2015
@fmoo
Copy link
Contributor

@fmoo fmoo commented Jun 7, 2016

Just wanted to add a link to some docs on how autotiles work in RMVXA.

Like Remex (which is basically abandoned these days), that link only covers the most popular "A2" format, so I'll to provide some extra details from my investigation on the other "A" formats.

  • The "A1" format has the same number of tiles as A2, except the first three (column-wise) blocks out of every four blocks of microtiles are animations of each other (e.g., water tiles).
  • The "A3" format uses squre blocks of 16 minitiles for every block instead of the (rectangular) 24 minitiles from A1/A2. As a result, A3 supports rendering of square/rectangular surfaces only. This is used primarily for things like walls, steeped roofs, bridges, etc.
  • The "A4" format is a hybrid of A2 and A3, where below every block of 24-minitile surfaces, there is a 16-minitile square block for walls themed according to the above roof/floor surface block.
  • "A5" appears to be a generic, non-minitile based tilesheet.
  • "B" and "C" are for objects, and are generic, non-minitile based tilesheets as well.
@kphillisjr
Copy link
Contributor

@kphillisjr kphillisjr commented Dec 27, 2016

I also think this is a good idea, and will greatly expand on what @fmoo stated. Also I will say that the following information can be used by anyone wishing to import tiles into this map editor.

Tile Types

Generic Terrain autotile

These are the easiest to work with, and cover most of the auto-tiles. For RPGMaker VX Ace optimized tilesets these are a 16 pixel by 16 pixel grid. I know my example is smaller than this. The Blue area represents the edge case with other tiles, and the white area is the terrain type for the Auto-Tile.
coreautotile

Animated Terrain autotile

These are terrain auto-Tiles from above where you have 3 frames of animation side by side.

Generic Wall Auto-Tile

This works exactly the same as Terrain auto-Tiles, but lacks the small inner corner case. In General these tiles do not have interaction with other tile-types.
wallautotile

WaterFall Auto-Tiles

This tile type is a set of two 32px by 32px animated tiles side by side where each row is a frame of animation. This means that this tile takes up the same amount of space on a sprite sheet as a generic terrain auto-tile. This can form an animated wall auto-tile when you have 3 or more that can be linked together. In general this is the type of tile where the users need to configure on a set-by-set basis because this can involve 3 types of terrain ( Waterfall, Water, and land type )

RPG Maker Tile Layers

Tile Layer A1

This is the most complex of the sprite sheets, but in general all of these have the similar layout as shown below:
autotilea

Tile Layer A1 - Area A - Water/Ocean

This is a Animated Terrain Auto-tile. In general it is used for water.

Tile Layer A1 - Area B - Deep Water/Ocean

This is a Animated Terrain Auto-tile. In general it is used for deeper water, and sometimes is placed within Area A.

Tile Layer A1 - Area C - More animated Water Tiles

More Animated Terrain Auto-Tiles. To my knowledge these have been used for Lava, Ice, and even more water animations.

Tile Layer A1 - Area D - Water Tile decoration

These are generally used for decoration of water tiles in an auto-terrain format.

Tile Layer A1 - Area E - More Water Decoration Tiles

These could be terrain auto-tiles or waterfall tiles. Either way this section requires a lot of user input, but in general these are always two 32px by 32px tiles side by side, and sometimes 3 of these can be combined to form a wall auto-tile.

Tile Layer A2

This is a straight forward import, this is a grid of 8 by 4 terrain auto-tiles.

Tile Layer A3 - Exterior wall/Ceiling

This is used for exterior Ceiling/walls, and is a 8 by 4 grid of wall auto-tiles. I believe the easiest solution for now is to define each wall auto-tile as a terrain.

Tile Layer A4 - Wall/Ceiling

This is is simply a row of 8 terrain auto-tiles used for Ceilings followed by a row of 8 wall auto-tiles. In general this forms a total of 48 tiles total.

Tile Layer A5 - Generic Tiles

These are 32px by 32px tiles.

Tile Layer B to E - Generic Tiles

These are Objects of varying size.

Possible issues.

Animated Terrains

I have not found any simple way to create animated terrains yet, and this is a required feature for this bug report.

Cross-File Terrains

I have found that occasionally the terrain auto-tiles have the center fill-tile found in the TileA5 file. To my knowledge there is no easy way to resolve this issue without editing the input files directly.

Terrain Fill

There is no easy way to fill using defined terrains. Instead you need to fill using tiles in the tile sheet directly.

Possible Solution

There is many solutions for this, but the easiest would be to use import wizard. The Wizard will need to have the user help guide the import since there is going to be a large set of tiles imported in one go. Most of the work would be terrain definition/names, and the occasional cross-file terrain fix.

@no-identd
Copy link

@no-identd no-identd commented Jan 24, 2019

Some semi-recent discussion of this issue on itch:

https://itch.io/post/487538

@no-identd
Copy link

@no-identd no-identd commented Jan 29, 2020

#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 (#1022) to finding a resolution? 🤔

@bjorn
Copy link
Member

@bjorn bjorn commented Jan 29, 2020

@no-identd Well, since RPG Maker performs its autotile magic by cutting the tiles into even smaller pieces and recombining them, this could now be done using a map and then that map can be used as the image of a tileset, where the terrain information for the terrain tool can then be set up.

Of course, that's a rather manual process that could also have been done using any image editing software. But a big time-saver is that the map of this tileset as well as the terrain information can be re-used with different RPG Maker tilesets, so it only needs to be set up once.

@bjorn
Copy link
Member

@bjorn bjorn commented Nov 24, 2020

Just a note to those wanting to use RPG Maker autotiles in Tiled: @fmoo wrote a tool for converting such tiles to a format that Tiled's Terrain tool can work with, available at https://fmoo.itch.io/autotile-packing-tools.

@devium
Copy link

@devium devium commented Mar 18, 2021

I wasn't happy with the tools available, so I wrote another conversion tool that pre-combines RPG Maker's smaller subtiles into all possible combinations:
https://github.com/devium/tiled-autotile
It's so far just a quick and dirty implementation, lacks documentation, config options, and only works with tileset layers in the specific A1 to A4 formats as explained by @kphillisjr above. But it gets the job done for now.

Basically, it turns this:
image
into this:
image
So it also makes single-tile "rivers" and paths available and arranges them a little neater.

@bjorn
Copy link
Member

@bjorn bjorn commented Mar 18, 2021

@devium That looks great! Since you're creating blobs, I wanted to try it out with the recently improved Terrain Brush, and it worked great:

image

Eventually it would still be nice if we could avoid the explicit expanding, though actually we would not get around to that without either implementing the sub-tile logic in Tiled as well as in the various game engines, or saving to a tile layer with smaller tiles (which depends on supporting tile layers with differently sized tiles in general).

Also unfortunately the single-tile is currently not covered by the Terrain Brush. Hopefully we can find a solution to this some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants