I am a C programmer learning Win32 API. I'd like to know how I could start learning to program games. Maybe not in DirectX, but how would I do it in DOS?
Any links to DOS game programming would be great. Thanks.
--Garfield the Great
Printable View
I am a C programmer learning Win32 API. I'd like to know how I could start learning to program games. Maybe not in DirectX, but how would I do it in DOS?
Any links to DOS game programming would be great. Thanks.
--Garfield the Great
Gamedev.net has some excellent articles on game programming theory.
DOS is dead. Sorry.
You may as well just start right in with the win32 api. I've been learning DirectX recently and it's really not that hard. And the win32 stuff you need to get started is very minimal.
Start with simple things first though. Display a .bmp then make it move, bounce off of things etc.
I could post some boiler plate code if you'd like. I've been doing this for a school project so the code is pretty clean and readable.
Actually, I think starting with DOS-games is a good idea, since it is easier to understand and get an idea of the concept, and later move on to Direct X.
One question: why the hell would DOS be considered dead? just because M$ is deciding to phase it out of its operating systems by slow degrees does NOT mean that it isn't still useful - not only for beginners, but for people who might not be content with working with overblown APIs! i'm not attempting to put down DirectX and MFC, but i think that people who have an urge to find out how systems actually work should be applauded, instead of saying that they are 'fighting for a lost cause' in essence.
i suppose that means you haven't tried ASM programming (or you have 'moved on' from DOS). well, even though no-one's expected to, it's a good idea to understand just how these APIs work before you get complacent using them.
Peter Kimberley
[email protected]
You see, I'm learning Win32 API right now. Not for games, just for software development. It is not like I want to make games my main programming practice, I just want to full around and use my imagination for some DOS based games. I personally think those are the best.
So, does anybody (besides gamedev.net) have any links to learn DOS game programming? Thanks.
--Garfield the Programmer
To get the feel of programming a game take a look at some of the popular BBS games. There are some simple types (Legend of the Red Dragon) and some complex ones (TradeWars 2002). That should give you a good base.
Garfield my friend get the book "Tricks of the window's game programming guru's." by Andre Lamothe. Its the best. It deals a bit with the win32 API and covers directX 7. I found it went great with sunlights tut's. Just goto the book store and read a couple paragraphs from the first chapter. It goes from a C or C++ developer perspective to a window's programming perspective. It eases you into the window's environment and I think it will cover alittle about MFC later in the book. It's GOOD!!!:D
Well, if you would like something crossplatform that allows for video, input, and sound, might I recommend Allegro? It is giftware (don't even have to give credit for using it in commercial products) and is quite powerful. Compile in DOS, Windows, Linux, BeOS, and soon Mac without changing a single line of code. Works great with several compilers - though I recommend Dev-C++ because it too is free. See my sig.
Where?Quote:
To get the feel of programming a game take a look at some of the popular BBS games. There are some simple types (Legend of the Red Dragon) and some complex ones (TradeWars 2002). That should give you a good base.
--Garfield the Programmer
Sounds good. Where can I get it? Is it just a library? Any sites so I can learn it too? Thanks, Justin.Quote:
might I recommend Allegro?
--Garfield the Programmer
Allegro is a wrapper library. It uses the most efficient lib on the given platform (on Windows it can use either DirectX or OpenGL) with a very easy to use API. It'll take you five minutes to figure out how to do nice, double buffered animation after you read the docs. www.allegro.cc has a good Allegro game programming forum if you have questions. Allegro's home page is at: http://www.talula.demon.co.uk/allegro/wip.on.html
Dev-C++ is at www.bloodshed.com (bad name but great IDE). You can use my graphical installer for Allegro with Dev-C++ from www.envy.nu/springsoft/main.html
The WIP (work in progress) for Allegro is complete for Windows. They are porting the whole thing to other OS's and compilers however, so until an estimate of December this year, they aren't going to call it the final version. The WIP is what you want though.
(If you prefer MSVC to Dev-C++, Allegro works perfectly well with that too.) People use to pay $2000 + for cross platform libs like this.... It is very clean as well, which I can't usually say about these sort of things.
Hope that helps.
-Justin
I can get you a copy of tradewars..but I haven't been able to find a copy of LORD. Just do a search for bbs and tradewars or LORD and you'll find a few telnet BBS. Just search through their files (in the legal manner) and you should find it.
They aren't anything fancy but it can give you ideas. These two games were (and are) very popular.
I'm very sorry if I insulted you Peter (or anyone else).
Microsoft's own Inside DirectX, "DOS Is Dead" (pg 3).
I was speaking in practical terms. I don't think anyone in their right might mind would suggest programming a game for Windows 3.1. So I don't understand why so many people want to program for DOS.
I'm not against console programming. Console programming is still very much alive. I think that's the best place to start programming. (But console programming doesn't mean DOS)
I did DOS programming when I was younger only because I thought win32 was too difficult.
I don't think programming in DOS first helps you understand the win32 API any better.
I am fluent in ASM and I happen to love low-level programming and computer architecture. I am also interested in operating systems. But I still think learning win32 is better than learning DOS.
Perhaps it would be wise to look into SDL.
www.libsdl.org
Drunken Hyena has some NeHe like tutorials for DirectX.
www.drunkenhyena.com
i didn't mean to act as if i were insulted - i suppose i assumued you to have been speaking out of speculation, not experience. forgive me...i can see why you are drawn to Win32 dev. and in many ways i agree with you in the sense that at this time, it's the only viable (although some may differ in opinion) platform on which to developer apps / games.
it's good to note that you too see the importance of understanding computing architecture - i can't help but laugh when i read that 'DOS is dead' in Microsoft's article...some corporate agenda fuelling that perhaps ;)
So, Justin, all I have to do is download this library (I'm running on MSVC++), put the library into my "include" folder (so I can access it), and then learn the API and I'm set?
Thanks.
--Garfield the Programmer
No, the lib is not compiled. It comes with the makefiles to compile it though. (I think for MSVC there is a batch file that does everything, even install it for ya.) For Dev-C++ there is my compiled version, but I haven't used MSVC for a while, so I don't have a graphical installer for it.
All the instructions are in the Allegro download. Readme.mvc, I believe.
The download also comes with all the documentation, a lot of examples, and some really extremely useful tools you never knew you needed. :)
Um...I don't think I'm understand this. So, it is not a compiled library? I won't have to do:
#include <Allegro library>
What exactly do you mean by makefile? I'm not too sure about compilers, so do you know how (step-by-step, please) I would do this?
I would download it off the site to what?
Thanks.
--Garfield the Programmer
I see what you are asking now.
Most libraries consist of two parts: header files (.h) that define stuff, and compiled source code functions/methods that are in a binary form. The .h files point to these compiled libraries. Usually, .h files are in your include directory and compiled files are located in your lib directory. Allegro gives you the .h files and the source that is not compiled yet for the lib directory. A makefile is a script that tells the compiler how to compile and where to put these files. You may not need to use them directly with MSVC, I think there is just a batch file you double click.. but just to be sure, you had better read the README.VC text file located in the Allegro directory after you unzip the download.
If you have any questions after reading that, I will try to help (or www.allegro.cc forums can help). I haven't installed for MSVC for a long, long time, so I'm a bit rusty. :) We'll get you going though.
(The installation is the only down side to Allegro. That is why I plan on making graphical installers for several platforms and compilers.. right now I only have it for Dev-C++ though.)
-Justin
hmm Garfield, haven't you said you were going to be on the dev team of liero2.
I thought we would do this in directx? so why learn allegro?
BTW is this thing still on, haven't heard of it much?
So to better answer your question:
1. Download this file: http://www.allegro.cc/files/all3939.zip
2. Unzip it in any temp directory. It has a lot of goodies.
3. In the temp directory there should now be an Allegro directory. Enter it and double click on the file named "readme.vc". Tell it to open with any word processor (notepad, wordpad, word, whatever). This file should guide you the rest of the way. :)
Justin, I think I might understand what you are saying. But, when I go to allegro.cc, where do I go to get the batch file for MSVC? I went into the "Files" section, and there were a load of files to download. Which do I unzip?
So, then how do I implement the functions from the allegro library? How do I use them to program DOS games?
Thanks and sorry for the confusion (I haven't had any previous game programming practice).
--Garfield the Programmer
Nevermind about the download, I see your link. You must haved replied when I was.
Thanks! I'll take a look at the file and unzip. If I have any questions, Justin will be the first to know! Thanks so much for your time.
And to answer maes, I'm more interested in making DOS games. Hard to explain. I don't think that killer graphics make a good game.
--Garfield the Aspiring Allegro Programmer
Easy option two (maybe try this to get your feet wet and see if you like it).
1. Install this IDE named Dev-C++. You can use it with nothing lost and it compiles a little better (it is a port of Linux gcc). Dev-C++
2. Install Dev-C++, not difficult, just follow the next buttons.
3. Download my installer from www.envy.nu/main.html At least the first two.
4. Unzip those files in a temp directory and join them by double clicking join.bat. An executable installation prog will now appear. Double click it and follow its next buttons.
5. Allegro is now installed with Dev-C++. Start up Dev-C++ and go FILE; NEW PROJECT. Select the Allegro Template tab. Select Static Link (no dll required). Now you have an Allegro template up that is a typical "hello world" program. Compile with the lightening bolt symbol (toolbar). Run the program and you've made your first Allegro application. :D
No problem Garfield, just glad to help. :) BTW, using Allegro, your game can be compiled for DOS, Windows, Linux, BeOS, or soon Mac, without changing any code, so no worries there.
Feel free to email me any time too: pikeknightataol.com (at = @)
I'm curently following the instruction in the readme.vc
but I have some problems.
this is what I did:
-double clicked vcvars32.bat (couldn't read what was in the command window; closed to soon)
- in the command prompt:
-cd allegro
-fix.bat msvc (something came up: "utod is not recognized as an internal or external command, operable program or batchfile")
got this error message twice. then it said done
-make win2k doesn't know this command. normally he would now be compiling. but this is where it goes wrong
Is this a problem becaus I didn't install djgpp(is this necassery?)
and what is "GNU make (mak*b.zip)" it is listed as required software. (maybe this is the problem???)
As to your first question, do your really need djgpp. You only need it to install Allegro (as I mentioned, the installation is the bad part).
Actually, you only need it if you are using djgpp or MSVC. The reason being, Microsoft's make.exe is.. not up to par with gcc ports (or GNU make that comes with DJGPP). I don't mean to
sound like I'm bashing it, but it can't handle the kind of complex scripting Allegro uses to set itself up. After the setup, you can remove MSVC and all will compile just fine.
To keep the console Window up and to keep the environment settings from disappearing after you set them, go Start - Run - cmd
This will give you a stable DOS prompt. Here you enter things like C:\PATH=C:\MSVC\BIN; and all those other environment settings. (I know, this is a lot of initial work. That's why I plan on eventually creating a graphical installer... *time..time*) Follow the rest of the instructions from this DOS box and you won't lose any error messages. If you encounter some more problems, you can also post them on the Installation forum at www.allegro.cc. About a undred knowledeable people will see it and help you. I'll be better at helping you to play with Allegro (if any is needed) as I haven't played with my MSVC for months... Hope that helps! Have fun with it!
-Justin
That was me, it didn't log me it right. That message didn't make as much sense as I meant it to because it is pretty much a copy and paste from the reply to your e-mail (but in case anyone else was following this...) :) Hope that gets you on the right path though.