Isometric view in QML



  • I am in the process of starting to write a game in QML with an isometric view (e.i. Civ-like). An isometric view is essentially a grid, with every other row staggered so as to simulate an isometric perspective. The backend would probably be a QAbstractTableModel, but doesn't have to be, I'm just getting started. Creating an isometric view be awkward at best in Graphics View, but seems very daunting in QML, which has no straightforward way to create new views. What would be the best way to create an isometric gameboard in QML?



  • I am currently working on an isometric civ-like tile project myself in Qt5. I am far from an expert on the mater but here are my thoughts. To others, feel free to say I don't know what I'm talking about. I'm still testing things out and the below opinions aren't written in stone.

    QML - While super useful for some simple graphics you are going to have trouble with more advanced graphics. Unless this is a very simple game I'd recommend reserving QML for UI programming only. See http://qt-project.org/forums/viewthread/16110/

    QGraphicsView- In my experience, while the QGraphicsView is really really cool, it is ultimately beter suited for desktop application development and not serious graphics programming. Again, if you are making a simple game then feel free to use the QGraphicsView but for my purposes it just isn't flexible enough. I strongly recommend you tear apart http://www.mapeditor.org/ . It has excellent examples in Isometric rendering and if you look close enough you'll begin to understand some of the limitations of the QGraphicsView.

    1. OpenGL - I'm currently reimplementing my prototype in OpenGL and expect I'll be happy with the results. I recommend looking at https://github.com/lendrick/Orange-Engine/wiki . While it isn't an iso game it is the only source code example of serious OpenGL progaming with Qt that I can find on the internet.


  • errrr...... I mean serious 2D game programming in OpenGL with Qt



  • Part of the reason I am doing this is to learn QML, and have some fun while doing it. I've already learned a lot just by trying to figure out what's possible. This is NOT going to be a fancy Civ5 type of game, so I don't need write it all in OpenGL just to eek out a couple more frames a second.

    There is a big school of thought out there that says "use QML for absolutely everything". I think that is taking it too far, but surely it's within the parameters of the framework to use it for a tiled game display.



  • "I was developing":https://github.com/Kakadu/proelium a civilization-like animation recently using GraphicsView from QtGui. Maybe it will be interesting for you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.