Comments (27)
I've made a very basic impl. of a hexagonal renderer. Basic stuff works. Please have a look at it: https://github.com/maq777/tiled and tell me what issues/fixes have the highest priority for an possible inclusion on upstream.
from tiled.
Hex maps have my vote. If I remember correctly hex maps were working some time back (around Tiled 0.5/0.6), at least there was an option for creating them.
from tiled.
@LearnCocos2D Hex maps have never worked in Tiled Qt, but there was experimental support for them in the Java version of Tiled.
The reason I've never merged @maq777 patch is mostly because I didn't like the implementation of the rendering, which I think is too inefficient. Of course, I expected to get around to doing a faster renderer sooner rather than later, but this hasn't been the case so far.
from tiled.
As long as it works editing hex maps would be great, even if it may be slow or inefficient. You can always optimize or rewrite it at a later time if it's not fundamentally broken or incomplete (ie no select, no tilesets - I have no idea what the hex renderer does and doesn't do).
from tiled.
@LearnCocos2D @bjorn F.Y.I. The impementation I provide is broken. Yes, it needs optimizations. But most of all it needs bug fixes. And the only feasible way to fix the selection problems is a completely new algorithm. I studied and found a new algorithm - unfortunately I didn't have the time to implement it (and now the theory is long forgotten).
from tiled.
@maq777 No worries, we're all looking for more time. Yet, maybe @LearnCocos2D is right that it would be better to have an implementation that is not fundamentally broken rather than no implementation at all. On the other hand I've added an incomplete staggered renderer which, even though it's optimized, does not support object layers because I hadn't figured out a good way of handling those yet, and that confuses people... :-/
In any case, my approach would be to tweak the current staggered renderer to also work for hexagonal, since the rendering method is very similar. However, a solution will still need to be found for the object layers. I think the objects should use pixel coordinates for these types of maps and just ignore the projection (since the projection is irregular anyway).
from tiled.
I would love to have Tiled support hexes. Many other applications I've looked into that support them are old and/or terrible. Please make this feature a priority. Thanks for your work so far.
from tiled.
I love that this is the first issue !
This is something that would make me find a use for tiled ! (i got no time to pitch in right now, though)
In case some of you don't know about this yet, here's the new reference for hexagonal tiling : http://www.redblobgames.com/grids/hexagons/
The barycentric coordinates system is the way to go !
from tiled.
@Goutte Thanks a lot for linking that article, it's very useful! However, the article does not mention a "barycentric coordinates sytem". Is it mentioned under a different name? The article actually recommends its "axial coordinates", which seem to make sense to me.
However, if any such alternative coordinate systems are to be supported it needs to be done in addition to supporting the "offset" coordinates, since that is the system supported by the old Tiled Java and is what cocos2d-iphone supports.
from tiled.
Axial coordinates is just another name for barycentric coordinates, AFAIK.
Offset coordinates are really painful to work with in hex grids, trust me. Should be fairly easy to convert from axial to offset once the hard calculus is done, though.
from tiled.
Well, I know offset coordinates and am familiar with the issues it causes with the editing tools in Tiled. However, as I said this mode needs to be supported for backwards compatibility. Of course it would be nice to support axial coordinates as well, and it looks like this system will work better with the existing tools. Though, I'm sure it will also need changes to things like line and circle drawing and of course the terrain tool, in order to work perfectly.
from tiled.
For reference here are the forks I'm aware of that merged @maq777 hexagonal renderer with more recent versions of Tiled:
@evant took that version and merged Tiled 0.6, 0.7, 0.8 and 0.9 into it:
https://github.com/evant/tiled/branches/hex
And here's another version by @chedburgh that rebased the commits on top of a more recent version of Tiled:
https://github.com/chedburgh/tiled/commits/master
from tiled.
I find a alternative way to build a hexagonal map using tiled map editor without any changes, my own practice is:
- My hexagon tile size is
128 * 64
- New map, set the tile size to
32 * 32
- New tileset, set the tile size to
128 * 64
- That's all, βThis tile editor is wonderful!β
I create a test repo, hextiletest
from tiled.
@go3k Ah, that's creative!
from tiled.
@go3k looks cool, but this is hack. i think users needs real support for hextiles
from tiled.
@Goutte - Thats a fantastic link! I originally wanted to use tiled for my map but i just decided to roll my own in 3d and that link provides a great amount of detail! Definitely helped me figure out some aspects of hex tiling =-D
from tiled.
Any update on this issue?
from tiled.
@anissen Nope, sorry. I've been trying to focus on getting a Tiled 0.10 release out for the past weeks. It has such a huge amount of new features that I don't really want to delay it further... on the other hand this is one of the main features still missing to make Tiled more complete. :-/
from tiled.
Thanks for your reply. It's perfectly understandable that you want to focus on finishing 0.10. I'm looking forward to it π
That being said, there's clearly a big interest in having hexagonal support in a future version of Tiled. Keep up the good work.
from tiled.
@bjorn Great to hear you are about to finish 0.10. I hope, you find the time to add hexagonal tiles later on. I guess, implementing hexagonal tiles is quite complicated, because those tiles can be asymmetric of width and hight. Beginning with evenly sized hexagonal tiles would be a great start.
from tiled.
@tr37ion Actually 0.10 is out since a week now!
As for hexagonal, I don't think the tile sizes will be problematic, it's more that hex needs additional rendering parameters. But maybe I will just support one variation at first.
from tiled.
+1 about priority of that feature.
from tiled.
+2 about priority of that feature. One from me and another from a friend of mine :)
from tiled.
+1 priority. Also I might have some time to help out . ping me if you'd like the help
from tiled.
@BenjaminFarris Thanks for the offer but I'm currently unsure what to ask help with. For me it's currently mainly a problem of getting around to it. In fact somebody has offered to sponsor this feature a few days ago, making it the first thing on my list. I will try to get this done in the next week.
Once in there will be hex-specific improvements that could be made to the tools. Things like line drawing, copying regions or the fill tool do not work correctly on staggered maps currently.
from tiled.
I've recently pushed my work on hexagonal map support to master so the daily builds include support for this now, at least two variations of "pointy top" hexagonal. Give it a try!
One caveat is that currently a new hexagonal map will start out looking pretty much the same as staggered isometric. It is only after you increase the "Tile Side Length" in the map properties that it will start to appear hexagonal (since by default the length of the side is 0).
I hope to get around to adding support "flat top" hexagonal later this week, and I'm also considering to add support for "hexagonal isometric", which would be a variation of the isometric renderer but with a hexagonal grid.
from tiled.
Adding support for "flat top" hexagonal took way longer than I had anticipated. The main issue with it was that it meant staggering the X axis, which required a rather different way of rendering to keep the tiles in the correct order. I also did not find a nice way to share code like grid drawing, layer bounding boxes and converting screen position to tile position. But, it's now finally done and pushed as 915fd32.
So, there is no support for "hexagonal isometric" yet, which I still hope to add later, but I consider this issue closed. The one problem with having to discover the "tile side length" property in the Map properties also remains, but I'll try to solve that later as well. Finally I'll also have to update the documentation about the new properties and how they affect the rendering.
from tiled.
Related Issues (20)
- Custom File Property Not Allowing a Relative Path HOT 2
- Tiled crash shortly after starting HOT 2
- Cropping map by selection leaves Tiled to think that tilesets are still in use HOT 1
- Keyboard shortcut typo for "Select Next Layer" and "Select Previous Layer" HOT 6
- Bug: Rotation of tileset collision is not well exported to godot 4. HOT 1
- Idea: To export Objects Only JSON file HOT 2
- Add a Selected Tile Preview to "Shape Fill Tool", just like the "Stamp Brush" has HOT 6
- tmxrasterizer's --hide-layer doesn't work with group layers HOT 1
- Scripting: Access Terrain Properties
- Issues compiling in Windows (newbie) HOT 3
- Automapping stops working when a project's rules.txt is modified during runtime. HOT 3
- "Blob Tileset" points to a broken link HOT 2
- Add map.fileName in tiled.registerMapFormat -> write HOT 2
- Unable to open a tmx file with a space in the filename using AppImage with the shell HOT 2
- Error with `libtiled` in Java 21: `java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException` HOT 1
- Any AI generated plugin? HOT 1
- Tile Animation Editor may not show additional tiles if source image resized
- World Map chunks getting loaded twice. HOT 4
- Scripting: Signal for brush changing
- Layer Blend Mode Property HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiled.