.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
The Star and the Crescent- Save $9.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #21  
Old September 23rd, 2007, 11:51 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Building a new computer...

First off, note that cores never wait for other cores; cores are always running, always processing instructions. The kernel task scheduler puts various processes and threads on each core dynamically, as needed for optimal load-balancing.

Abandoning the garbage sequential movement mode solves the concurrency issue nicely. If all game modes featured simultaneous movement, each AI can think at the same time, since all they are doing is giving orders. They can even do all their thinking while the human player is playing his turn... Turn resolution can still benefit somewhat from multithreading, since you could process the movement of all of an empire's ships in one thread. Have each one process one day worth of movement and wait for combat resolutions.

With 20 threads and 4 cores (a full game), the kernel task scheduler would typically have 5 of the threads process on each core (though it could really be any distribution, depending on how long each AI thread takes to finish). Each AI thread would process one day of movement, then go to sleep. After all such AI threads are sleeping, all pending combats would then be assigned their own threads, and executed in parallel. Once they are all done, the main game thread just has to wake up each of the AI threads.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:31 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.