How were graphical DOS Games written?

You are probably mixing up the notion of a console/terminal, that is, a text-only window fed by text streams with a few escape commands, with the DOS computer itself. The console is not DOS, and DOS is not the console.

A console takes care of displaying the text its client applications send to it via the input and output streams, of scrolling the old text up and statically displaying it. A console is a layer above the graphics hardware, and a service of the operating system, and you don't need it to display graphics. In DOS times, the program would directly write into the graphics buffer, circumventing the text-only display you see.

On the other hand, consoles exist today (such as xterm or the windows command prompt), and they have nothing to do with DOS.


How did they generate graphics?

Games from that era usually wrote directly to the graphics hardware. They mapped to a special place in memory, and directly manipulated pixels as if they were an array.

Were there any libraries to use?

Sound and network driver libraries were common. Which ones, I don't know - these days you wouldn't have to provide drivers along with your game due to the Hardware Abstraction Layer provided by the OS itself.

Besides this, there were the C/C++ language standard libraries. Game middle-ware libraries didn't become as common until after that era.

Examples of middle-ware are:

  • Physics libraries such as Havok
  • Image format loader libraries such as DevIL
  • Sound format loader libraries such as FMOD
  • Video handler libraries such as Bink

The DOS days were, however, the popular birth of the Game Engine. Examples from that day include:

  • Scumm
  • Build
  • Doom
  • Quake

What languages they used?

C and assembly were extremely common.

More rarely Pascal, or more other more obscure languages.


If you want to develop low-level software like was done in the DOS days, programming for an old game system might be a good idea. NES, C64, Gameboy and Gameboy Advance programming all require the author to utilize direct hardware access, and require you to know C or some form of assembly. You can use an emulator to run and debug your finished product, so it isn't as high a barrier to entry as current-gen consoles.

If you just want to develop a DOS-style game, these days you have a lot of graphics and sound libraries available to you. Instead of doing things exactly like they did, I recommend using one of those libraries. Allegro, SDL, PyGame, OpenAL, and OpenGL to name a few.

You will still be able to do low level graphics programming, but you will get your game running much faster, will have better tech support when things break, and your game will be cross-platform.


Assembler, Pascal and C were popular languages. Graphics were generated by directly interfacing with the display hardware, for instance the Color Graphics Adapter. (CGA)

Probably there were libraries, but not like today, and libraries were often not shared outside a company.

A resource which would have been relevant in say, 1988, can be found here:

https://web.archive.org/web/20170910230837/http://gd.tuwien.ac.at/languages/c/programming-bbrown/advcw1.htm

Tags:

Graphics

Dos