Home Forums Programming Multithreaded game design

Viewing 10 reply threads
  • Author
    Posts
    • #7102
      Anonymous
      Inactive

      I know this is a bit of a generic catch-all question, but I was wondering if anybody here has had experience programming multi-threaded games, either from professional or personal experience?

      I’ve dug up a lot of useful information on the topic so far from the internet, but I would be interested to hear about peoples practical experiences within the field.

      The reason I’m asking is because I’m currently doing research for my final year project, which involves designing a small game engine demo to leverage multi-core architecture as much as possible. The main goal will be to show typical (bread and butter) game tasks, and propose ways in which they could be parrelised- or at least run in parallel with other concurrent tasks. Scalability is also another concern, and I’m trying to come up a design that will hopefully show tangible gains on future many-core (8,16,32 etc.) architectures.

      Not an easy task you say! Oh.. And I have to implement this thing as well if you were wondering! :)

      Any advice or anecdotes at all would be appreciated. I’m mainly interested in particular approaches taken to this problem and how well they fared. Things like what worked well, what didn’t, problems that were encountered, benefits gained, all that sort of stuff..

      Thanks,
      Darragh

      P.S for anyone who’s interested in multi-threaded DX rendering, I think this is a nice find and definitely worth looking at:

      http://www.emergent.net/GameFest2008

      It should help fill the gap on Windows until DX11 when per-thread devices become available.

    • #43301
      Anonymous
      Inactive

      D,

      Check out Naughty Dog’s Post-Mortem material, and anything else you can dig up about their title, "Drakes Fortune."

      It gets touted, again and again, as being really smart when it comes to effective use of threading, as well as effective use of the SPU’s, and cache smart code.

      Thanks for the links to the Emergent material, looks great.

      I attended a lecture on DX11 in Brisbane just before Christmas, I’ll see if I can find the slides online, went through true multi-thread rendering in some detail. In fact, I think the DXNov08 SDK has DX11 samples.

      Brendan.

    • #43303
      Anonymous
      Inactive

      Yep majority of these presentations (uncharted included) are vague at best, as they are presentation designed to be fun, interactive and digestable to the general audience. Typically, the meaty stuff you wanna know isnt really discussed in them. Insomaniac games have a nice R&D section on their site, discussing Ratchet and Clank: FTOD and Resistance and how they did some things. They’ve also got some nice code sample (spu stuff) on various other optimisation bits and bobs. They’re trying to start an initative of where companies within the industry talk more about problems they face and how they solve them.i.e. a kind of open source, as they’ve released some of their libraries from internal. So far there hasent been any other studios to my knowledge who will share also. NDA etc probably playing a part and competition clauses etc.

      Anyway intel also ran a serious of features on Gamasutras site which discussed the Smoke Framework and how its used as a test bed for multi-core etc. Alot of nice stuff and examples. Also on their own home page i think theres some more stuff.

      Personally/professionally, I’ve worked on 2 titles fom beginning to end (shipped) which have been heavily multi-threaded (PS3/360/PC multi-core). Currently, working on my 3rd. So if you’ve got some questions fire me a PM and I’ll try to give you some answers/insight based on my experiences etc.

    • #43308
      Anonymous
      Inactive

      Hey guys, thanks for all the for the useful suggestions. I’ve been pouring over Insomniac and Naughty Dog’s stuff and whilst a lot of it is very PS3 specific, there are some very good points to be taken from it.

      Anyway intel also ran a serious of features on Gamasutras site which discussed the Smoke Framework and how its used as a test bed for multi-core etc. Alot of nice stuff and examples. Also on their own home page i think theres some more stuff. [/quote:96652bdc2c]

      Yeah I’ve been looking into this one myself over the last week or so and it’s definitely an excellent example of how proper MT games should be designed.

      I think the key thing to be take from all these sources is that loose coupling, segregation of different systems and caching is the key to parallezing code. Strict access rules and good design from the get-go are paramount.

      I attended a lecture on DX11 in Brisbane just before Christmas, I’ll see if I can find the slides online, went through true multi-thread rendering in some detail. In fact, I think the DXNov08 SDK has DX11 samples.[/quote:96652bdc2c]

      Wow.. Didn’t know the DX11 preview out there already. Thanks for this information! (Goes off to download..)

      Personally/professionally, I’ve worked on 2 titles fom beginning to end (shipped) which have been heavily multi-threaded (PS3/360/PC multi-core). Currently, working on my 3rd. So if you’ve got some questions fire me a PM and I’ll try to give you some answers/insight based on my experiences etc.[/quote:96652bdc2c]

      Thanks for the offer Peter. I may well get back to you on that one when I have a more concrete list of questions.

      For now I’ll spend some time soaking up all this information I’ve found and afterwards begin the hard work of coming up with a design and plan for this demo.

      Thanks,
      Darragh.

    • #43344
      Anonymous
      Inactive

      Hey everyone,

      Making good progress with this project so far. I’ve more or less finished with the design of the framework (save some minor tweaks here and there) and I’m currently halfway through it’s implementation. After that it’s a case of writing the application itself and deciding what game features I will use to demonstrate it.

      Just have a few more questions however with regard to the project if anyone can answer them.

      1 – What sound library would you recommend for the project ? What are the threading abilities and characteristics of the different libraries ? Things like thread safety, control over the amount of threads available to the system, etc.. At the moment I’m thinking either XACT/XAudio or FMOD.

      2 – I’m going to use the Havok physics engine for the physics portion of the demo; just wondering however is the Havok library deterministic ? This is important because it determines whether time-demos can be used as a means of benchmarking or not.

      3 – In terms of CPU cache usage, do you think it is better to get all the threads working on similar tasks (which may use shared memory) at the same time or is it better to instead split the threads off to very different tasks that use different portions of memory ? I’m unfamiliar at the moment with the behaviour of cache in multicore systems.

      4 – Lastly.. Has anyone got a Corei7 or other Intel SMT processor at their disposal ? :) I need to test some CPUID code to make sure that it is correctly counting the number of physical cores on the machine as opposed to just the number of logical cores. I don’t want to oversubscribe the application on SMT machines with too many threads.

      Thanks,
      Darragh

    • #43352
      Anonymous
      Inactive

      I have a Q6600 if that’s any help?

    • #43358
      Anonymous
      Inactive

      Hi KookiMonster, thanks for the offer.

      I think the Q6600 is similar to my own cpu (Q9650) in that it doesn’t have SMT (Simulataneous multi-threading), or ‘hyper-threading’ as Intel call it; so 4 cores on a Q6600 equates to 4 real cores; i.e there are no ‘logical cores’ that use up idle execution units on the CPU.

      Basically I’m looking for a test processor that reports more cores to the OS than there are actual physical cores. The application should be able to distinguish the difference in this case and not create too many worker threads- something which could harm performance.

      I think the Pentium 4 with hyperthreading and some Pentium D’s (Smithfield core) also have SMT enbled too if anybody has one of these processors either.

    • #43359
      Anonymous
      Inactive

      Ah, ok.

      I have a bunch of P4 machines floating about….

    • #43506
      Anonymous
      Inactive

      Intel have a great article up on Gamasutra on this very topic.

      http://www.gamasutra.com/view/feature/3941/sponsored_feature_designing_the_.php?print=1

      Easily a +2 to your knowledge check…

      B.

    • #43509
      Anonymous
      Inactive

      Intel have a great article up on Gamasutra on this very topic.

      http://www.gamasutra.com/view/feature/3941/sponsored_feature_designing_the_.php?print=1

      Easily a +2 to your knowledge check…

      B.[/quote:f021e16942]

      Thanks for the link Jediboy. Yeah the Smoke framework is by far one of the best resources I’ve seen thus far on the subject; little wonder too- it’s in Intel’s interest to promote this stuff! :) I’ve been studying this particular framework heavily and have tried to incorporate what I felt were the best aspects of it’s design into this project; hopefully it will pay off in the end!

      Making some solid progress on this anyhow since my last post. Just about finished an implementation of continous terrain LOD (using tri-linear filtering and mipmapping on the heightmap) and the results so far are promising. Profiling shows roughly a 3x performance increase on a Q9650 when moving from 1 thread to 4 and I reckon this margin still has more room for improvement yet.

      Next job on the rendering side of things is large scale foliage and decor rendering. I wonder do Speedtree do a non-commercial license actually ? Might be nice to integrate that with the terrain rendering..

    • #43511
      Anonymous
      Inactive

      Fuck me, this is the kind of super star graduate games companies are looking for, nice work Darragh, and when you sign, dont sign for graduate wages!Definately a cut above the rest. Looking forward to reading your dissertation at the end.

Viewing 10 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.