DOS Games Message Board
DOS Games Discussion
A message board to talk about DOS games, get help, and find old games.
Do NOT post warez or abandonware requests please
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


So you want to program DOS games? Steps inside...

 
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation
Author Message
redshock
Newbie
Newbie


Offline
Joined: 22 Aug 2007
Posts: 5

PostPosted: Wed Aug 22, 2007 8:31 pm     Post subject: So you want to program DOS games? Steps inside... Reply with quote

I read several threads here and usually there's good advice but there's no step by step process for a complete beginner. For some background, I do lot of Windows game development and am going after a computer science degree. I started missing the old DOS games and I figured I want to try out DOS programming once and for all. It kills a quick career in game programming, but I find DOS more enjoyable to program in. Besides, DOS needs more new games Happy These are the steps to get you into programming your own DOS games.

0) Downloads: Assuming you have XP or beyond, you need DosBox 0.71+ (http://dosbox.sourceforge.net/news.php?show_news=1). Also, you need Turbo C (http://dn.codegear.com/article/20841). You will be writing your code within Turbo C, which is running inside of DosBox. If you installed Turbo C to the C: drive, in DosBox, type "mount c c:\turboc\disk1", hit enter, then "tc.exe". Of course, there's nothing like a real DOS machine to program with Happy Usually you can get a value machine with VGA support for around $20-$50 depending where you go.

1) Study the Standard C programming language while using Turbo C. A good book would be C: The Complete Reference by Herb Schildt. If money is an issue there are several websites available that give tutorials. Stay away from C++ since it's a lot of overhead in DOS. If you're using a DOS emulator, you might get by with it.

2) Learn a bit on data structures. I know, it's an unfun topic but it will help in the long run. Most importantly, look into stacks, queues and linked lists.
This will better help you program with efficiency and apply better performance. Liberally speaking, you can ignore this step but I recommend it. (Update) I forgot, the book above teaches exactly this in the second half.

3) Buy the book Tricks of the Game Programming Gurus by Andre' LaMothe. Link: http://www.amazon.com/Tricks-Game-Programming-Gurus-Andre-Lamothe/dp/0672305070 This is the book that set the standard for DOS game programming, so you can't go wrong with it. I just bought it for $12, so it's affordable to those inspired to make DOS games. It mostly goes over 2D and also walks you through your own raycasting(wolf3d)-type game along with networking, input, and sound. (Update) Be sure to check if the CD is included with your purchase!

And you are off to making your own DOS games.

Further thoughts:

Distributing your games:
1) You can have games from DOS and Windows to play your game. XP and below can run them without DosBox, but there's always something that might not work right without DosBox. If you tested each system and found a problem, you can tell your gamers to use DosBox. Vista removed the 16-bit subsystem that XP had, so you can no longer run native DOS games under Vista alone. However, DosBox works fine since it's a 32-bit application.

Exploring Windows:
If you feel like taking the next step and make your games Windows applications (32-bit), you can get Andre' Lamothe's other book titles known as Tricks of the Windows Game Programming Gurus (and) Tricks of the 3D Game Programming Gurus. Microsoft has a free Express edition of Visual C++ 2005/2008 that can be downloaded from their site. He really tries to keep the feel like DOS and keeps it all linear-memory for 2D/3D, which is what you were use to with the first book. It goes over various APIs plus game topics including Win32 API, COM, and DirectX.

If I think of any extra tidbits I'll include them with an update mark.

Good luck!
redshock
Back to top
dosraider
Admin
Admin


Offline
Joined: 15 Mar 2005
Posts: 9259
Location: ROTFLMAO in Belgium.

PostPosted: Thu Aug 23, 2007 5:20 am     Post subject: Re: So you want to program DOS games? Steps inside... Reply with quote

redshock wrote:
..... If you installed Turbo C to the C: drive, in DosBox, type "mount c c:\turboc\disk1", hit enter, then "tc.exe". ...

"mount c c:\turboc\disk1", hit enter, then "tc.exe".
Nope.
You need to install TC first and you need the files that are on the 3 disks.
Mounting your way gets the install to stuck completely.
And use dosbox to install TC, you don't need to write floppies that way.
More: many modern PCs don't have a flopdrive (yay for modern times :/ ) and the install only works from the A: , so dosbox is really the best option.


This is a better way to do things to install TC:
In windows first:
Create a c:\games\temp folder
Down the file , extract all files/subs from all the disks (3 of them) to c:\games\temp\

Run dosbox, input:
mount c c\games
mount a c:\games\temp
a:
install


Accept all, TC will be installed in c:\games\TC\ , (That's C:\TC\ in dosbox ! )
The install will find all the needed files/subs, no problems. And as you run the install from HardDisk it's fast.
You're still in dosbox here, prompt a:

To run TC:
c:
cd TC
TC

Next time you wanna run TC:

mount c c:\games
c:
cd tc
tc


Advantage is that you can store your games on your virtual dosbox C:\ (C:\games\ in windows).
You also can use the same one for your other games.
And you have the C:\games\ mounted as C, so you don't need to completely clutter up the TC folder to store your writings/testings/whatevers.

That C:\games\ is an example, can be a D:\games or other if you have more partitions.
But use a subfolder. Much better.

BTW: nice post you wrote.
And welcome to dosgames board.
Back to top
redshock
Newbie
Newbie


Offline
Joined: 22 Aug 2007
Posts: 5

PostPosted: Thu Aug 23, 2007 6:24 am     Post subject: Reply with quote

Thanks for clearing that up! glad to be aboard...
Back to top
Dogbreath
Admin
Admin


Offline
Joined: 14 Sep 2002
Posts: 4627
Location: In the back of a jacked-up Ford.

PostPosted: Thu Aug 23, 2007 9:50 am     Post subject: Reply with quote

Nice post.

And congrats on being the 2000th member!
Back to top
The_Sinister_Mastermind
Overlord


Offline
Joined: 26 Oct 2005
Posts: 2745
Location: NSW, Australia, Down Under Verse

PostPosted: Thu Aug 23, 2007 11:50 am     Post subject: Reply with quote

Indeed a nice post there redshock and it was nice chatting to you in the IRC channel earlier yesterday. Iím curious to see some of your own work, from our conversation I gathered you have aspirations of making some games yourself, be sure to keep us posted if you get anywhere, or indeed if you need some help/advice/etc from our members.
Back to top
carbontwelve
Member
Member


Offline
Joined: 07 Oct 2008
Posts: 32
Location: England - Coventry

PostPosted: Thu Jun 11, 2009 8:08 pm     Post subject: Reply with quote

After reading this thread I thought I would write a how to with screenshots as one isn't really available on the net. Then I decided to go one further and create a osx app package which would run turbo C (within dosbox) under osx, something I do with all my dos games (means 100 or so copies of dosbox, but the games all have pretty icons in osx)

You can see my tutorial here with download link at the bottom for the osx app: http://photogabble.co.uk/projects/dos-days/turbo-c-dos/

Or the osx app can be downloaded directly from http://photogabble.co.uk/wp-content/plugins/download-monitor/download.php?id=10

I hope this helps other people...
Back to top
aliannahfth
Newbie
Newbie


Offline
Joined: 11 Jul 2009
Posts: 1

PostPosted: Sat Jul 11, 2009 1:14 am     Post subject: So you want to program DOS games? Steps inside... Reply with quote

Thank You.Its Reslly nice to provide.Ill Try this.
Back to top
Vangar
Lord of Gaming
Lord of Gaming


Offline
Joined: 03 Apr 2006
Posts: 231
Location: NSW, Australia

PostPosted: Sun Apr 11, 2010 5:02 pm     Post subject: Reply with quote

And if you want to mess around, there's always qbasic for beginners.
Back to top
nitrofurano
v20120621191040
v20120621191040


Offline
Joined: 27 May 2012
Posts: 8

PostPosted: Sat Jun 09, 2012 11:13 am     Post subject: Reply with quote

Vangar wrote:
And if you want to mess around, there's always qbasic for beginners.


qbasic? i started to do something on FreeBasic instead, like this:
http://www.freebasic.net/forum/viewtopic.php?f=2&t=19967

btw, FreeBasic seems to be an awesome tool for newbies (like me) trying to code some stuff on DOS - the problem is FreeBasic is limited to not less than 386 - so, if people want to code on 286 or 8088 from FreeBasic, they must be able to edit the .asm file it generates temporarily when compiled

btw, for the "screen1" (320x200 4 colours), i coded this FreeBasic snippet, providing some pattern text, sprite simulation, and 52 palette combinations: http://pastebin.com/4bdwf2qJ
Back to top
ETTiNGRiNDER
Member
Member


Offline
Joined: 19 Apr 2014
Posts: 12

PostPosted: Sat May 31, 2014 1:00 pm     Post subject: Reply with quote

Is there a special advantage Turbo C has over, say, OpenWatcom?
Back to top
Quadko
Darklander
Darklander


Offline
Joined: 24 Jun 2011
Posts: 1978

PostPosted: Fri Jul 18, 2014 5:13 pm     Post subject: Reply with quote

Usually the advantages are either library support or platform (dos, windows, etc.) support.

If you are writing for Dos specifically, maybe there are advantages to using dos era compilers. Other than things like Borland (Turbo C)'s BGI graphics library, or Watcom's early windows tools, or Microsoft's MFC for windows, it's not likely you'll care for fooling around with basic dos games.

And if you are developing for modern windows, you almost certainly want modern tools, especially as a beginner. Lots of cool stuff in new tools that didn't exist back then... but you can't compile code to dos in them anymore (mostly...). Happy

Not sure if that answers the question. I know it was a while ago you asked. Happy
Back to top
tienkhoanguyen
PSEUDOCODER


Offline
Joined: 05 Sep 2014
Posts: 2683
Location: Texas

PostPosted: Sat Sep 06, 2014 5:50 am     Post subject: Reply with quote

Borland Turbo C 2.01 is a very good and easy language for gaming. I created my own Tic-Tac-Toe on it. However, I do have years of programming and IT experiences. At least 2 years of community college programming and many years of independent hacking if you will. These years of messing around might seem like a waste of time however I find it useful especially in making all the pieces come together. I would just say take it easy and take your time. Some of these renderings are amazing that I do not even know how to do. For instance, I love the Quake One for DOS. The rendering is amazing. It is in the same game gendre as Duke Nukem except I have the official version for Quake One. Anyways, sometimes I lose it and just toss the disc in the trash. haha Anyways, what I was telling you is that Borland Turbo C 2.01 is also free and the graphics library is modest. It might not be the latest true color in your face realism; However for games and fun it is enough.
Back to top
ETTiNGRiNDER
Member
Member


Offline
Joined: 19 Apr 2014
Posts: 12

PostPosted: Sat Sep 13, 2014 1:11 pm     Post subject: Reply with quote

I guess the question was a bit vague.

OpenWatcom can still compile to DOS formats if you give it the right setting. It's a continuation of the old Watcom that was used for some DOS programs (in general looking at the docs with some source releases, it seems like id Software preferred Borland while 3D Realms used Watcom).

OpenWatcom is free and open source, and you can download as you will while Borland is apparently only free of monetary charge but with some obnoxious strings attached (they want mailing address and telephone # just for me to download? I don't think so, bro.)

So my question is more, what (if anything) can Borland give me that Watcom can't? As far as I can tell the answer might be that Borland has some extra DOS graphics libraries of some sort, but I haven't been able to find a good feature comparison on that front, nor how hard it would be to make Borland code compile in Watcom (or vice versa). I'm not sure how much old C compilers were like the old BASIC dialects where every system had a different and incompatible one.

DJGPP is also a thing, but I haven't looked into it as much. Seems it can only compile protected mode programs, which may or may not be a bother depending on what you're making I guess.
Back to top
tienkhoanguyen
PSEUDOCODER


Offline
Joined: 05 Sep 2014
Posts: 2683
Location: Texas

PostPosted: Sat Sep 13, 2014 11:42 pm     Post subject: Reply with quote

As a nobody who has experiences of maybe 8 or more programming languages in my lifetime, I would have to say it depends on you! Many people seem to prefer C++, or even Objective-C over Borland Turbo C 2.01. Others prefer Tiny C Compiler (TCC). Then there is GCC which is built by TCC. So there are so many options. I have tried Watcom and it was a pain in the buttocks. It boils down to what each individual seems to like. Maybe I like Vietnamese Spring Rolls while another person might enjoy a nice Hamburger with Fries. So don't be shy hehe Just dig in and have fun with what you like. As for Borland asking for person information, I do know they do advertise frequently their 64-bit Borland packages. However it is a small price to pay for a package that was originally $450 back in 1987, 1988. Also, as a registered user, you can put your own copyright sign, however, I like the annoying priviledge of boasting about the standard Borland preference haha.

Well, developing a demo is fine and it is good practice. However, getting everything copyrighted and getting all the legal works done is a pain in the butts. So I know having to get approval is often times harder than it seems. This is especially true of known companies.
Back to top
SeanRamey
Newbie
Newbie


Offline
Joined: 24 Aug 2017
Posts: 1

PostPosted: Thu Aug 24, 2017 5:50 pm     Post subject: Reply with quote

I have put together a pack with many good books for DOS development, plus my own Code::Blocks dev environment setup for DOS programming.

The upside of mine is that you can use Code::Blocks IDE which runs on modern Windows and Linux, and I've integrated Dosbox a bit so that you can be more productive.

The downside of mine is that I haven't figured out a way to integrate a debugger yet, and I also don't have a profiler integrated. These shouldn't be too hard to add if you can find a debugger that works with Digital Mars C (that's the compiler I use in this setup) and you might be able to integrate Turbo Profiler pretty easily, but I haven't tried. But, here are the files if anybody wants them.

Instructions are in the Readme.txt.

DOS Programming Pack.7z
Back to top
Display posts from previous:   
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation All times are GMT - 5 Hours
Page 1 of 1

 
Free Windows games


Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)