Making a 3D game in C++ without a game engine?

  • Context: C/C++ 
  • Thread starter Thread starter Algren
  • Start date Start date
  • Tags Tags
    3d Game
Click For Summary

Discussion Overview

The discussion revolves around the challenges and considerations of creating a 3D game using only C++, without relying on a game engine. Participants share their experiences with 2D games and express interest in transitioning to 3D game development, referencing classic games like DOOM as a point of inspiration.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • Some participants emphasize the limitations of using Turbo C++, noting that it does not support modern 3D graphics libraries and is a 16-bit compiler that may not run well on current operating systems.
  • Others suggest switching to modern compilers like Visual C++ or g++, which would allow the use of OpenGL or DirectX for 3D graphics programming.
  • One participant mentions that while it is possible to create 3D games in Turbo C++, it would require writing a custom 3D library, which is a significant undertaking.
  • Some argue that using a game engine could greatly simplify the development process and recommend exploring existing engines suitable for hobbyists.
  • A few participants highlight that DOOM utilized ray casting rather than true 3D rendering, suggesting that understanding this technique could be beneficial for beginners.
  • There are mentions of alternative IDEs like Eclipse and NetBeans that support C++ development, which could enhance the programming experience compared to Turbo C++.
  • One participant humorously claims that it is impossible to create a 3D game solely with C++, while acknowledging that third-party libraries can provide necessary functionality.

Areas of Agreement / Disagreement

Participants generally agree that using a modern compiler and potentially a game engine would be beneficial for 3D game development. However, there is no consensus on whether one should strictly avoid game engines, as some advocate for their use while others support the idea of building from scratch.

Contextual Notes

Participants express varying levels of familiarity with C++ and game development, leading to differing opinions on the feasibility and practicality of using Turbo C++ for 3D games. The discussion reflects a range of experiences and knowledge about programming practices and game design.

Algren
Messages
74
Reaction score
1
I don't want to use any game engine.

I want to use only C++ to make a 3D Game. How can I do so?

I have made many 2D games, like chess, connect 4, mario, snake, etc.

But how do i do 3D and make things like DOOM?

I use the OLD Turbo C++ Compiler, not Dev C++
 
Last edited:
Technology news on Phys.org
Algren said:
I don't want to use any game engine.

I want to use only C++ to make a 3D Game. How can I do so?

I have made many 2D games, like chess, connect 4, mario, snake, etc.

But how do i do 3D and make things like DOOM?

I use the OLD Turbo C++ Compiler, not Dev C++

AFAIK, Turbo C++ doesn't support any 3d Graphics library. Other than that, TurboC++ is a 16-bit compiler & it produces 16 bit binaries. 16 bit stuff doesn't run well on Win7-64 bit edition - you will need to use an emulator.

Download Visual C++ (I think non-commercial edition is free) or g++ (this is fully free) Then you can use OpenGL or DirectX for programming 3D Graphics.

If you want to learn more about Computer Graphics - pick up the book by Hearn & Baker.
 
phiby said:
AFAIK, Turbo C++ doesn't support any 3d Graphics library. Other than that, TurboC++ is a 16-bit compiler & it produces 16 bit binaries. 16 bit stuff doesn't run well on Win7-64 bit edition - you will need to use an emulator.

Download Visual C++ (I think non-commercial edition is free) or g++ (this is fully free) Then you can use OpenGL or DirectX for programming 3D Graphics.

If you want to learn more about Computer Graphics - pick up the book by Hearn & Baker.

Well, i will have to make a great deal of syntax change to transfer into another compiler.

Although, then what is the best possible game makeable in TC?
 
Algren said:
Well, i will have to make a great deal of syntax change to transfer into another compiler.
Depends. All the standard C++ stuff remains the same. But any compiler specific functions you have used would need to be rewritten. Another thing to remember is that TC is a 20 year old compiler. C++ has changed radically since those times. Most standard code written in TC++ would still work in a modern C++ compiler, but current C++ is far more powerful & offers you really powerful features (templates etc) which will make programming easier for you.

However, since you say that you have only written 2d games till now, wouldn't you have to scratch from scratch anyway to make 3d games?

Algren said:
Although, then what is the best possible game makeable in TC?

You can do 3D - but you would have to write you own 3d library which would be non trivial exercise. If you are serious about programming, take the plunge and move to a modern compiler & library.

By the way, I am not a game programmer.
 
First off, you probably do want to use a game engine. Here's a list of game engines suitable for a hobbyist, some free...

Second off, I recommend using Dev-C++ or Microsoft Visual Studio Express.

Third off if you just want to start drawing 3D and do not want to rely on a library, the best thing to do is start learning OpenGL or DirectX. What I like to do is use SDL to create an OpenGL window and draw OpenGL inside of that. I use this approach because it means my code is very portable and can run on all operating systems. (If you are careful to write "OpenGL 3.0" or "OpenGL ES", you can even port to mobile phones easily.) There are many OpenGL tutorials on the internet.

Here is some OpenGL sample code I put on the internet but I am not sure it will help you much if you are a beginner... http://msm.runhello.com/?p=385

If you really, REAAALLLY just want something that looks like "doom", and you have working 2D drawing already, the original "doom" was done using "ray casting" and rendering in CPU. You can easily do the math for ray-casting yourself and then just splat that to screen with your existing 2D drawing tools. I find a tutorial on raycasting here. However this is not what you want, you want to be using a modern 3D API with GPU acceleration. 3D in CPU will be very slow and not look very good.

Well, i will have to make a great deal of syntax change to transfer into another compiler.
If you have actually written code which will break if you change C++ compilers, then it is bad code and you want to replace it anyway.
 
Algren said:
I don't want to use any game engine.

I want to use only C++ to make a 3D Game. How can I do so?

I have made many 2D games, like chess, connect 4, mario, snake, etc.

But how do i do 3D and make things like DOOM?

I use the OLD Turbo C++ Compiler, not Dev C++

Hey Algren and welcome to the forums.

As other posters have pointed out, using a game engine to make games is a good idea. I say its vital because it will take you a very very long time to get things done.

You should note that DOOM is actually a raycaster. It's not a true 3D rendering application like you see in your modern games. Quake was the one that filled this gap. You can get source code for both binaries from the iD website if you want to learn about this.

Also as other people have mentioned you will need to switch compilers. There are a few to choose from: Visual Studio is good for its interface. You could use Dev-C++ but I don't like its interface as much as VS.

Making 3D games is a lot of work. As other posters have pointed out, there are a lot of open-source hobbyist engines out there that allow you to get something up and running fairly quickly, and allow you to integrate game specific code fairly easily.

The biggest headache is learning the internals and how to get the stage of adding content (art assets or code) to where you can get what you want up and running straight away.

It takes a little while before you become able to get stuff up and running the way you want it with an existing engine, but its worth it. I wouldn't code your own from scratch unless you really, really want that learning experience. I did this to a large extent and it was a great learning experience for me, but it took years of my life to do this.
 
Really you might be happiest just downloading Unity 3D and using C#. If you already know some C++ it is not a big jump.
 
there was no mention of IDEs but both Eclipse and NetBeans supports C++ development and provides the same kind of experience as Turbo C++ does complete with code completion and code debugging. Learning these IDEs are crucial for modern programming development.
 
I'll give the cheeky answer.

Algren said:
I want to use only C++ to make a 3D Game. How can I do so?

It's impossible: C++ simply doesn't offer you the features to do so. Of course, the same is true of most programming languages.


However, C++ (and most languages) is flexible enough that third parties can provide you libraries that let you do graphics and other stuff.

For example, absolutely nothing in conio.h is part of C or C++. Instead, that was a bonus feature a lot of old MS-DOS vendors decided to bundle with their product.
 
  • #10
Hurkyl said:
I'll give the cheeky answer.

It's impossible: C++ simply doesn't offer you the features to do so. Of course, the same is true of most programming languages.However, C++ (and most languages) is flexible enough that third parties can provide you libraries that let you do graphics and other stuff.

For example, absolutely nothing in conio.h is part of C or C++. Instead, that was a bonus feature a lot of old MS-DOS vendors decided to bundle with their product.

Lol, you're a bastard Hurkyl :)
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 133 ·
5
Replies
133
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
19
Views
4K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 397 ·
14
Replies
397
Views
21K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K