.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   Images of Westeros, somebody make a map out of it! (http://forum.shrapnelgames.com/showthread.php?t=39527)

Kristoffer O July 5th, 2008 09:26 AM

Re: Images of Westeros, somebody make a map out of
 
Placing 2500 individual provinces in a map would take huge amounts of time. I can't see how anyone could finish making a map where thy intend to place 2500 provinces, which i assume one would do if one made the westeroes map playable.

I would probably not play a map of similar proportions, but I imagine there are those who would. But playing might be more rewarding then placing and naming provinces. http://forum.shrapnelgames.com/images/smilies/happy.gif

Sombre July 5th, 2008 09:33 AM

Re: Images of Westeros, somebody make a map out of
 
The westeroes map doesn't inherently have 2500 provinces. If you look at the boardgame version it has like 50.

It can have as many provinces as the mapper wants it to have. I think 100 or so would fit well on the map.

Gandalf Parker July 5th, 2008 07:52 PM

Re: Images of Westeros, somebody make a map out of
 
As much as I love huge maps, and do play 1500 maps, I would advise against increasing the size again. The last increase involved far more than we expected. The game crashed over some of the strangest things and we had to increase many arrays that we did not expect to be affected.

Atreides July 6th, 2008 02:00 AM

Re: Images of Westeros, somebody make a map out of
 
I am definitely a fan of large maps, and thank you Ich for that province count. How did you determine the number approximately? I figured I was over, but fortunately I am OCD enough and love A Song of Ice and Fire enough that I'll just redraw it with fewer provinces http://forum.shrapnelgames.com/images/smilies/happy.gif Probably on the image you posted too. It's much cleaner, maybe add in some of the labels that are on the image I used. Oh well, back to work.

PvK July 6th, 2008 06:49 AM

Re: Images of Westeros, somebody make a map out of
 
The Oeridia (sp?) map has 1225 provinces, and is freaking enormous, complex, and lots of fun, but perhaps a bit much.

lch July 8th, 2008 10:00 AM

Re: Images of Westeros, somebody make a map out of
 
Quote:

Atreides said:
thank you Ich for that province count. How did you determine the number approximately?

I counted the white pixels, then rounded towards the next largest number.

To get the number of pixels of any color, you could do the following for example:
- install ImageMagick
- run it like 'identify -verbose Westeros.bmp'
- look for the row titled "(255,255,255) #FFFFFF white" in the color histogram, the number in front is the pixel count

(If you're on *nix: 'identify -verbose Westeros.bmp | grep white')

Edratman July 8th, 2008 12:40 PM

Re: Images of Westeros, somebody make a map out of
 
Quote:

PvK said:
The Oeridia (sp?) map has 1225 provinces, and is freaking enormous, complex, and lots of fun, but perhaps a bit much.

I agree entirely. I've been playing this map almost exclusively for a few months, but I end up quitting because of the turn times. I believe it has about 1200 provinces, and this appears to be my limit. I put 30 to 40 opponents in it (all eras mod) and it is fun, up to a point. Larger maps would just result in more start variety, but the same time problems after 50 or 60 turns. There just would be more provinces and foes out of reach.

lch July 8th, 2008 01:19 PM

Getting the number of provinces in an image
 
Ok, apparently the solution that I provided to count the number of provinces doesn't work because ImageMagick refuses to generate a histogram for an image as big as Westeros.bmp.

What I used to count the number of pixels was some small Python program. It uses PIL, the Python Imaging Library.

Here's my code:

<font class="small">Code:</font><hr /><pre>from PIL import Image

img = Image.open("Westeros.bmp")
(xdim, ydim) = img.size
# yeah, this is a hackish way to do things
channels = len(img.getbands())
white = tuple([255]*channels)

count = 0
if Image.VERSION &gt;= "1.1.6":
data = img.load()
for y in range(ydim):
for x in range(xdim):
if data[x,y] == white:
count += 1

else:
data = img.getdata()
for y in range(ydim):
for x in range(xdim):
if data[x+y*xdim] == white:
count += 1

print count, "provinces"</pre><hr />
This takes about 30 seconds to complete, because of the for loops which do the pixel checks. There are ways to speed this up. First, you could consider mapping to the luminance:
<font class="small">Code:</font><hr /><pre>from PIL import Image
count = list(Image.open('Westeros.bmp').convert('L').getda ta()).count(255)
print count, "provinces"
</pre><hr />
This takes half as long, but the conversion from the internal PIL format to Python data containers still takes too long. If you want to make full use of the underlying C code that PIL is built on, then you can do the following:
<font class="small">Code:</font><hr /><pre>from PIL import Image
count = Image.open('/home/lch/dominions3/maps/Westeros.bmp').convert('L').histogram().pop()
print count, "provinces"</pre><hr />
This takes less than a second on the Westeros.bmp for me.

The way that I am getting the information that I want here, over histograms, can be done with image editing programs, too. Just look where your image editing program has the Histogram function, and set it to Luminance/Value. Then enter a range of 255-255 (or pick the pure white color) and it should tell you the number of provinces. GIMP seems to have a bug, though: Although it does work correctly with other map images that I have tried, it reports something like 12038 pure white pixels here, which clearly is wrong.

Instructions for GIMP:
- open image
- open Histogram: either through "Colors &gt; Info &gt; Histogram" or "Dialogs &gt; Histogram"
- change channel to "Value"
- enter 255 as left and right limit
- look at "Count" value

Workaround for GIMP:
- open image
- choose "Select &gt; by color" (Shift+O)
- select a pure white pixel
- choose "Edit &gt; Copy" (Ctrl+C)
- choose "Edit &gt; Paste as &gt; New Image"
- do the above, but with 0 and 255 as limits for the range

Atreides July 8th, 2008 04:28 PM

Re: Getting the number of provinces in an image
 
Thanks Ich, that'll help a lot when I'm redrawing the map. Much appreciated.


All times are GMT -4. The time now is 02:32 PM.

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