Language…
10 users online: Alexis Franco, Burning Loaf, Jamie, Nint, Raychu2021, SaintRedFox,  Segment1Zone2, StarWolf3000,  Valentine, Zute - Guests: 79 - Bots: 258
Users: 65,969 (2,173 active)
Latest user: Santicico

3D MS-DOS game engine I coded in C

Non-Super Mario WorldWork in ProgressMiscellaneous

About 8 months ago, I was bored, so I coded a simple 3D game engine in MS-DOS in C. It took quite a lot of work.




The game engine uses VGA Mode-X with a 320x240 pixel resolution. The player immediately starts at the origin point of the map: (0, 0, 0), and can move with the WASD keys and look around with the mouse. There's no physics here, so the player can phase through walls and fly.

There are placeholder images at the bottom of the screen showing the player's HP and Ammo, though I haven't implemented this feature in yet. There's also some debug text at the top showing the frames per second and other miscellaneous info, which can easily be changed in the source code.

Oh yeah, the code is heavily unoptimized, and I'm a bad programmer. The triangle-rendering code is especially unoptimized; you can see the FPS drops to the 8-16 range when I get close to the map.

There's still lots of things that I need to add to this project, though I doubt I will ever finish it because I'm really slow at working on shit. Some of my main goals for updating this engine are:
- Sound
- Physics
- Enemies, items, NPCs, etc.
- Saved Games (I feel I could do this easily)

And here's one final screenshot of Princess Peach to go along with this C3's theme:



Let me know what you think of this game engine!

UPDATE: My project is now on GitHub!
This is giving me a lot of DOOM vibes, and from the looks of things here it seems like a good start!
For this project, do you plan for it to have any story? And talking about the picture of Peach, always following the royality.

If this were a DOOM hack in development, I'd call it DOOM: "Hello World!" Manifestation.

Jokes aside, good luck with the engine! #smrpg{y}
Originally posted by Heitor Porfirio
For this project, do you plan for it to have any story?

I was thinking of creating a first-person shooter that takes place in the Galilean moons, the four moons orbiting Jupiter, though I haven't thought of a definitive story yet.

I was inspired to make this project because of DOOM and also Half-Life. I actually bought both games last Christmas while working on this project.
That's pretty cool! Have you tried running it on real hardware? I'd be willing to give it a test on my Windows98 machine sometime in the future.
This is really cool! I can't imagine how much of a pain it must've been to put this together, in C of all languages, but the result looks really cool! It has that lovely flavour of nostalgia to it too.

This looks very promising. The effort here is admirable, and it's made for the old DOS system? Was it made completely from scratch? Either way, pretty cool! And I'm a sucker for the old 3D aesthetic. Good luck with the project!
Originally posted by patcdr
Have you tried running it on real hardware? I'd be willing to give it a test on my Windows98 machine sometime in the future.

Not yet. I tested this game in DOSBox with a simulated Pentium CPU at 100MHz, and with 8MB of RAM. The bin folder that holds all of the game's data, including the game itself, is currently 376 kilobytes in size. Judging by these requirements, I think your Windows 98 machine would run this engine just fine.

Originally posted by bebn legg
I can't imagine how much of a pain it must've been to put this together, in C of all languages, but the result looks really cool!

Yeah, it really was a pain. I had several moments where I was purely frustrated and quit the project for a few weeks or months, but I inevitably come back to see what I can add or fix.

Originally posted by RussianMan
The effort here is admirable, and it's made for the old DOS system? Was it made completely from scratch?

Yes, I made it from scratch. The very first thing I remember doing for the project was printing lines of text to the screen to display the player's coordinates, then a few days later, I followed a VGA tutorial to render the screen, then I took off from there.
I can test this on real hardware aswell.
It's so beautiful! It looks like it was came straight from Duke Nukem 3D.
I'm officially now on BlueSky! Follow me at @nanahikari-klug.bsky.social for updates! 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
I made a few quick updates to the engine:

It now detects if SoundBlaster is enabled on the DOS machine or not. Still haven't worked with actual sound or anything.
There's now gravity in the game. I'm also trying to work with line-triangle collision, but it doesn't seem to work, so instead I used a simple test to check if the player is below Y=0.

I also created a GitHub repository to share my engine.

Non-Super Mario WorldWork in ProgressMiscellaneous