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

Add custom cell placement/axes for TileSet #11498

Open
webcatzz opened this issue Jan 5, 2025 · 1 comment
Open

Add custom cell placement/axes for TileSet #11498

webcatzz opened this issue Jan 5, 2025 · 1 comment
Labels

Comments

@webcatzz
Copy link

webcatzz commented Jan 5, 2025

Describe the project you are working on

an isometric tactics game. @

Describe the problem or limitation you are having in your project

i'm trying to implement a 24x17 tile tileset like this:
Image
currently, godot tilemaps doesn't allow me to. my tiles are irregularly shaped and don't fit any of the tile_shape options.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

add an extra tile_shape mode to tilesets that allows defining custom Vector2s for the x and y axes.
this'd allow rendering tiles in any configuration where each tile has four adjacent tiles.
(which includes the existing SQUARE, ISOMETRIC, and HALF_OFFSET_SQUARE shapes. i'm sure there's some reason these shapes aren't already implemented using adjustable axes, but if there isn't, i'd suggest deprecating them in favor of this implementation. HEXAGON could retain its custom logic.)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

the shape of a tile would be defined by the two axis vectors.
e.g. a square tile could be defined by x & y axis vectors (1, 0) and (0, 1), and an isometric tile could be defined by x & y axis vectors (16, -8) and (16, 8).

tilemap cells' map coordinates would be multiplied with the axis vectors to calculate the position they'd be rendered at.
e.g. if a tile's placed at map coordinates map_coords in a tilemap with custom axes x_axis & y_axis, it'd be rendered at position x_axis * map_coords.x + y_axis * map_coords.y.

If this enhancement will not be used often, can it be worked around with a few lines of script?

no! it requires writing your own custom tilemap implementation.

Is there a reason why this should be core and not an add-on in the asset library?

see above.

@AThousandShips
Copy link
Member

This proposal doesn't really describe any practical ideas or details for how this would be achieved, this isn't very simple to achieve and involves a lot of operations behind the scenes, so some idea of how to actually accomplish this would be appreciated

@Calinou Calinou changed the title custom cell placement/axes for TileSet Add custom cell placement/axes for TileSet Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants