.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   DomMap - new Version (http://forum.shrapnelgames.com/showthread.php?t=21216)

LintMan October 10th, 2004 12:14 AM

DomMap - new Version
 
A few weeks ago, I started looking into the DomMap random map generator program to take a look at how it works (it's a pretty cool program), and I thought it might be fun to add some features and fixes while I was in there. I had a few ideas and asked Gandalf for some ideas as well, which he was happy to share.

So I've been plugging away at it for a while, having some fun, and it's about time to let some other people besides Gandalf have a crack at it.

I've updated the Version to 2.12 (yeah, I've gone through multiple rounds of changes/fixes with Gandalf beta-testing for me (thanks, Gandalf!).) You can find the zip file with both the source and a Windows executable at: http://www.dom2minions.com/DomMap/DomMap212.zip

So what's new? I haven't kept an explicit change log of what I've done, but I'll try to remember the notable details...

- Impassable borders option: you can specify a fraction of the province neighbor connections to be made uncrossable (ie: like the Cradle map) to create some bottlenecks and chokepoints. Uncrossable borders are marked with a thicker (2-3x) border. DomMap will ensure that all provinces are interconnected and reachable from each other no matter what fraction of impassable borders you set. Optionally sea-sea borders can also be randomly made impassable.

- The province capital placement algorithm is revamped to be far more able to find islands, peninsulas, and landlocked lakes much more frequently. I've also tweaked the default settings to help with this as well.

- large/small provinces - there are new options to set thresholds for provinces being marked as large or small based on their pixel sizes in relation to the average land or sea province size. Some statistics about land/sea province sizes and the number of large/small provs is now output to the .map file.

- manysite provinces - you can set a fraction of all provinces to be set with the ManySites flag bit, which will cause it to be more likely to contain special sites.

- fixed bug in the random generation code that was causing (in Visual C++ anyway) some odd square map artifacts and was also causing the shadow map shading to not work correctly.

- I also discovered the rand() random number generator isn't so great (at least under VC++), and can only generate 32K different values (no so hot when one large map can easily use 6 million+ random values). I've integrated the "Mersenne Twister psuedorandom number generator" as a superior random number generator (it's not GPL, but it's freely distributable - just need to preserve their copyright notice).

- added new default terrain/border colors chosen by Gandalf

- Sea provinces can now contain land, so tiny islands are not bordered off as unusable islands or converted into sea pixels.

- Fixed some problems with the land/sea border color options not working correctly.

- Fixed a bug that sometimes resulted is a province not being marked #nostart when it should have been.

- borders were stopping 1 pixel short of the map edges - fixed.

- sea provinces can now have special shapes just like land ones do.

- The #terrain lines in the .map file are now annotated with a text comment showing province land/sea type, and its number of land/sea connections, in the form of: L-S2L3 for a land province with 2 sea and 3 land neighbors. This was a request from Gandalf to help people who do further work on the random maps (adding independents, etc).

- added -blank option to create maps with only plains terrain for those that use the random maps as an outline basis to paint their own maps on.

There's probably a few small things I missed, but that's the bulk of it.

You can run DomMap with -help to get a listing of all the command line options. I can help explain them further if anyone want to know what they do. Gandalf has generated a set of small maps with the same random seed but other, different parameters which can help show what some of their effects are. That's at: http://www.dom2minions.com/~dominion...ojects/DomMap/

Let me know if you have any other questions/problems with DomMap, and I can try to help.

-LintMan


Edit: fixed link to small example maps

deccan October 10th, 2004 12:20 AM

Re: DomMap - new Version
 
The link is incorrect.

LintMan October 10th, 2004 12:29 AM

Re: DomMap - new Version
 
Oops, sorry! It should be fixed now.

Arryn October 10th, 2004 12:37 AM

Re: DomMap - new Version
 
Quote:

LintMan said:
You can find the zip file with both the source and a Windows executable at: http://www.dom2minions.com/DomMap/DomMap212.zip


Is the Windows .exe in your archive compatible with the already-existing Windows GUI front-end for DomMap (by Mark Garnett, available on my website)? If so, I can remove the binary I compiled back in late February in favor of your latest one.

Gandalf Parker October 10th, 2004 01:02 AM

Re: DomMap - new Version
 
Here is a quicky list of command switches....

Usage: ./dommap <options>
-v (for verbose mode)
-h <map height> (100-2400)
-w <map width> (100-3200
-n <map name>
-s <random seed>
-r <terrain ruggedness>
-sr <Shadow map ruggedness>
-wl <water line (0-100)>
-tl <tree line (0-100)>
-ml <mountain line (0-100)>
-pl <poverty line (0-100)>
-rl <rich line (0-100)>
-d <terrain dithering>
-ns <num of sea provinces>
-nl <num of land provinces>
-ps <percent special shape provinces>
-sa <min distance from shore (sea)>
-la <min distance from shore (land)>
-ss <distance between sea provinces>
-ls <distance between land provinces>
-sc <cost for spreading over shore>
-tc <cost for spreading over terrain>
-sm <amount of border smoothing>
-ln <minimum neighbours for starting (land)>
-sn <minimum neighbours for starting (sea)>
-imp <fraction impassable borders (0.0-1.0)>
-th3 (use triple-thickness for impassable borders (default))
-th2 (use double-thickness for impassable borders (default))
-ssi <1 = allow sea-sea impassable borders, 0 = not allowed>
-ms <fraction provinces marked as ManySite (0.0-1.0)>
-nfw (do not prevent all land pixels in sea provinces - default)
-fw (all land pixels in sea provinces are converted to sea if smoothing is on)
-ba <on|off> Turns additional shading on or off (default is on)
-bw <on|off> Turns additional shading of water on or off (default is off)
-beb <0-255> Max amount to brighten a color due to elevation-map
-bes <0-255> Max amount to shade a color due to elevation
-bsb <0-255> Max amount to brighten a color due to shadow-map
-bss <0-255> Max amount to shade a color due to shadow-map
-c_plains <0xrrggbb Sets the colour of plains to the specified RGB hex value>
-c_water <0xrrggbb Sets the colour of water to the specified RGB hex value>
-c_mountain <0xrrggbb Sets the colour of mountains to the specified RGB hex value>
-c_farmland <0xrrggbb Sets the colour of farmland to the specified RGB hex value>
-c_forest <0xrrggbb Sets the colour of forests to the specified RGB hex value>
-c_swamp <0xrrggbb Sets the colour of swamp to the specified RGB hex value>
-c_tundra <0xrrggbb Sets the colour of tundra to the specified RGB hex value>
-c_wasteland <0xrrggbb Sets the colour of wasteland to the specified RGB hex value>
-c_land_border <0xrrggbb Sets the colour of land borders to the specified RGB hex value>
-c_sea_border <0xrrggbb Sets the colour of sea borders to the specified RGB hex value>
-sps <max fraction of average province size to be a small province (0.0-1.0)
-lps <min multiple of average province size to be a large province (1.0+)
-blank (produce a 'blank' map: no (visible) terrain except sea, plains)

Gandalf Parker October 10th, 2004 01:07 AM

Re: DomMap - new Version
 
If anyone wants to suggest a better color set feel free to while we are still fairly un-distributed. The colors are mostly my fault.

On the examples:
http://www.dom2minions.com/~dominion...ojects/DomMap/

by setting them all to the same random "seed" of 7 it allowed me to run the same map with different switches. While doing that I realized that one neat thing someone might do is a dark and light map. Such as, on the map I did there are two continents. Run it with no coloration of water and a set water color. Once lightened, and once darkened. Then cut-n-paste one continent from each run onto one map. Could be a neat effect.

Now that we are released I will try to get around to changing the nightly maps run to use the new program. Maybe I will have each size do it partially to slide into it.

LintMan October 10th, 2004 01:22 AM

Re: DomMap - new Version
 
Quote:

Arryn said:
Is the Windows .exe in your archive compatible with the already-existing Windows GUI front-end for DomMap (by Mark Garnett, available on my website)? If so, I can remove the binary I compiled back in late February in favor of your latest one.

I just dl'd the GUI, and it does work, but of course it doesn't have controls for the latest switches I've added, which means until/unless it's updated, you're stuck with the defaults for those settings. That probably won't matter much except that impassable borders is turned on by default, which some people may not want.

If you'd like, I can build a new windows exe with different defaults that may suit the GUI better.
In fact, let me do that right now and just attach it here...

Or not. For some reason it keeps telling me it can only attach files with certain extensions (including .exe), but I'm trying to upload a .exe file. Should I just email you the exe, Arryn?

-LintMan

Arryn October 10th, 2004 01:34 AM

Re: DomMap - new Version
 
Yes, please email me the .exe and I'll update your archive with it before I host your archive on my site.

Perhaps, if we're lucky, Mark will update his GUI to include your new controls. (If he doesn't, and if there's enough demand, I could always write a new GUI myself, though I'd probably do it in Java so that everyone could use it.)

LintMan October 10th, 2004 01:48 AM

Re: DomMap - new Version
 
Arryn: sent.

Arryn October 10th, 2004 02:01 AM

Re: DomMap - new Version
 
Thanks. I've updated my site accordingly.

mgarnett October 11th, 2004 07:05 AM

Re: DomMap - new Version
 
Hi Guys,

if you like I can modify the GUI to add the new switches. Should only take a couple of minutes. Let me know if you still need me to do that and I will get right on it and send through the new EXE.

Mark

Arryn October 11th, 2004 07:38 AM

Re: DomMap - new Version
 
Please do, Mark. Then email me the latest file. Thanks.

Nagot Gick Fel October 11th, 2004 09:09 AM

Re: DomMap - new Version
 
IMO this thread deserves to be stickied.

Arryn October 11th, 2004 10:56 AM

Re: DomMap - new Version
 
Quote:

Nagot Gick Fel said:
IMO this thread deserves to be stickied.

Don't we have enough stickies already? IMO, a better solution is to add a link to the thread in Zen's links sticky, especially since there already is a mapping section in that post.

Edi October 11th, 2004 12:37 PM

Re: DomMap - new Version
 
Gandalf, might I suggest 0xb43c00 for the land border color? It corresponds to Red 180, Green 60, blue 0, and is a nice reddish color, close to red brick. It wouldn't be quite as painfully bright as the current red border, but it will be clearly visible. If the borders can be set to be discrete (no color diffusion toward the edges, or is that just the effect of saving the files to jpg?), it will do the job wonderfully.

Edi

Gandalf Parker October 11th, 2004 01:19 PM

Re: DomMap - new Version
 
Quote:

Edi said:
Gandalf, might I suggest 0xb43c00 for the land border color? It corresponds to Red 180, Green 60, blue 0, and is a nice reddish color, close to red brick. It wouldn't be quite as painfully bright as the current red border, but it will be clearly visible.

Thanks. that maximum red was the original setting and I kept meaning to soften it. The MapEditor has a preference for red borders. I did do some experimentation to get a watery border which was better but still has enough red for the editor (I think, I havent tested it).

Of course anyone who wants to download/play with the program now can use the switch of -c_land_border 0xb43c00 to override that red. But I think you are probably correct that the default should be something along the line of what you said.

How about swamp? I wanted to get it abit more sick-green and easier to tell apart from the plains and farmlands.
Quote:

If the borders can be set to be discrete (no color diffusion toward the edges, or is that just the effect of saving the files to jpg?), it will do the job wonderfully.

Thats the JPG effect.

Gandalf Parker October 11th, 2004 01:21 PM

Re: DomMap - new Version
 
Quote:

Gandalf Parker said:
Quote:

Edi said:
Gandalf, might I suggest 0xb43c00 for the land border color? It corresponds to Red 180, Green 60, blue 0, and is a nice reddish color, close to red brick. It wouldn't be quite as painfully bright as the current red border, but it will be clearly visible.

Thanks. that maximum red was the original setting and I kept meaning to soften it. The MapEditor has a preference for red borders. I did do some experimentation to get a watery border which was better but still has enough red for the editor (I think, I havent tested it).

Of course anyone who wants to download/play with the program now can use the switch of -c_land_border 0xb43c00 that Leif put in to override that red. But I think you are probably correct that the default should be something along the line of what you said.

How about swamp? I wanted to get it abit more sick-green and easier to tell apart from the plains and farmlands.
Quote:

If the borders can be set to be discrete (no color diffusion toward the edges, or is that just the effect of saving the files to jpg?), it will do the job wonderfully.

Thats the JPG effect.


LintMan October 11th, 2004 01:25 PM

Re: DomMap - new Version
 
Quote:

Edi said:
Gandalf, might I suggest 0xb43c00 for the land border color? It corresponds to Red 180, Green 60, blue 0, and is a nice reddish color, close to red brick. It wouldn't be quite as painfully bright as the current red border, but it will be clearly visible. If the borders can be set to be discrete (no color diffusion toward the edges, or is that just the effect of saving the files to jpg?), it will do the job wonderfully.

I'll leave it to Gandalf to comment on your border color suggestion, but I will just mention that you can override the default land border color with the -c_land_border switch (though that won't help you if you want to download maps from Gandalf's site.)
Edit: Doh! In the time it took me to make my reply, Gandalf already replied twice!

The random maps do not diffuse the border colors at all - if you open the .tga files, you can verify that. But Dom2 itself seems to apply a slight blur or perhaps antialiasing to the maps.

Nagot Gick Fel October 11th, 2004 01:46 PM

Re: DomMap - new Version
 
Quote:

Arryn said:
Don't we have enough stickies already? IMO, a better solution is to add a link to the thread in Zen's links sticky, especially since there already is a mapping section in that post.

That would be fine.

Edi October 11th, 2004 02:04 PM

Re: DomMap - new Version
 
I'll play around with GIMP and try to find a suitable swamp color. I kind of like the gray-green colors that can be found in the Faerun map's swamps, so I'll see if one of those fits the bill.

Edi

Gandalf Parker October 11th, 2004 02:44 PM

Re: DomMap - new Version
 
Quote:

Edi said:
I'll play around with GIMP and try to find a suitable swamp color. I kind of like the gray-green colors that can be found in the Faerun map's swamps, so I'll see if one of those fits the bill.

Good. Im not a good choice for colors. My eyes, and my giant monitor that I wont give up, are both getting weak. Feel free to recommend better greens and browns for my site also. Im getting jokes about it.

I was debating that I should probably pull up Kristoffers latest map and pull the colors out of that. As a general default on map colors that would seem to be a good source.

I wonder if anyone will play with the color switches and do a lava map, or a desert map, or arctic, jungles, etc etc. Hmmm if I choose dark cave colors and set the impassable switch to maximum I could get a cave layer. Ohh Ohh do a width 2000 and heigth 500 with colors of blues and whites, another 2000x500 of greens and ocean, and a Last with cave colors and a maze, then paste them together into one 3 level map. I know there are already a couple like that but I like the idea.

LintMan October 18th, 2004 12:22 AM

v2.17
 
1 Attachment(s)
I have a new Version, 2.17 ready. Notable additions:
- a gaussian blur is applied to the map to smooth things out some. This blur can be turned off or increased through new switch -gbr.
- Some anti-aliasing is applied to the province borders to spiff them up a bit and make them more visible. The strength of this is controlled through new switches -aa and -aad.
- capitals are now surrounded by a small yellow diamond shaped border to make them more visible. The effect can be disabled with the -cb switch and the color changed through the -c_cap_border switch. The shape of the border is under consideration if people want to vote for an alternate such as a simple + shape, x, or square.
- improved switch help output showing default values
- note that a few parameters now take percentages (0-100) instead of 0.0-1.0 fractional ranges
- somewhat smaller memory requirements.

I have sent the zip to Gandalf, who will hopefully add it to his site and if Arryn is willing to host it, I will send it there as well. And let me try again to attach it here...

Gandalf Parker October 18th, 2004 10:20 AM

Re: v2.17
 
Yes the link for now is.....
http://www.dom2minions.com/~minion/DomMap/dommap217.zip
If someone wants to whip out a "homepage" for DomMap I would gladly accept it. http://forum.shrapnelgames.com/images/smilies/happy.gif

We have abit of a voting lock. Some of you with a discerning eye want to voice an opinion on the new capital-outline feature? Is the diamond OK? Will it actually allow for color variation off of that yellow color?

Others for consideration would
(A) + (one pixel above, below, and each side
(B) x (a pixel on each diagonal)
(C) box
(D) diamond as it is now.

PhilD October 18th, 2004 04:17 PM

Re: DomMap - new Version
 
I tried downloading and running the new Version, and ran into something strange.

The Perl script (with no arguments) seems to freeze midway through a Gimp script-fu; if I Ctrl-C it, that kills the Gimp, and the script runs its course, but the resulting maps are way more blurry than I'd expect; the run_dommap.sh (shell script) gives, IMHO, a much better result.

Is that normal, or is this Version only intended to be used with more precise options?

Gandalf Parker October 18th, 2004 07:14 PM

Re: DomMap - new Version
 
Actually I dont think the scripts are looked at. DomMap now has its own blur routine. Actually something like 5 of them. One standard blur written in, one shadow-terrain effect, one for shadow-roughness which does what bump and scatter were doing to the maps before, one which does the new capitals highlighting, and one which anti-aliases the borders. All of them have new switches to control them.

The easiest I think is to run it just as defaults, then change what you feel you need to.

LintMan October 18th, 2004 11:29 PM

Re: DomMap - new Version
 
1 Attachment(s)
Quote:

PhilD said:
I tried downloading and running the new Version, and ran into something strange.

The Perl script (with no arguments) seems to freeze midway through a Gimp script-fu; if I Ctrl-C it, that kills the Gimp, and the script runs its course, but the resulting maps are way more blurry than I'd expect; the run_dommap.sh (shell script) gives, IMHO, a much better result.

Is that normal, or is this Version only intended to be used with more precise options?

Sorry, the Perl script is a bit out of date... Using Gimp 2.0.2 in WinXP, I had to hack the script-fu script to get it to work called from within gimp, and I've never been able to get anything but a useless error when calling it from the command line. So I had long ago changed my copy of the perl script to skip the gimp part but left it as-is in the main distribution because presumably it worked OK for others. Then I forgot all about the difference.

But in any case, with the built-in blur in DomMap, the gimp stuff isn't really necessary (which was the point). I'm attaching a new perl script sans the gimp bit.

Edi October 19th, 2004 05:07 PM

Re: DomMap - new Version
 
Gandalf, check your email. I ran a couple of quick and dirty tests on the colors I lifted from the Faerun map, the suggestions are in the text file I attached to the message.

Edi

Gandalf Parker October 19th, 2004 05:29 PM

Re: DomMap - new Version
 
Got it, thanks. Forwarded a copy to Lintman

LintMan October 20th, 2004 03:32 AM

Re: DomMap - new Version
 
Quote:

Edi said:
Gandalf, check your email. I ran a couple of quick and dirty tests on the colors I lifted from the Faerun map, the suggestions are in the text file I attached to the message.


I like the colors, Edi. As you mentioned, they can sometimes come out way too light after all the shading, etc is done. Here's some settings you can use to prevent that for the most part:
-beb 16 -bes 96 -bsb 32 -bss 128

Gandalf Parker October 20th, 2004 10:07 AM

Re: DomMap - new Version
 
Quote:

LintMan said:
Quote:

Edi said:
Gandalf, check your email. I ran a couple of quick and dirty tests on the colors I lifted from the Faerun map, the suggestions are in the text file I attached to the message.


I like the colors, Edi. As you mentioned, they can sometimes come out way too light after all the shading, etc is done. Here's some settings you can use to prevent that for the most part:
-beb 16 -bes 96 -bsb 32 -bss 128

Hmmm I always felt that the range on those was alittle high anyway. Too much random variation for a default setting. Maybe if Edi (and anyone else who wants to check it) feels that the new colors, and the new shading variables, work well together then we can chance both at once to be an acceptable general default for the public. As long as it still ALLOWS a range from slightly-less and slightly-more than the developer thinks anyone would ever want, then Im happy with the possiblities for my beloved randoms

Edi October 20th, 2004 10:41 AM

Re: DomMap - new Version
 
I'll get around to checking it in a couple of days. Right now, too busy with making corrections to a project related job assignment with a deadline.

Edi

Edi October 20th, 2004 06:44 PM

Re: DomMap - new Version
 
Actually, it looks like I found time to do the map color testing today (took #&*! hours...)

After fiddling enough with the color settings to be sick and tired of them for life, I have found that in my opinion the following would make best color defaults (assuming Lintman's filters)

Plains: dcc8af (or possibly e1cdaf if you like a slight bit darker, but imo the first is better with the forest and mountain colors)
Swamp: 969687
Tundra: d7dce1
Wasteland: e6b464
Farmlands cdcd82
Forest: 466446 (or possibly 465f46, or perhaps 46644b, but the first one is imo best)
Mountains: 8c6455
Sea: afcde1 (I could test some more possibilities for this one)
Sea border: 0f417d (darker) or 2350a0 (lighter), depending on what you prefer. The ideal is probably somewhere in between, but it's half past midnight here, and my gf will kill me if I stay up any longer twiddling with this.

I like these colors more than the initial ones, because they are more powerful. A map with the same random seed (7) made with the earlier suggestions compared to one made with these new ones looks like a pale ghost with a storm-darkened sea.

The most difficult part was finding a proper swamp color, and it only cleared when I switched the old forest color to swamp and then leached some of the green away from it.

Run the program with these settings and compare to the old, you'll see how much better it is now. http://forum.shrapnelgames.com/images/smilies/happy.gif

Edi


All times are GMT -4. The time now is 10:09 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.