forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Sun Nov 19, 2017 5:43 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu May 06, 2010 8:27 pm 
Offline

Joined: Thu Apr 08, 2010 7:43 am
Posts: 15
I think I found a good way to write quickly the drawMap.php file, in particular the part of it related with the placement of 'neutral square' behind the centers which belong to a nation but have to be neutral at the beginning of the game (as Ceylon in the Colonial map).
1. find the right position for one center, and note it down (we shall call it center A); 2. open the map image and define a new layer in the image software (I use Gimp);
3. in the new layer, copy and paste an identical center which covers exactly center A;
4. choose a color (I used [243,128,139] ) and put a dot in the position previously noted down;
5. copy an area which comprises the center and the colored dot, and paste it on every center which has to have the neutral rectangular shape;
6. deselect every layer but the new one;
7. save the picture;
8. with a simple program (I used a 10-rows Matlab script, enclosed in the next post) find the (x,y) position of each colored dot;
9. write them in the drawMap.php file (guessing which center has which numbers should not be difficult!)


Top
 Profile  
 
PostPosted: Thu May 06, 2010 8:31 pm 
Offline

Joined: Thu Apr 08, 2010 7:43 am
Posts: 15
Code:
imag=imread('orientation.png','png');

x=1;
y=1;
j=1;
height=length(imag(:,1));
width=length(imag(1,:))/3;
%this value needs to be divided by 3 in Matlab

for x=1:width
    for y=1:height
        if imag(y,x,1)==243&imag(y,x,2)==128&imag(y,x,3)==139
            found_x(j)=x-1;     %minus one because Matlab has no zero index
            found_y(j)=y-1;     %minus one because Matlab has no zero index
            j=j+1;
        end
    end
end

found=[found_x' found_y'];   %just to arrange them in a better format


Top
 Profile  
 
PostPosted: Thu May 06, 2010 11:35 pm 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
I don't quite understand why these territories need to start under control of one nation as it is?


Top
 Profile  
 
PostPosted: Fri May 07, 2010 12:03 am 
Offline

Joined: Thu Apr 08, 2010 7:43 am
Posts: 15
It's just a matter of graphics or hystorical situation: they can't be actual supply centers, because this would affect the game too much; on the other end, in many cases it's nice to see the theorethical influence zones of the different nations.
Look at example at the Colonial map: should Britain start the game with a unit in every pink centers, the game would be unbearably unbalanced, but it's cool to see which centers theoretically belong to Britain, isn't it?


Top
 Profile  
 
PostPosted: Fri May 07, 2010 12:19 am 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
I guess not.


Top
 Profile  
 
PostPosted: Fri May 07, 2010 1:31 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Tadar Es Darden wrote:
It's just a matter of graphics or hystorical situation: they can't be actual supply centers, because this would affect the game too much; on the other end, in many cases it's nice to see the theorethical influence zones of the different nations.
Look at example at the Colonial map: should Britain start the game with a unit in every pink centers, the game would be unbearably unbalanced, but it's cool to see which centers theoretically belong to Britain, isn't it?

For a historical map sure, but for a game of Diplomacy that just sounds v confusing :P


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group