• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

-12 Bad

About redshock

  • Rank

Personal Information

  • Interests
  1. Book suggestions for C++ 2D Game Programming

    I started off with Absolute Beginners Guide to C Programming, 2nd edition, which is the base document of C++, and then I got the rest of my answers of C and C++ with C++: The Complete Reference, 4th edition. While the C++ book is outdated with the current versions of C++ (C++ 11, 14, 17), and if you plan to use C++ later for future jobs, you might be called to work on earlier versions of C++ for maintenance of old applications, so it wouldn't be a bad idea to know the base â€‹of C++ before the latest and greatest features. For example, at work we used different versions of .NET. Newer projects would use the latest .NET version. The older ones had to be maintained. It was beneficial knowing where one version of .NET ends and other begins, which makes you a well-informed .NET developer. Same goes with knowing where C ends and C++ begins, where C++ 11 ends and C++ 14 begins, etc. These books will give you a sequential and organized understanding of C++. 
  2. Book suggestions for C++ 2D Game Programming

    SFML is my favorite library, though they've been slow with updating it for Visual Studio 2017, if that's your editor. Their last binaries were made for Visual Studio 2015, so I don't know why they've been slow lately. Prior to beginning, having a good understanding of C++ is probably the most important before starting with SFML, which is entirely built around classes. 
  3. Book suggestions for C++ 2D Game Programming

    Several game programming books are actually graphics books, and they are often focused on 3D instead of 2D. This is because the young market wants 3D because it's modern. Personally, my bias is beginners just need to know how to make Pong, not a 3D race car game or a MMORPG. Simple 2D games teach a lot! And it's manageable. There's only a handful that is focused on 2D for beginners. These are what I recommend for 2d game programming: Tricks of the Windows Game Programming Gurus, 2nd edition, by Andre' LaMothe.  - Covers Windows programming (still very relevant), DirectX (this is largely outdated, but it's one of the few graphics books focused on 2D, and you can apply it to newer APIs -- see the book below. I converted his graphics code into OpenGL in the past, for example. In addition, there's AI, physics (in 2D!), sprite animation, etc. The author's writing style and personality is different and not liked by some, and writes in a C style in C++ to keep it easy for the reader to follow along, but after knowing him for several years, he's one of the most brilliant game programming authors out there. These days, he develops and teaches hobbyists of making video game consoles (XGameStation, etc.), embedded systems and robotics which is way beyond me  (http://www.ic0nstrux.com/). Many popular developers started because of his books (Call of Duty, etc.).  Data Structures for Game Programmers by GameDev's Ron Penton, Series Editor: Andre' LaMothe. - Covers data structures you'll need in 2D and beyond (and it's more than what the STL library provides), 2D graphics with SDL, common algorithms, etc. All written in C++ classes. Optimizing it depends on your skills, but you would most likely use the STL after learning how the data structures work underneath and learning how to appropriately apply them. Really, those two big book tomes are what you need. You'll be far ahead than anything else in the book market.  Hope that helps!
  4. Interesting. I guess I'll continue to avoid them then unless it's necessary. Thanks for the thoughts. 
  5. In the past, books stated that exception handling was slow for C++ and game dev. The books suggested to call std::nothrow when allocating memory, for example, and then using an if condition to see if the pointer is null or not. These days, I'm not sure. My assumption is it's fast these days. Has there been a best practice for using exception handling these days for games? 
  6. Tips for Beginner?

    Welcome to the world of game programming! I started off with C when I was young. I enjoyed starting there before looking into higher-level languages, which you'll definitely use later for creating map tools, etc. Starting with C (and even C++) allows you to get a sense of how computers work with memory, pointers, etc. It will be less scary because it's common to hear that higher-level programmers have trouble trying C/C++ later. If you start with C or C++, the higher-level languages are easy to pick up. After that, I wouldn't recommend DirectX right away, but look into wrappers like SDL and SFML. Game logic is the same, so that should be the focus. There's no right or wrong way to begin, but my personal bias is starting with C or C++ helps you appreciate the majority of games written in those languages.  
  7. Java vs. C++ for my game?

    ... in the AAA games industry. Yes that's true, the games industry is fueled on C++ by and large. Having said that, the OP did highlight that he already is employed in QA and is looking to do this as a hobby not as a job. So these are maybe not things the OP need worry about right now.   Absolutely, there's no question that knowing C++ is beneficial to a developer for these (and other!) reasons. At the same time to be a well-rounded and knowledgeable developer it is of the utmost importance to know other languages too such as Java/C#/Python/Scala/F#/javascript/etc. And it doesn't really matter which order these are tackled in.   That is somewhat true depending on how you define 'sandbox' but it's not very limiting in practice unless you're writing something low-level like a driver or operating system. Even C++ has a logical VM 'sandbox', defined by the standard, and this does not map directly to the underlying physical machine architecture either.   I think this is the real take-away point that is on-topic for this thread. I would just temper it by pointing out that there are many software development opportunities out there for languages other than C++. I myself currently work as a back-end Java developer by day.   Actually Java's Hotspot JIT uses a lot of advanced techniques to decide what/when/how to JIT. The JIT compiler in .Net is actually comparatively basic. This is an area where Sun/Oracle have invested a lot more time than Microsoft. Microsoft have spent that time building the language itself and the tooling around it. So it's horses for courses really.   Of course! No offence taken. It's just a viewpoint. It's one I happen to disagree with but no reason to take offence all the same. What I see is actually a very good demonstration that recruiters don't know what they're talking about when it comes to programming. I would not what that guy doing my company's recruitment.   Good points. C#'s new RyuJIT compiler for 64-bit is quite impressive, but I'm sure Java's has matured over its longer lifetime. 
  8. Java vs. C++ for my game?

    I would suggest C++. If you're wanting a job later, there's some things to consider. The below quote is from a job recruiter, and based on my professional experience I found this true and helpful in my career, i.e. dropping into unmanaged (native) code for writing performance enhancers where it'd be slow if written in Java/C#, and just being better aware of performance issues (C# and Java's runtimes were built using C++). Those who specialize in C#/Java tend to be limited as sandbox users, though that's fine depending on the project. While reading, keep in mind that C# is similar to Java. If you're just doing this for a hobby and don't plan to do game development or software development, like many here enjoy indie/hobby work, Java is a good choice, and C# is closely related and better coupled with the Windows operating system and has a better JIT compiler for performance. While C#/Java hobbyists might not like the quote, it's not meant to offend, but it's what at least one recruiter looks for. Good luck with your games!  
  9. What do you think 'finally' does?   This works as an alternative. When I asked for opinions, I didn't expect an immature person calling it 'dumb' or reputation clickers who can't voice an opinion. This site is filled with kids with nothing better to do. Go outside. Learn to socialize and be respectable.
  10. It runs for me. I added the throw/catch exception. #define finally#include using namespace std;int main(){      int *p = NULL;  try  {    cout << "Allocating." << endl;    p = new int;    throw bad_alloc();  }  catch(bad_alloc e)  {    cout << e.what() << endl;  }    catch (exception e)  {    cout << e.what() << endl;  }  finally  {    cout << "Done!" << endl;    if (p) {      delete p;      p = NULL;    }  }  system("pause");  return 0;} Current Output: Allocating. bad allocation Done!
  11. At work, I'm used to exceptions with the try-catch-finally format. I wondered how to add 'finally' to C++.   After seeing a finally block wasn't implemented in C++11 (Stroustrup is against them in favor of RAII...), and how others asked for it, I tried this alternative. I think it does the trick without any issue, as finally is used to clean up any resources allocated in the try block. I think it's nice to have. Do you think this alternative is just as effective?   1) Put this at the top of your code: #define finally   2) And, since you can create a unit block using { }, just put finally before that.   Example (poor, but proves a point): #define finally#include using namespace std;int main(){      int *p = NULL;   try  {    cout << "Allocating..." << endl;    p = new int;  }  catch(bad_alloc e)  {    cout << e.what() << endl;  }  finally {    cout << "Cleaning up!" << endl;    delete p;  }  return 0;} Output: Allocating... Cleaning up!
  • Advertisement