-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Reimplement ability to flip/rotate/modulate individual tiles in a TileMap (as opposed to creating flipped/rotated/modulated tiles in the TileSet) #3967
Comments
I don't think bringing them back is worth the trouble. Also, remember that this feature only works for square tilemaps, and that the new TileMap features a lot more different shapes now. So I am not in favor of implementing a workaround specific to this situation. Edit: BTW, that does not mean that the alternative system is perfect right now. I agree on the fact it's hard to be organized with them. I am not against some changes there that would simplify the workflow for flipped or rotated tiles. |
I don't think "most of the time" is a fair characterization. There are diverse workflows for working with art assets. If your tileset only contains right-facing walls and corners, and you flip them to get the the rest, you've just halved your total texture count. And if you do make two corners, you can flip both versions to get that diversity on either side. What works for objects does not work for walls, and it's certainly not a "place once" fix. The tileset I've been working with is "all wall," because my objects are composed of tiles smaller than themselves so that they can be mixed and matched. This is more like how many SNES games like Chrono Trigger handle tesselation (trees in particular)--which is quite different from the Link's Awakening style tiles I noticed from most of the demos. Flips would be useful at least for all rectangular sets. Horizontal flips at least would be useful for isometric sets. I don't think it make sense to deny functionality simply because not every use case will require it. Besides, other users of more exotic tiles might surprise you with their creative uses of this feature if it's available. If there's something I'm missing in terms of the functionality that will be offered through patterns, please do explain. It's not inconceivable that the alternatives system could work for the use case I'm describing. The best case I can imagine is selecting my entire tilemap, hitting "make alternative," selecting h-flip, and getting an identically laid out copy of the entire tilemap, flipped. This would work, but it would be extremely inelegant for half the tiles used for related objects to appear on opposite sides of the tile palette. And then, if I needed v-flip on top of that, I'd be doubling everything again. Now that I think about it, the same could hold true for modulate, too, but my actual plan there is to use palette swapping by drawing custom values on a separate layer, which I don't ever expect editor support for. Regardless, IMHO, most of what appears in the alternatives system belongs in the TileMaps, not TileSets. |
I'm not sure about implementing them exactly as they were, but I do have to agree that these features are pretty standard for a tile-based... well, anything, and that they will be missed by users making use of them, forcing them to spend plenty of time implementing an alternative that can be considered a mere downgrade for this purpose. Perhaps, there could a way to set them up in the TileSet without wasting texture space, unlike autotiles, and have them easily accessible through similar shortcuts as the 3.x's existing buttons on the TileMap editor. |
Its nice the new system integrates tilesets and tilemaps closely, but it confuses their roles. Tilesets represent the semantics of what a tile is while tilemaps control where and how they're placed and rendered. Flips, transposition, modulation, and z-index concern the latter. Moving the alternatives properties to tilemaps will give the user finer control without needlessly creating new objects. I've been thinking I'd like to have very gradual, subtle, color shifts in all my tilemaps using modulate, for instance. That would require hundreds, even thousands of tilemap alternatives - or it could just be painting onto the tilemap. I strongly recommend that this be fixed before the 4.0 release. The new tilemaps are an important breaking change so its important that their design be good. |
How to flip the pattern? My pattern consists of multiple tiles, I can't flip my pattern by alternative tile. I don't want to combine several tiles into one tile, and then create an alternative tile and flip it. |
You cannot, in Godot 4.0 as of yet. This is in the milestone, so it will have to be added at some point down the line. |
Are there any updates for this topic? |
There is no ETA for features being completed, as contributors are working on a best-effort basis. |
It would be important to have this feature ON, even if it wanst working 100%. |
I'm curious, is this feature going to be implemented? Cause I'd love to have it too. |
Judging by the overwhelmingly positive feedback, yes, and absolutely it should. Not now, perhaps a later 4.x version. No one that I've seen came up with an actual implementation yet, so it may only be 4.1 is we're being cautiously optimistic, or if it's deemed to be a quite urgent feature to have. |
Alright, I guess I need to write a follow up to my previous message. Sorry if it sounded dismissive of the problem, but that was not my intention. It is indeed clear now, considering on my message downvotes, that a lot of people relied on that feature and that it should be brought back one way or another ASAP. Sadly it's now a bit late for 4.0, but I think it should be easy to bring it back for 4.1. |
The workflow for flipping and rotating tiles could perhaps be implemented by automatically selecting or creating alternative tiles. Consider the following workflow:
The same would be done with the other keyboard shortcuts, Z, A and S. This way the users would paint flipped and rotated tiles the same way they did in 3.X, but behind the curtains alternative tiles would be used as it is currently designed. The same logic would also work for patterns. Suppose the user selects a pattern, whatever it's shape. If the user tries to flip the entire pattern, then the editor flips each tile of the pattern and rearrange the tiles inside the pattern. For example, while flipping horizontally, every tile would be flipped horizontally and each tile in the row would be reversed: the first in the row would become the last, the second would become the second last, and so on and so forth. |
I would like to add to the proposal the possibility of flipping tiles via code. This is pretty important for procgen. However, it is unclear to me if it should be discussed here or on an issue. |
i recreated the functionality with my Tiled Importer Plugin for Godot 4 with creating alternative tiles for each tile in the tileset and using the alternatives in the imported maps. |
I would remove the 1000x tiles on screen, and alternate tiles, and let user deal with the problem. Iam sure a solution will came up, something like a viewPort that only draws the size of the camera, or something else. There is a possibility that duplicating the entire tile sheet into 3 or 4 will make things worse. I have a 1 sec delay when changing between levels ( I think its a for loop somewere, might need to pre-load the level scenes ) Or even simplier solution make 2 tile map editors, 1 with alternate tiles, and another 1 without alternated tiles. |
As someone who really only writes code, I am very much struggling with importing my project to godot 4 because of this. I relied on tile rotating and flipping for my tilemap, and now that that is no longer available I need to figure out how to flip selections in paint.net, which apparently isnt really possible :/ |
Tiled 1.10 RC https://github.com/mapeditor/tiled/releases/tag/v1.9.91 Added a godot 4 export plugin It handles flipped and rotated tiles by creating 7 variants for each tile in the tileset (3 rotations for the default non flipped tile + 1 horizontally flipped tile + 3 rotations for the horizontally flipped tile). |
I'm the author of the Tiled exporter. Note that you need to turn on exportAlternates to get the flipping/rotating feature, because I wasn't comfortable with octupling the tileset size by default. I imagine it doesn't have much impact on performance, but actually using the generated TileSet in Godot is very unwieldy with so many alternates. If there was a way to flip/rotate tiles in the TileMap instead of the TileSet, I would definitely have used that option instead. Or perhaps a way to make an alternate class, which applies the same transformation to the whole sheet, and shows the whole sheet transformed. |
There's PR that implements this feature: godotengine/godot#80144 Note that not all default shortcuts will work until godotengine/godot#80221 is fixed, so you need to rebind them. |
Thanks for testing @jonSP12!
I already mentioned that this shortcut won't work. It conflicts with another shortcut in 2D editor; for now you need to bind another key as a workaround.
Fixed. Also improved how patterns are transformed in general, so every case should be supported now. godot.windows.editor.dev.x86_64_Sd06YCEusO.mp4
I exposed the transform bits in TileSetAtlasSource and documented some example how they can be used. Is that enough? Other points are unrelated. I'll link an updated build once it's finished. EDIT: |
Is it possible to flip tiles via gdscript? |
Yes. You can achieve that by manipulating their alternative tile ID, as described in the example I linked. |
Thanks! I'll check it out very soon. |
[edit ] - pattern in select ctrl + c , ctrl + v is missing flip/rotate tools I tested the animation with flip/rotation and it works. Problem was... The Tile animation doesnt make much sense, the person cant use the tiles it wants..?! If i want to animate a tile i have to delete the other tiles to use them has frames. ( This way i cant use them anymore ) Cant an array be used in the editor, and loop that array to animated ? tilePost.mp4*******Label
*TileMap
|
Describe the project you are working on
A top-down procedurally generated rogue-like.
Describe the problem or limitation you are having in your project
Godot 4.0 Tilemaps no longer support the flipping and transposition of individual tiles. This feature is useful for reusing assets, preventing resource bloat, and synchronizing symmetrical features. The project I'm attempting to test-port from 3.0 to 4.0 relies heavily on this functionality. Because there's no support for this feature, and my maps are built for it, 4.0 isn't currently a viable option for my existing projects.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The way Godot 3.0 handled flipping and rotation was excellent. I suggest adding that part back into 4.0, which is otherwise superior.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I recommend reinstituting the previously existing buttons back on the icon bar of the tilemap editor. The icons for rotate left, rotate right, flip horizontally, flip vertically, and clear transforms would appear next to the other buttons, or become accessible after clicking on a "transform" button.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This is an editor issue, not a coding issue.
As for work-arounds, not everyone will need this, but for those of us who do, the alternatives are rather painful. It is possible to make an "alternate tile" with these transforms set. This should theoretically work alright for a small number of individual tiles.
Attempting this for an entire tileset, the result is an unusable mess, especially as there is no way to cleanly match an alternate to its corresponding primary tile. It is far less painful being able to make these transformations as needed on the fly in tilemaps rather than in tilesets. You can't necessarily plan in advance what might need to be flipped, it's impractical to flip everything, and in general, the current layout of the alternatives panel leads to bad organization even if you were to try planning this out. Likewise, with the current alternative tiles panel, you lose the functionality to paint "patches" of tiles because they appear out of their intended ordering.
The thought also occurred to me of making a separate layer and using costum dummy tiles to mark where I'd like transformations, but these changes would be non-obvious in the editor, which is required for design best practices.
Is there a reason why this should be core and not an add-on in the asset library?
Mostly, because this is re-implementing a 3.0 feature that got lost in the shuffle. In my opinion, an add-on should not be necessary for porting projects to 4.0.
The text was updated successfully, but these errors were encountered: