View Full Version : Tool for calculating ideal place for capital
I don't think this has been posted here before...
d0t has made a cool tool to test where to put your capital city to minimize unrest penalties.
i made a javascript script to calculate the best choice for a capitol
you can also check other cities on how they influence unrest in the other settlement.
the url is: bbb.unknownnet.com/rtw/bestcap.htm
it was made by using php-gd to map all the black pixels in map_regions.tga to cities using descr_regions.txt, and saving the coordinates of the cities.
used that data to get version 1 done, which just took the shortest average distance as the best city.
later on i figured out the formula for unrest ( distance-10, rounded to the nearest 5% ) and added the fancy % signs and try other cities.
Original thread at .com forums by d0t (http://p223.ezboard.com/fshoguntotalwarfrm7.showMessage?topicID=16220.topic)
Grumfoss
12-02-2004, 13:51
Cool Tool. I have been having trouble in moving my Capital to the right region for my empire, and now I can get it right ~;)
I'm surprised its needed. Surely the best place for your capital is as near the centre of your empire as possible.
What more does this tool do?
Medieval Assassin
12-03-2004, 01:29
It seems straigforward...I don't think it does do anything else.
therother
12-03-2004, 07:09
I'm surprised its needed. Surely the best place for your capital is as near the centre of your empire as possible.Not necessarily. Corruption is also affect by distance to capital, so it will usually be a good idea to have your capital near your richest cities, even if that makes some poorer cities unhappier.
Not necessarily. Corruption is also affect by distance to capital, so it will usually be a good idea to have your capital near your richest cities, even if that makes some poorer cities unhappier.
So, does this tool tkae such things into consdieration. i.e. Do you have to enter the financial details of all your cities into it?
therother
12-03-2004, 16:47
So, does this tool tkae such things into consdieration. i.e. Do you have to enter the financial details of all your cities into it?Not that I'm aware.
therother
12-03-2004, 16:55
These are some discrepancies between the tool and the game - Tarentum is the capital.
Name X Y dx dy dist Game% Calc% Difference Full Name
Antioch 200 55 86 -8 86.37 80 75 -5 Antioch
Londin 57 128 -57 65 86.45 80 75 -5 Londinium
Alesia 66 106 -48 43 64.44 50 55 5 Alesia
Alexan 178 19 64 -44 77.67 65 70 5 Alexandria
Aquin 116 101 2 38 38.05 25 30 5 Aquincum
Arreti 91 80 -23 17 28.60 15 20 5 Arretium
Capua 102 68 -12 5 13.00 0 5 5 Capua
Cherso 175 95 61 32 68.88 55 60 5 Chersonesos
Cirta 55 41 -59 -22 62.97 50 55 5 Cirta
Corin 139 50 25 -13 28.18 15 20 5 Corinth
Messa 106 51 -8 -12 14.42 0 5 5 Messana
Patavi 94 90 -20 27 33.60 20 25 5 Patavium
Salona 118 75 4 12 12.65 0 5 5 Salona
Segest 105 90 -9 27 28.46 15 20 5 Segestica
Sinope 190 80 76 17 77.88 65 70 5 Sinope
V_Gothi 111 136 -3 73 73.06 60 65 5 Vicus Gothi
The tool seems to be underestimating the grace distance as 12.5, whereas it seems to be ~15. Anything within 15 will have no penalty. That accounts for Capua & Messana.
The rest seem to be on the boundaries between two levels, e.g. 77.88 is rounded to 70 by the calculator, but is 65 in the game.
Edit: Looking at the data, it looks as if any city over 85 (or 86 perhaps) is rounded up to 80% penalty.
therother
12-04-2004, 22:47
Just a quick note on this excellent tool - the method of calculating the penalty is a little flawed at the moment. To resolve a couple of the problems, save the tool locally, and then edit the hmtl file in a text editor.
You want to replace this:
//dst = 5 * Math.round( ( edst - 10 ) / 5 );
dst = 5 * Math.floor( ( edst - 10 ) / 5 );
if(dst < 0) dst = 0;
if(dst>=75) dst = 80;
with this:
dst = 5 * Math.round( ( edst - 10 ) / 5 );
if(edst < 15) dst = 0;
if(edst>=86) dst = 80;That should resolve a few of the issues, but unfortunately not all.
It looks like that code has already been replaced. Is the url above the same as the one that was posted over at the com?
Thanks for the heads up.
therother
12-05-2004, 01:12
It looks like that code has already been replaced. Yes, d0t switched to the code above shortly after I posted it here and linked to it on the .com. So you won't need to make any changes if you download it now.
Is the url above the same as the one that was posted over at the com?Yes, I believe it is.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.