Originally Published: Monday, 2 July 2001 Author: IRC Staff
Published to: interact_articles_irc_recap/IRC Recap Page: 1/1 - [Printable]

Gaming Week: Programming Linux Games with John Hall

For Gaming Week, we had John Hall, author of Programming Linux Games come in and talk to us about his book and his experiences programming. We had a great audience with good questions. At the end of the event, we also had one of his books and some t-shirts, courtesy of NoStarch, to give out. If you missed the event or just want to read the log, here it is.

   Page 1 of 1  

<overcode> dan
<theoddone33> hey there
<overcode> ooh, nice hostname
<hendersa> theoddone33: Intern: The Next Generation.
<heimdall> Sam will likely show up in a bit :-)
<theoddone33> These are the voyages of the starship Loki
<Wintersun> Okay, I'm going to go ahead and start this event off
<Wintersun> I'd like to welcome everybody to today's Live! Event
<Wintersun> We have John Hall here today to talk about his new book "Programming Linux Games"
* overcode waves and continues dodging tomatoes
<Wintersun> Afterwards, we're going to be raffling off a copy of the book as well as 5 NoStarch Press t-shirts, so please stick around for the raffle. Thanks!
<Wintersun> During the event, if you have any questions, please /msg lcModerator and he will ask them for you
<Wintersun> Thanks, and now, I'm going to hand the stage over to overcode to introduce himself and tell us a bit about what he's up to.
<Wintersun> overcode?
<overcode> Thanks everyone. I'm John Hall, a fairly typical computer science geek from Georgia Tech. I've been into game programming as a hobby for quite some time.
<overcode> I had the fortune to meet Loki at the Atlanta Linux Showcase in '99, through the Loki Hack contest.
<overcode> I'd been thinking of doing a book on game programming for a while, but plans really began to fall into place when I met Sam Lantinga, author of SDL.
<overcode> He liked the idea of a book, and before long Loki hired me to write one.
<overcode> At the moment I'm working for Treyarch, a console game company. My current project is Spider-Man 2 for the PS2.
<overcode> So, that's me. The book went to press recently, and it should hit the shelves in less than a month. -overcode- Ja?
<lcModerator> How long have you been using linux ?
<overcode> Since about my junior year in high school. I met a programmer (a game programmer, actually) at a bookstore. He was a bit of a Linux zealot and wasted no time in telling me why it rocked.
<overcode> I didn't get around to installing it immediately, but eventually I grabbed a copy of Slackware 3.2 and put it on an extra partition.
<overcode> It was downhill from there.
<lcModerator> Does the book deal only with sdl or does it explain other APIs such as svgalib, X etc?
<overcode> SDL is the most important API in the book. I don't cover SVGAlib (which I consider dead) or X (no real advantages over SDL, which can target X anyway).
<overcode> I do talk about the Linux framebuffer console, though.
<lcModerator> What languages does the book talk about, C, C++, others, and maybe even asm?
<overcode> All of the book's code listings are C. If I were to start over, I'd probably go with C++. There's also a bit of Tcl in the scripting chapter.
<overcode> C leaves something to be desired, but it's a common denominator most coders can understand.
<lcModerator> Why do you consider SVGAlib dead?
<overcode> I'd like to cover a bit of asm in a future edition, but right now I lack sufficient experience in asm, and I ran out of time.
<overcode> SVGAlib is a low-level library for talking to SVGA cards. SVGA is, for all practical purposes, a PC-only standard, and I think it's holding the industry back. Even modern 3D accelerators have VGA cores. It's an ancient design that needs to die yesterday. And even though so many cards have SVGA support, they're all slightly different in the programming details, and SVGAlib supports only a handful of them particularly well.
<overcode> Aside from that, I think the API is ugly.
<lcModerator> What do you have to say about games that were originally written for windows using directx? how easy would it be to port to linux, using SDL or opengl or something like that?
<overcode> SDL is meant to be a wrapper for DirectX and other multimedia toolkits, so porting games from DirectDraw to SDL is fairly straightforward. That was one of SDL's design goals.
<overcode> A much bigger challenge is porting Direct3D apps to OpenGL. I'm not qualified to answer that one, but some of the Loki programmers could share horror stories.
<overcode> (FWIW, Heavy Gear II was a D3D -> OpenGL port.)
<lcModerator> One of the problems fraggle finds with SDL is that it only provides a very basic interface to the multimedia devices and extra libraries are needed for more functionality. Which extra libraries do you use (if any) ?
<overcode> (one moment)
<overcode> I generally use SDL, OpenAL (an environmental audio library), and SDL_image (a multi-format image loader).
<overcode> But I don't find SDL lacking in support for low-level features.
<overcode> One of my peeves is its lack of support for triple buffering (asynchronous swapping), but that's coming in the next big release (2.0).
<overcode> Otherwise, I'm not sure exactly what you mean. fraggle, feel free to /msg me and clarify.
<lcModerator> What do you think it will take to get Windows developers using SDL instead of DirectX?
<overcode> I think it will take a well-executed next major release of SDL (the 2.x series). SDL *is* sufficient for commercial game programming; Loki has proven that. But to really gain mindshare, SDL needs to further its reputation as not only easy to use, but powerful.
<lcModerator> What do you have to say about the current 'business' of writing games for linux? id software at one point said that "support was horrible" because of different core libs, and just the way different linux boxen are setup in general?
<overcode> Win95, Win95 OSR2, Win98, Win98 SE, WinME, Win2k, Win2k Professional, WinNT 4. *ahem*
<overcode> So I don't agree with id on THAT point.
<overcode> Quite honestly, I think id had a bad run-in with Linux.
<overcode> It's true that there are different glibc releases.
<lcModerator> What kind of games do you talk about in the book? General3D Games? or ultima5-like games?
<overcode> But the differences aren't enormous.
<overcode> This is NOT a book about 3D game programming. Its focus is primarily 2D, though I do touch on using OpenGL with SDL. 3D programming is the subject of many other books, and it's not a Linux-specific subject. I felt that a thorough coverage of 2D programming would be more valuable than an attempt at scratching the surface of 3D programming.
<overcode> OpenGL is a cross-platform API; once you have a rendering context, it doesn't really matter which OS you're using.
<overcode> The same could be said about SDL, but SDL has strong roots in Linux.
<lcModerator> Does the book cover mostly programming API's or does it also cover general game development topics, like say collision detection for example.
<overcode> It's meant as both a toolkit reference for experienced programmers and an introduction to game programming for beginners (assuming a knowledge of C and the basics of Linux). I tried to include a basic foundation in the techniques of game programming, but also an easy to reference guide to the various APIs. reset by peer)
<overcode> (btw, included APIs are SDL, OSS, ESD, ALSA, OpenAL, Tcl, the Linux fbdev, gpm, and sockets)
<lcModerator> What was the first game you wrote and how old were you?
<overcode> I wrote some REALLY ancient stuff on the Commodore 64. I was around 7-8 at the time. That was more fiddling than programming, but it was where I got started. I got more serious about it in 6th grade when my dad got a computer with (*gasp*) Turbo C++.
<lcModerator> What do you think of the allegro game programming library?
* overcode crosses his arms over his chest, utters some Klingon phrases, and turns his back
<overcode> j/k. Allegro is pretty neat.
<overcode> I prefer SDL though.
<lcModerator> hehe. :)
<lcModerator> Can you elaborate on what's in the scripting chapter of your book?
<overcode> Most games these days use a scripting language for content. Level designers build a world in 3DS MAX or similar, and scripters define the behavior of the world. This is generally considered to be content creation, not coding, and it makes sense to separate it from the main codebase. Furthermore, scripters generally aren't hardcore programmers, and they would have difficulty with something like C++.
<overcode> I introduce this idea and demonstrate how to create a scripting system with the Tcl language.
<overcode> I chose Tcl because it's incredibly simple to embed into other programs.
<overcode> (Though if I were to build a game, I'd use Lisp or Python; Tcl is a bit klunky sometimes.)
<lcModerator> What do you think about the posibility of linux driven consoles?
* overcode pats his PS2 devtool
<overcode> I think it's a great possibility.
<overcode> Thr trouble is getting the game industry to accept it.
<overcode> Game developers are heavily Windows-centric. I'm not completely sure why.
<lcModerator> How is the code in the book licensed (ie. can example code be reused by open source developers?)
<overcode> But of course.
<overcode> I'm not sure of all the licensing details, but I suspect most of it will be LGPL.
<overcode> (the code is distributed as a downloadable archive; it'll be up in a few weeks)
<lcModerator> What is the weakest link of Linux game development?
<overcode> If not LGPL, then some free software license.
<overcode> Tough question.
<overcode> So I'll name a few things.
<overcode> a) zealotry. It does not make the community look good, and turns a lot of people away.
<overcode> b) tools. gcc is pretty good. g++ is less good, but getting there. Content creation tools don't exist.
<overcode> c) marketshare. It's hard enough to make money on a commercial Windows game.
<overcode> d) drivers. Nvidia is helping, but overall Linux 3D driver support is not in good shape.
<overcode> a) can be addressed, and it's getting better. b) is also getting addressed, with Maya, Blender, and The GIMP.
<overcode> c) is a chicken and egg problem.
<overcode> I'm not sure about d), but I hope Nvidia will continue to support the Linux community with top-notch drivers.
<overcode> And I hope ATI will follow suit.
<lcModerator> Do you think there will be more original games for linux as opposed to ports of Windows games in the future?
<overcode> It could go either way.
<overcode> I think we'll see more in-house ports.
<overcode> Depending on how those do, maybe we'll see some Linux originals.
<lcModerator> Do you have any advice for someone, or a group of people, who are interested in publishing an original commercial Linux game (as opposed to a port)?
<overcode> Gamers want to play games. They don't care about the underlying OS. That's why I like consoles -- you plop a CD in a box and hit the power button.
<overcode> So if we want them to come to Linux, we need to make them welcome, and make sure their stay is pleasant.
<overcode> Yes. a) don't alienate the community. You don't have to release the source, but don't release a Linux server and not a Linux client; that's just annoying.
<overcode> b) be prepared to support the product.
<lcModerator> Does it bother you that the NVidia drivers are closed source?
<overcode> That would involve making sure your QA department knows enough about Linux to answer basic questions. I'm sure heimdall could respond to that in depth.
<overcode> It bothers me, but I don't think it will change any time soon.
<overcode> Quality binary drivers are better than no drivers or crappy open source ones.
<lcModerator> What do you think about tools like blender?
<overcode> Of course quality open source drivers would be the best case, but Nvidia's IP agreements apparently preclude that.
<overcode> I'm glad to see Blender, but the interface is from another planet, so I haven't been able to do much with it.
<overcode> (Aside from that, I'm not an artist, so I don't have much of an informed opinion on Blender.)
<overcode> Maya is much more interesting.
<lcModerator> As somebody working in the gaming industry, how do you expect the number of games with linux versions to change in the next few years?
<overcode> Hopefully the number will increase. It depends on how well the Linux community responds to the initial releases.
<overcode> If there is a strong response, I'm sure more will happen.
<lcModerator> How long did the book take to write, cover to cover?
<overcode> Most gaming houses have at least one Linux geek who might be willing to do a port. But that's unlikely to happen unless he/she can convince the higher-ups that there will be some gain from it.
<overcode> I started last January, but didn't really get much done until May. I was wrapping things up around March.
<lcModerator> Is it possible to check your projects out on the net?
<overcode> I thought it would be a much quicker process, actually. But there were a LOT of details to attend to.
<overcode> The book's Web site is http://www.nostarch.com/plg.htm, and I suspect Loki will set up a page for it. I hope to eventually build an online game programming resource, but that's a matter of free time.
<lcModerator> Do you have any plans to write in the future?
<overcode> Definitely.
<lcModerator> What Linux distro do you use now? Do you have a favorite?
<overcode> I don't know what or when, exactly. But I had fun writing this book.
<overcode> I use Slackware. I've tried Red Hat, SuSE, TurboLinux, and (briefly) Debian, but I like Slackware for its hands-off approach.
<lcModerator> Can you suggest a good Mexican restaurant near the Loki offices? :)
<overcode> Alberta's!!
<lcModerator> and the final question, (gotta be asked by someone) :)
<lcModerator> ...boxers or briefs? :)
<overcode> (they serve enormous chicken burritos known as "@#$%bricks")
<overcode> to be decided when I get up in the morning.
<lcModerator> hehe :)
<Wintersun> nice answer. :)
<Wintersun> Okay, that was all the questions that were sent to the moderator, so I'd first like to thank John Hall for coming and talking to us today.
<overcode> My pleasure.
<Wintersun> I'm going to quickly raffle off the book and the t-shirts and then I'll open up the channel for open discussion
<Wintersun> So, first off, the winner of the book is... <drum roll>
<Wintersun> madcat__!
<Wintersun> madcat__: please /msg me if you're in here so that I can get information from you to send you you're prize
<overcode> Hangon, we can find him.
<Wintersun> Okay, he /msg'ed me
<Wintersun> And now, the winners of the t-shirts are... <new drum roll>
<Wintersun> Treenaks!
<Wintersun> Neo|Work!
<Wintersun> pdo!
<Wintersun> Alkini!
<Wintersun> and... solomon!
<Wintersun> If you 5 could also please /msg me and I'll get your info to mail you your prize
<Wintersun> Thank you everyone for coming and the channel is now open for discussion




   Page 1 of 1