Black Art of 3D Game Programming Issues
Posted: Sun Dec 22, 2024 12:39 am
Hi all.
I'm having issues getting games to build properly with the Black Art of 3D game programming library. I want to get my old game from back in the day up and happening again. The issues seem quite strange to me as they are also happening building the book's own demos, unmodified.
At the moment I'm trying to build worms.exe. When I run the original .exe it runs fine. When I build it, the sprites won't "animate". They stay "stuck" on the same frame, just scrolling along.
I'm building using MS C/C++ 7.0, in DosBox, running HXDPMI, using the recommended commands:
cl -AM -FPi87 -c -Fc -Gs -G2 -W4 %1.c
link /ST:12000 %1,,,blacklib,,
I've also built the project in Open Watcom with the same kinds of issues. Also... this happened back in the day with my old game as well, built with MS C/C++ 7.0 probably running under Windows. I'm running the built games in DosBox.
I've had a look at the issues over time. I get:
- Trying to display various frames of a sprite but having the first frame display instead (ie "stuck animation").
- Having sprite frames:
- not display (I'm guessing it's reading all zeroes)
- display as garbage, which sometimes dynamically changes (surely pointer is pointing to data that's changing).
- display a piece of the background picture instead.
- being larger than their proper size (and being garbage)
- Rarely: keypresses not causing their function
So obviously there are issues with the bitmap pointers. There are other issues as well over time. Relating to the sprites, I've noticed using printf() statements in PCX_Get_Sprite(), sometimes the sprite's num_frames counter won't increment. Sometimes it's a garbage value as well. That's weird, right? It's old old code thousands have built from...
If I'm using the CD's exact code, including on Open Watcom (with small necessary modifications), and it's happened back years ago as well, I must be missing something basic about how to build the projects. Any clues on what could cause this?
I'm having issues getting games to build properly with the Black Art of 3D game programming library. I want to get my old game from back in the day up and happening again. The issues seem quite strange to me as they are also happening building the book's own demos, unmodified.
At the moment I'm trying to build worms.exe. When I run the original .exe it runs fine. When I build it, the sprites won't "animate". They stay "stuck" on the same frame, just scrolling along.
I'm building using MS C/C++ 7.0, in DosBox, running HXDPMI, using the recommended commands:
cl -AM -FPi87 -c -Fc -Gs -G2 -W4 %1.c
link /ST:12000 %1,,,blacklib,,
I've also built the project in Open Watcom with the same kinds of issues. Also... this happened back in the day with my old game as well, built with MS C/C++ 7.0 probably running under Windows. I'm running the built games in DosBox.
I've had a look at the issues over time. I get:
- Trying to display various frames of a sprite but having the first frame display instead (ie "stuck animation").
- Having sprite frames:
- not display (I'm guessing it's reading all zeroes)
- display as garbage, which sometimes dynamically changes (surely pointer is pointing to data that's changing).
- display a piece of the background picture instead.
- being larger than their proper size (and being garbage)
- Rarely: keypresses not causing their function
So obviously there are issues with the bitmap pointers. There are other issues as well over time. Relating to the sprites, I've noticed using printf() statements in PCX_Get_Sprite(), sometimes the sprite's num_frames counter won't increment. Sometimes it's a garbage value as well. That's weird, right? It's old old code thousands have built from...
If I'm using the CD's exact code, including on Open Watcom (with small necessary modifications), and it's happened back years ago as well, I must be missing something basic about how to build the projects. Any clues on what could cause this?