Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: General question  (Read 4620 times)

0 Members and 3 Guests are viewing this topic.

dark ninjuh

  • Newbie
  • *
  • Posts: 13
    • View Profile
General question
« on: October 08, 2014, 09:38:31 am »
Out of your guys's experience . How much knowledge of c++ would you think it would take to manage a simple 2d game. I've been studying c++ for years. i can use classes functions and such. but throw the virtual keyword at me or polymorphism and my mind just melts. (i do understand basic class inheritance) But that's about all i can manage to teach myself. I've been trying for years But I would just never grasp it on my own. Do you think if i start trying to work on large projects (i never have before) that i could manage. Or should i keep bashing my head against the wall until i get all these uber complicated topics of c++.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: General question
« Reply #1 on: October 08, 2014, 09:49:00 am »
To develop larger projects, you definitely need to know advanced abstraction techniques such as polymorphism or templates. "Larger" doesn't mean the most simple 2D games... however, they are actually a very good opportunity to learn and practice new programming language features.

The concept of virtual functions is actually not very difficult, especially if you already understand inheritance. I assume you just haven't had a look at enough practical examples to understand the use. Do you have a good C++ book? Good literature is absolutely crucial in C++, you can waste years when learning with the wrong books or no books at all.
« Last Edit: October 08, 2014, 09:52:28 am by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: General question
« Reply #2 on: October 08, 2014, 09:50:20 am »
"simple 2d game" is a rather vague description. You don't need polymorphism or anything complex for a Tic Tac Toe game or a Pong clone, however if you think about something like a platformer or RPG then your code base would probably turn into a big mess without polymorphism or other more advanced paradigm.

If you know the basic C++ principles then I think you should be able to start with some simple and small games. From there you can take the opportunity and actually try more advanced things - learning of C++ can only really be achieve through practice.

Before you get all excited about SFML though, you might want to read more about your build tools (compiler, linker, CMake, etc.), because speaking from experience this is what a lot here on the forum have problems with, mainly because they didn't invest any time into learning about their tools.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dark ninjuh

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: General question
« Reply #3 on: October 08, 2014, 10:13:22 am »
"simple 2d game" is a rather vague description. You don't need polymorphism or anything complex for a Tic Tac Toe game or a Pong clone, however if you think about something like a platformer or RPG then your code base would probably turn into a big mess without polymorphism or other more advanced paradigm.

If you know the basic C++ principles then I think you should be able to start with some simple and small games. From there you can take the opportunity and actually try more advanced things - learning of C++ can only really be achieve through practice.

Before you get all excited about SFML though, you might want to read more about your build tools (compiler, linker, CMake, etc.), because speaking from experience this is what a lot here on the forum have problems with, mainly because they didn't invest any time into learning about their tools.
Yeah ive spent alot of time learning tools, (ive set up multiple engines. used multiple os's linux windows, used the irrlicht engine. allegro. ... doesnt mean i ever acheived even a simple project with them. but have set them up)

To develop larger projects, you definitely need to know advanced abstraction techniques such as polymorphism or templates. "Larger" doesn't mean the most simple 2D games... however, they are actually a very good opportunity to learn and practice new programming language features.

The concept of virtual functions is actually not very difficult, especially if you already understand inheritance. I assume you just haven't had a look at enough practical examples to understand the use. Do you have a good C++ book? Good literature is absolutely crucial in C++, you can waste years when learning with the wrong books or no books at all.
Not very difficult...... NOT VERY DIFFICULT?!?!?! .. Ive had a library of c++ books. (quite literaly..... a library) an entire bookshelf of c++. ive read so much. ive been through tutorials. i actually started using/studying c++ over 5 years ago. and in that time. ive acheived ... nothing. so im still bashing my head against the wall trying to understand it all. i mean i made 1 little thing with allegro that was pong without the ai it was just a wall. thats about it. though ive seen people manage to acheive more in 1 week than what i have in 5 years. (great for my self esteem) though since it seems i wouldnt be able to manage with what i have. i dont even know... i dont even know anymore....

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: General question
« Reply #4 on: October 08, 2014, 10:24:01 am »
Maybe you're learning the wrong way. Not every person uses the same approach; some directly understand what they read, others need many practical examples, etc. Have you tried to implement the concepts in code? Often, one doesn't fully grasp something until it has been tried multiple times, in various situations.

...but in any case, what answer do you expect from us? As stated, simple games will be possible without polymorphism, but for larger projects, knowing how to abstract is a must.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

dark ninjuh

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: General question
« Reply #5 on: October 08, 2014, 10:55:35 am »
Have you tried to implement the concepts in code?
I do attempt. But when i actually try to "use" advanced concepts in my code i run into brick walls and no way to logically get around them. and end up just using a standard noobish style to preform the task. Like trying to make a class then finding out in one of the functions declared i needed to manage the window, which was declared in main so its not accessible from that class. Things like that is my problem.

Xornand

  • Jr. Member
  • **
  • Posts: 78
  • C++ / Python
    • View Profile
Re: General question
« Reply #6 on: October 08, 2014, 11:06:34 am »
Not very difficult...... NOT VERY DIFFICULT?!?!?! .. Ive had a library of c++ books. (quite literaly..... a library) an entire bookshelf of c++. ive read so much. ive been through tutorials. i actually started using/studying c++ over 5 years ago. and in that time. ive acheived ... nothing. so im still bashing my head against the wall trying to understand it all. i mean i made 1 little thing with allegro that was pong without the ai it was just a wall. thats about it. though ive seen people manage to acheive more in 1 week than what i have in 5 years. (great for my self esteem) though since it seems i wouldnt be able to manage with what i have. i dont even know... i dont even know anymore....
To be honest, I find it hard to believe that you've been studying C++ for 5 years and haven't understood the OOP concepts.

Out of curiosity, what are the books/articles you've read to learn about the concepts like virtual functions and polymorphism?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: General question
« Reply #7 on: October 08, 2014, 11:10:25 am »
I've had some trouble understanding different concepts and ideas as well when I started with C++ (and SFML). When you're alone and try to figure out something, your brain can easily just give up, thus from my experience having people with more experience around was very, very helpful. However the forums can only go so far when it comes to figuring things out - they are great for discussions, but don't work for "conversations" - and thus I've started to use IRC more and more and now don't want to miss it. Thus feel free to checkout the official SFML IRC channel. I'm sure some will be willing to help you out where possible. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dark ninjuh

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: General question
« Reply #8 on: October 08, 2014, 11:19:15 am »

To be honest, I find it hard to believe that you've been studying C++ for 5 years and haven't understood the OOP concepts.

Out of curiosity, what are the books/articles you've read to learn about the concepts like virtual functions and polymorphism?
http://www.cplusplus.com/doc/tutorial/classes/
http://www.dsi.fceia.unr.edu.ar/downloads/informatica/info_II/c++.../Practical%20C++%20Programming%201995.pdf
http://ptgmedia.pearsoncmg.com/images/9780132673266/samplepages/0132673266.pdf
C++ A Beginner's Guide 2nd Edition (2003) <-- cant recover link just have the copy
http://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf
http://www.redhawk.ccur.com/docs/root/4redhat/PLDE/0890497-040.pdf
http://www.angelfire.com/art2/ebooks/teachyourselfcplusplusin21days.pdf
Thats the digital copies of books that i have, All my hard copies of other books i dont have any more.
and i dont think criticizing my learning pace is appropriate for this forum... if your really curious i have sites in which i signed up for around the time i started that have beginner code that i had made. pm me if your really that curious.

Xornand

  • Jr. Member
  • **
  • Posts: 78
  • C++ / Python
    • View Profile
Re: General question
« Reply #9 on: October 08, 2014, 11:59:06 am »
Thats the digital copies of books that i have, All my hard copies of other books i dont have any more.
and i dont think criticizing my learning pace is appropriate for this forum... if your really curious i have sites in which i signed up for around the time i started that have beginner code that i had made. pm me if your really that curious.
And where exactly did I criticize your learning pace? I simply stated that it is hard for me to believe that someone could have been studying something for 5 years while not grasping some of the important core features of the very thing they had claimed to be studying.

That was to provoke a discussion on whether you've been studying those things the right way. As stated above, people learn differently and not every approach works for everyone. Me asking you about the books you've read was to see whether they were good sources to learn about the things you don't know and perhaps to suggest some other sources.

And from what I can see, the books you've linked to are mediocre at best but they should get the job done if you're willing to put some additional effort into practicing the stuff you read about. If for some reason, you just can't learn it from these sources, then perhaps checking out some actual good introductory books, such as this one might be a better choice. Aside from that, there are also countless YouTube videos, such as one, which also might be of great help when trying to grasp some of the concepts of OOP.