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 trimetric maps #951

Open
franksauvag opened this Issue May 16, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@franksauvag
Copy link

franksauvag commented May 16, 2015

Hi Bjorn,

I am wondering if it would be possible to support Trimetic maps in addition to isometric ones.
( http://en.wikipedia.org/wiki/Axonometric_projection#/media/File:Graphical_projection_comparison.png )

I know trimetric isn't the most used kind of map, but it provides really great results for some kind of games so this might be a great feature.

I am only familiar with TMX parsing and rendering, but I took the freedom to look at the source code, and found few references:
-> map.h
-> newmapdialog.h
-> trimeticrenderer.h (That do not exist yet..).

I guess this is more a matter of rendering the map rather than changing the map models. Or I missed something ?

Thanks for your help on this matter. I am trying to assess the complexity of getting a complete tool chain for trimetic games up and running.. (including Tiled)..

thanks.

@bjorn bjorn added the feature label May 16, 2015

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented May 16, 2015

Well, it would certainly be possible. The only thing I'm wondering a bit about is how to go about it.

I would say this map orientation could be defined by the offsets by which the tiles shift as they move down the X and/or Y axis. I realize you could do some strange things with those values, but when defining the projection using the angles, pixel alignment would be hard to get right. This does mean that the map properties "tile width" and "tile height" are pretty much meaningless, apart from providing a default size when adding a tileset.

That said I have no experience with any games using this projection and don't know how it is commonly implemented. It would be good to have a look at the FIFE Engine, which supports this type of map. On their features page they mention the custom isometric views are defined by angle and tilt of camera, so maybe that's not such a bad idea after all.

@franksauvag

This comment has been minimized.

Copy link
Author

franksauvag commented May 16, 2015

Thanks for the link to the FIFE engine, I didn't know about it. Looking at it right now..

Yes, trimetic projection is a bit unusual, but was used in popular games such as Fallout or SimCity 4000.
Interesting point is the final render that look more natural than the usual isometric.

About the tile width and height, agree that this would become mostly useless apart the tileset import.
Rendering/Packing tileset also requires a bit more work but that's another story.

I am however not sure to understand the issue with the offset. finally, as soon as you get the proper offset (based on the angles), aren't the offset applied to each tile always the same ? that should not be much different from the usual isometric outside of tiles looking kind of flatten/streched in comparison to usual iso.

One thing I realized also, is that the angles should be save as part of the TMX format, but that shouldn't be a great deal.

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented May 16, 2015

I am however not sure to understand the issue with the offset. finally, as soon as you get the proper offset (based on the angles), aren't the offset applied to each tile always the same ? that should not be much different from the usual isometric outside of tiles looking kind of flatten/streched in comparison to usual iso.

Right, that would be one way to go. I was just browing the FIFE source code though, and they actually set up a matrix using the camera tilt and angle, and then use this to determine the position at which to render each tile. If it works for them I guess it would work for Tiled as well.

@franksauvag

This comment has been minimized.

Copy link
Author

franksauvag commented May 16, 2015

I was looking at the same classes...:)

I'll play a bit with the Fife editor, and also try to generate a sample tileset to check how this could be played with.
I need to check how this looks like and work with the angles as I guess not everything can be used (or at least, not everything looks good..).

But overall, looks like for a project I am working on, this trimetic projection would be much better than ISO and I'd really love to stick with Tiled..

@not-surt

This comment has been minimized.

Copy link

not-surt commented Dec 30, 2016

I've implemented arbitrary axonometric tiling in the past by having a 2D vector each for tileXStep and tileYStep. And of course you can just drop the two vectors into one matrix.
eg. 32x16 pixel isometric
tileXStep = (16, 8) pixels
tileYStep = (-16, 8) pixels
tile (2, 5) = pixel 2 * tileXStep + 5 * tileYStep = pixel (32, 16) + (-80, 40) = pixel (-48, 56)

@bjorn bjorn referenced this issue Aug 22, 2018

Closed

Trimetric maps #1650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.