Sign in to follow this  

Parallel game design - books? resources?

This topic is 3288 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I'm a college student, aiming for the game development concentration of the computer science major at my school. I've programmed some small games, read books about game development... But now that multi-core processors are out and they're the 'next big thing', I understand we need to get away from the single-core idea of a game loop, processing things in a procedural format... And so, in my RSS reader the other day I found a couple interesting links: http://www.gamasutra.com/view/feature/3861/performance_scaling_with_cores_.php?page=1 http://software.intel.com/en-us/articles/designing-the-framework-of-a-parallel-game-engine Great! Just when I'm wondering about multi-core game programming, I get exactly what I need, right? Well, these plans are complicated. They are for big-time game developers, with several engines under their belt and whatever. I can (and WILL) go through it all, digest it and get what I can out of it. But I want more. Are there any good books about this kind of thing? I mean, the university library here is huge, and the inter-library loan system basically guarantees me any book out there for free. I also have access to academic journals and such but haven't looked yet. Has anyone else seen any articles about it? Is it in one of the Game Development Gems books? (I'm working my way through them, at books 2 and 3 now). Also, what other resources? And finally, how can I begin playing with this stuff? I've been thinking about some project I could do or something. Kinda like how you start by making pong and tetris and move up from there... Maybe if I start with some sort of parallel pong or parallel tetris (or more complex, because I've already tackled those games before)... Any recommendations? Thanks! ~Ricket

Share this post


Link to post
Share on other sites
I'm definitely not the best when it comes to parallelism or multicore computing, but I did have a friend email me a link to an article on it. He said he found it to be very well written. I've only had a chance to browse the topics, but I think you might enjoy it. Anyway, here is the link

Share this post


Link to post
Share on other sites
Quote:
Original post by Ricket
Hi all,

I'm a college student, aiming for the game development concentration of the computer science major at my school. I've programmed some small games, read books about game development... But now that multi-core processors are out and they're the 'next big thing', I understand we need to get away from the single-core idea of a game loop, processing things in a procedural format...

And so, in my RSS reader the other day I found a couple interesting links:
[1] http://www.gamasutra.com/view/feature/3861/performance_scaling_with_cores_.php?page=1
[2] http://software.intel.com/en-us/articles/designing-the-framework-of-a-parallel-game-engine

Great! Just when I'm wondering about multi-core game programming, I get exactly what I need, right? Well, these plans are complicated. They are for big-time game developers, with several engines under their belt and whatever. I can (and WILL) go through it all, digest it and get what I can out of it.

But I want more.

Are there any good books about this kind of thing? I mean, the university library here is huge, and the inter-library loan system basically guarantees me any book out there for free. I also have access to academic journals and such but haven't looked yet. Has anyone else seen any articles about it? Is it in one of the Game Development Gems books? (I'm working my way through them, at books 2 and 3 now).

Also, what other resources?

And finally, how can I begin playing with this stuff? I've been thinking about some project I could do or something. Kinda like how you start by making pong and tetris and move up from there... Maybe if I start with some sort of parallel pong or parallel tetris (or more complex, because I've already tackled those games before)... Any recommendations?

Thanks!
~Ricket


Hello!

I am not sure if I get it since I am not a native speaker, but it seems to me you are actually looking for something very old and common, which is called 'lightweight processes' or more commonly named 'threading'.
Using threads is actually a very wide spread technology used in game development as in many todays applications. Even some development libraries like for sound playback make use of threads, for controlling playback and allocation of resources from disk/dvd etc.

Common games like World of Warcraft have somthing like 20-30 threads running at the very same time and if you have the number of cores to fit, you could have each running on it's own core, which actually might be a very rare constellation for todays home computers of course.
But this is only in theory, since some software products sort of bind themselfs to a 'logical' or even 'physical' processor image to prevent some certain racing conditions and synchronization issues and from this has all it's threads running on one core competing each other to become scheduled.


So if you look for literature about multi-core games, you might simply look for keywords like 'threading' along with 'inter process communication' as keywords. There should be plenty of literature about this topic.


With best wishes, Sebastian Gruber.

p.s.

When I look at resource [2] I do not see anything new from the technical point of view, apart from that they possibly favour threading at a scale within very little time slices. Perhaps this is favouring especially intel processor hardware from now and/or for the next generations, but still nothing new after all from the point of technical innovation.



[Edited by - Sebastian Gruber on December 6, 2008 8:12:29 PM]

Share this post


Link to post
Share on other sites
MikeTacular: Thanks for the link! It's a little biased, being basically an advertisement for the Cilk library (which I will not use due to its requirement of a special compiler), but it does provide a nice quick overview of multithreading.

Sebastian Gruber: Well yes, the concepts of threading and such have been around for many years, because there have always been servers with multiple processors, and distributed systems, and supercomputers... But there is a big difference between just learning how threading works, and figuring out how to implement it into the ideas of a game loop and such.

Also, regarding World of Warcraft, there are a lot of conflicting answers on the internet as I try to find a definitive answer with google, but it doesn't seem to me that they are properly utilizing multiple cores either. There are sites claiming they are using 'multithreaded OpenGL', but OpenGL is mostly on the GPU anyway - the important improvements would be seen by multithreading the physics and such.

I kinda like this article, about adding multithreading to Doom:
http://developer.amd.com/documentation/articles/pages/1213200696.aspx

It uses OpenMP, as several other tutorials do. I'm not yet sure I really like OpenMP though. It seems like it hides a little too much for my comfort; I think I'd rather manage my threads, thread pools, mutexes, etc.

I'm still looking. Next time I make it to the school library (in the next day or two; maybe even tonight, it's open 24/7 for finals right now) I'll skim through Game Programming Gems 4-6 and see if I see anything... I'm not getting my hopes up though.

And I'm still considering how to approach the actual "application" part of this. What game should I make? I'm thinking something like Pac-Man; try and make each of the AIs controlled by separate threads. Ah, well, I'll think about it more and let y'all know.

Anyone else want to join the conversation? :)

~Ricket

Share this post


Link to post
Share on other sites
I believe this is still all something of a black art. Concurrency in game development tends to be a case of sticking a mutex around something, spawning an extra thread, and hoping for the best. The best practices learned in academic situations seem often to be completely unknown to game developers, but then that's not entirely surprising as often they are not appropriate, eg. where they incur large latency hits in return for enhanced throughput. It's no good having your game run 4x faster on a quad-core if the latency between input and rendering goes up 4x, because then the game will feel sluggish even if rendering smoothly.

And that raises another problem for PC developers - utilising every processor fully is not necessarily much use during normal gameplay. If your minimum specification is a powerful single-core machine, then time spent optimising it for quad-core computers is wasted. What will you do with the spare 75% of your CPU time? Most of your rendering is on the GPU so you can't spend it on cosmetics. You can't spend it on AI because you don't want the game being 'harder' on faster PCs. So it may be the case that the traditional game loop is actually not where the parallelism is best employed, at least for the PC. If you're targeting fixed hardware like a console, these are not such big concerns as you want to get the most out of what you've got.

I think this area is one that is yet to see much good writing on it, because people disagree over the best way to approach things, and because the safer ways tend to diverge greatly from the old model. Perhaps as people get better at this, we'll start to see more consensus among developers.

Generally speaking you can't go far wrong if you follow a few basic principles:
- remove, or at the least minimise all global and shared data
- split your system up into separate tasks which can be started at one point in time, and the results collected later
- minimise the data flow into and out of each task
- consider keeping buffers or copies of data so that one process can edit data now while other processes can read its previous state
- avoid low level primitives like locks/mutexes and instead work with data structures that are designed for passing data between threads

Share this post


Link to post
Share on other sites

This topic is 3288 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this