Axonometric support

Hi there,

Now that I got stuff up and running, I spent the few spare time I had prototyping a rough trimetric support.

So far, I added a TrimeticRenderer and bind it within the newMapDialog.

I need now to specify two angles in the UI, meaning here is coming the “real” support.
I guess, this means that I’ll have to add those value in the tileset.h for the model and modify the ui_newmapdialog.h. (I’ll update reader and writer later on).

So here are my two questions:

  • What’s the best layout for the dialog box ? (show the two angle field below when the trimetic type is selected ?).
  • What’s the clearer way to express those angles ? angle from the Y/X axis of the screen ? (kind of like this way…but not sure exactly how to make it “clear”).

Comments/ideas are welcome :smile:

Regards;
Frank;

Just wondering, trimetric is essentially isometric cut in half. So all you really need to do is take the iso renderer(s) and allow the left and right half of an iso tile to be edited separately. No need for angles since width & height of the iso tiles defines the angles implicitly. At least that would be my naive approach.

Thanks for your reply.

We might have a misunderstanding here.
I am talking about trimetric projections.

Trimetric, dimetric and isometric are all axonometric projections where only the number of equal angle differs.
Isometric have 3 equal angles with 120*.
With trimetric, all 3 angles are différents but 2 is enough to define it.
By définition isometric is a specific case of the trimetric. So you could do iso with trimetric support, not the opposite.

My goal here is to define the two angles: right and left based on the X axis.
Offsets, segment size will then ne defined based on the tile size and the angles.

So… we still need to set those angles somewhere in the map creation dialog :slight_smile:

Oh, I get it. I thought you were referring to this kind of map (it’s orthogonal in the screenshot but the same works for isometric tiles):

But you are referring to this, right?

and

Source: http://www.tilemapeditor.com/maps/

Yes correct.

I created a ticket of it: https://github.com/bjorn/tiled/issues/951

So, looking at it, I guess providing the left and the right angle might be a good way to show it ?

To support hexagonal maps I simply added some members to the Tiled::Map class to store the additional required information. It’s not the best design I think, but it works. These angle properties could be added there as well for now.

As for the UI, also for hexagonal it would be nice if the New Map dialog would adapt when that type is selected, to also show the “tile side length”, “stagger axis” and “stagger index” properties. The same goes for trimetric maps. I guess the easiest approach would be to add all these fields in the UI designer, but then hide the ones that are not applicable for the selected map type by code. In any case the new properties would have to be added as well to the PropertyBrowser, which is the widget showing the properties in the Properties view.

As discussed at the issue you reported, the FIFE guys apparently achieved good results by implementing their coordinate conversion with a matrix. This approach could also be used to support oblique maps later.

Finally, thanks a lot for looking into adding support for this!

Did I really said tileset.h instead of tiled::map? :sweat:

Yes, having the properties and hide them when unused is what we do in general.

I do not have the UI designer, (nor I use this kind of tools in general).
Can I add that manually or will this break your layout files (if exists, I don’t know how QT handle that) ?

Or maybe I can just ask you to add the properties widget/component in the Dialogbox and I’ll look to get the backend working ?

For the support, you’re welcome, if it can help getting this cool feature, it’s a pleasure to give a hand.

You’ll probably want to use Qt Creator to develop on Tiled and when you open newmapdialog.ui you should be able to figure how to get some new controls in there. If you’re using a different IDE and would like to keep using it, you can use the more stand-alone Qt Designer application to open just the newmapdialog.ui file for these additions.

You can of course ask me to do it as well, then we’ll save it for later. It’s usually better anyway to make sure things are going to work out before implementing the UI. :-)

Sorry for offtopic :sweat_smile: . That site is alive? It looks interesting, but I can’t leave any message there.

By average lifecycle statistics of internet websites according to my experience, the site is dead. First post May 7th, last post May 26th 2014.

I can imagine how this site came to be and how and why it stopped so abruptly after just 2 weeks. In my experience, 2 weeks is the average euphoric high when enaging in a “exciting new venture” that turns out to be a lot of work after all. :wink:

Oh, thanks! :smile: But I note right now on Editors page the last update date is 2014.12, and may be site is not so dead.

I would have say 2 or 3 days as this is the average time I’ve seen from my students before they realize that it might take more than a week to write a AAA FPS and give up their coding career…

Yes this website is dead as far as I know. It is however well referenced as I end up to it most of the time while looking for informations on various projections.

Btw: sorry for giving no update on this thread… I got stop in the middle of my prototype by the need for a new release at my primary job… Anyway, got everything working from QT (Wow 9 gigs to edit a file :))…

Not sure if I did specify… but this feature is not for a commercial project… so I do have time to get it… :innocent:

Makes me think the mean average tends to go up as one ages, ultimately leading towards a passion by the time one retires. :smiley:

Actually if you download only the version you need, Qt + Qt Creator is only about 1 GB, so I’m not sure what you’ve been downloading to get to 9 GB. :open_mouth: Anyway, on the plus side it’s only one dependency so the development environment isn’t so hard to set up!

I had never heard about this Tessellator project. It definitely has an inspiring set of goals. I had visited the site before, but then there was just the wxWidgets based Tile Mapper or “Lupas Map Editor”. That editor actually looked pretty similar to Tiled and had some nice features that have yet to make it into Tiled, like support for projects and more advanced animation editing. But for some reason the authors seem to have abandoned it.

Oh yeah, no bad feelings about the dependency, that’s just it was big to edit a single file in my case :smile:

  • I need to integrate in my own IDE… you know how we can be tight to one of those sometime :smile:

For the 9 gigs, I got the defaults settings of QT creator on Mac. I might have reduce the size, but as I wasn’t sure of what was required…I just got what was suggested.

Yep, but at least Tiled is the n° one on their list :smile:

There is a french website talking about Tiled as well:
http://ezelia.com/2012/projet-doyazan-les-outils-utilises-pour-la-creation-du-jeu

Unfortunately in French, but you might be able to translate. They created a map compiler to link map between them. I found the idea quite funny in fact.

They have an “English” button at the top center/right. :wink:

Hi everyone,

So I am back and got few hours tonight to move forward on the renderer itself…
I won’t lie, I am definitely rusted with some Maths… so I wasted much of time digging formulas here…

To give a quick overview of where I am heading:

  • I was hopping to be able to cheat some 2d with some offset, but thas quickly become a pain for the Screen2Tile and so…
  • After few tests, I finally opted to implement completely the Axonometric matrix process.
    (Meaning Trimetric support will become Axonometric support as this is finally a non sense to support only Trimetric here)…
  • Matrix also open a nice door to be able to do some zooming easily at the render level… but that’s another story :wink:

So I decided to Use the QMatrix4x4 I found in the QT Framework rather than another 3rd party implementation.

Any feedback/advices welcome on this first point.

I am also looking to print some debugging data to ease debugging.

  • I found the ConsoleDock, but doesn’t seems to be used at the moment outside of plugins…
  • Any idea of how I could implement logginginterface.h in a renderer (or anything that is not a plugin) and get it recognize by the console ?

Well that’s all for now… not much but still happy to play again bit of Math/C++.

Thanks for any help on those matters;
Frank;

Quick prototype while my wife and son are asleep :smiling_imp:

I implemented most conversion and the grid is there now.
Still need to look at the bounding rect, as the required marging around the map is too big…

Also some angles are really not looking nice; Here I am using 30° (x) and 40° (z).

Anyway that’s a good start :smile:

A QTransform (3x3 matrix) should be sufficient given that we’re only transforming 2D points, so please try to use that instead.

For debugging output you can just do qDebug() << "..." << variable;. It won’t go into the console dock, but it will go into the application output window of your IDE.

Do you mean the grid lines don’t look nice at some angles? In that case, try turning on anti-aliasing on the QPainter instance before rendering the grid: painter->setRenderHint(QPainter::Antialiasing).

It’s really nice to hear about your progress and I’m looking forward to see your patches!

I’ll have a look for sure. but side question: Is there any plan for zooming ? the 4x4 allows to manage scaling, so it might not be completely useless.

That’s more or less a cout. but ok that should do the job for now. I am just used to have a debug UI directly within the app so I can test outside an IDE as well.

Sorry I meant some projection angle do not really make sense as the result looks pretty bad. Even worse… 90° even gives you… a line…:slight_smile:

I keep the render hint anyway that might be useful… :wink:

Lol thanks, but don’t expect it too quickly… I am still in the experimentation phase of my project, so I have very little cycle for it :smile: