However, multi-core CPUâ€™s all of a sudden change everything. Now instead of only one core that Valve wants to keep 100% utilized, you have two, or in QX6700â€™s case, four cores that Valve wants to keep fully loaded. Anything less would just be a waste of computational power, and would cause the end-user to miss out on the gameplay experience.
And so now we move on to the focus of what Valve discussed during their hardware day; the challenges they faced when actually implementing threading within the Source Engine. They noted that there were three different ways they looked at to thread the Source Engine; coarse threading, fine-grained threading, and hybrid threading. With that said, letâ€™s take a closer look at these different techniques and how Valve plans to adopt multi-threading in the Source Engine.
Valve likes to describe coarse threading as an approach that puts â€œentire systems on individual coresâ€. By using the term â€œsystems,â€ Valve means that they would put physics on one core, AI on another, and so on. They said that this approach is the easiest to implement, and essentially this approach has multiple single threads operating at the same time. In their internal performance tests, Valve saw that they could get nearly 2x the performance in â€œcontrived maps;â€ a collection of in-game play scenarios that omitted many aspects of real-world game play. However, when they ported coarse threading into real-world Source engine game play, they only saw performance gains of only 20% when compared to single-threaded gaming. This is certainly a testament to real-world gaming testing when compared to the canned benchmark
Fine Grained Threading
The next approach Valve tested out was called fine grained threading. Fine grained threading was designed to accommodate the scalability that coarse threading lacked and essentially worked by taking very similar tasks and parallelizing them over â€œXâ€ cores, the amount of cores within the CPU. This would theoretically take advantage of future CPU generations that include more cores for more threading ability.
Hybrid threading is the most difficult of the threading techniques and requires a lot of development time to figure out when and how youâ€™re going to implement it. However, hybrid threading is able to scale to the â€œNâ€ amount of cores we talked about earlier, which will allow hybrid threading to not only take advantage of all four cores in the current Intel Core 2 Extreme Quad Core QX6700, but also in the 80-core CPU Intel announced for release in 2011, and everything in between.
AI in games has traditionally had strict CPU limits, and has been given a time splice in a frame and the AI has to do all of itâ€™s calculations within that little time splice. So how will AI change? First it will improve frame rate. You can restructure AI to support something Valve calls â€œparallel agent execution,â€ which will let you do calculate AI for multiple creatures at the same time in parallel. Beyond frame rate, multi-threading can make AI more interesting. AI will have better world interactivity, AI that move through the world more realistically and less â€œstupidlyâ€.