Author Topic: WIP: dabascht's QT4/5 based map editor  (Read 4750 times)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
WIP: dabascht's QT4/5 based map editor
« 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

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):

Code: [Select]
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):

Code: [Select]
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.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #1 on: 15 March 2014, 18:50:41 »
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

Code: [Select]
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


softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #2 on: 15 March 2014, 23:14:48 »
Great job, hope this editor gets finished an really replaces out use of wxwidgets.


Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #3 on: 17 March 2014, 15:13:16 »
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

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: WIP: dabascht's QT4/5 based map editor
« Reply #4 on: 17 March 2014, 19:02:15 »
please provide some screenshots :-) .
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

kagu

  • Administrator
  • Horseman
  • ********
  • Posts: 203
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #5 on: 18 March 2014, 00:27:37 »
Megaglest Chat
Please support:
1. CEGUI 2. In-process games 3. Registered Players
Playtime:
Every Sunday 21:00 - 01:00 CET

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #6 on: 18 March 2014, 02:41:56 »
Newest version, the statusbar is fake :D

You can’t see it, but this version is much faster and uses less RAM.


Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #7 on: 18 March 2014, 19:44:19 »
If you wanna try the preview feature without compiling the whole game, but you have installed megaglest:

Code: [Select]
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

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #8 on: 19 March 2014, 14:16:58 »


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
  • fixing repainting of objects and resources
« Last Edit: 19 March 2014, 14:33:30 by Baŝto »

kagu

  • Administrator
  • Horseman
  • ********
  • Posts: 203
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #9 on: 19 March 2014, 14:21:38 »
Dabasto i have a feature request to make the possibility save maps as XML, so we can import and compile the maps.
Megaglest Chat
Please support:
1. CEGUI 2. In-process games 3. Registered Players
Playtime:
Every Sunday 21:00 - 01:00 CET

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #10 on: 19 March 2014, 15:19:08 »
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.

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #11 on: 21 March 2014, 18:06:10 »
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-lag
  • History (part of Edit)
  • Selection of tiles
  • fixing repainting of objects and resources
« Last Edit: 21 March 2014, 19:24:18 by Baŝto »

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: WIP: dabascht's QT4/5 based map editor
« Reply #12 on: 22 March 2014, 01:27:40 »
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.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #13 on: 22 March 2014, 12:02:14 »
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:
Code: [Select]
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.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: WIP: dabascht's QT4/5 based map editor
« Reply #14 on: 22 March 2014, 13:13:37 »
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.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #15 on: 12 April 2014, 23:04:57 »
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



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
  • fixing repainting of objects and resources
  • correctly linking to Qt on windows

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #16 on: 17 April 2014, 02:17:41 »
Looks Very Very Nice!, GJ
WiP Game developer.
I do danish translations.
"i break stuff"

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #17 on: 1 May 2014, 18:04:31 »
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!



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
  • fixing repainting of objects and resources
  • correctly linking to Qt on windows
« Last Edit: 13 June 2014, 22:00:29 by Baŝto »

Tiel

  • Archer
  • *
  • Posts: 30
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #18 on: 2 May 2014, 18:57:11 »
I'm an idiot, what does this mean?

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #19 on: 3 May 2014, 16:07:18 »
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, the current editor uses WxWidget

Tiel

  • Archer
  • *
  • Posts: 30
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #20 on: 4 May 2014, 04:52:44 »
What does that mean, though? Better cross compatibility?

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #21 on: 4 May 2014, 05:10:20 »
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.

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #22 on: 4 May 2014, 06:20:56 »
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 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.

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: WIP: dabascht's QT4/5 based map editor
« Reply #23 on: 4 May 2014, 16:26:38 »
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.

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora
Re: WIP: dabascht's QT4/5 based map editor
« Reply #24 on: 5 August 2014, 08:44:18 »
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” functional
  • Scrolling and moving the canvas
  • Reducing/vanishing pen-lag
  • History (part of Edit)
  • Selection of tiles
  • fixing repainting of objects and resources
  • correctly linking to Qt on windows
  • Catching exceptions and showing warning messages
  • code cleanup

 

anything