MegaGlest Forum
MegaGlest => MegaGlest => Topic started by: tomreyn on 15 March 2014, 18:33:07
-
dabascht AKA basxto is currently working on a QT4/5 based clone of the (cureently wxgtk based) map editor:
https://github.com/dabascht/megaglest-source/tree/qt4 (https://github.com/dabascht/megaglest-source/tree/qt4)
It's work in progress, most functionality isn't there, yet, but it's possible to build it already.
So here's how to build it on Ubuntu:
Ubuntu 12.04 LTS (QT4):
cd
mkdir SCM
cd SCM
git clone https://github.com/dabascht/megaglest-source.git megaglest-source_dabascht
cd megaglest-source_dabascht
# If you also want the default MegaGlest assets:
#git submodule update --init --recursive
git checkout qt4
cd mk/linux
sudo ./setupBuildDeps.sh
sudo apt-get install libqt4-dev
sed -i 's/^EXTRA_CMAKE_OPTIONS=$/EXTRA_CMAKE_OPTIONS="-DBUILD_MEGAGLEST=Off -DBUILD_MEGAGLEST_MAP_EDITOR=On -DBUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS=Off -DBUILD_MEGAGLEST_MODEL_VIEWER=Off -DUSE_QT5=Off"/' build-mg.sh
./build-mg.sh
Ubuntu 13.10 (QT5):
cd
mkdir SCM
cd SCM
git clone https://github.com/dabascht/megaglest-source.git megaglest-source_dabascht
cd megaglest-source_dabascht
# If you also want the default MegaGlest assets:
#git submodule update --init --recursive
git checkout qt4
cd mk/linux
sudo ./setupBuildDeps.sh
sudo apt-get install qt5-default
sed -i 's/^EXTRA_CMAKE_OPTIONS=$/EXTRA_CMAKE_OPTIONS="-DBUILD_MEGAGLEST=Off -DBUILD_MEGAGLEST_MAP_EDITOR=On -DBUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS=Off -DBUILD_MEGAGLEST_MODEL_VIEWER=Off -DUSE_QT5=On"/' build-mg.sh
./build-mg.sh
Ubuntu 14.04 LTS will likely work the same as 13.10.
SCM stands for source code management, it's just where I like to keep any source code repositories - you can name this differently and place it elsewhere, of course. The same goes for the megaglest-source_dabascht directory.
-
Also builds on Arch GNU/Linux with
pacman -S qt4
or
pacman -S qt5 and -DUSE_QT5=On
You can find the default dependencies with pacman -Si megaglest
mkdir SCM
cd SCM
git clone https://github.com/dabascht/megaglest-source.git megaglest-source_dabascht
cd megaglest-source_dabascht
git checkout qt4
cd mk/linux
sed -i 's/^EXTRA_CMAKE_OPTIONS=$/EXTRA_CMAKE_OPTIONS="-DBUILD_MEGAGLEST=Off -DBUILD_MEGAGLEST_MAP_EDITOR=On -DBUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS=Off -DBUILD_MEGAGLEST_MODEL_VIEWER=Off -DUSE_QT5=Off"/' build-mg.sh
./build-mg.sh
-
Great job, hope this editor gets finished an really replaces out use of wxwidgets.
-
Basic map editing should be possible now.
still TODO:
- Making menus “Edit” and “View” functional
- Scrolling and moving the canvas
- Catching exceptions
- Reducing/vanishing pen-lag
- History (part of Edit)
- Selection of tiles
-
please provide some screenshots :-) .
-
(http://i.imgur.com/QQU3WVn.png)
-
Newest version, the statusbar is fake :D
You can’t see it, but this version is much faster and uses less RAM.
(http://s61.img-up.net/2014-03-18f9b0.png) (http://img-up.net)
-
If you wanna try the preview feature without compiling the whole game, but you have installed megaglest:
cd mk/linux/
ln -s $(which megaglest) megaglest
still TODO:
- Making menus “Edit” and “View” functional
- Scrolling and moving the canvas
- Catching exceptions
Reducing/vanishing pen-lag- History (part of Edit)
- Selection of tiles
-
(http://i68.img-up.net/2014-03-195e55.png) (http://img-up.net)
still TODO:
- Making menus “Edit”
and “View” functional - Scrolling and moving the canvas
- Catching exceptions
Reducing/vanishing pen-lagHistory (part of Edit)- Selection of tiles
fixing repainting of objects and resources
-
Dabasto i have a feature request to make the possibility save maps as XML, so we can import and compile the maps.
-
I’m using the shared libraries of megaglest for loading and saving maps.
It should be possible to extend shared_lib/map/map_preview, this would make it possible loading and saving .xml just like .mgm and .gbm.
This is mostly independant from map editor, just need to modify the suffix filters for loading and saving dialogs.
But I’m focusing on getting rid of WxWidget and porting map editor and g3d viewer to Qt.
-> Will not implement that now.
-
Improvements compared to WxWidget version:
- smooth drawing without gaps in the line
- no gray / black fragments when rendering got screwed up
- working history
still TODO:
- Making menus “Edit”
and “View” functional Scrolling and moving the canvas- Catching exceptions
Reducing/vanishing pen-lagHistory (part of Edit)- Selection of tiles
fixing repainting of objects and resources
-
You're making good progress there!
Some more suggestions for further improvement:
Split toolbars more:
In my opinion, the "heights and diameters" tool bar should be split up in two ("Heights", "Diameters"), so that users will be able to access all diameter icons with a single click even on smaller resolutions (or when windowed). The QT tool bar implementation is rather flexible (try drawing one of them around with the mouse to see), it would be a pity not to make better use of this. So I'd actually split up the "objects and surfaces" toolbar, which is really about editing, surfaces and objects, into tool bars labelled "Edit", "Surfaces", "Objects".
Zoom:
Much better now. But it continues to zoom to the center of the map (not the mouse pointer position) until the map fully fills the window and the canvas is no longer visible. Only then will it actually zoom towards the mouse pointer.
-
I modified the build scripts.
Most distributions will build with Qt 4 and some (newest Ubuntu and Fedora) with Qt 5.
This code should be sufficient now:
cd
mkdir SCM
cd SCM
git clone https://github.com/basxto/megaglest-source.git megaglest-source_basxto
cd megaglest-source_basxto
# If you also want the default MegaGlest assets:
#git submodule update --init --recursive
git checkout qt4
cd mk/linux
sudo ./setupBuildDeps.sh
./build-mg.sh
This also builds the game, but you will need it for the preview feature.
-
this will lack the game data, so previews will fail. You could do a --recursive clone, though, or instruct people to point the submodule "remote" to a local directory where the game data already exists as a git repository.
-
It’s now possible to copy the selected area, it will then be pasted at the most top left point of the actual selection.
Ctrl-Left click: move map in window
Shift-Left click: select tiles
(http://j71.img-up.net/2014-04-132e20.png) (http://img-up.net)
still TODO:
- Making menus “Edit”
and “View” functional Scrolling and moving the canvas- Catching exceptions
Reducing/vanishing pen-lagHistory (part of Edit)Selection of tilesfixing repainting of objects and resources- correctly linking to Qt on windows
-
Looks Very Very Nice!, GJ
-
It should now be possible to compile with Microsoft Visual Studio 2010 Express, if Qt 5.2.1 is installed to C:/Qt/5.2.1/msvc2010_opengl
This is just the 32bit version!
(http://goblin.coding4schoki.org/mgoblin_media/media_entries/7/2014-05-01_1552_1280x1024.medium.png) (http://goblin.coding4schoki.org/u/basxto/m/mg-map-editor-compiles/)
still TODO:
- Making menus “Edit”
and “View” functional Scrolling and moving the canvas- Catching exceptions
Reducing/vanishing pen-lagHistory (part of Edit)Selection of tilesfixing repainting of objects and resourcescorrectly linking to Qt on windows
-
I'm an idiot, what does this mean?
-
I'm an idiot, what does this mean?
I don’t feel what exactly you are referencing to.
If you meant this project in whole:
I’m rebuilding the GUI with Qt (https://en.wikipedia.org/wiki/Qt_%28toolkit%29), the current editor uses WxWidget (https://en.wikipedia.org/wiki/WxWidgets)
-
What does that mean, though? Better cross compatibility?
-
A little bit yes, but also QT has a little greater possibilities.
Mainly regards some linux distributions which don't like (or even hate) gnome and gnome's dependencies.
In my opinion over time this phenomenon will intensify since "canonical" :thumbdown: has an impact on this environment and slowly spoils it :-X.
-
The main reason is that I’ve never heard of WxWidget before and were more interested in Qt.
Furthermore the old editor used WxWidget and OpenGL, the latter for rendering (https://github.com/MegaGlest/megaglest-source/blob/develop/source/shared_lib/sources/graphics/gl/base_renderer.cpp) the actual map. I was able to render it with pure Qt and Qt is much more straight forward than OpenGL … at least when drawing a 2D canvas. Qt is handling the redrawing and moving of the canvas. The old editor sometimes failed to draw the map on the screen proberly … at least on my system.
Qt mostly splits code and UI-design. Every non-programmer can open the .ui-files with QtDesigner and redesign the GUI by dragging stuff around.
We used an obsolete version of WxWidget, so we needed to port it to a never version or a different toolkit.
I think, most features I added, should also be possible with WxWidget. The old editor just did not use the whole potential of this toolkit.
-
Comparing WxWidget to QT is pretty common when people want to know what UI library to use. QT has a few cons, but I suspect for most people that its pros outweigh them quite easily. Its definitely focused on being easy to use. And it has a first party drag and drop compared to the low quality third party ones for WxW. Plus, signals and slots built in from the start.
-
The map-editor should be feature complete by now.
If you still miss a feature or a feature does not work as explected, please let me know.
But I don’t promise to include any further features.
still TODO:
Making menus “Edit” and “View” functionalScrolling and moving the canvasReducing/vanishing pen-lagHistory (part of Edit)Selection of tilesfixing repainting of objects and resourcescorrectly linking to Qt on windows- Catching exceptions and showing warning messages
- code cleanup
-
Today I made some huge changes to the painting of tiles. Thus I can now use a standard-method for zooming, this had also the option to keep a tile under the cursor when scaling. Titi and Tomreyn requested this behavior.
still TODO:
Making menus “Edit” and “View” functionalScrolling and moving the canvasReducing/vanishing pen-lagHistory (part of Edit)Selection of tilesfixing repainting of objects and resourcescorrectly linking to Qt on windowsCatching exceptions and showing warning messages- code cleanup
-
This gets better and better and I bet this will replace original map editor soon!
things I would like to see:
- no painting with middle mouse.
- instead move pane with middle mouse down and not with shit + left mouse down
- maybe scroll can be done in smaller steps
-
things I would like to see:
- no painting with middle mouse.
- instead move pane with middle mouse down and not with shit + left mouse down
- maybe scroll can be done in smaller steps (2px steps now)
Using middle click turned out being too difficult, also especially some laptops lack a middle mous button.
-
Im not sure if this is a bug but I'm posting it anyway.
Not rectangular maps not centred , and if you zoom it , the zoom doesn't happen centred in mouse area (like in GIMP).
(http://i.imgur.com/4GLKGVq.png)
-
If the map size shrinks, this also happens when you open a map or create a blank one, the surrounding view doesn’t. And this view is centered. Did not figure out how to fix this, but this is probably possible.
As long as the whole map fits in the window it’s centered. As soon as it does not fit anymore, the pixel under the mouse cursor is the anchor for zooming. The Gimp has exactly the same behavior.
-
As soon as I hit Ctrl + Z , it crashes for me. The terminal shows no errors.
-
Oh forgot to mention, that I can't reproduce that bug.
Also it won't compile with newest Qt versions, will try to fix that next week, this week I try to make the windows version compilable, but with an older version of Qt.
-
This time it was easier than expected.
Icons can't be displayed, also opening and saving files crashes … but rest looks good.
Revision 3100276fa79512b068d3860a0fe6ade7e493da48 (https://github.com/basxto/megaglest-source/commit/3100276fa79512b068d3860a0fe6ade7e493da48) from windows-test branch should work with VS2010 Express.
You need to install Qt 5.2.1 to C:\Qt\5.2.1\msvc2010_opengl … I plan to change this in the future.
-
It’s now possible to compile on linux with Qt 5.4 (released Dec 10)
Now I’m trying to reduce the posibilities to cause memory leaks and segmentation faults. (using less pointers in C++)
-
Well, i tried installing QT and Tried compiling This is the result
vs10c++
Windows 10.
Pastebin
http://pastebin.com/JEPy1nxK
-
Got it to compile, But Binary does not :/.
-
What is the status of this editor? Is it functional enough to replace the wxwidget editor?
-
This project is frozen at the moment.
Basically it's feature complete if I recall correctly.
It's broken with newest Qt version and titi said, it's to slow on his computer.
-
I cannot remember that I said slow. For me this editor works very well!
@softcoder try it here:
https://github.com/basxto/megaglest-source
-
I think I used to say that some things are slower than on the old editor. But this was a while ago, and I think you optimized things since.
And you definitely improved a lot of things already, and ironed out some old bugs.
Also, QT should work cross platform which is not the case for wxgtk (it does not seem to build on OS X).
So it would be great if we could replace the old editor by yours.