Author Topic: Map editor development  (Read 22416 times)

andyglest

  • Guest
Re: Map editor development
« Reply #50 on: 20 March 2010, 13:31:01 »
You're welcome. Also, when the "map zoom and position" is reseted, map's upper-left corner isn't positioned under the tool-bars (green arrow), but under the menu-bar (red arrow). I guess that was also because of the canvas issues and should be fixed now.

zombiepirate

  • Guest
Re: Map editor development
« Reply #51 on: 21 March 2010, 05:42:55 »
Does anyone use the randomize feature? If nobody has any objections I'm going to start working on making it a bit more useful.

Maybe if I get it working well enough it could be incorporated into the game itself for random maps?

andyglest

  • Guest
Re: Map editor development
« Reply #52 on: 21 March 2010, 15:15:10 »
Yes, I use it. Before I start creating the map I always randomize it a few times to make it look more realistic. Improved randomizing function would certainly be useful.

BTW: creating large maps (128x128) takes up a lot of CPU. Placing objects isn't real-time - when I click, the object shows up a second or two after click. Especially if the radius is big and I draw the line very fast.
Here is a video that explains it better (it's 500 kB 7zipped but 26 MB after extracting) :bomb:
It is even slower now because of the recording process.
Also, that is not my regular cursor, It's just for the purpose of recording.

Does anyone else have this problem? (I have a 1.6 MHz GHz processor, but it doesn't seem to be sufficient)

EDIT: OMG LOL I mean GHz :O
« Last Edit: 21 March 2010, 15:21:54 by andy0101 »

zombiepirate

  • Guest
Re: Map editor development
« Reply #53 on: 21 March 2010, 16:59:01 »
It's actually because you randomize the heights that it's so slow. 64x64 maps are fine as far as the lag and randomizing doesn't seem to affect it noticeably. 128x128 maps for me can be drawn on smoothly without randomization and after randomizing the heights the lag is terrible. 256x256 maps the lag is really really bad even without randomization and after randomization the editor becomes unresponsive.

If the height rendering was improved then it should solve your problem, but there may be other issues as well.

andyglest

  • Guest
Re: Map editor development
« Reply #54 on: 21 March 2010, 17:05:11 »
True, I tested all the combinations and it's same here. Something needs to be done about that.

Usually I don't create big maps since I'm a detail-freak, but I would like to try, and it's really hard because of the lag.

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #55 on: 23 March 2010, 15:54:05 »
I added a map preview which loads the map into glest with a selectable tileset. Should help mappers to see what they are doing.

I committed this to the branch tmp_0.2_merge because there's is already a better commandline handling of glest. So it won't be available very soon, just to inform other devs that this is already done.

zombiepirate

  • Guest
Re: Map editor development
« Reply #56 on: 24 March 2010, 04:38:39 »
As far as map randomization goes how should the player start locations be randomized? There are basically two options:

1. Systematically place the player star locations around the outside edge of the map with a little bit of randomization to ensure that everything about start location is fair.
2. Randomize the start locations anywhere on the map while only stopping to make sure that the players didn't get put right on top of each other.

modman

  • Guest
Re: Map editor development
« Reply #57 on: 26 March 2010, 00:37:17 »
I added a map preview which loads the map into glest with a selectable tileset. Should help mappers to see what they are doing.

I committed this to the branch tmp_0.2_merge because there's is already a better commandline handling of glest. So it won't be available very soon, just to inform other devs that this is already done.

We should be able to save these previews in a folder which also contains the map.  Then, the previews can be loaded into Glest to let us preview before we play as well. ;D

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Map editor development
« Reply #58 on: 26 March 2010, 00:43:58 »
Yes that is a good idea.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Map editor development
« Reply #59 on: 26 March 2010, 02:18:39 »
The "new" map editor is great.  :thumbup:
But when I try to open the map by opening it in Windows, it will just start up the editor, and will not open the map. (I associated the GBM/MGM files with the map editor)...  So...why?  ::)
Thanks.  :)

zombiepirate

  • Guest
Re: Map editor development
« Reply #60 on: 26 March 2010, 03:28:22 »
Loading a map via file association works fine for me in Linux... are you sure you associated the files correctly?

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #61 on: 26 March 2010, 07:59:17 »
As far as map randomization goes how should the player start locations be randomized? There are basically two options: ...

This will be tricky, and some terrain analysis may be needed to get good results.  I'd recommend ignoring this problem for now, just concentrate on good hieghtmap and object placement results. Even resource placement might need some terrain analysis to get good & 'fair' maps.

But when I try to open the map by opening it in Windows, it will just start up the editor, and will not open the map. (I associated the GBM/MGM files with the map editor)...

Ensure you didn't associate them with the old map editor, this works fine for me on windows.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #62 on: 26 March 2010, 08:16:54 »
We should be able to save these previews in a folder which also contains the map.  Then, the previews can be loaded into Glest to let us preview before we play as well. ;D

It would be nice to have a map preview in the new game menu but what i added can't be used for this. It's just direct loading the map without units and fog of war in glest, no render from far away.

zombiepirate

  • Guest
Re: Map editor development
« Reply #63 on: 26 March 2010, 16:57:20 »
This will be tricky, and some terrain analysis may be needed to get good results.  I'd recommend ignoring this problem for now, just concentrate on good hieghtmap and object placement results. Even resource placement might need some terrain analysis to get good & 'fair' maps.

Well, my algorithm so far uses seed start locations for players and resources (including trees) and grows resources around the seeds. It so far builds playable maps which are fair a decent number of times.



I could commit the code I have so far or post a patch if you'd like to take a look at it.

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Map editor development
« Reply #64 on: 26 March 2010, 23:14:15 »
Never mind, it works. I just had to "click" on it once...  :-[ Silly me.  :|
Thanks.  :thumbup:

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Map editor development
« Reply #65 on: 27 March 2010, 10:26:49 »
I could commit the code I have so far or post a patch if you'd like to take a look at it.
Please commit to trunk which holds the newest map editor. Post commit review is just fine.

zombiepirate

  • Guest
Re: Map editor development
« Reply #66 on: 27 March 2010, 17:19:08 »
Ok, the changes have been committed to trunk. I made comment blocks at the top of the Map::randomize() function talking about how it works and at the bottom about what I thought for terrain randomization.

zombiepirate

  • Guest
Re: Map editor development
« Reply #67 on: 28 March 2010, 20:26:19 »
I did a bit of work with the terrain randomization, I have not yet implemented the "diamond" stage in the "diamond-square" algorithm but filling the map with squares looks like this:

http://www.mediafire.com/?ytdmnjoth3m

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Map editor development
« Reply #68 on: 28 March 2010, 22:26:30 »
Looks good, way more realistic.  :)
Get the Vbros': Packs 1, 2, 3, 4, and 5!

zombiepirate

  • Guest
Re: Map editor development
« Reply #69 on: 28 March 2010, 23:18:38 »
Thanks ElimiNator.  ;D I wasn't even finished yet though!

I've finished the "diamond-square" terrain generation now, and it gives some pretty neat results. I still have yet to do any terrain analysis for good object placement, but I'm sure everyone would like to see what I have so far. I don't know if this map is playable for 4 players (I think the yellow guy got put in a lake) but It's still fun to look at in the map preview.

http://www.mediafire.com/?biuoztqzj20

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Map editor development
« Reply #70 on: 28 March 2010, 23:22:05 »
Do you think there could be a way to make the map random but give it radial symmetry, so none of the players are at a (dis)advantage from the terrain?

zombiepirate

  • Guest
Re: Map editor development
« Reply #71 on: 28 March 2010, 23:30:40 »
Quite possibly, the algorithm that's being used right now can be seeded and I intend to do that eventually. If certain points were seeded up and others seeded down then lakes or mountains could be coaxed into existence. I don't think 100% symmetry would look good but partial symmetry could look good and still be fair.

As far as player placement goes, I'm still planning on doing a bit of terrain analysis so that players don't get placed in lakes like the poor yellow guy in the last map I posted.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Map editor development
« Reply #72 on: 29 March 2010, 03:57:43 »
... in the "diamond-square" algorithm but filling the map with squares looks like this:

/me drools
I like algorithms, especially ones I'm not already familiar with  :o

I've had a look over the additions in changset 530, but not your newer commit yet, I can solve some of your TODOs and probably some other problems with another algorithm I'm quite fond of, but it will require moving some code from the game into the shared lib.

You seem to be 'full steam ahead' though, so don't 'wait up' on my account, but as soon as 0.2.13 is out the door, I have some fancy tricks I'd like to share with you ;)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

zombiepirate

  • Guest
Re: Map editor development
« Reply #73 on: 29 March 2010, 04:17:05 »
Well, I'm quite fond of algorithms as well  :)

I'm also rather fond of fancy tricks and if you're planning to tell me about some I'd be happy to listen.

There's also a couple of other terrain generating methods that I looked into. One especially looked like it would be good at generating valleys and I was thinking about using it in addition to the one I'm using now.

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Map editor development
« Reply #74 on: 30 March 2010, 10:47:47 »
Good work.  :)

In 'Programming an RTS Game with Direct3D' book he multiplies a hightmap defining the player areas and multiplies it with the generated hightmap. "To ensure each player gets an equal size of flat terrain" and "to ensure that a path exists between the players". He uses perlin noise (and multiplying different octave levels) to generate the hightmap, although it looks like the diamond-square method is more popular.
« Last Edit: 30 March 2010, 10:51:45 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

 

anything