Author Topic: Map editor development  (Read 22417 times)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #25 on: 4 March 2010, 13:44:27 »
When i tried to make player 5- the whole thing stopped working, or correctly, it did not answer

are you saying the program froze up? or it didn't do anything?

Did you 'reset players' first?
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Gabbe

  • Guest
Re: Map editor development
« Reply #26 on: 4 March 2010, 13:50:28 »
im very sorry ( and embarrased :-[) reset players worked thanks

Trappin

  • Ornithopter
  • *****
  • Posts: 447
    • View Profile
    • MegaGlest Map Compendium
Re: Map editor development
« Reply #27 on: 4 March 2010, 16:01:58 »
Three minor typo's and one new designation.

Object 8-C3,  <-comma needs to be removed.

Object 9-[C4] <- is missing.

Object 10-[C4] <- is missing and the underscore under the 10 is offset.

Surface 5-Custom is renamed Ground (titi)

Nifty - props to zombiepirate, silnarm and titi !

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Map editor development
« Reply #28 on: 4 March 2010, 16:10:51 »
I thinks thats my fault, I didn't ported the strings to GAE yet. I Think the editor you are using now is the one from GAE.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

zombiepirate

  • Guest
Re: Map editor development
« Reply #29 on: 5 March 2010, 03:36:47 »
The GAE subversion for the map editor doesn't compile for me at r504. Errors in "main" and "program".

There are others but these are some main ones.
map_editor/main.cpp:189: error: no match for ‘operator+’ in ‘"F\000\000\000i\000\000\000l\000\000\000e\000\000\000 \000\000\000=\000\000\000 \000\000\000\000\000\000" + ((MapEditor::MainWindow*)this)->MapEditor::MainWindow::fileName’

map_editor/main.cpp: In member function ‘void MapEditor::MainWindow::onMenuEditRedo(wxCommandEvent&)’:
map_editor/main.cpp:336: error: no matching function for call to ‘MapEditor::MainWindow::onPaint(wxPaintEvent)’
map_editor/main.cpp:261: note: candidates are: void MapEditor::MainWindow::onPaint(wxPaintEvent&)

map_editor/program.h:79: error: ‘stack’ was not declared in this scope

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #30 on: 5 March 2010, 07:37:47 »
macro expansion problems (at least I hope).

For windoze wxT(x) evaluates to x, which was masking some horrible mistakes I made ;)

I think I've fixed them all now... (still haven't tried on linux though)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #31 on: 5 March 2010, 12:26:30 »
No, there are some more. I'm fixing them. :)

EDIT: Should be fixed now. Shortcuts for brushs are now disabled because there were problems with the event when calling the callback. I'm atm just too stupid (i dislike references):
Code: [Select]
map_editor/main.cpp:616: error: no matching function for call to 'MapEditor::MainWindow::onMenuBrushHeight(wxCommandEvent)'
map_editor/main.cpp:489: note: candidates are: void MapEditor::MainWindow::onMenuBrushHeight(wxCommandEvent&)

We should rather post the event than call the callback directly.
« Last Edit: 5 March 2010, 14:32:59 by Yggdrasil »

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #32 on: 5 March 2010, 14:39:39 »
No, there are some more. I'm fixing them. :)

EDIT: Should be fixed now. Shortcuts for brushs are now disabled because there were problems with the event when calling the callback. I'm atm just too stupid (i dislike references):
Code: [Select]
map_editor/main.cpp:616: error: no matching function for call to 'MapEditor::MainWindow::onMenuBrushHeight(wxCommandEvent)'
map_editor/main.cpp:489: note: candidates are: void MapEditor::MainWindow::onMenuBrushHeight(wxCommandEvent&)

We should rather post the event than call the callback directly.

Thanks Yggdrasil... the references problem is because I create temporary wxEvents as reference paramaters, gcc doesn't like this, creating them on the stack first, then passing them in is fine, but creating them in the function call is apparently not acceptable.

I knew this, I've had to deal with it before... will clean it up (and maybe even do it on linux :) ) tomorrow.

Edit:
All re-enabled and fixed up.
« Last Edit: 6 March 2010, 02:03:18 by silnarm »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Map editor development
« Reply #33 on: 7 March 2010, 03:46:15 »
I ported the editor to megaglest too now. Good work, its really nice to handle now!
In GAE/Megaglest I updated the strings Trappin mentioned and I set the player startpoint colors to those known by everyone
red->player1
blue->player2
...

I didn't checked it in in megaglest(editor) yet, I will do this tomorrow
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Map editor development
« Reply #34 on: 8 March 2010, 00:01:55 »
I'm currently adding some info support for the editor.  When you move the mouse over an object/resource its name is displayed in the statusline.
This feature already works.
The next thing I add is a simple "brush" copy where you get the object/resource brush which is under the mouse by simply hitting the space bar.

I will add these changes to the GAEs editor too and will checkin tomorrow.

update:
It was done quicker than i thought! I already checked in .
@Trappin: I'm quite shure you will love this feature! This speeds up mapping  a lot!
« Last Edit: 9 March 2010, 09:37:23 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Super Tom

  • Draco Rider
  • *****
  • Posts: 311
    • View Profile
Re: Map editor development
« Reply #35 on: 8 March 2010, 00:54:52 »
Very powerful map editor, I am really looking forward to us with this map editor to do out of the new map!

andyglest

  • Guest
Re: Map editor development
« Reply #36 on: 15 March 2010, 16:45:09 »
See this topic if you don't know what this is about.


This is the new version of map editor buttons.

Changes:
- Rarely used tools are removed. Such include: Open, Save, Reset, Reset Players, Resize, Flip X, Flip Y, Info, Advanced, Reset zoom and pos. They will still be accessible from the textual drop-down menu.
- New tools are added: Undo, Redo, Gradient, Players 5-8.
- All images are now in a single folder. This makes easier to view all the images at once and to batch-convert them. Beggining of the filename indicates what textual drop-down menu do they belong to.
- Some images are modified significantly or only several pixels, while others are the same.

You can download it here: http://dl.dropbox.com/u/2044596/glest/andy0101_buttons_v02.zip

Since I haven't played the GAE Megaglest yet, I don't know what colors are teams 5-8.

Note to whoever wants to implement them in the map editor: don't forget to write tooltips since not all of the images are self-explanatory.
« Last Edit: 17 March 2010, 15:44:18 by andy0101 »

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #37 on: 17 March 2010, 12:50:22 »
I committed some initial work on adding your icons to the map editor. Just added all icons and dumped some of them in two toolbars. I have actually no idea how to lay it out in a good way. I never made any map. So, anyone can feel free to change it and add the rest. We can also add the icons to the menus (not checkable then) or remove the menus which have buttons in the toolbar.
« Last Edit: 18 March 2010, 10:58:34 by Yggdrasil »

andyglest

  • Guest
Re: Map editor development
« Reply #38 on: 17 March 2010, 15:42:30 »
I committed some initial work on adding your icons to the map editor. Just added all icons and dumbed some of them in two toolbars. I have actually no idea how to lay it out in a good way. I never made any map. So, anyone can feel free to change it and add the rest.
It's great that someone took the job. :) Thanks!

Please lay them out like this:

Toolbar 1: Edit:      Undo, Redo, Randomize, Randomize Heights, Switch Surfaces
Toolbar 2: Height:    -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 (blue ones)
Toolbar 3: Gradient:  Same as above (red ones)
Toolbar 4: Surface:   Grass, Secondary Grass, Road, Stone, Custom
Toolbar 5: Object:    Tree, Dead Tree, Stone, Bush, Water Object, Custom 1, Custom 2...
Toolbar 6: Resource:  Gold, Stone, 3, 4, 5
Toolbar 7: Player:    Only one button (players), which would be a drop-down menu with these buttons:
                      Red (1), Blue (2), Green (3), Yellow (4), 5, 6, 7, 8
Toolbar 8: Radius:    1, 2, 3...


We can also add the icons to the menus (not checkable then)...
Nice idea! It would be easier to remember what button does what. Of course, tool-tips are still inevitable, and they should be identical to the text in the menu-bar.

...or remove the menus which have buttons in the toolbar.
No. :) There is no application that has something in the toolbar and not in the menubar.

BTW, I've downloaded Megaglest - colors for teams 5-8 are â–ˆ White for 5, â–ˆ Cyan for 6, â–ˆ Orange for 7, and â–ˆ Pink for 8. But I haven't made the buttons for them yet because there is no orange color in 4-bit palette. :P And having one true-color or 256-color button when all others are 16-color, hmm... not likeing.

BTW2, could someone change the colors for teams 1-4 in the map editor? In reality, they are red, blue, green and yellow, but in the map editor they are...
and it's really confusing. I know I'm annoying, but think of me as a beta tester. :D

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #39 on: 17 March 2010, 17:19:51 »
Just about the colors:
I converted your icons to xpm to get it easily included in the code. Every xpm has its own palette with full rgb. There's no problem with orange. Just provide png or convert to xpm yourself.

I will change the player color later.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #40 on: 17 March 2010, 20:04:29 »
I think titi already changed the colours to the expected values for players 1-4.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

andyglest

  • Guest
Re: Map editor development
« Reply #41 on: 18 March 2010, 00:06:17 »
I converted your icons to xpm to get it easily included in the code. Every xpm has its own palette with full rgb. There's no problem with orange. Just provide png or convert to xpm yourself.
OK, I'm looking at the Wikipedia article about XPM. Based on this info, I conclude the following :D
- XPM supports transparency, but not the Alpha channel
- The more colors I use, file size will be bigger, since each color used has to be defined before the image.
Right?

Colored button images for players 5-8 will be released in a few days, but you don't have to wait for it. It would be awesome if you could upload the map editor with tool-bars so we can test it.

I think titi already changed the colours to the expected values for players 1-4.
Well, it doesn't seem so in my Map editor. Maybe I have an old version? It's 1.5.0 beta 2, built Mar 4 2010.

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #42 on: 18 March 2010, 10:55:10 »
OK, I'm looking at the Wikipedia article about XPM. Based on this info, I conclude the following :D
- XPM supports transparency, but not the Alpha channel
- The more colors I use, file size will be bigger, since each color used has to be defined before the image.
Right?
Yes, but the file size is not so important nowadays. It's still really small.

Colored button images for players 5-8 will be released in a few days, but you don't have to wait for it. It would be awesome if you could upload the map editor with tool-bars so we can test it.
I could only provide linux binaries and it's not useful atm.

I think titi already changed the colours to the expected values for players 1-4.
Yes, it's fine.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #43 on: 18 March 2010, 23:21:42 »
I've fixed up the order of the object buttons, and swapped the road and custom(ground) surface texture button.

1.5 beta3 for windows can now be download here.

@ Yggdrasil: I had to 'translate' the mouse co-ords to account for the toolbars, everything was being placed about 50px up from where you clicked, can you confirm this is also needed for linux? If it isn't (ie, if it places things about 50px below where you click) could you please wrap the contents of translateCoords() [it's defined just above GlCanvas::onMouseDown()] in a #ifdef WIN32.

@ andy0101: The custom objects all have names these days (based on the precedent set with the tilesets that came with Glest), maybe some new button images for them would be nice?

@ Yggdrasil & andy0101 : Nice work, it's looking pretty schmick now :)

@ Anyone: If someone wants to take the cheat sheet and add titi's space bar innovation to it, and then format it nicely (pdf or html), it would probably be a good idea to distribute it with the editor.

Cheers.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Map editor development
« Reply #44 on: 19 March 2010, 00:46:16 »
maybe we add some more content/info in misc->help ?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #45 on: 19 March 2010, 05:00:15 »
You mean like some actual help content? What a novel idea  ;)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #46 on: 19 March 2010, 08:11:56 »
There was a resize problem. The map jumped up and down if one resizes the window. In initial size it was fine on linux so i did not notice that this also adds an offset to the mouse pointer. I hopefully fixed that now. Nevertheless it needs your translateCoords now.

andyglest

  • Guest
Re: Map editor development
« Reply #47 on: 19 March 2010, 15:04:36 »
Great job! It works perfectly, but there are more things to be done. Resource and edit toolbars are missing.

@ andy0101: The custom objects all have names these days (based on the precedent set with the tilesets that came with Glest), maybe some new button images for them would be nice?
Work in progress...
And, should the Invisible blocking object have an invisible image? :D

@ Yggdrasil & andy0101 : Nice work, it's looking pretty schmick now :)
Thanks!

andyglest

  • Guest
Re: Map editor development
« Reply #48 on: 19 March 2010, 18:28:44 »
Done. I also modified other objects and created 5-8 player icons (players 1-4 on this image are only for comparison).


Download: http://dl.dropbox.com/u/2044596/glest/andy0101_buttons_v04.zip

EDIT: Oops, the numbers are wrong... two objects are 5, and others are one less... ah it's over now.

EDIT 2: fixed :) (not in the image, but in the ZIP)
« Last Edit: 19 March 2010, 18:43:54 by andy0101 »

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #49 on: 20 March 2010, 11:32:17 »
I added the rest of the icons and also found the reason for the offset of the mouse pointer. The mainwindow draws the map in glCanvas with its own size not with the size of glCanvas. So i removed translateCoords for linux. If it now also works on windows then please remove it completely.

It really looks now much nicer. Thanks for your contribution andy0101.