• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need C++ knowledge

Status
Not open for further replies.

Screamernail

S

Screamernail

If this is the wrong forum to post this then put it somewhere else.


I want to make a game (Even went so far to want to make my own console) and need some C++ learning. I will start from scratch and need some assistance to build the game up to retail. (Or at-least beta) Please tell me where to start and what to do first.


The game's a 2.5D first-person-shooter, there will be an map editor which you make polygon areas with.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If your goal is to make a game, I highly suggest you to use a game engine, such as Unity or Unreal Engine 4, focusing on the game, rather than on irrelevant implementation details.
They sport C# and C++ as their main API languages respectively.
UE4 supports also a WC3-GUI-like interface, however unlike GUI, it has nearly the same capabilities as the C++ API.

If your goal is to learn how to make a big and complex C++ project, sure, but then you need to define what's your baseline.
Do you use a 3D graphics library? do you write one yourself? Do you use a library to handle OS-specific things, or do you write one yourself? etc.

If you can describe better what your goal is, more specific information and suggestions could be given.
 

Screamernail

S

Screamernail

If your goal is to make a game, I highly suggest you to use a game engine, such as Unity or Unreal Engine 4, focusing on the game, rather than on irrelevant implementation details.
They sport C# and C++ as their main API languages respectively.
UE4 supports also a WC3-GUI-like interface, however unlike GUI, it has nearly the same capabilities as the C++ API.

If your goal is to learn how to make a big and complex C++ project, sure, but then you need to define what's your baseline.
Do you use a 3D graphics library? do you write one yourself? Do you use a library to handle OS-specific things, or do you write one yourself? etc.

If you can describe better what your goal is, more specific information and suggestions could be given.
Well i have OpenGL but it could be more fun making my own. And i must admit i'm not clearly an amazing programmer. I know a-bit of unity coding but that's about it.

But i want to learn it. i want to make my own game only on my own. But i need to learn.
cplusplus.com - The C++ Resources Network
I need to get this more easily with help from some other people here.

EDIT: Where do i start off first? Any suggestion?
 
Last edited by a moderator:
Level 29
Joined
Jul 29, 2007
Messages
5,174
OpenGL is the "making my own", I meant something like Ogre3D.

You can start looking at SFML for a cross-platform library to handle basically all of the things you generally don't want to (creating a window, getting an OpenGL context, OS events, etc.).
It gives you also simple APIs for rendering stuff if you want to use them, or you can use OpenGL directly however you want to.
The latter of course means you also need to learn about linear algebra and OpenGL!

The next step is to get a math library, for that I would recommend OpenGL Mathematics
glm has an API that by design resembles closely the OpenGL Shader Language (aka GLSL), so it fits nice with OpenGL code.

From there it's all up to you, how you design your levels, your objects, the file formats (models, textures, sounds, etc.) you want, the game logic (where you'll actually spend most of your time), and so on.

If you have any more specific question, feel free to ask, but there isn't so much more to say about making games in general.
If you are lacking information sources such as tutorials on some of these or other subjects, I likely have some.
 

Screamernail

S

Screamernail

Got it.

So i'm using OpenGL, GLM, and Notepad++ to work with it.

But i need to practice. I need to do a smaller project. Can you help me start off the project of a typing game? (Nothing too complicated)

EDIT: Actually never mind. I should do the FPS first. So I'll do the ray-casting now right?
 
Last edited by a moderator:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Get some simple form of a level to render, get a simple form of a player that you can control with inputs.
This is the base of every game.
Try to make it as simple as possible, no need to get too complicated right off the bat.

I am not sure what you mean by 2.5D FPS.

It's not very clear to me what your background is, but it looks like you are new to C++ and to game development and to OpenGL.
If that's the case, I suggest you to start working with the library rendering constructs, rather than learning OpenGL.
Simply because you will need to learn too many things in too many subjects all at once, which will result in you not really seeing any results for a long time, which will demotivate you.

I'd say that seeing things is the best motivator. No matter how awesome your code is, if nothing gets rendered to the screen, and all you can see are debug messages in the console...

By the way, if you are indeed new to C++, ONLY LEARN FROM UPDATED SITES. Look for keywords like C++11/14/17.
C++ has a notorious history of being taught as C with classes, which makes people write C++ code as C with classes, which is terrible.
I cannot point you in any direction, since the last time I actively used C++ was before C++11.
 
Last edited:

Screamernail

S

Screamernail

Get some simple form of a level to render, get a simple form of a player that you can control with inputs.
This is the base of every game.
Try to make it as simple as possible, no need to get too complicated right off the bat.

I am not sure what you mean by 2.5D FPS.

It's not very clear to me what your background is, but it looks like you are new to C++ and to game development and to OpenGL.
If that's the case, I suggest you to start working with the library rendering constructs, rather than learning OpenGL.
Simply because you will need to learn too many things in too many subjects all at once, which will result in you not really seeing any results for a long time, which will demotivate you.

I'd say that seeing things is the best motivator. No matter how awesome your code is, if nothing gets rendered to the screen, and all you can see are debug messages in the console...

By the way, if you are indeed new to C++, ONLY LEARN FROM UPDATED SITES. Look for keywords like C++11/14/17.
C++ has a notorious history of being taught as C with classes, which makes people write C++ code as C with classes, which is terrible.
I cannot point you in any direction, since the last time I actively used C++ was before C++11.

If i need to tell details about the game it is old-school.

2.5D is infact 3D levels with 2D sprites. (You know, like doom) I got the inspiration from Marathon, quite a-lot of inspiration. A classic game. And what i mean with "polygon areas" is the old way of placing connected vertices and fill the middle to make a room.

I'm just stupid again so please tell me if you meant that the website i where on spreads false knowledge.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
It's not about false knowledge, but rather that many sites show information or write tutorials using very old and irrelevant to modern times C++ code.
The old practices just led to bad code that's harder to write and maintain, and is usually less efficient in the end too.
 

Screamernail

S

Screamernail

It's not about false knowledge, but rather that many sites show information or write tutorials using very old and irrelevant to modern times C++ code.
The old practices just led to bad code that's harder to write and maintain, and is usually less efficient in the end too.
Well the game won't be that complex so it won't hurt me right?
 
Last edited by a moderator:
Level 29
Joined
Jul 29, 2007
Messages
5,174
It definitely will! with modern C++, you almost never need to allocate things on the heap directly, for example. "new" is bad for your life.
I honestly can't get too much into this, because like I wrote, I haven't actively used C++ in a long time, but modern code is so better than C++98, which is what a lot of old sites use for tutorials and such.
Just find keywords like C++11, and it should be fine.
 

Screamernail

S

Screamernail

I'm really terrible at doing decisions so can you chose for me? What site should i go to get the information?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Every time I have a C++ question regarding functions and such, I google it and most of the API websites are up to date for C++17. Some even have selectors for legacy versions if C++17 is too modern.

For C++ programming you will want to look into programing techniques such as object orientated programming and functional programming. To learn the language even old C++ tutorials are fine, however you should check the full C++17 API (eg here) before writing your own code as some modern API features either replaced old ones, or were added to make some tasks easier to program. Might also be worth glancing over the various versions of C++ to see what they added, as more modern versions of C++ have greatly improved template and constant variable functionality. Even if you find a very modern tutorial, they might skip out on many of the more advanced modern features. It is also worth noting that not all compilers support the full C++17 standard, in fact no compiler has all features implemented due to difficulties with the targeted platform.

If you want low level graphics then use either OpenGL (kind of deprecated) or Vulcan (modern). D3D12 is also an option but only works on Windows 10 systems so is less flexible than Vulcan. Older versions of D3D are pointless to learn, rather learn OpenGL which has pretty much feature parity. Be warned that going down this route is a whole other learning experience that has little to do with C++ or game engine design, as such you might be better off using a high level API to do graphics as GhostWolf has suggested.
 
Last edited:
Level 4
Joined
Jan 9, 2016
Messages
42
I'm really terrible at doing decisions so can you chose for me? What site should i go to get the information?

If you have to ask people on random forums to choose for you, you have no idea what you're in for. Start searching for such discussions like these on google and then take a look at the arguments.
I'd suggest you use one of the pre-existing engine unless you have good experience making games that you can call 'good' from scratch.

Handmade Hero is a video series where the guy uses c/c++ to make a game from scratch. You could learn some things from him.

Also... c++11/14/17 have both good and bad things for making a game, don't put them on a pedestral. There are times where the good ol' c99 code is sufficient and simple enough, while some c++11/14/17 objects have a ton of hidden inefficient allocations and trashy syntax.
 
Level 9
Joined
Oct 19, 2014
Messages
94
personaly i would say that making your own game engine (in sdl or other library) is good for learning c++ and skilling your patience. after you created simple game engine you should know all basics of c++ and always could use your engine as reference. But starting with ready game engine works too, if you focus on creating content instead of debugging all the time.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Also... c++11/14/17 have both good and bad things for making a game, don't put them on a pedestral. There are times where the good ol' c99 code is sufficient and simple enough, while some c++11/14/17 objects have a ton of hidden inefficient allocations and trashy syntax.
Actually it is the opposite... Many of the newer C++ revision features are aimed for performance. For example they are capable of managing compile time constants better allowing for such constants to be inlined, or use more efficient memory deallocation thanks to sized destructors.
 
Status
Not open for further replies.
Top