Results 1 to 11 of 11

Thread: Tool for calculating ideal place for capital

  1. #1

    Post 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.


    Quote Originally Posted by "d0t" at totalwar.com forums
    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

  2. #2
    Member Member Grumfoss's Avatar
    Join Date
    Nov 2004
    Location
    Wrexham North Wales.
    Posts
    217

    Default Re: Tool for calculating ideal place for capital

    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
    May the Foss be with you....


  3. #3
    Member Member Didz's Avatar
    Join Date
    Oct 2000
    Location
    Bedfordshire UK
    Posts
    2,368

    Default Re: Tool for calculating ideal place for capital

    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?
    Last edited by Didz; 12-03-2004 at 00:49.
    Didz
    Fortis balore et armis

  4. #4
    Takeda Kygona-san Member Medieval Assassin's Avatar
    Join Date
    May 2004
    Location
    Nova Scotia, Canada
    Posts
    458

    Default Re: Tool for calculating ideal place for capital

    It seems straigforward...I don't think it does do anything else.
    I pledge allegiance to the underworld One nation under dog,There of which I stand alone,A face in the crowdUnsung, against the mold
    Without a doubt
    Singled out
    The only way I know

    Stepped out of the line,Like a sheep runs from the herd
    Marching out of time,To my own beat now
    The only way I know

    One light, one mind,Flashing in the dark
    Blinded by the silence of a thousand broken hearts

    "For crying out loud" she screamed unto me
    A free for all,Screw 'em all
    You are your own sight

    I want to be the minority,I don't need your authority
    Down with the moral majority,I want to be the minority

  5. #5
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,637

    Default Re: Tool for calculating ideal place for capital

    Quote Originally Posted by Didz
    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.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  6. #6
    Member Member Didz's Avatar
    Join Date
    Oct 2000
    Location
    Bedfordshire UK
    Posts
    2,368

    Default Re: Tool for calculating ideal place for capital

    Quote Originally Posted by therother
    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?
    Didz
    Fortis balore et armis

  7. #7
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,637

    Default Re: Tool for calculating ideal place for capital

    Quote Originally Posted by Didz
    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.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  8. #8
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,637

    Default Re: Tool for calculating ideal place for capital

    These are some discrepancies between the tool and the game - Tarentum is the capital.

    Code:
    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.
    Last edited by therother; 12-03-2004 at 18:28.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  9. #9
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,637

    Default Re: Tool for calculating ideal place for capital

    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:

    Code:
      //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:

    Code:
      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.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  10. #10
    Member Member R3dD0g's Avatar
    Join Date
    Jan 2003
    Location
    USA
    Posts
    127

    Default Re: Tool for calculating ideal place for capital

    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.
    As democracy is perfected, the office of president represents, more and more closely, the inner soul of the people. On some great and glorious day the plain folks of the land will reach their heart's desire at last and the White House will be adorned by a downright moron.
    H. L. Mencken

  11. #11
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,637

    Default Re: Tool for calculating ideal place for capital

    Quote Originally Posted by R3dD0g
    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.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO