World Data/API?

DeletedUser

Guest
I now have a working interface, next project will be zooming in on islands
 

DeletedUser

Guest
As you all probably know each city has x,y coordinates of the island, and an island position. You have to know how the city numbers are counted for each island type, and I have figured this out for 8 of the 10 island types. But I dont have coordinates of the last two island types. Any help is appreciated.

This is how you do this:

1) Copy the name of a city on the island you want to check.
2) Open the file towns.txt and search for the city.
3) Note the town position on the island (6th value in the record)
4) Copy the x and y coordinates (like xxx,yyy).
5) Search the coordinates in the file islands.txt
6) Note the island type number. (4th value in the record).

If it is a type 6 or a type 8 island please post the city coordinates here. You might want to figure out yourself how the towns are numbered :)

This is what I figured out:

Island type 1: Start north, count to the left. (first position counts as 0)
Island type 2: start north-west in the bay, count to the right
Island type 3: start north left of bridge, count to the left
Island type 4: start northeast, count to the right
Island type 5: start northwestwest, count to the right
Island type 6:
Island type 7: start left, count to the right
Island type 8: start northeast, count to the right
Island type 9:
Island type 10: start northeast, count to the right
 

DeletedUser

Guest
Good work, now how to figure out the spacing between the cities and translating it to the map will be the hard part ;)

It might be easier to make the map bigger at first, run the program, then scale the size down.
 

DeletedUser

Guest
It might be easier to make the map bigger at first, run the program, then scale the size down.

Hm. not sure i get what you mean with this. In my current program each pixel represents an island. But if you zoom in you need to have the exact location of cities. Also if you want to be able to do attack planning you need exact distances.

There are two options:
1) InnoGames provides this information (they must know all details of the game lol). I have asked them to do so...or
2) we might be able to use travel times of e.g. slingers between cities to map the cities on the islands in an x-y plane.

I would prefer the first method because it will give better results if we use the exact data from the game developers, and its a hell of a job to do the mapping ourselves.
 

DeletedUser

Guest
What I meant by that is if you want to do a map covering the entire world with the individual cities map, first you would make the map with each city spaced properly. This would mean a much larger number of pixels on the map. But you could then use something else to resize the image to something more workable.
 

DeletedUser

Guest
Ah i get it. Yeah worlds are very large in Grepolis. My islands map is 1000x1000 pixels lol.

I was thinking of having the option to make ocean maps, because in my experience players tend to think in terms of oceans. Each ocean is a 100x100 map, so that leaves a 10x10 sprite for an island.

But i did not yet examine the islands in detail, i would not be surprised if an island image in the grepolis world spans more than one coordinate. The islands.txt file lists 100.000 islands and there are 1.000.000 coordinates so only 1 out of 10 coordinates is an island coordinate.

lol this gets complicated :)

Oh let me show you the island grid just for fun: island map
 

DeletedUser

Guest
Oh crap, that's scary.

Generating one world map would take forever.
 

DeletedUser

Guest
well yeah thats why i think offline is the way to go.
This is the map with islands that contain cities:

map

Map generating works reasonably fast, it took me like 5 minutes to make the map with the 10 alliances.
 

DeletedUser

Guest
Check the "world map" thread of world alfa, it seems that there are ghost oceans in this world.
 

DeletedUser

Guest
I have been informed by a forum moderator (or maybe from a higher level even) that it is a forum rule to only post images of max size 520x640 pixels. Thats why the maps have been put in spoilers. They are right in that they enforce the rules, i can appreciate that. Just posting this here for others to not make the same mistake.
 

DeletedUser

Guest
I decided that I will publish my python script for making maps in this forum so others can see how it is done and hopefully contribute to it. I will add instructions for getting you up and running using python in case you are not familiar with python.
 

DeletedUser

Guest
Would it be possible for you to make predefined maps, such as these ones, that will periodically regenerate and upload to the same URL automatically? If possible, it would be quite helpful ;)
 

DeletedUser

Guest
Would it be possible for you to make predefined maps, such as these ones, that will periodically regenerate and upload to the same URL automatically? If possible, it would be quite helpful ;)


I smell a tw player :)

But wouldn't doing that mean paying for a server host?
 

DeletedUser

Guest
@Diggo11:

Yeah I see what you mean. I think it should be possible, I could make the program generate all maps for all worlds and have them send to some URL. It is definitely worth looking at.

I had an e-mail correspondence with a python-powered web hosting company, but I havent heard from them for a few days now. Big websites (google, youtube) are python-powered, but it is not easy to find a web host that allows python programs to run on their server because you have the power with python to mess up the server :)

Anyway what I think is also important is to find a way to make your own interactive maps so you decide what alliances, players, islands etc you want to see on the map, and also to have some way of calculating distances for planning attacks.
 

DeletedUser5

Guest
@Diggo11:

Yeah I see what you mean. I think it should be possible, I could make the program generate all maps for all worlds and have them send to some URL. It is definitely worth looking at.

I had an e-mail correspondence with a python-powered web hosting company, but I havent heard from them for a few days now. Big websites (google, youtube) are python-powered, but it is not easy to find a web host that allows python programs to run on their server because you have the power with python to mess up the server :)

Anyway what I think is also important is to find a way to make your own interactive maps so you decide what alliances, players, islands etc you want to see on the map, and also to have some way of calculating distances for planning attacks.

If you're unable to get a python host, if I get the time, I'm sure I'd be able to work with you to convert the code to PHP, as it's easy to get a PHP host.
 

DeletedUser

Guest
@aco4:

Thanks for the offer, I appreciate you are willing to put time in this project (if you have it) and it's an interesting option. I was of the opinion that python is more powerful than PHP but on the web there are differences in opinion (as usual i might add).

I will first put on the forum what I have and then we can decide as a community what to do with it. If anyone feels like converting it to PHP no problem, as long as you have fun doing it. I know PHP a little but i'm not sure about its graphics possibilities.
 

DeletedUser

Guest
Hi again Xarandir, and hello folks in the thread.

First I'd like to congratulate Xandir on the idea of generating a island-domination-based view of the world map...that's an awesome visualization of the alliance's domains in a given world.

Second, about ocean views, have a look at the kind of maps I'm currently able to generating:
About town positions on islands, simply grab the island (X,Y) coordinate and add, in pixels: (relative to the level of zoom you see in the map above)
Code:
townPositions = {
	1: {0:(34,10), 1:(28,12), 2:(22,15), 3:(17,19), 4:(17,23), 5:(16,29), 6:(21,28), 7:(26,30), 8:(33,33), 9:(38,36), 10:(42,33), 11:(49,33), 12:(53,31), 13:(57,29), 14:(63,25), 15:(61,20), 16:(60,15), 17:(55,16), 18:(56,20), 19:(55,24)},
	2: {0:(23,13), 1:(22,7), 2:(29,7), 3:(38,5), 4:(45,6), 5:(50,7), 6:(54,9), 7:(58,11), 8:(58,16), 9:(56,21), 10:(54,26), 11:(50,28), 12:(40,29), 13:(35,29), 14:(26,28), 15:(17,28), 16:(15,23), 17:(9,22), 18:(9,17), 19:(14, 14)},
	3: {0:(36,6), 1:(30,5), 2:(26,6), 3:(22,9), 4:(17,12), 5:(12,18), 6:(12,23), 7:(17,26), 8:(22,28), 9:(26,30), 10:(30,32), 11:(35,33), 12:(40,31), 13:(43,26), 14:(55,29), 15:(52,25), 16:(62,19), 17:(61,14), 18:(57,11), 19:(51,8)},
	4: {0:(38,9), 1:(43,10), 2:(50,11), 3:(54,14), 4:(58,17), 5:(50,20), 6:(45,21), 7:(40,21), 8:(36, 18), 9:(32,15), 10:(25,15), 11:(19,17), 12:(20,21), 13:(21,25), 14:(16,26), 15:(10,25), 16:(8, 20), 17:(13,15), 18:(19,12), 19:(27, 10)},
	5: {0:(17,16), 1:(18,11), 2:(23,7), 3:(30,5), 4:(39,5), 5:(39,9), 6:(46,9), 7:(52,9), 8:(54,13), 9:(60,14), 10:(62,19), 11:(58,24), 12:(53,26), 13:(47,28), 14:(42,31), 15:(33,34), 16:(28,31), 17:(23,28), 18:(46,23), 19:(45,18)},
	6: {0:(34,27), 1:(42,31), 2:(49,33), 3:(55,34), 4:(61,32), 5:(61,27), 6:(56,25), 7:(51, 23), 8:(47,15), 9:(43,13), 10:(36,10), 11:(31,11), 12:(26,13), 13:(20,15), 14:(15,17), 15:(9, 21), 16:(12, 24), 17:(17, 27), 18:(14,32), 19:(20, 34)},
	7: {0:(12,19), 1:(10,16), 2:(9,13), 3:(9,10), 4:(13,8), 5:(17,9), 6:(24,12), 7:(29,13), 8:(36,14), 9:(32,16), 10:(34,19), 11:(37,22), 12:(37,26), 13:(32,29), 14:(32,35), 15:(28,33), 16:(23,32), 17:(18,34), 18:(14,31), 19:(10,30)},
	8: {0:(42,18), 1:(46,20), 2:(50,22), 3:(55,25), 4:(51,27), 5:(47,29), 6:(43,30), 7:(36,33), 8:(32,33), 9:(24,32), 10:(19,29), 11:(14,25), 12:(10,23), 13:(10,19), 14:(8,15), 15:(11,13), 16:(14,11), 17:(17,9), 18:(23,9), 19:(26,13)},
	9: {0:(15,23), 1:(9,22), 2:(10,17), 3:(14,13), 4:(25,7), 5:(30,4), 6:(37,5), 7:(43,10), 8:(59,14), 9:(63,17), 10:(62,22), 11:(53,29), 12:(48,31), 13:(44,27), 14:(39,28), 15:(40,32), 16:(32,32), 17:(28,33), 18:(26,29), 19:(24,26)},
	10:{0:(41,12), 1:(46,8), 2:(52,8), 3:(57,12), 4:(61,17), 5:(59,23), 6:(54,26), 7:(49,29), 8:(39,30), 9:(31,32), 10:(26,31), 11:(21,29), 12:(16,27), 13:(10,22), 14:(11,13), 15:(16,9), 16:(24,8), 17:(29,11), 18:(28,15), 19:(20,15)}
}
The above is Python code, a dict with the 10 types of islands (not included are the islands with no farming villages...I think we can safely agree we can ignore those for now :p) and each town's position relative to it's island position.

Third, about hosting python apps...I never tried it, but there's Google AppEngine, which is free (up to a certain limit) and awesome.

Last but not least, I really, really think we should colaborate in this. I had many ideas in the past, but never got aroud to actually do it for lack of time. In a team, we can distribute the chores and make a great looking tool.

PS: I was going to message this info to Xarandir, but hey...there might be other pythonistas out there who could use the info and maybe get excited and join the cause.
 

DeletedUser

Guest
About the PHP idea...yep it's another possibility. And yep, it is quite capable to produce the same imagery.
 

DeletedUser

Guest
Thanks rev, its good to have people around and share ideas, so yes put your thoughts on the forum for all to read and collaborate.

Its a great help to have the city offsets at hand, thanks for that. I started positioning cities on two islands but it took a lot of time so i went back to the world map to improve it. It would be great if you agree with sharing your code for the ocean map with the community.

I agree we have to organise things to ease the coordination. At this time we have two programs, your program and mine. I propose to proceed like this:

1) I will look at your program, you look at mine and we try to merge the two as best we can. That will be version 1.0. of ... eh ... oh we need a name for it :) (i.e. SDLC)

2) We all make a wish/ideas list for version 2 and put names after each item if you feel like having a look into it. Someone needs to manage that list. (i.e. URS)

3) We make separate threads for each wish to share ideas and work things out, publish improves code etc.

I trust the forum mods keep an eye on this thread (I shared my ideas with ac04 and Furryicecubes, ac04 seems to be the techie of the forum) and if they feel like this project is worth a subforum they possibly will move the threads.

As of right now I can think of the following wishes for our wish list:

- improved algorithm for assigning color to islands (see thread world map delta)
- improved user interface (button window)
- automation of publishing maps (google apps?)
- a mechanism for request maps (see thread world map alfa)
- a solution for ghost islands (see thread world map alfa)

I'm sure I had more on the list but i forgot :)

Does this sound like the way to go?
 
Last edited by a moderator:
Top