• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
stein102

Deciding to switch to C++

9 posts in this topic

I've been programming in Java since grade 11 in highschool(Just finished first year university) and I've made some really good progress with the language. I've made a few simple games like the ones recommended on this site. I'm currently working on a 2d RPG in Java using LibGDX and it's going fairly well.

 

My concen is that there really isn't that much support for Java game development... I mean, for the level of programming I'm doing the performance difference is negligible so that really isn't a factor. But it seems that there are WAY more good APIs and engines for C++ than you can find for Java. 99% of the gamedev books I see written are intended for C++. I'm sure the concepts transfer, but it would be better to just have a book in a langauge that you'd know.

 

Another thing I've conisdered is that I'll have to learn C++ eventually anyways if I want to become a professional gamedev after school. Not many AAA games use Java, even runescape has left it for HTML5.

 

Ranting aside, what do you guys think I should do? I was considering ordering C++ Primer, then maybe Game Coding Complete and seeing where that takes me.

 

Any suggestions would be greatly appreciated.

Thanks,

Stein102

2

Share this post


Link to post
Share on other sites

What exactly do you mean that the tools in relation to refactoring and such are more primivite

 

Would you say it's worth the time in learning C++ and dealing with all the learning pitfalls so I can work with better game APIs and have more support? I feel like my main issue is just that it's really hard to find a good game programming book in Java.

 

Also, I'm not sure whether or not I should finish my current game(It's going to take a ton of time to finish) or just switch now.

 

Thanks

Edited by stein102
1

Share this post


Link to post
Share on other sites

What exactly do you mean that the tools in relation to refactoring and such are more primivite?


To perform refactoring, tools have to be able to accurately parse the source code and determine what everything means. It's much harder to do this accurately with C++ source code than it is with Java source code.

It depends on the project, but C++ refactoring tools have a tendency to get confused and miss things or discover false positives when doing this.

The preprocessor plays a big part in making life hell for static analysis of C++. Edited by Nypyren
0

Share this post


Link to post
Share on other sites
Would you say it's worth the time in learning C++ and dealing with all the learning pitfalls so I can work with better game APIs and have more support? I feel like my main issue is just that it's really hard to find a good game programming book in Java.

 

Well, the ultimate goal of every programmer is to ignore language and focus on concepts, ideas and their respective solutions. Not that Java is a bad language for game development, although I'm sure you already know that.

You will mostly be doing the same things in C++ as you are doing in Java, except everything takes more time and you have alot more room to express yourself in the code. Which can be a good thing and a bad thing depending on the alignment of certain planets.

 

If you think finishing your current game is going to teach you alot (it probably is, if its a complex game), then don't. If it's just alot of boilerplate programming, like adding a menu or replacing assets with better ones, then just consider it complete. There can be alot of value in finishing things you start with, especially more complex projects. I made a legend of zelda game engine once upon a time, and I learned the most at the very end of the project. I had no books, and no one to teach me what to do, since this was before the age of the Intergoogle. I realized that I don't have to draw all the tiles that I can currently see on camera if I just combine them on a bigger texture that fits inside the screen (and slightly outside to make transitions look smooth). I learned to sort sprites by Z/depth, even if the algorithm was really shitty. I learned how to blend a layer of clouds and a shitty sunshaft animation on top of the screen to make a cool effect that I didn't really like. And I also learned a little bit of C to create effects like snow-flakes falling down, or sand blowing in the wind. In other words, there's always something more you can do, and it can really just go on forever if you're like me.

 

In the end, I regretted not learning c++ sooner. Just make sure if you do go the C++ route to REALLY investigate what the absolute easiest route to getting started is. And make sure your setup is not a hinder. Download free MSVC++ for windows, or Codelite for Windows/Linux. With Microsoft VC++ you get the (locked-in) compiler, but the IDE is the best around. Codelite isn't the worst, and with it you can use the GNU compiler suite (mingw64 / TDM-GCC-64 on windows) and on linux it's just a "sudo apt-get install g++" away. I recommend Microsofts IDE btw. as it sets things up for you and "it just works."

 

Churn through some tutorials to get the basics of the language, make sure you READ THE RESPECTIVE C++ Reference on each and every little thing you do, since it's actually very informative. And there are occasional examples. For example, C++ strings: http://www.cplusplus.com/reference/string/string/

After that, consider using SDL2 (or later) or SFML for graphics programming. Note that SDL is a complete framework that includes sound/streams, networking and all that fancy stuff.

 

The cplusplus.com tutorial section: (not sure how good it really is)

http://www.cplusplus.com/doc/tutorial/

1

Share this post


Link to post
Share on other sites

Also, I'm not sure whether or not I should finish my current game(It's going to take a ton of time to finish) or just switch now.

 

Absolutely finish your game.

 

You can, as jbadams suggests, learn C++ at the same time. But the ability to finish a game project is a compelling one for a potential employer; the sooner you start on that habit the better.

2

Share this post


Link to post
Share on other sites


Absolutely finish your game.

 

In principle, I agree, but since OP alludes to it taking a ton of time it *might* be worthwhile to port the game to C++ and complete it there, especially if OP feels that the lack of gaming support in Java is a hindrance.

 

I would say if you are less than 40% of the way through, or if you're more than 9 months from completion, then consider re-writing what you have in C++ and finish the game. Otherwise, stick it out with Java. Josh is absolutely right that a completed game in any language is way more valuable than numerous half-finished ones. A bird in hand is worth two in the bush, and all that.

 

However, be aware that you will certainly find C++ to be more slow-going. C++ has a great many points in its favor, but productivity is never counted among them -- even moreso for a beginner. You will not have good tools for rapid refactoring, error messages are often arcane, and your programs will leak memory gleefully if you fail to apply proper management patterns.

 

Modern, idiomatic use of C++11 better arms you against those sorts of problems than C++ ever has in the past, but its road is simply not as well-paved as languages like Java or C#. Since you have the benefit of starting now, in the age of C++11, I would recommend you against using dated resources for learning. Many of the core books -- Lippman's C++ Primer, Stroustrup's The C++ Programming Language, and Josutti's The C++ Standard Library -- are up-to-date with C++ 11 in their latest editions, try to learn from those. Stroustrup's A Tour of C++ is a great introductory text as well, short, but inexpensive. Meyer's is writing an updated Effective C++ as well, but its not ready yet, that one looks like it will cover both C++11 and C++14, which is being voted as a final standard soon (I wouldn't wait for texts to be updated for C++14, the changes between it an C++11 are less radical/fundamental than between C++11 and what came before it.)

1

Share this post


Link to post
Share on other sites

 

Absolutely finish your game.

 
In principle, I agree, but since OP alludes to it taking a ton of time it *might* be worthwhile to port the game to C++ and complete it there, especially if OP feels that the lack of gaming support in Java is a hindrance.
 
I would say if you are less than 40% of the way through, or if you're more than 9 months from completion, then consider re-writing what you have in C++ and finish the game. Otherwise, stick it out with Java. Josh is absolutely right that a completed game in any language is way more valuable than numerous half-finished ones. A bird in hand is worth two in the bush, and all that.
 
However, be aware that you will certainly find C++ to be more slow-going. C++ has a great many points in its favor, but productivity is never counted among them -- even moreso for a beginner. You will not have good tools for rapid refactoring, error messages are often arcane, and your programs will leak memory gleefully if you fail to apply proper management patterns.
 
Modern, idiomatic use of C++11 better arms you against those sorts of problems than C++ ever has in the past, but its road is simply not as well-paved as languages like Java or C#. Since you have the benefit of starting now, in the age of C++11, I would recommend you against using dated resources for learning. Many of the core books -- Lippman's C++ Primer, Stroustrup's The C++ Programming Language, and Josutti's The C++ Standard Library -- are up-to-date with C++ 11 in their latest editions, try to learn from those. Stroustrup's A Tour of C++ is a great introductory text as well, short, but inexpensive. Meyer's is writing an updated Effective C++ as well, but its not ready yet, that one looks like it will cover both C++11 and C++14, which is being voted as a final standard soon (I wouldn't wait for texts to be updated for C++14, the changes between it an C++11 are less radical/fundamental than between C++11 and what came before it.)

 

Yes, getting the C++11 versions of the books (which I linked) is definitely important. It is important to note though that most compilers do not fully implement the C++11 standard yet, usually its either parts of the standard library missing (such as regex) or its language things like constexpr.
 
Effective C++ is a great book regardless of C++11 or not, but since he'll be spending his time learning, its not a necessary book to have in the near future... So... he can wait to pick that up until the 2014 edition is out.

As far as the project goes... honestly, its nice seeing projects in multiple languages. It shows a level of flexibility that many junior programmers do not have. So if this project is too far in the future, it would be good to do up another project that simpler in Java.

2

Share this post


Link to post
Share on other sites


Yes, getting the C++11 versions of the books (which I linked) is definitely important. It is important to note though that most compilers do not fully implement the C++11 standard yet, usually its either parts of the standard library missing (such as regex) or its language things like constexpr.

 

Many of the compilers are more than good enough to basically ignore outmoded techniques and idioms though.

 

Notably, Microsoft's compiler is furthest behind -- they plan on delivering a sort of mishmash of C++11 and C++ 14 features going forward, until around the time that everyone ought to be delivering C++14, when they'll achieve rough parity. If you've read any of the blogs, they've stated several times that the simple fact is that their compiler internals had been quite dated, and they're having to refactor great swaths of it concurrently to implementing new language features -- I mean, the compiler didn't even have an intermediate representation before.

 

Still, even today on any mainstream compiler including Microsoft's, you get things like auto, trailing return types, lambdas, variadic templates, parameter packs, shared_ptr/weak_ptr/unique_ptr, make_shared, chrono and random, range-based for-loops, rvalue references and move semantics. initializer lists, decltype, defaulted and deleted member functions, default template arguments for template functions, delegating constructors, atomics. The most useful stuff is widely available (with the notable exception of constexpr), the stuff that really impacts the way you architect and write your code.

2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0