Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Civ3-General-Archive > Explaining of civ3 slowdown - Intractable algorithms!
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Nadexander is offline Nadexander
Warlord
Saratoga, California
Mar 2001
time: 21:16
  Old Post 01-12-2001 02:08
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Explaining of civ3 slowdown - Intractable algorithms! Support Apolyton, buy Civilization: The Boardgame

As anyone that has played a game on a huge map with 16 civs has noticed that it takes a _VERY_ long time for the AI to play its turns. In trying to understand why i happened on a very important observation: when you pillage a road, destroy a harbor, conquer a city or do anything else that disrupts the trade network there is a lag time of around 30 seconds (on a 900mhz cpu). The reason that this takes forever is that calculating the existance of a connection between x number of cities and through y number of squares is proportional to x! (x factorial) In other words the cost of calculating the existance of the trade network gets exponentially larger as the number of cities and the number of map squares increases. This also explains why there is a significant slow down when the AI is at war. Think of how often the AI pillages a road or takes a city? I wager that 90% of the game turn winds up being the recalculation of the trade network. I suggest that firaxis change the game mechanics so that the trade network is only calculated at the end of turn in order to make the game playable on the huge map settings.

Peets is offline Peets
Chieftain
Belgium
Jun 2001
time: 05:16
  Old Post 01-12-2001 02:15 Visit Peets's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Hmmm, I was wondering too why it took so long time...
good job of "maybe" finding it
Well, I hope they can do something about it...

Ferdi is offline Ferdi
Warlord
Europe, Brussels
Oct 1999
time: 06:16
Unhappy  Old Post 01-12-2001 02:18
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Tired of ads?

Indeed, this problem has been reported by many other guys but without pointing the problem. I've also been faced with that and it must be DEFINITELY fixed.

Asmodean is offline Asmodean
King
Aarhus, Denmark
Aug 1999
time: 06:16
  Old Post 01-12-2001 02:18 Visit Asmodean's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Avatar Enlargement: We've got the solution

If that is really so - and I suspect that you may be right there, it should be fairly easy for Firaxis to solve this - major - problem.

Maybe add a message that says (when it's your turn once again) something like: [CityX] can't build Musketeer, due to lack of supplies. Or something to that effect.

Asmodean

Cavalier_13 is offline Cavalier_13
Chieftain
Montreal
Nov 2001
time: 00:16
  Old Post 01-12-2001 02:55
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
A wasted thread...... Put an end to popups!

I went into detail of this in 2 prior posts in 2 different threads, and yet you say the same thing I did. Was a new thread really needed?

Cavalier

justin_sayn is offline justin_sayn
Settler

Nov 2001
time: 05:16
  Old Post 01-12-2001 03:31
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
WRONG AND WRONG! Support Apolyton, buy Civilization III: Complete

Actually Johnson's algorithm will find the shortest past between all squares in a time that is roughly proportional to (X*X)*lgX +XE (where E is the number of links, and a link is only counted between 2 squares)

I.E.: If there are 1000 squares on the map, the time of algorithm will be proportional to:
1000*1000*Lg1000 +1000*E=

Since each square is linked to 8 other squares then there are 8*1000 = 8000 links, so we have:

1000*1000*Lg1000 +1000*8000 = 1 000 000*10 + 8 000 000

Which is equal to 18 000 000.

Since the number of squares and links on the map is constant, there is no reason for the game to take an increasingly amount of time as more cities are developed. (if they were using that alogorithm of course).

Where did you ever get the X! idea?

Eitherway, whatever algorithm they use, the number of squares is always constant on the map.

War4ever is offline War4ever
Emperor
I live amongst the Red Sox Nation
Jan 1970
time: 21:16
  Old Post 01-12-2001 03:36
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Help yourself to an AD-FREE life

laymans terms.....all i know is standard maps are about all i have the patience for

Nadexander is offline Nadexander
Warlord
Saratoga, California
Mar 2001
time: 21:16
  Old Post 01-12-2001 08:43
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Re: WRONG AND WRONG! Tired of ads?

quote:
Originally posted by justin_sayn
Actually Johnson's algorithm will find the shortest past between all squares in a time that is roughly proportional to (X*X)*lgX +XE (where E is the number of links, and a link is only counted between 2 squares)

I.E.: If there are 1000 squares on the map, the time of algorithm will be proportional to:
1000*1000*Lg1000 +1000*E=

Since each square is linked to 8 other squares then there are 8*1000 = 8000 links, so we have:

1000*1000*Lg1000 +1000*8000 = 1 000 000*10 + 8 000 000

Which is equal to 18 000 000.

Where did you ever get the X! idea?

Eitherway, whatever algorithm they use, the number of squares is always constant on the map.


assuming a square map of side x
number of squares is x^2
number of paths between any two squares X^4
time to find a path between two given squares: worst case
is X^2 so time to find path between all given squares is x^6
So i messed up saying that its non-polynomial. Its but its not pretty thats for sure. Doubling the map size will make it so that it takes something like 50 times as long. And you also need to consider that the bigger the map, the larger the number of units running around and pillaging things so the more often the paths need to be calculated.

Nadexander is offline Nadexander
Warlord
Saratoga, California
Mar 2001
time: 21:16
  Old Post 01-12-2001 08:44
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Re: WRONG AND WRONG! Support Apolyton

quote:
Originally posted by justin_sayn
Actually Johnson's algorithm will find the shortest past between all squares in a time that is roughly proportional to (X*X)*lgX +XE (where E is the number of links, and a link is only counted between 2 squares)

I.E.: If there are 1000 squares on the map, the time of algorithm will be proportional to:
1000*1000*Lg1000 +1000*E=

Since each square is linked to 8 other squares then there are 8*1000 = 8000 links, so we have:

1000*1000*Lg1000 +1000*8000 = 1 000 000*10 + 8 000 000

Which is equal to 18 000 000.

Since the number of squares and links on the map is constant, there is no reason for the game to take an increasingly amount of time as more cities are developed. (if they were using that alogorithm of course).

Where did you ever get the X! idea?

Eitherway, whatever algorithm they use, the number of squares is always constant on the map.


This is only for finding a path for any two given points (which worst case can never take more steps than the number of squares on the map. However It needs to calcualte the pairwise linking for any two cities (to see if it could be accessing a resource from that city.

Archmage is offline Archmage
Chieftain
Arizona Nevada border
Nov 2001
time: 23:16
  Old Post 01-12-2001 12:11
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Uuuuh....must find tylenol.......uhhhhghhhh

Magician is offline Magician
Chieftain
HK
Nov 2001
time: 15:16
  Old Post 01-12-2001 12:14
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Re: Re: WRONG AND WRONG! Increase the size of your Attachments

quote:
Originally posted by Nadexander


This is only for finding a path for any two given points (which worst case can never take more steps than the number of squares on the map. However It needs to calcualte the pairwise linking for any two cities (to see if it could be accessing a resource from that city.


As far as I know Johnson's algorithm is capable of finding all pair shortest path. It is not limited to finding a path from two vertex alone.

Btw, I don't think this is a shotest-path problem. If you find a path (trade route) from one city to another, no matter it is the shortest or not, will be accepted. Using shortest path algo will enumerate all vertex which is a big overhead.

So playing on a large/huge map != long wait. although the chance is higher.

Combat Ingrid is offline Combat Ingrid
Chieftain
Satan's Majestic Empire
Nov 2001
time: 06:16
  Old Post 02-12-2001 13:57
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

Maybe they should include DNA computers with the patch, they are supposed to be very efficient at doing this kind of stuff

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:16.
Apolyton Time is 00:16.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0403 seconds (90.42% PHP - 9.58% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net