Log in

View Full Version : getting DX5 for 2D games


alchemist
11-08-2002, 03:51 AM
Awhile back we had a thread on DX8 vs DX5. Steve's position was that you'd increase your sales if you went with DX5, and your download would be smaller too.

This makes sense to me for casual, 2D games. But is there any downside? Is DX5 more difficult to deal with (again, not talking about 3D games), or are there other hidden issues? Are all the newer video cards sufficiently backward compatible?

And where can I get DX5? I've found one or two places that have a "DX5 core" for downloading with another game -- what more do I need for my programmers if I'm going to tell them to make our games DX5 compatible? (The M'soft site didn't seem to be of any help).

Finally, what's the difference in terms of availability, ease of programming, presence in the casual game-player (not gamer!) market, and download size between DX5 and DX7?

Thanks for any help.

LordKronos
11-08-2002, 04:16 AM
You can use the DirectX8 SDK to program for DirectX 5. You can get old DirectX help files from some sites. I had one I use all the time, but I can't seem to recall the URL for it. If no one else posts, I'll do it later when I find it.

As far as 2D goes, I really don't know exactly what the differences are. A lot of the advances they did was with 3D, but I think they may have simplified the setup code, added some helper functions, maybe added better support for cursor overlays, and stuff like that.

As far as download size, it doesn't matter. Microsoft only offers downloads for the latest version of DirectX (8.0a for Win95, and 8.1 for 98/2000/ME/XP). All older versions of DirectX are automatically supported.

Win 95 comes with DirectX 1, 98 comes with 5, 98 SE has 6.1, 2000 has 7, XP has 8, and I can't remember what ME has. So if you go with DX5, you can support pretty much every machine purchased in the last 4 years, plus any older machines that have been upgraded.

alchemist
11-08-2002, 04:27 AM
Thanks Kronos!

So if I understand correctly, if you limit yourself to DX5 (even using a recent or current SDK), you shouldn't need to provide any sort of DX download along with your game (excepting a very small segment of even the casual population that might still for some reason have only DX1)? Steve, if you're reading this, does that fit with your experience?

If you have the URL for the old DX help files, that'd be great. I have a contractor who's reluctant to chain himself to something as old and crufty as DX5. :)

Dan MacDonald
11-08-2002, 04:46 AM
I'm going to have to hop in here and give my Allegro plug. DirectX 5 is tricky to use if you're not all that familiar with com, in fact it's just tricky to use in general. Allegro provides a nice easy interface to all of directDraws's features and even adds some. On top of that if you use allegro's routines you should be able to take your source and compile it on a linux or beos machine and not have to change anything in your code to port it to those platforms. A mac allegro port is in early beta right now as well.

Dexterity
11-08-2002, 05:39 AM
I don't recall saying that your download would be smaller if you used DX5 vs. DX8 -- that wouldn't really be true as far as I can tell.

I started with WinG years ago, then the GameSDK before its name was changed to DirectX, so I've been with DirectX for a long time. I have no idea what it's like for people to learn it today from scratch, since for me the learning curve was gradual. JumpStar, which is still selling on our site today, was written using WinG back in 1995. I don't think I have copies of the DirectX 5 SDK, since I installed DirectX 8, but just use the functionality of earlier versions.

Jake Stine
11-08-2002, 06:23 AM
If you want to do as much hardware acceleration as possible, then you are probably better off using DirectX 8 (disregarding compatability and/or targeted-platform considerations). DX8 basically removed DirectDraw in favor of a mostly 3D-oriented API that can make better use of the generally-3D-oriented hardware accelerators in people's computers these days. As for DirectDraw, it was effectively discontinued after DirectDraw 5-- that's when Microsoft decided they were never going to bother to implement all those missing features that the DXSDK talks about, which includes most of the alpha blending and batch blitter functions.

Anyways, I found the entire Win32 SDK (ie, almost everything in the MSDN) to be nearly impossible to use for the first several months I was using it. Once I got used to the general style of programming that Microsoft expects and aims for, interpreting the stuff in the MSDN into functioning code became a lot easier, and likewise the stuff in DirectX made more sense too. Nowdays, a full two years later, I find myself to be a bit of a MSDN expert and can not only find what I'm looking for (ahfl the battle), but put it to use in a few minutes. Took me long enough to get to that point!

Still, I based most of my DirectDraw driver code on examples I got from the web and from some friends-- for example, I used the SDL's directdraw driver as a guide to what functions I needed to call and what order I should call them in. This seems the best approach because code that has been used and tested in the real world tends to take into consideration a lot of things that tutorials and examples do not. There are Microsoft examples that come with the DXSDK, but I always found those to be quite lacking (sometimes it seems like they didn't bother to test their own examples at all).

- Air
- Hour 13 Studios (http://www.hour13.com)

alchemist
11-08-2002, 07:42 AM
Okay, I'm a bit confused - not an unusual experience.

Steve, I thought one of the reasons you said that creating 2D games with DX5 vs. DX8 would increase your sales is because the download for 5 was smaller than 8? Or is it just that many casual players don't have the hardware required to make use of DX8, or something else?

Dan, I'll look into Allegro too. I'm working with a guy who has implemented games using DX7 before, so the learning curve isn't so much of an issue -- I'm really mainly concerned about overall salability. But abstraction and portability are good things too.

I also read on another board that if you compile using DX8.1, you have to have that installed on the machine to run it, even if you use only DX5 routines. Anyone know firsthand if that's true?

I guess wha tthis comes down to in my situation is this: if you were working on a 2D, not-real-graphics-intensive PC shareware game and you wanted to maximize your potential audience, what SDK would you use? DX5, DX7, DX8-but-only-the-DX5-calls, SDL, Allegro, or something else?

Thanks again you guys.

LordKronos
11-08-2002, 08:05 AM
Originally posted by alchemist
Steve, I thought one of the reasons you said that creating 2D games with DX5 vs. DX8 would increase your sales is because the download for 5 was smaller than 8?
If Steve ever said that, I suspect he meant that if you use DX5 instead of 8, there is a much better chance the user will be able to play your game without having to download an additional 10MB DirectX install.

I also read on another board that if you compile using DX8.1, you have to have that installed on the machine to run it, even if you use only DX5 routines.
I recall hearing something like that too. I suspect the difference is that you probably have to do something like
#define DIRECT_DRAW_VER 0x0500
(although I cant remember the exact define name you use) and then link to the older libs rather than the newer ones.


If I had to make a 2D app, if I did it in DirectX I would just use DX5 with whatever SDK I had available. If I didn't have one available, I would just download the latest from Microsoft (except look into that 8.1 issue first). Of course, I might decided to go with Allegro or something else, but I've never used them and so I'd have to evaluate them personally first.

LordKronos
11-08-2002, 08:07 AM
Jake:
Very few 2D apps ever tax the processor enough to warrant 3D accelleration. Additionally, if you use 3D accelleration, then you are needlessly screwing yourself over with the users who don't have 3D hardware.

Jake Stine
11-08-2002, 08:13 AM
Originally posted by alchemist
Steve, I thought one of the reasons you said that creating 2D games with DX5 vs. DX8 would increase your sales is because the download for 5 was smaller than 8? Or is it just that many casual players don't have the hardware required to make use of DX8, or something else?
As far as I know, Microsoft doesn't bother to maintain download links for older versions of DirectX, so if your user needs to upgrade, it's pretty much DX8 or bust. The key is that most people already have DirectX 5 installed. DX5 came standard with most versions of Win98 and 2000, and DX7 comes with Win ME. Hence, the majority of Windows users simply don't need to download or install anything to play a DX5 game. And therefore, yes, for a lot of people who never upgraded their base Win98/2000 installs, a DX5 game is effectively a smaller download than a DX8 game.

I also read on another board that if you compile using DX8.1, you have to have that installed on the machine to run it, even if you use only DX5 routines. Anyone know firsthand if that's true?

Not true. It only matters what version of the API you use. You can control the version of the API on most portions of DirectX using a simple compiler #define. For example, to force the DirectInput and DirectDraw headers to give you access to 5.x or lower, use this at the top of your C file:

#define DIRECTINPUT_VERSION 0x0500
#define DIRECTDRAW_VERSION 0x0500

- Air

LordKronos
11-08-2002, 08:20 AM
OK, I found out what it was. It seems it only applies to 3D. Look here:
http://www.mvps.org/directx/faq.php#tpc4_3

alchemist
11-08-2002, 08:23 AM
Thanks very much guys.

This place is great.

Dexterity
11-08-2002, 08:28 AM
Originally posted by alchemist
Okay, I'm a bit confused - not an unusual experience.

Steve, I thought one of the reasons you said that creating 2D games with DX5 vs. DX8 would increase your sales is because the download for 5 was smaller than 8? Or is it just that many casual players don't have the hardware required to make use of DX8, or something else?


I don't believe the download size of DirectX matters much at all, and in any event, we have no way of measuring that kind of impact. We don't distribute DirectX with any of our games.

My main point about DX5 vs. DX8 was that at least in the near-term, I think it's best to stick with DX5 if that's all the functionality you need. I.e. if you're making a 2D puzzle game and you don't need any DX8 functionality, then requiring DX7 or DX8 will only limit your market. There are a couple reasons for this: 1) Lots of people still have DX6 or earlier, and 2) Even when people upgrade to DX8, if they have an older computer, they may not have drivers that are fully DX8 compatible.

As a real-life example, there are a number of players who cannot get our DX7 games to run on their systems, but they can run our DX5 games just fine. They've upgraded to DX8.1, their systems have all the hardware needed to run the games, and the DirectX diagnostic reports no problems except that their drivers are 2-5 years old and are uncertified. In many cases the manufacturers stopped providing driver updates for their video cards after DX6, considering those older cards to be obsolete. Those players that end up buying newer video cards with DX8 drivers are suddenly able to run our DX7 games just fine.

You'd be surprised at how many players have sub 1ghz PCs, 3-5 year old video and sound cards, and older versions of DirectX installed. For non-hardcore gamers, there often isn't much incentive to upgrade. If you have a 400mhz machine that does your word processing and still let's you play thousands of shareware games, that's all you need, right? :) If you download a DX7 demo and it doesn't run, you uninstall it and download something else. With try-before-you-buy, if the demo doesn't run, players don't have to worry, since they didn't pay anything for it. But a potential sale has been lost.