Ask Sam Lantinga About SDL On PS2 And More
Sam Lantinga is the author and project lead of the Simple DirectMedia Layer (SDL), which was recently ported amid general acclaim to the Sony PS2. People have been curious about SDL for a long time (it's been around for a while, and used in quite a few games). He's not just a library programmer though; he also designs games (in this case, working with Lauren MacDonell) and thinks hard and lucidly about the intricacies of information display within them. Here's your chance to ask Sam directly what's on your mind about SDL, game design and more. Note -- many questions are answered within the links already given, so hit those first. One question per post, please (but as many posts as you'd like) -- we'll forward the highest-rated questions on to Sam, and post his answers soon after.
Writing and distributing a game for a computer is fairly easy. But I don't see how the same process could be applied to the PS2.
How would games developed for the PS2 with SDL actually get to people? I doubt we're going to see a lot of free, open-source games on DVD at Best Buy. But (for instance) I can play a whole slew of SDL-based games on Linux, Windows, and BeOS with just a quick download.
It seems to me like this might be a problem for the PS2.
This guys is a GAME DEVELOPER and is working on *SDL*. Where does it say to ask about GPL legalities and kernel distributions...???
SHeeeeesh....... Welcome to Slashdot - we only have one drum and we beat it loudly.
Why was this ever modded up to +5? It's not even flamebait - it's just totally off topic. Why don't we ask him about his opinion on stem cell research too....
I'm not sure if SDL already does this, but is SDL planning on doing something along the lines of Direct Input in order to get things like force feedback joysticks, and rarely used controllers (i.e., Steering wheels, PC Light Guns) to be easily put into a game?
-Kenix "Beer is proof that God loves us and wants us to be happy."
Why, does everyone here want to spend their money on PS2s?
When you buy a PS2, you give money to Sony, who is both a member of the MPAA and the RIAA.
MPAA:
Sony Pictures Entertainment
RIAA:
Sony Broadway
Sony Class./Sony Music Soundtrax
Sony Classical
Sony Direct
Sony Discos
Sony Masterworks
Sony Music Special Products
Sony Music US (Latin)
Sony Portrait
Sony Wonder
General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
My question is a bit tainted by my personal opinion in this matter, but I'm sure Sam will be able to provide a different (and surely interesting) point of view.
At the risk of being a tad Linux centric, does the availability or unavailability of hardware specifications and technical documentation on graphics hardware affect a Linux game developer and why? With two concrete cases in mind, on one hand NVIDIA who provides binary drivers and "high level" documentation about their cards, and on the other hand, ATI for which there's source code for the drivers with support for half of the features the hardware offers, but neither openly accesible hardware documentation nor much "high level" docs, how do you think this can affect the future development of games for Linux (proprietary or otherwise)?
Thanks
This may be more of a question for everyone else than for Sam (but Sam can feel free to answer also :)
I'm not a big gamer, but I would play some if it weren't such a bitch to get the proper libraries working under Linux. Last time I tried was about 6 months ago... After following some really complicated directions and compiling umpteen obscure drivers I finally got SDL and hardware-accelerated OpenGL working. I had to disable it and revert to my previous versions, though, because it locked up my system a lot during games and made X pretty unstable.
Anyway, my question is this: is multimedia support for Linux getting any easier to install? Is it possible that someday I will be able to install a distribution and have it automagically configure hardware 3D support, install SDL, etc.? Or is Linux multimedia still too much in the toddler stages?
I'm just a lowly PHP coder. I don't understand all this low-level mumbo jumbo. I just want to fire up a game every now and then and blow shit up. Is there hope for me?
the gpl is referred to as "viral" because anything that is derived from a gpl'd product must be gpl'd. it spreads. like a virus. hence the term "viral".
Every once in a while I like to masturbate a new word into my vocabulary, even if I don't know what it means.
Now that you work at Blizzard, can you comment on whether Blizzard has an interest in releasing games for Linux along with the PC and MAC?
I'd first like to thank you for the port of Maelstrom, which has to be one of the most addictive games ever. (One of my friends called it legalized crack.) But how hard is it to port a classic game like Maestrom to SDL? Was it more work that it would of been to start over? Or because of its size and complexity was it relatively easy?
Sony charges stiff fees for Playstation (2) development licenses. Was one of the primary focuses of SDL a way to circumvent these fees, broaden the PS2 platform, broaden the SDL platform, or broaden Linux as a viable game platform?
There are, of course, some very good commercial 3D API's that will abstract over this problem. One of the strengths of SDL has been that you have abstracted over the low level and have avoided getting into the sticky business of fighting OpenGL and Direct3D for the 3D API. This also limits the utility of SDL, however, because of the lack of a solid, free API for abstracting the 3D API.
Do you see SDL moving higher up the graphics pipeline in the future, or is it your intent to continue to avoid higher level 3D calls?
-magic
just a thought about these types of libraries in general...
Seems to me that a lot of gamers have complained on and off about the lack of original games and general stagnation of the game industry. In my opinion, that was alleviated a bit with the introduction of 3d engines that were produced specifically to make life easier for game developers. No longer did you need to have a large staff of programmers to write your game engine (2d or 3d) from the ground up. Take a portion of your game dev budget and plunk it down for a proven graphics engine. Get some artists, perhaps some 3d modelers and have at it.
I think the proliferation and evolution of game development libraries like this will lead to making better games. The more of the budget that can be dedicated to fine-tuning the gameplay and design, the better. On the other hand, though, I fear that making games really easy and quick to create will lead to even more cheap, crappy quickie games with no substance.
My sigs always suck.
Additionally, your middle name wouldn't happen to start with a "D", would it? (Sam D. Lantinga)
Was your depature good? Daniel Vogel also left. Is Loki in a good position or did you leave because of some problem. What's the deal?
This is my signature. There are many signatures like it but this one is mine..
To what extent do the games compiled with SDL for PS2 are slower than the analogous native versions? If a programmer uses a special programming style, does that improve the performance?
Also, does the overhead of SDL grow since there are so many platforms/tricks to be supported (i.e. if a feature of PC hardware leads to a certain architectural solution, the same feature does not necessarily exist or is relevant to the PS2 architecture).
With SDL for PS2, are there any plans to do the same for the other next-gen platforms, the Gamecube and the Xbox?
Erik
"You," Bite me.
"Each and every one of you." Bite me.
I did note that. Read the last sentence.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
To clarify an important point:
You only have to make the source available to the person you send the binaries. There is no (ridiculous) requirement that you must open the source to everyone.
However, you can't forbid that person from redistributing the source afterwards which generally makes the point moot.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
Hi Sam,
correct me if I'm wrong but to develop games for the PS/2, you need the Sony "TOOL" DTL-T10000 and the Metrowerks development environment, this runs about $20,000.
In your communications with Sony has anything been expressed about opening up the PS/2 to home developers? The Linux thing is neat but most hackers would like to develop a game for the PS/2 and then burn it to DVD for distribution to friends, customers etc.
I'm reasoning that the first console to have an affordable dev environment is going to clean up in market share. It would be a shame to see the Xbox 'innovate' in this manner.
That's mostly hardware.
1024x768 at, say, 32bpp is 3.1MB. About 50MB per second if you get 16fps. This really doesn't sound like alot, until you consider that you're blitting to the buffer as well -and- you sit around waiting on the bus to 'flip' the buffer; and the bus is an awful lot slower than direct memory access.
You can get around this by using a hardware buffer and hardware surfaces, but you're stuck with using just images and usually color key that way; no primitives for the time being, and alpha blend isn't always supported in hardware.
As far as full screen page flipping goes, you need to use a hardware surface. You won't always get one; check the flags on the surface that is returned. May also need SDL_DOUBLEBUF, it's been awhile since I messed with that.
- aoiushi, #sdl
What are you working on at Blizzard? Do you get paid for continuing your work on SDL, or do you have to do that in your spare time?
Sig (appended to the end of comments I post, 54 chars)
From playing with it, and noticing what has been conveniently removed from the documentation (but is still in the libraries), it looks like DirectX 8 is trying very hard to do away with driectdraw and work purely through the 3d engine. Sprites are just 2d textured polys, etc...
This leads me to believe that any future enhancements/optimizations/support/testing/etc... that will happen with directx will be only on the direct3d part, and directdraw is probably going to be unsupported. Do y'all have any plans to deal with that?
---
Play Six Pack Man. I
Are you the least bit concerned that Microsoft might claim that 'DirectMedia' infringes on it's trademark of 'DirectX', 'DirectSound', etc?
Things you think are in the Constitution, but are not.
Replacing X with a much better designed and modern interface has been a long time dream of mine and this sounds like a way to do it.
I suspect SDL may lack features for allowing more than one program to cooperate on the screen (ie it lacks overlapping windows). But these should be possible to add with a few calls that should be designed to resemble the rest of SDL as much as possible.
But they have to give the people they gave the binaries the source under the GPL, so anyone receiving it could release it to the public. NDAs are not valid there.
This message is provided under the terms outlined at http://www.bero.org/terms.html
It was a cause of concern when I read that you left Loki Software. Even though I understand that you personally hold the Copyright for SDL, the nature of Loki seems to imply that it's presence encouraged you to continue development. With that part of your life behind you, would you like (or have you made) a public statement about the future of SDL?
The real question is: why is it so hard to spell?
Sam LaNtinga.
Sheesh.
m.
"Sebastian you're in a mess. They called you King of all the Hipsters, is it true or are you still the Queen?" -- B
Have you ever actually used SDL?
I play SDL-based games regularly, and to me it looks like a direct parallel to DirectX.
I can play every game on my system, using only a single shared library for graphics and sound I/O.
These games were all developed using a single shared library for graphics and sound I/O.
Tell me how this adds 50-75% overhead?
From what I understand, the PS2 Linux distro uses a proprietary, binary-only driver/library/program to allow programmers to access the PS2's graphics chip. My question is, how will this hinder end users' ability to get their hands on SDL-based PS2 games?
Does this mean they'll have to buy a copy of the $200 Linux development kit? Or are developers allowed to freely redistribute the graphics runtimes? (Or have you found some other way around this, perhaps by accessing the PS2 hardware without the binary runtime?)
I'm just afraid that most PS2 gamers (read: non-geeks) won't find SDL games too attractive if they have to buy a $200 Linux kit to play them.
From http://news.cnet.com/news/0-1006-200-5756218.html, linked in the slashdot story:
The programming blueprints, or source code, for the kernel--the heart of Linux--is included on the DVD, Sony said. But the source code for a proprietary "runtime environment" that lets games play on the system is not.
I know its slashdot, but I can't believe being a blind, mad, and paranoid GPL zealot will still score you +5.
This is primarily a PC (as opposed to console) question:
I have tried writing a game for SDL under both Linux (redhat 6.2, XFree 4.0.1, Geforce DDR), and under windows 2000 (geforce DDR, and also tried with an ATI all in wonder pro). In all cases, i could not get a page flipping full screen mode to work, and i could not blit the screen full and "flip" to achieve anything faster than 16fps at 1024x768. This is a dual pIII 800 i've been trying this on.
My question is: Is it hardware or software?
---
Play Six Pack Man. I
Having ported a bunch of Windows games, and worked on SDL, what would you say the weakest technical link in writing games for Linux et al, is? With SDL we have a common 2D interface, with OpenGL, common 3D, OpenAL for 3D audio. What's left?
Actually, I've heard that they lose money on every sale. The games sold more than make up for it. I know for a fact the XBox is the same: it'll sell for about 70% of the price it cost to make (published in Wired and other places). Price wars seemed to have forced this odd situation. Since Sony makes money from every game sold, and they know roughly the average number of games a console user will buy, they can max profit by undercutting competition in prices, selling more games (which have a HUGE profit margin), and make a bundle.
And related to this, my plan is to by a few XBoxes after someone hacks a linux distro for it. I won't buy any games, it looks good just as a high-end graphics linux box (and far cheaper than a comparable PC). And to top it off, I'll basically be taking money from Microsoft.
Maybe I'm oversimplifying, so if I'm wrong, please speak up!
Developers: We can use your help.
I've used SDL for almost 2 years now, and it completely blows away everything we have had to trudge through to get graphics going on a linux platform (Hell, it blows away what is available for DOS/windows... I haven't had this much fun programming cince my atari!)
SDL will become a de-facto standard soon, it's fast, coupled with OpenGL it's powerful, and it's a dream to program with.. Svgalib was nice back in the 1980's but this is a real graphics lib.
Hell, you can make a side-scroller game in PERL with it.... and there's a few embeded GUI's based on it now.
Do not look at laser with remaining good eye.
First of all, I'd like to say that I love Myth 2. Without SDL, I don't know that Loki would have business. Anyway, on to the question.
The Linux desktop as a whole has gained ground-breaking increases in the number of users, but still falls way behind Windows. In my opinion, the only thing that's holding back Linux is it's lack of entertainment, specifically in the game department. In order for Linux to truly take off, Linux needs a plethora of games to even try and be on the same level as Windows.
Where do you see Linux gaming in the next few years, and do you think it will directly affect the number of users?
arcane for life
Will WarCraft3 use SDL at all? And the other question about WarCraft3?
The heat from below can burn your eyes out
This is so youy can use GPL'ed software in a private environment w/o the concern that you must make the source available to anyone who comes knocking. So supercorp. is allowed to take Linux or any other GPL product and custumoize with all sorts of cool proprietary knick knacks containing all their cool IP and code and not have to worry about being forced to legally distribute the achanges because a disgruntled employee blabs on slashdot. This remains true as long as supercorp never distributes the product to the public.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
What most Linux enthusiasts have realized is that Linux needs marketing in order for it to become a prominent desktop platform for end-users. We've been getting some help from IBM and Compaq to name a couple. Since you are using Linux as the core of the PS2, would you consider advertising it as so? It seems to me that many computer-literate console players would be intrigued by seeing a "Powered by Linux" sticker on their PS2s enough to go out and buy/download a distro.
We dance to all the wrong songs.
--Refused.
First, thanks for SDL and SMPEG. They ran mpg321 very well for a while. Thanks, too, for your development help.
I know you probably get asked this a lot, but as a loyal Loki customer I just have to know: now that you and most other Loki programmers have moved on to bigger and better things, in your opinion does Loki have a chance in continuing to produce Linux games?
Also, what about a wrapper against D3D? There is currently a nice integration with OpenGL, when SDL needs to use 3D acceleration, but under Windows (where a lot of SDL games already exist) most of the coders are using D3D. Also, based on the fact that D3D 8 is not as bloated as previous versions, a wrapper for other OSes could be easily achieved (IMHO).
Last question, again on the spirit of 'SDL Vs DirectX', are there any plans for more support for more input devices, like force feedback wheels etc.
Take care and thank you for all the hard work you have put on SDL the last few years. (and also greatly thank you for the BeOS port! :)
SDL was written for porting games, and as such, you would expect most programs that use SDL to be written in C or C++, for speed. However, with the Python bindings for SDL, programmers can write in a better application programming language and still take advantage of your cross-platform "game" library. What applications do you envision with SDL and very-high-level languages?
I was investigating the possibility of using the SDL as the lowest layer in the system. My goal was to replace X Windows entirely, and use SDL instead to create a window system based on OpenGL in a manner not to far fetched with what CoreGraphics is doing inside MacOS X. It appears that SDL on the platforms it supports (in my case linux) , relies on the XWindows windows server and event propagation model.
Do you think it would be feasible to plug something with less complexity than X Windows at the bottom of SDL to do such a task. How tied is SDL coupled with the platform architectures it supports?
-- I feel better now. Thanks for asking.
Again, only must be available to you if you obtain the binary. Not just because you have a PS2 (unless it runs a Linux as shipped).
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
As with any system, there are trade-offs. The PSX2 graphics chip (EmotionEngine) has a number of features which require careful programming to exploit, especially given the (relatively) limited main memory (32M). The question is to what extent you expect to compromise your API's growth in capability/portability to support gee-whiz features. The dual of this question is of course that with a cross-platform API, you tend to end up with something equally mediocre across all systems, potentially leading to a catch-up mentality in the marketing perception which is particularly fatal in the computer gaming sector which continually relies on new features to draw in users. How do you expect to handle these compromises without alienating too many of the stakeholders (developers, manufacturers, users, etc)?
LL