Breathing New Life Into Old DirectDraw Games
An anonymous reader writes "I bought a bunch of old Wing Commander games for Windows, but they use DirectDraw, which Microsoft has deprecated. They don't work too well under Windows 7, so I ended up reimplementing ddraw.dll using OpenGL to output the games' graphics. I wrote an article describing the process and all the fun workarounds I had to come up with, and released all related source code for others to hack on."
and we didn't need gimmicks like motion controllers, photo-realistic graphics and high framerates to enjoy them.
I've been waiting for this, though not expecting to see it. In my understanding, this'll allow future generations to play at least MechWarrior 2 and Battlezone, which have sadly been destroyed by DirectX patching.
Fastest slashdotting *ever*
I haven't read TFA yet
but wouldn't this have been a prime use-case for Wine on Windows?
use an older version of Windows in a virtual machine.
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
My own DirectDraw apps from 1996 work great in Windows 7. The API is deprecated in the sense that Microsoft no longer recommends using it, and who knows if they're still even shipping ddraw.h, for that matter. But as a COM component, runtime support for IDirectDraw isn't any more endangered than CreateWindow().
As its difficult to get through the Slashdotting (I can't reach the site), this would be "The Kilrathi Saga" versions of the games - almost as valuable as a WoW Vanilla Collector's Edition to WC fans - which were "upgraded" versions of the original DOS Watcom C games for Windows 95. I say "upgraded" because I was once speaking to one of the original programmers who were working on the Kilrathi Saga edition and said that they couldn't even convert WC1. He called the original source a "Goat-fuck-hack" demo which Roberts put together to get a job at Origin, so they instead tinkered with a DirectDraw-wrapped WC2 engine.
The original DOS versions of the games, alternatively, work fine through DosBox.
"The true measure of a person is how they act when they know they won't get caught." - DSRilk
In 1998, I bought a second-hand Wing Commander IV: The Price of Freedom for US$10. The gameplay and graphics quality were fantastic, and I was particularly impressed with the producers' investment in the game.
But there was one thing I couldn't get past: the warzone aspect. At the time, a dear friend of mine was in the Bosnia combat zone, and every time I tried to play WC4, I couldn't help but think about her and what she was experiencing. I wanted to enjoy WC4, honestly, but after about 5 minutes I just couldn't, knowing that my friend was in mortal danger for real. It got to the point that I ejected the CD, wrote off the $10 as a bad investment, and flung it across the room.
THINK about your BREATHING!
The server has 'asploded so I can't read the article (note to people: don't submit your shit to /. if your server isn't ready for it) but I'm questioning the summary. Windows 7 does have DirectDraw. ddraw.dll is present in the Windows directory.
As far as I know, compatibility is maintained for ALL versions of DirectX back to the beginning. Things stop being supported, but that just means they aren't included with the new APIs. So you can't use DirectDraw from DirectX 11 APIs, but if you have an old DirectX 6 game, it'll still work fine.
As a practical matter the original Fallout runs, and it wants DirectX 3 to do its thing.
I'm not claiming that the author didn't have to do something to make these games work, but I think he may be confused about the situation.
I also wonder on his methods. Why would you use OpenGL to reimplement DirectDraw on Windows 7? DDraw's replacement is Direct2D, which is a native Windows API. OpenGL works fine on Windows, but only in the event that the company who makes the graphics card chooses to write an ICD for it. Direct2D is automatic for anything with WDDM 1.1 drivers.
Man that is pretty bad! I say we put Origin out of business for making such a hurtful game!
Except the Bosnia war ended in 1995. so your friend could not be in combat zone.
(I know. I was there. I still am.)
Looks like this is some little personal site, perhaps run on a server in a broom closet (I run such a closet server at my house). I have no idea why the author thought it would be a good idea to submit that to Slashdot.
Were there ever anything I wanted to submit, I wouldn't stick on my closet server, I'd stick it on my Pair server and link to it there. Slashdot people are very, very clickly. Anyone who submits to here ought to know that.
You must be a real hoot at parties.
Seriously, thanks for the good work!
Tomorrow is another day...
The server's crashing, but coral cache managed to get the text:
http://sol.gfxile.net.nyud.net/ddhack/
I've been trying to get Command & Conquer and Red Alert 1 working on Windows XP and upwards for quite a while now.
Here's hoping this will work for these two DX6 games!
I sure do hope it runs Monolith's Blood! I tried it in VMWare recently and it ran like a hog - and not in VESA modes.
No, I am agnostic.
Yours,
God
Perhaps he meant it in a "had been" way instead of a "was" sort of way. War's impact on someone you know doesn't become less real with time; if anything, anyone who has been through the process of helping a friend through the re-tellings, the emotional fallout, and the post-traumatic stress of it all can relate to the fact that, for many, the apparent impact of the war seems to only grow with time.
In the Beginning
It all started about a month ago, when one friend of mine had decided to follow his dreams and was moving to the states, and he had to get rid of a lot of stuff. Among his discard pile was a bunch of Wing Commander games, which I bought off him, figuring they might be interesting research material, as I'm planning on a game with similar game play structure (as in story combined with game play, not a 3d space shooter).
So, I found myself in the possession of Wing Commanders 1, 2, 3 and 4, all Windows versions - the Kilrathi Saga and WC4CD to be specific. I installed the first and tried it out. My Win7 switched to 256 colors at a 640x480 resolution, but the game ran.. with completely wrong palette.
Bugged by this I played with the compatibility options, and got the game to almost work well, with the palette going wrong at some points.. so the game was sort of playable, but I hated the fact that Windows changed to 256 colors and I couldn't see my mailbox properly in the other screen, etc.
I also tried WC2 and WC3, and they had similar - or worse - problems. I even learned the steps to get WC3 to work properly:
1. Find the WC3W.EXE executable, turn on (basically) all the compatibility options.
2. Start task manager.
3. Find and kill all instances of explorer.exe. Your desktop will disappear, along with the task bar.
4. Using task manager, launch WC3W.EXE
Naturally the screen resolution and color mode will be 640x480 and 256 colors, but if you've bent backwards that much, you probably don't care all that much.
Seeing that the games use DirectDraw, I decided to roll my own.
Doing the Homework
The first step is always to look for prior art. Maybe someone had written a new ddraw.dll already, and I could just use it. As it happens, lots of people have, but nothing that's useful for me. Most of the ddraw.dll hacks are actually wrappers - that get between the game and the real ddraw.dll, change something subtle, but let the real ddraw.dll do the heavy lifting.
The point of these hacks is to fix small problems, like games that ignore surface pitch, require cleared surfaces or some such. In one case I found a forum thread claiming that deleting ddraw.dll from the game's directory fixes something, so in this case it's a hack gone wrong.
After further searching I found a project which actually released sources, with a liberal license even. It was a wrapper project (meaning, again, that they just call the real ddraw.dll), only supported DirectDraw7 and only very small parts of it, but it showed me how to get going.
I also dug up old DirectX SDK:s from my personal CD stack, as Microsoft has helpfully nuked all old DirectDraw documentation off the online MSDN. Thanks, dudes.
Wing Commander 1
Wing Commander 1 for Windows uses DirectDraw2. There's no real reason it couldn't just use DirectDraw1, considering that all it does is locking the front buffer and dumping a frame to it, along with some palette manipulation.
Or well, that's not the whole truth. If the game can set a 320x200 mode, it does what I described above. If this fails, it tries to set up 640x400, and after that fails, 640x480. In the two higher resolution modes, the game allocates a software 320x200 buffer, and uses blt() to scale it up 2x, meaning that in 640x480 mode, black bars are introduced to the top and the bottom, and the aspect ratio is wrong.
When playing WC1 it astonishes me just how much love has gone into the it when compared to later games. The later ones may be better in some ways, but the polish that can be experienced in WC1 is gone.
Anyway, I started by writing a wrapper that just dumps out log about what calls are made with what parameters, and then went on to implement a hack dll that only implements those calls.
The hack dll resizes the application's window to desktop resolution, sets up an OpenGL context, uploads
I try to enjoy parties, but every time I can't help but feel bad for all those poor Indians who died in 1812 during the Boston Tea Party.
Does this sig remind you of Agatha Christie?
While people can say that the old ddraw works fine in Win7, that's all nice and everything. But sometimes we want more then just the old school graphics and gameplay. In this case we can hack the ddraw layer to add extra features like a higher resolution, AA or HQ2x or something like that.
I tried to do this with Direct3D7 for TheTypingOfTheDead, to run it at higher resolutions, but I failed. Maybe if I use this code as base I have a better shot at it.
Minecraft is the most fun I've had in a computer game for years, and practically everyone I have shown it to has downloaded it and become obsessed - yet the graphics are kind of shit - but even then, it requires a reasonably modern computer to run quickly (drawing millions of cubes is quite time consuming, I guess - does anyone know how he draws everything so efficiently? Does MC only render blocks that are unoccluded? If so, how does it figure that out? I'm really intrigued by the tech behind MC). I wonder if the game would be more fun if it had better graphics? I kinda think it would.
Yes, God don't believe in a higher being!
Were damn fine games I'd love to play again.
After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
At the time,
Heads up for combat soldiers family and friends, get a grip. Stress is one thing, wigging out is another and helps no one.
Plenty of combat soldiers/Marines/airmen game in-theater! Deployments have loooooong, boring stretches and gaming is a popular distraction.
"This post is an artistic work of fiction and falsehood. Only a fool would take anything posted here as fact."
Why was I not consulted ? DEATH TO INFIDELS ! Except babies. No, babies too.
M.
Virtualization has gotten really good these days, for those that don't keep up with it. You can virtualize modern OSes at near native speed. Running servers in VMs is getting real common. At work we have a few servers that we keep as physical boxes, like our SQL server, but the majority of our servers are virtual. Not only can that save on hardware costs (we have like 30 virtual servers on 4 physical servers) but it provides some amazing flexibility.
Now when talking older OSes, it isn't as speedy. Not all of the modern tricks work as well, and there's often not client drivers to accelerate things... However there doesn't need to be. Consider that when Windows 95 was about a Pentium was as good as things got. Well when you are dealing with something that slow, you can incur a hell of a lot of overhead in your virtualization and still maintain good speed.
As another posted mentioned, DOSBox is a good example. So are various console emulators.
I AM a fan of old games, and have played around with this. For DOS games, DOSBox works great. For probably 99.9% of Windows games, they run natively on Windows 7 64-bit. The rest seem to run fine on Windows XP 32-bit which works real well in VMWare, Virtual Box, and even MS's own VM is you have professional or ultimate. I've not yet come across a game for which I'd need to get 95 or 98 and virtualize those. I have done it at work though, and 98 does function just fine.
As you said, doesn't have to be optimal.
He said "At the time", and since he bought it in 1998 - at the time means that his friend was in war in 1998 ... so your explanation is very improbable ...
It doesn't matter. Reason of my posting is to correct the prejudice about my country. In 1998 there were no combat zones in Bosnia and his friend could not be in danger in any way that could be presented in a game about war.
Having been clipped in the calf muscle by an RPG while serving with IFOR in Sarajevo in 2002, I can personally tell you that even though the war ended, it was most certainly still a combat zone for many years.
Keypunch Software, is that you? (Commodore)
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Maybe you should take a look at what Direct2D and DirectDraw does before making some silly assumption that Direct2D is more suitable for simulating DirectDraw behavior.
Direct2D effectively acts as a hardware acclerated scanline renderer, so it is more comparable to GDI than DirectDraw. DirectDraw surfaces are actually much closer in design to Direct3D and OpenGL textures. So your real question should be why he didn't chose Direct3D instead. My guess is that he liked OpenGL's API better and this is about fun after all - nobody was paying him.
Did you not know that it was a space combat game?
To have a right to do a thing is not at all the same as to be right in doing it
all the wing commander games where available from the snes to ps1. you could have played them on your favorite emulator and not had to do all the hacks to make them work on a windows 7 box.
The "Back in the day things were so much better," stuff gets annoying no matter what it is about and games are no exception. Were there good games back in the day? Sure were. Guess what? There were also bad ones, you just don't remember them as well. This is in part because our memory tends to deliberately filter out bad experience, but mainly because good games you played a ton, bad games got set aside.
Know what else? There are good games now. The modern graphics and so on have not stopped people form being able to make good games.
Also I don't like this elitist "purist" thing that people pretend to of "Oh I don't even like the graphics, I just want good gameplay." Guess what? The graphics and sound can well be a part of that. When games are visually appealing it can add to the immersivness. It is easier to lose yourself in a convincing world.
So stop getting all "Get off my lawn," about games. There are great old games and you can still enjoy them with the help of emulators. However don't hate on new games just because they look better. That is not a bad thing, it is a good thing.
Except the Boston Tea Party occurred in 1773...
Beyond that, people tend to not realize how unstressful life threatening incidents can be. If you're properly trained and not under the illusion that you live forever, it's not universally stressful as people seem to assume. I've personally had more than my fair share of near death scrapes just as a civilian. What is stressful though is when you go through long periods of boredom knowing that at any moment something might happen. The incidents themselves according to pretty much everybody I've ever talked to seem to mirror my experience in that they're not where the stress comes from. But, it really depends on the person and YMMV.
I've seen similar problems with Starcraft ('wrong screen color settings' regardless of which is tried) and notice that Starcraft is listed on the site "with sluggishness".
This is interesting, because I found a work-around purely by happenstance in Windows 7, at least for SC. Leave your video settings as they are and just open the Display Properties dialog. THen start the game: it'll play flawlessly.
You have to wonder if, indeed, the incompatibility is intentional. I can see no other reason why SC would work 100% fine with the Display Properties window open, but not in every other scenario, compatibility modes and pre-set resolutions included. The functionality to play the game is evidently still there, so why doesn't it work?
~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
... yet for some, it still continues today. You never get over seeing that much tea, man.
I know, I was there and it haunts me every day.
All text, but sort of an action-puzzle-mayhem game for DOS. Great fun.
You are in with the old crowd here. S.T.A.L.K.E.R. is a few years old, except for Pripyat, and even then the graphics are the most dated part of the game.
And, yes, gameplay is what really matters. I still break out M.U.L.E. occasionally, and, guess who joins? My hardcore gaming kids, aged 8, 12, and 14.
Read that again: Game play IS the top priority in a game's longevity.
M.U.L.E.
Age of Empires
Age of Mythology
DOOM/DOOM2
Freelancer
Serious Sam
Oblivion
Rainbow Six 3: Raven Shield
Counter Strike (Half-Life1 AND 2 versions)
Quake, Quake2 CTF
These are just a few that drive home the "game play matters" idea. Notice how almost all of those are over 5 years old? My guess is that it is that we are in the era of "Milk the online play", and past the "Make it worthy of replay" era.
But does the 80% go to the rear shields, or the front?
I've yet to see a VM implementation that properly supported hardware-accelerated graphics. While there has been some good work done on sharing disk, memory, and network resources in a VM, the general assumption is that a VM doesn't need accelerated graphics or sound. The result is that performance of such applications is absolutely abysmal.
I do not fail; I succeed at finding out what does not work.
This sounds different from what was done for Thief 1 & 2. I recall their problems being related to newer graphics hardware architecture, specifically shaders I believe. If you tried to play the games, everything would be a greenish tint, and the shadows (which is a major gameplay element) were pitch black and unusable. I recall someone modding the game to run all the graphics through the CPU rather than GPU to avoid this issue.
Would someone care to explain the difference between what I just described and what they did for WC?
LHX : Attack Chopper. Lost many many hours to that one in the early 90's
This might be useful for Starcraft. On Windows 7, the palette used for 256-color mode is all messed up. Strangely, it does work on Vista.
What about Postal? I still love that game.
That brings me to an interesting point, / . is just "the ramblings of socially-inept, technology-literate news-mongers".
What I don't understand is: why did he implement the wrapper on top of OpenGL?
I'm not trying to start another DirectX/3D versus OpenGL war, but I think it would have been so much easier to implement the missing pieces using the latest DirectX.
Also, OpenGL support on Win7 is not so great.
-- You know, I've been thinking about that THX movie you spoke about the other day...
-- Yep, what's it?
-- Maybe we can lobby to make it illegal the entire thinking thing...
-- I don't think we have enough jail space for all those GPL maniacs.
-- Who said I want to keep them imprisoned?
-- Hmm, that could have some negative PR effects...
-- Well, you can't make an omelet...
-- True.
Well of course all those games are over 5 years old. You only picked games that were over 5 years old. What were your criteria here? Games you liked? While I'll agree that all of the games there that I've played were really good, I don't play any of them any more (or know anyone who does) so its not a longevity thing...
Please elaborate and tell me, for example, why Quake2 CTF is *better* than Team Fortress 2, or why Age of Empire is *better* than Starcraft 2. I'm not saying the old games still can't be fun to play, I want to know in what way games have suffered from the progress of technology.
I can't speak for AoE, but I can speak for StarCraft vs StarCraft 2. SC2 does have some welcome improvements, such as an enhanced ability to command your units (no 12 units only limit) and better pathfinding/targetting/etc. AI, but with those upgrades comes the flaws. Balance is one of them; the game hasn't had the many years of refinement that SC1 has had. There are a few balance issues to be ironed out (mostly around Terran and Zerg, IIRC). Also, the storyline for StarCraft and SC:BW was far, far better than for SC2. The voice acting was better, too, from what I remember, especially for the Protoss.
SSC
What isn't balanced? I've played many matches and I haven't found any balance problems. Personally, I was extremely impressed with how balanced the game was at release.
Agreed on the voice acting and storyline.
I thought tons of backwards compatibility was the main point of using Windows!
Where was Microsoft on this?
I haven't noticed anything major as far as balance issues in TvZ; most of the reported balance issues are only noticeable if you play at a very high level.
Apparently wizard is not a legitimate career path, so I chose programmer instead.
For games at such low resolutions, it's probably better to use something like hq2x http://wikipedia.org/wiki/Hq2x than OpenGL's bilinear filtering.
Quake2 CTF doesn't completely gimp you if you're new or don't devote thousands of man hours to murdering red or blue wearing people.
That being said though, Team Fortress 2's unlock system isn't the result of being new it's the result of poor design. The unlock system was the fucking worst thing ever for newbies. TF2's strength over Q2CTF is that TF2 isn't just CTF, it's territory control and other variants(I'm not even sure what the hell i'd call Payload Race).
Non impediti ratione cogitationus.
It's true it's nothing major, but it's still a tiny bit off.
SSC
That is because a standardization is not done in the online field. Should compel them to make products that can be used on any platform.auto second hand
I'll have to try the DD hack - I haven't played WC1 and WC2 in a heck of a long time. I loved the whole series. For especially WC Prophecy, I play in all its Glide API glory via zeckensack's Glide wrapper http://www.zeckensack.de/glide/index.html and a bunch of patches and high resolution fixes from http://www.wcnews.com/index.shtml using WinXP. I switched to the glide wrapper when my antique Voodoo 12MB 3D pass through card bit the dust. At the time I used a AMD Athlon slot A 800Mhz and Geforce256 DDR and the glide wrapper was a life saver for my Glide games.