Announcement

Collapse
No announcement yet.

Is CIV 4 AI multithreaded?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is CIV 4 AI multithreaded?

    I didn't see it mentioned anywhere. Galactic Civilizations 1 AI was multithreaded and apparently helps a lot with the AI making intelligent decisions.

  • #2
    Multithreading is a programming "option" that allows a program to run several simultaneous "threads" each executing parts of the program/game/whatever instead of in a single thread.

    So, is the game multithreaded? Probably.
    Is the AI multithreaded? Perhaps. It doesn't really matter.

    It doesn't mean that the game will make more intelligent decisions, it simply means that it can be coded in a more flexible structure.

    Comment


    • #3
      right on the nail, nixen.

      Comment


      • #4
        Multithreading can help AI by allowing it to think while human player is making his moves, not just between turns. This is what GalCiv does, I believe.

        Comment


        • #5
          However it's easier in simultaneous turn games, the problem is that the human player (and other AI players) make moves that would invalidate the thinking.

          Comment


          • #6
            It seems to have something along those lines, since the two "fake" CPUs in a HT-enabled P4 have drastically different usage patterns while running the game, and it's not because one "cpu" is being used and the other not.

            Comment


            • #7
              By default, a lot of DirectX will run on a separate thread. This can (and usually does) make for a more responsive user interface.

              However, the AI would be unlikely to actually run any faster when multithreaded UNLESS you actually had two processors or a dual-core processor. If the AI was multithreaded, and the load was well balanced (usually by using some form of dynamic load balancing) THEN it could run up two times faster.

              That's a theoretical maximum; in practice, a well designed multiprocessor algorithm will normally only run around 1.5-1.8 times faster on dual/dual core processors because of other overheads. But there's a lot of variation due to the complex nature of handshaking and resource contention between threads.

              At the end of the day, a multithreaded AI would almost certainly help significantly on multiprocessor systems.

              Comment


              • #8
                Originally posted by GodSpawn

                However, the AI would be unlikely to actually run any faster when multithreaded UNLESS you actually had two processors or a dual-core processor.
                Not entirely true. While the player is taking his/her turn, a lot of the CPU time is 'wasted'. A low priority thread would allow the AI to calculate moves, while not causing any slow down for the player.

                How much of an advantage that would be would depend on how much of the AI's decision making process relies on accurate positioning info. As someone said, it would be pointless if it was invalidated by the player making moves.

                Bh

                Comment


                • #9
                  Yeah, the AI calculations seem to be considerably faster than on Civ3...whether that is purely a thing of better coding or better use of the technology is anyone's guess...
                  Speaking of Erith:

                  "It's not twinned with anywhere, but it does have a suicide pact with Dagenham" - Linda Smith

                  Comment

                  Working...
                  X