DirectX and Alternatives for Linux Game Development

Started by Donald Darden, April 14, 2008, 11:51:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Donald Darden

The problem for game developers that want to move to Linux is, that DirectX, the API set that they use, is a product of Microsoft, and closely tied to the Windows platform.  In fact, Microsoft has used different versions of its DirectX product to leverage gamers into upgrading their system software, and consequently, has also raised the barrier where it comes to hardware requirements.

Game players don't seem to mind, since they seem eager to reinvest in their addiction, always wanting the latest and best of a new breed of games that take advantage of the improvements in both hardware and software capabilities.

Thus, we find that DirectX 9 works with Windows 98/Me/2K, DirectX 10 works with XP, and you have to have Vista in order to upgrade to DirectX 11.

Now there have been several alternatives when it comes to Linux.  One has been the effort to port DirectX to work with Linux via WINE.  This has been done with DirectX 9c, so technically you are trying to play Windows98/Me/2K games under Linux using the compatibility provided by WINE.  Of course you can also try to play games in a virtual environment, but indications are that performance will be really erratic and frustrating if you try that.

For a long time, people have used OpenGL (GL stands for Graphics Language) or some derivative under Linux for game development.  OpenGL is also available for Windows and other OSes, so its appeal was that it offered a universal approach to game (and other) graphics.  But OpenGL still left some open-ended issues for the developer to grapple with, and of course it was not fuctionally the same as DirectX, so a relearning curve was involved.

I ran into a product called OGRE awhile back.  I played with some of the graphic examples, and it was somewhat impressive.  What I had worked under Windows, but I learned that it was available under Linux as well.  I guess I need to research it some more to see where it stands.

Here is a couple of links to another option: 
http://www.libsdl.org/
http://www.linuxdevcenter.com/pub/a/linux/2001/09/21/sdl.html

This posting is just to get the door open a bit.  I'm sure other posters will have a lot more to add to this short list.

Petr Schreiber

Hi Donald,

I just woke up so I am in correcting mood, please forgive me :)

You have little inprecision in specified DX versions.
Latest DirectX on XPs is 9.0c, and on Vistas we have 9.0L and 10.0 ( 10.1 ). Only the 10.x is Vista exclusive, there is no version 11 yet.

It is also a bit difficult to compare DirectX and OpenGL, as DirectX is big package handling sound, input, networking and graphics ( Direct3D ) and OpenGL "just" graphic library.

I would not say OpenGL is less capable than Direct3D 10, I repeat it all the time so I know I am starting to bore others, but OpenGL on XP can do things which manage Direct3D only under Vistas. Like geometry shaders.

The only theoretical problems I have with OpenGL are 2 following:

  • Its implementation on Intel onboard cards
  • Lack of communication about development of OpenGL 3.0 aka Long Peak, this silence in ether started in autumn 2007

I must admit although I use OpenGL for about ~7 years, I still do not know it all!
But the learning curve seems better than the Direct3D one, thanks to frequently discussed and controversial "immediate mode" glBegin/glEnd, which MS Direct solution lacks ( or at least lacked when I started to learn ).

Immediate mode can be inefficient, but it is the best way to start learning. Try to teach early-teen to define triangle directly using pointers to arrays and he will run away with tears in eyes :D.

Once you master immediate mode you can jump to more efficient geometry definitions like vertex arrays, VBOs or even geometry shaders.
Thats the thing I like a lot on OpenGL, as you progress in knowledge, you can use more and more efficient ways to achieve similar or better results.

Regarding inavailability of DX on other systems ... if you know World Of Warcraft, it is MMORPG which runs also on Macs. Macs do not have DirectX so they simply used OpenGL to render graphics. Can you see some differences in PC and Mac screens? Me not - so it is just about having all vertex data stored in some independent way, and then you can use any rasterizer API.

And second extreme - games from Id Software. Those use OpenGL on PC, but on MS consoles they run under DirectX.

So lesson learned :), if possible, learn both APIs, for your hobby work use one you prefer, and for serious stuff simply that API which suits target hardware better.


Thats my view at OpenGL now :),
Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Donald Darden

Hi Petr,

Thanks for correcting and expanding on my brief intro to the topic.  I learned a few things myself.  I am not a game programmer, but I know that there is a lot of interest in this area.  I figure this would be a subject worth exploring in more detail.

There are sites that are devoted to game development, and we will provide links to those as well.  Plus, a number of game development systems and languages have come about, and I'm sure that these will be mentioned and discussed as we go along.

Unless you are writing a text-based game, graphics are your principle means of conveying information to the player.  Sounds can add emphasis and a degree of realism, but the mechanics behind the game are what really set it apart.

During play, a game has to evolve or show some aspects that capture our interest or imaginations.  You might consider this the twist factor.  If you are young, you might find tic-tac-toe interesting until you learn that you can always play the game to a stalemate or win situation, but that the win situation will only occur if the other player has not learned this yet.  After that point, the game is boring.  Then if you move on to Connect Four, you will find that you will have new factors to evaluate before you understand how to master that as well.  Once we solve the underlying mystery of a game, and develop the skill necessary to exploit it, it no longer challenges us, and we lose interest.

The fascination of game play can be extended through the introduction of the multiplayer mode.  Now you have to contend with what another (or others) might attempt to do, and beating other players is more personal than just beating a machine.  In the traditional board or card game, each player plays in turn, so that only one player is active at a time.  But many modern computer games permit many players to play at the same time, to play at their own speed, and even to take breaks from the game.

The time spent in game play is time taken out of real life.  It can have a posiitive impace, because game play can be a way of marking time, getting some enjoyment and thrills without risk, and sometimes helps us acquie some new information or develop some worthwhile skills.

The problem is, that games can become addictive as well, and some people become so involved that they basically just drop out of their real lives.  Some peiple try to counter by making game play a part of life, like creating games that teach fundamental subjects.  The new emphasis on reality shows on TV is to let us employ elements of game play in average people's lives with the chance at recognition and financial reward.

Game programming can be about just coding existing games into computer play, where the computer can act as the opponent, or where the computer is merely the facilitator to game play between a number of players.  Or it can be about getting involved in mew game concepts and how to exploit them.

Anyway, here is a forum for those that want to explore the topic further.

Donald Darden

#3
Game Development involves a lot of planning.  If you are thinking of creating a new type of game, you have to decide what type of game it should be, how it should be played, how many players it can have, the goals and objectives, and of course the challenges and approaches to resolving them.

Here is a mundane topic related to game development:  How is the keyboard to be used?  Can the player type in commands, which obviously adds lots of flexibility but shows down reactions, or are the keys intended to function as buttons on a console, so that pressing different keys envoke different actions?  If the latter, than you can't ise regular INPUT or INKEY statements, because these really just trap normal typing responses.  You probably have to resort to looking at the scan codes that are returned from key presses.

In fact, you have to consider other aspects as well, such as the graphics capabilities of the targeted machine where the game is to be played, whether the game can be enhansed with the use of some type of game controller or not, and so on.

If you are a committed game player yourself, then likely you are already familiar with the idea, or even the art of creating or modifying game play.  This is both good and bad, because you have an idea of what is possible in game development, but at the same time, it means that you are probably setting the bar too high for yourself as you start out game programming on your own.

The best suggestion I can make is to accept that game development is a long term objective, and that you will have to master the art in stages.  Many people prefer to begin with learning how to manage the graphics first, because that is the most evident and obvious area to tackle.  But eventually, in order to succeed, you will have to study many different aspects of game development, from game theory to storyboarding to audio sequencing.

Dispite this gloomy prospect, we see many young people, guys in particular, that get involved in game development.  Young people have lots of energy and can go without sleep and often have lots of free time, particularly in the summer months, and they yet lack the ability to earn much money, so the idea of committing many hours to somethign like game play or game development iseems like a small price to pay for having fun or doing something interesting.
And if they are any good at it, and stick with it, they may create something that can be marketed, so the chance to possibly end up creating the next killer game and making a lot of money is another attraction.

Naturally the rules of creating games do not apply to these young developers, and yet they may succeed where many others would fail.  But being avid game players themselves, they have learned much from the activity that they have engaged in for so long - but the question is, can they translate this into game form themselves?  Many can't, but some do.

If you look at the different OS camps around the PC, you would immediately recognize that the Windows camp is the largest.  Not only that, but this camp is the one that has the greatest concentration of paying customers, and the customers most likely to buy things to enhance their PC experience.  You would also recognize that the greatest share of computer games are written for this group, and that you have the advantage of DirectX as an attribute of Windows that can aid you in game development.

So the obvious choice is to select Windows as the preferred OS when you set out to write your game.  But the problem is, most other developers are writing to the same group for the same reasons, and that means that Windows is saturated with many game titles that are all competing for the discretionary dollars that are targeted for games.  As a result, some game titles enjoy great popularity, and others vie for the few dollars that remain.

I was once advised by my brother to move from Atlanta to New York because the job market there was much larger in my chosen field.  I declined, because while I might be competing with hundreds for a single job in Atlanta, the number of applicants for a similar job in New York was several times as many, and thus my chances of getting a job would not increase.  In fact, in a larger candidate pool, it was more likely that each position would go to a person that was deemed to be a better match, or better qualified.

The argument to consider here, is that if the market for computer games would be smaller with an OS like Linux, then at the same time, the competition for that market would likely be less intense.  A new game there might have a better chance at catching on.  However, the real down side to Linux is that it is perceived to be an Open Source community, and as such, would resist the idea of paying for something if it is possible to get it for free, or do without.

So if you are seriously thinking about a future in game development, you might think twice about which market to tackle.  Now as part of your research, you might need to consider what the competition is in each market.  Here is a list of sites that promote games for Linux.  You can judge for yourself the quality and quantity of such games, and then weigh that information against what you know about the game field for Windows:

http://www.happypenguin.org/
http://techgage.com/article/top_10_free_linux_games/
http://absolutist.com/linux/
http://games.linux.sk/
http://www.linux-games.com/
http://www.tuxgames.com/
http://lhl.linuxgames.com/
http://www.linuxlinks.com/Software/Games/
http://lgames.sourceforge.net/
http://www.phelios.com/linuxgames/
http://adonthell.linuxgames.com/
http://www.tuxgames.com/
http://www.lokigames.com/

I also found a link to a book on the topic of programming Linux Games:

http://nostarch.com/frameset.php?startat=plg

More Links:

http://www.linuxdevcenter.com/topics/linux/games
Wednesday, April 16
6:00 pm:  Dinner
6:45 pm:  Class on Study (Scriptures) - Clair Weddle

http://www.gamedev.net/reference/programming/features/linuxprogramming5/
http://www.happypenguin.org/forums/viewforum.php?f=7
http://www.amazon.com/Linux-Programming-Prima-Techs-Development/dp/0761532552
http://www.amazon.com/Programming-Linux-Games-Loki-Software/dp/1886411492
http://www.thefreecountry.com/sourcecode/games.shtml
http://h.webring.com/hub?ring=linuxgp

Petr Schreiber

Hi Donald,

very nice post.
Quote
So the obvious choice is to select Windows as the preferred OS when you set out to write your game.  But the problem is, most other developers are writing to the same group for the same reasons, and that means that Windows is saturated with many game titles that are all competing for the discretionary dollars that are targeted for games.  As a result, some game titles enjoy great popularity, and others vie for the few dollars that remain.

I think the game popularity factor is strongly pushed not only by platform and dollars, but also by reviews in both paper and online game magazines. It is surprising how much people can be angry and take games as a holy artifact just because someone somewhere wrote it.
So there is quite big power in the press which has very strong influence on the sales.

On the other side, even positive review does not help sometimes.

For example games which I enjoyed a lot, sadly have very low sales here:
Anachronox ( the devteam bankrupted )
Beyond good and evil
Moment of silence

Next thing are "budget" games, which are often not worth playing, not because they cost less, but because they are simply very "empty" and very often seem like sadistic revenge of angry developer :D who just wanted to created bare minimum to kick out money from.
That does not mean budget game do not have good technology, but that they very often lack the brain with a brilliant idea behind.

But there are few exceptions, like terrific FlatOut and FlatOut 2 games - sold at mini prize, and the best racing games I had chance to play so far. Quite inovative with big physics interactions.

Your point about game controllers is interesting, fact is I still prefer keyboard + mouse. Very interesting is "new" wave of gyroscopic controllers ( like Wii controller, or Sixaxis (?) for PS3 ).


Bye,
Petr

AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com