Hi,
I'm interested in developing a 2d platform game under Dos operating system with vector graphics not bitmap (pixel).
There were several games back in the days with such graphics like "Another World", "Prince of Persia" and etc.
I'm programming with C language under Windows 3.11 with Visual Studio 1.5 .
I don't know what are the C libraries or framework to implement such graphics and animation.
Any light on this topic would be appreciated.
Thanks in advance.
Vector graphics programming under Dos
Why in all that is holy would you want to create DOS software in ... *checks calendar*... 21st century?
/edit: you can definitely make dos-look-alike games using modern technology
/edit: you can definitely make dos-look-alike games using modern technology
Why in all that is holy would you want to create DOS software in ... *checks calendar*... 21st century?
Well, i'm interested in gaining knowledge on some technical concepts in game programming but from the beginning.
Besides, there's the DosBox emulator so why not develope for Dos.
I believe that a good game is not only a fancy fancy graphics but rather a good idea and there are still
hobbiests for such games. call me an old schooler but this is me. like i said i'm after knowledge.
You can make the graphics as "fancy" as you want.
Anyhoo, what do you mean by "vector graphics"? What makes you think Prince of Persia has "vector graphics"? Because it is NOT vector graphics....
Asteroids IS vector graphics. Maybe you could clarify what you mean by "vector graphics".
Programming graphics for Windows or for emulator is lots of fun, especially if it either screws your desktop resolution (run directly in Windows) or it screws your mouse in the game (run inside DosBox)...
I was programming for Dos for several years (after 2004). My only excuse was that I couldn't code for Windows, which was a pretty week excuse IMHO.
Anyhoo, what do you mean by "vector graphics"? What makes you think Prince of Persia has "vector graphics"? Because it is NOT vector graphics....
Asteroids IS vector graphics. Maybe you could clarify what you mean by "vector graphics".
Programming graphics for Windows or for emulator is lots of fun, especially if it either screws your desktop resolution (run directly in Windows) or it screws your mouse in the game (run inside DosBox)...
I was programming for Dos for several years (after 2004). My only excuse was that I couldn't code for Windows, which was a pretty week excuse IMHO.
Well, i'm interested in gaining knowledge on some technical concepts in game programming but from the beginning.[/quote]
You can also do it with more ""modern"" operating systems, like with Windows. It's not any "higher level" programming-wise, if you're afraid of that.
You can make the graphics as "fancy" as you want.
Anyhoo, what do you mean by "vector graphics"? What makes you think Prince of Persia has "vector graphics"? Because it is NOT vector graphics....
Asteroids IS vector graphics. Maybe you could clarify what you mean by "vector graphics".
Programming graphics for Windows or for emulator is lots of fun, especially if it either screws your desktop resolution (run directly in Windows) or it screws your mouse in the game (run inside DosBox)...
I was programming for Dos for several years (after 2004). My only excuse was that I couldn't code for Windows, which is a pretty week excuse IMHO.
The animations of the lead character in POP, AW/OOTW and FB are all very smooth... I'm not sure about POP,
but the OOTW character animations could have been made with vector transformations. Notice the characters here:
That's nice but you can do all those oldie-like games without being stuck in 16 bits and 4MB of RAM. Might as well be using punch cards ...
I started a Commander Keen remake in XNA a few years ago but got sidetracked on other stuff.
I started a Commander Keen remake in XNA a few years ago but got sidetracked on other stuff.
Hi,
I'm interested in developing a 2d platform game under Dos operating system with vector graphics not bitmap (pixel).
There were several games back in the days with such graphics like "Another World", "Prince of Persia" and etc.
I'm programming with C language under Windows 3.11 with Visual Studio 1.5 .
I don't know what are the C libraries or framework to implement such graphics and animation.
Any light on this topic would be appreciated.
Thanks in advance.
I'll try not to write a long reply but there's a lot of stuff to consider so I'm sorry if I'll get tedious.
NOTE: I ASSUME YOU WANT TO DO THINGS THE OLD WAY, MEANING THE DOS EMULATOR WILL RUN AT ORGINAL 386/486/PENTIUM CLOCK SPEED.
If you want to use the power of a modern CPU to do things the old way then what I am going to write won't be accurate, performance-wise.
From my pov the toolchain is your first problem. Back at that time none would ever use visual studio to develop a game/demo.
So first question you have to answer is: do I want to setup a toolchain for a game as old as prince of persia or for something as old as doom?
The point being older games were written in real mode and I suggest getting a copy of Borland Turbo C/C++, version 3.0.
Games like doom were written in protected mode with the much more modern watcom compiler.
I remember when I switched from Turbo C 3.0 I started using watcom 10.5 and 11 and except for some linking bug it was ok.
http://en.wikipedia.org/wiki/Turbo_C
http://en.wikipedia.org/wiki/Watcom_C/C%2B%2B_compiler
In brief the difference between real mode and protected mode is:
- real mode can make you access pages via a segment/offset, each offset being exactly 64kb (dos is a 16-bit OS, remember). You are limited to this kind of addressing because that's the way a x86 CPU used to work in 16-bit... real mode addressing in assembly is just ds:si cs:ip ss:sp etc.
- protected mode allows you to create bigger pages, overcoming the 64kb limitation effectively creating pages up to 4GB (actually protected mode is an extension giving you the power of 32-bit CPUs inside a host 16-bit OS like DOS). And here of course the assembly addressing takes advantage of 32-bit indices, esi eip esp etc.
The extender sold with watcom compilers was DOS4GW, a de facto standard at that time for games.
http://en.wikipedia.org/wiki/DOS4GW
The only alternative I know about (and used) was PMODEW, very popular in the demoscene because of its reduced size making it the only viable solution for a scener.
http://en.wikipedia.org/wiki/PMODE
As weird as it sounds, given those alternatives, you have to decide first which resolution you want to target. Three options here
- Standard VGA 320x200 8bit single buffer
- Custom modex VGA 256x256/320x200/320x240/etc 8bit double/triple buffer
- Standard multires VESA up to 24bit
If you plan to use VESA then the only solution is protected mode as any decent VESA resolution goes beyond 64kb so when rendering you have to change the segment. And since 64kb = 65536 bytes switching will occur in the middle of a line. Not easy and not fast.
If you plan to use standard VGA things are simple (320*200 = 64000 less than 64kb) but remember there's only one buffer so you have to synch to your monitor vertical retrace and be very careful about performance because framerate will instantly drop by half everytime you break a performance barrier unless you consider tearing acceptable.
As for modex it's a very tricky way to configure a video card using all 256kb available on standard VGAs and supporting hardware scrolling or double buffering. This was very popular... probably one of the first games using it was epic pinball (epic... yes the guys of unreal engine 3). Even in this case you might need protected mode but the problem with this system is on some resolutions bytes aren't addressed sequentially.
For four buffer that would mean:
byte 0 maps to pixel 0 buffer 0
byte 1 maps to pixel 0 buffer 1
byte 2 maps to pixel 0 buffer 2
byte 3 maps to pixel 0 buffer 3
byte 4 maps to pixel 1 buffer 0
http://en.wikipedia.org/wiki/Mode_X
Also get prepared to do some assembly work... I worked with tasm (turbo assembler) and wasm (watcom assembler) hated masm (microsoft assembler).
I suggest giving a try to NASM if you want to start writing stuff on a standard VGA resolution quick.
http://www.nasm.us/
As a final note to writing to video memory on a VGA using asm in DOS is very simple.
;setup the video mode, saving 13h as a parameter in ax register and call the video mode switch interrupt service (10h)
mov ax,13h
int 10h
;make es segment point at video memory
mov ax,0xa000h
mov es,ax
;reset the offset inside video memory using xor (saves 1 or 2 bytes)
xor di,di
So now you can write or read to video memory. If you want to fill the screen with a color all you need is this
mov al,colornum
mov cx,64000
rep stosb
rep repeats stosb as many times as specified in cx (64000 = 320x200)
stosb copies the content of al (your 8-bit color) into es:di (your video pointer) and adds 1 to di after copy.
Just remember colornum must be in the range 0..255 and the video mode is palettized so the default color list is fixed (you can find the default VGA palette here http://en.wikipedia.org/wiki/File:VGA_palette_with_black_borders.svg ). Palette can be changed via interupts or (better) outptting data to ports.
Hope this was helpful for a start.
[quote name='szecs' timestamp='1314793463' post='4855847']
You can make the graphics as "fancy" as you want.
Anyhoo, what do you mean by "vector graphics"? What makes you think Prince of Persia has "vector graphics"? Because it is NOT vector graphics....
Asteroids IS vector graphics. Maybe you could clarify what you mean by "vector graphics".
Programming graphics for Windows or for emulator is lots of fun, especially if it either screws your desktop resolution (run directly in Windows) or it screws your mouse in the game (run inside DosBox)...
I was programming for Dos for several years (after 2004). My only excuse was that I couldn't code for Windows, which is a pretty week excuse IMHO.
The animations of the lead character in POP, AW/OOTW and FB are all very smooth... I'm not sure about POP,
but the OOTW character animations could have been made with vector transformations. Notice the characters here:
[/quote]
The animations of the main character in POP are not that smooth. It seems to be smooth and life-like, because the sprites where drawn using real videos of a guy doing those moves.
(AFAIK)
[quote name='SuperVGA' timestamp='1314793755' post='4855850']
[quote name='szecs' timestamp='1314793463' post='4855847']
Anyhoo, what do you mean by "vector graphics"? What makes you think Prince of Persia has "vector graphics"? Because it is NOT vector graphics....
The animations of the lead character in POP, AW/OOTW and FB are all very smooth... I'm not sure about POP,
but the OOTW character animations could have been made with vector transformations. Notice the characters here:
[/quote]
The animations of the main character in POP are not that smooth. It seems to be smooth and life-like, because the sprites where drawn using real videos of a guy doing those moves.
(AFAIK)
[/quote]
Yep, that's probably true. I read an interview on it some years ago, and now that you mention it, the interview explained sprites drawn from filmed movement.
-Also, it's easier to achieve "smooth" hand-drawn animations on lower resolutions. I just remembered the Quake animations,
and they always seemed pretty coarse...
Back in the day I had this book:
http://www.droberts.com/pcgpex/pcgpex.htm
If you can find a copy, it supplies a basic library for modeX/Y/13H stuff for use with Borland C++ 3/4ish (which is probably a reasonable choice cos at least you can run the IDE on window!)
http://www.droberts.com/pcgpex/pcgpex.htm
If you can find a copy, it supplies a basic library for modeX/Y/13H stuff for use with Borland C++ 3/4ish (which is probably a reasonable choice cos at least you can run the IDE on window!)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement