May 2009 blogs
Small module pipelines
Goodbye 3D Realms.

Current Filter - None
None
Family
Misc
Game Dev
Rants
Entertainment
Musings
Life

April 2009 blogs
March 2009 blogs
February 2009 blogs
January 2009 blogs
December 2008 blogs
November 2008 blogs
October 2008 blogs
September 2008 blogs
August 2008 blogs
July 2008 blogs
June 2008 blogs
May 2008 blogs
April 2008 blogs
March 2008 blogs
February 2008 blogs
January 2008 blogs
December 2007 blogs
November 2007 blogs
October 2007 blogs
September 2007 blogs
January 2007 blogs
December 2006 blogs
May 2006 blogs
April 2006 blogs
March 2006 blogs
Febuary 2006 blogs
January 2006 blogs

Admin

All Content (c) Jake Simpson 1999 - Current. Except the pics of women, which I just grabbed from the public domain.

Created using MacroMedia DreamWeaver 8


            The Ramblings of an old Games Developer...

" Nothing will ever be attempted if all possible objections must be first overcome"

- Dr Samuel Johnson
Posted 2008/06/23 11:47:47 by Jake Simpson

This site was last updated on June 23rd 2009

We've been hit by 787588 voyueristic gamers

Here are the Blogs!

Note - all content is personal opinion and not the opinion of the company for which I work. This blog has no affiliation with anyone.
If you want an RSS 2.0 feed for the blogs, click the logo here.

Small module pipelines

Something I've noticed over my years of developing stuff for people is the distinction between those who love small module pipelines and those who prefer monolithic large app pipelines.

An example of small app pipelines is a pipeline made up of lots of little apps - each app modifying data and passing it on to the next app. Usually under control of some master calling process that marshalls the data and ensures that only the data that *needs* to be processed actually gets processed - it handles dependency checking and so on. A good example of a control process might be Scons or KJam - a Python built system.

A more monolithic approach is a large app that basically does all your processing for you - everything that does data transformation is within the app. You just call that one big app and sit back and wait till it's done.

Now the advantages of the small app is flexibility. Want to change how shaders are generated? Sure, just replace that module with another one. As long as it can handle the file formats as they are forwarded on, you are good to go.
Another good thing about this process is that the data itself is usually held in file format between applications which makes debugging that much easier. If one node in your tree is doing bad things you have the trail of data to look at to work out which node is doing The Bad Stuff(tm).
Another advantage is that the module code tends to be able to be incorporated into other modules relatively easily. Have a materials processing module? Great, you can probably wrap that up into a Maya Plugin relatively easily because the code is designed as standalone code in the first place.

Cons of this approach include speed issues - since each app is an individual app it means that the app needs to start up, data needs to be loaded, processed, saved and then passed onto the next. This is both time and bandwidth consuming with so many loaded and saved temporary files. It's also loaded with many points of failure - each node could be the wrong version of the application, or someone made a modification of that node and didn't test the entire pipeline to ensure it plays well with others.
Another issues is lack of consistency. While a well run project has very defined parameters for how modules are built there is often enough vagueness that developers tend to create their own ways of how the module logs errors, or what languages a module uses ("Oh, this bit is Python, but that calls this Perl Module that then accesses this other website"). The lack of overall framework often results in each module having it's own set of very specific overall dependencies on 3rd party code / feature sets. Sometimes these dependencies can even be at odds with what *other* nodes in the network require.
One last problem that can crop up is an extension of the internal dependencies problem - what works in isolation doesn't work in combination. For example, a module that's written to work on it's own can't be compiled into another module simply because it uses the same libraries as the larger module but a different version. There's an external library collision - then what do you do? Because everything is built in isolation there is way less forcing of conformity of library usage. The classic "Well, it works on my machine" problem.

The advantage of the large app is that generally data is passed from one internal process to the next in memory, which makes it a lot faster than the small node pipeline. Also, all the code is in one place which makes the dependencies issues far less - you *have* to load the entire pipeline in order to test new code because, well, it's all in one place.

The disadvantage of this approach is that code reuse tends to be at a minimum - when the code for a particular operation is inside a larger application it tends to get targeted at that specific application and molded for it - the idea of an independent module with no dependencies tends to get lost. The code itself also tends to be way more mission specific and less flexible than code written for smaller modules, and certainly there is less in the way of error checking internally because you tend to trust the data that is fed in more than you would as an independent module (although that can also have the plus of speeding the code up a bit - lacking all that value range checking it just Is Faster).

It's also way harder to debug - you get all the logging output from every step rather than just the one you want and generally have to sit through gobs and gobs of other code to get to the part you want.

An observation I've noticed is that individual engineers preferences toward one type of pipe against another tends to come from their platform of choice.
Linux is a small app driven environment - lots of small console apps all strung together to make an operating system. If you've ever seen linux users string together commands on the command line, piping the data from one into another you are seeing a microcosm example of what the small app pipeline looks like.

Windows users tend to go for more monolithic application approach since that's what dialogs and so on are built around. Windows does have DLL's it's true, so each module could be built as a small app, but anyone who's done any extensive work in DLL's can tell you, versioning can get out of hand very very quickly under windows and sometimes diagnosing this can be of great pain.

My personal feeling leans towards the monolithic app, simply because I'm a windows user - the small app pipeline just has too many points of failure and too many smaller internal dependencies that all have to be set perfectly for it to work.

Whatever else you may say about windows, it does at least have far more graceful legacy handling of older formats. Smaller hand built modules tend to be far less fault tolerant, but report less so when they do fail you have no idea why. The small module approach is definitely The Way To Go in certain situations, but too much dependency on it means you end up with large pipelines with god awful sets of dependencies within them. One change tested in isolation and it brings the whole thing down.

Just something to think about when you are designing your next pipeline.

Posted at 15/05/2009 11:47:26 AM PST by Jake Simpson
Groups : Game Development



Comments:


#1.

I hate to be that guy, but your wrong both technically and philosophically.

Linux users don't prefer small tools piped together because they're used to them, they prefer them because they are better. Small tools allow standards, easy patching and updating and innovation. I can change or add entirely new tools to the pipe without altering anything else as long as I adhere to the standard.

And Windows users prefer monolithic apps because, well they have to. There's no good interprocess communication when you program on Windows(or at least not traditionally, I'm not a Windows expert). If you can't share data between tools you have to make one giant tool.

And your implication that smaller tools are slower because they pass data as temporary files is incorrect. Very rarely is temporary files the means of interprocess communication, and no modern Unix implements pipes like that. It's generally a Windows hack due to lack of options. Although admittedly there is some prep/cleanup of the data that could be avoided if it ran in one application, I would call this a case of premature optimization.

I would suggest you read the whole of The Art of Unix programming, but the relevant chapters are here:
http://www.faqs.org/docs/artu/ch01s06.html
But reading that won't really let you understand the beauty of developing with Unix tools, you have to do it daily to see.

Well, that's my daily dose of soapbox. Good luck ;)

Posted at 15/05/2009 02:32:20 PM PST by whaledawg



#2.

I would normally not do such a random-ass generalization justice by commenting on it:
"And Windows users prefer monolithic apps because, well they have to. There's no good interprocess communication when you program on Windows(or at least not traditionally, I'm not a Windows expert). If you can't share data between tools you have to make one giant tool."
However, this is just complete nonsense. Windows has (and has had since 95) an extremely robust inter-process communication API (you can even do things you probably shouldn't be able to in accordance with a security nut's wishes), and control over kernel-level thread contexts and events is both more robust and generally better-performing than alternatives seen in any linux/bsd kernel I have ever worked with. I've done plenty of threading and process management implementations on plenty of operating systems, even some proprietary embedded ones, and happen to have a good perspective on what Windows does here. Unix zealotry is fine and all, but at least preach to the real strengths it has over Windows instead of pulling assumptions out of your ass. :)

As for data processing pipelines, if you're talking game development sorts of tools, then in just about every environment, I'm a big fan of putting everything under a single process. I always write things in an incredibly modular manner, and have been known to make DLL interfaces for such tools when it becomes appropriate - and as for threading, just about every system I've written in the last few years has used a very dynamic job threading interface. Which brings up the other nice thing about using a single parent process - very seamless sharing of core functionality without having to put that in its own DLL, or copy it all over the place, or otherwise do the insane messy project module cross-referencing thing.

There is no one right answer for the "data processing pipeline" problem, though for the scope of game development pipelines, I agree that one process is usually the cleanest and simplest solution.

Posted at 05/06/2009 01:21:41 AM PST by Rich Whitehouse



Goodbye 3D Realms.

Well, this week saw the shuttering of 3D Realms, developers of the Duke Nukem Franchise.

There's so much to say about these guys - 13 years and no game? 2 Engines, gobs of money and development work and still no game? So many people have had a pop at them over the years and lets face it, it's pretty easy to do this. Wired has awarded them their yearly vaporware award so many times that it's silly.

3DRealms have never released a game on a windows platform. The last internal game they released (besides re-releasing Duke Nukem 3D on XBLA) was Duke Nukem 3D. They've released other stuff developed by other people - expansion packs, but nothing that was supposed to be their flagship.

But what is less generally known is the work they did with external developers. Max Payne only existed to the degree it did because 3D Realms went in there and helped them out, paying milestones and helping with IP Creation.
Prey was the success it was in part because of the help that 3D Realms gave developer Human Head (and it's worth mentioning that Human Head are an awesome bunch of guys, but they are as dependent on publisher money as the next developer - having a group like 3DR run interference for them was invaluable). It's doubtful that game would be quite the quality it was without 3DR's help.

3DR was more than just "the guys making DNF" - they were a scrappy indie developer who actually walked the walk - they made their own decisions, brooked no interference from publishers and generally were everything an indie was supposed to be.

However I also suspect that was part of their downfall - they weren't making friends with publishers, and publishers do tend to have long memories about that kind of thing.

I also suspect that when they required money to finish DNF that, given the largely silly amount of time they've already had on DNF that it worked against them - from the publisher point of view I can quite see that funding a company who was openly rebellious and that has basically proved they can't actually get stuff done on time or in budget probably wasn't a great bet.

Lets be honest here - 3DR probably bears quite a lot of the responsibility for whats occurred here - they made their bed and now they have to lie in it.

I have the feeling that there was some brinkmanship regarding IP rights behind this door closing - it may well that their distribution partner, 2K, wanted those IP rights and 3DR, knowing that a developers only real value is the IP it owns, refused to give them up. 2K, being in the driving seat cos they have the money probably said something like "Well, give us the rights or go out of business" and 3DR, being 3DR, would rather do that than give them up for free.
NOTE - this is personal speculation, not any kind of insider info.

But having said that, could nothing have been worked out so the world got to see what was reportedly one hell of a game? I just feel it's sad that the world is deprived of a great gaming experience, and from the point of game developers in general, there goes one of the poster boys for indie development.

Possibly as a result of their own hubris and certainly as a result of their inability to actually, you know, get something done and release it. But still, people have lost employment and we've all lost a great game and a poster boy for indie development.

This is a sad day.

Posted at 08/05/2009 10:40:41 AM PST by Jake Simpson
Groups : Game Development









Blog Roll

Brenda Brathwaite
Black Company
Scott Jennings
Wolfgang Engel
Jamie Fristrom
Tom Forsyth
Japanmanship
Mainly about Games
Mundinator
Cory Ondrejka
Random Encounters
7 Degrees
Stacey Diana
T=Machine
Harvey Smith
Bruce On Games
Clint Hocking
David Jaffe
DeadRock
Rich Carlson
SnipeHunter
Chris Survival Horror
Justin Chin
Mischief and Soap
qDot
Unobscured View
Raph Kosters MMO Blog
Tom Plunkets Agile
Jon Jones
Mattias Worch
The Pickford Bros
Rob Fermier