The Uteen
Sentient
my status: very quo
Posts: 83
|
Post by The Uteen on Mar 9, 2016 22:11:10 GMT
What do the programmers think of using C++ for coding the game?
From my limited experience, it's a pretty low-level language, where memory-management is something you have to think about, and this is largely its appeal. In addition, it boasts a wide range of features, including function pointers. As for the low level aspect - does this have a significant impact on how effectively you can get stuff done, once you become familiar enough with the language?
I think one of the benefits of C++ is cross platform support (and performance would clearly benefit) - are there other benefits, and are the tradeoffs worth it when working on something like Thrive?
As powerful as C++ is, I can't get over the semi-acronym function names, and weird __gg_wp type parameters. So, any good tips for a high-level programmer on getting to grips with these more off-putting aspects of the language?
|
|
|
Post by crovea on Mar 10, 2016 22:17:07 GMT
Hey
Modern C++11 and onwards can be used very similarly to a high level language. You shouldn't actually be doing or worrying about any memory management if you're doing things the proper modern way with smart pointers and everything the language handles for you automatically.
Writing code will be a little bit slower than with something like C# as you will have to be more explicit with a number of small things and errors in your code can be more tricky to figure out in some cases, compiling also takes time. This is why we also use the scripting language lua, which makes quick changes and implementations easy to do and also enable modders to change the game without recompiling (we have a c++ library that interprets the lua code while the game is running).
Easy cross platform and performance are indeed the major reasons why we use C++, but also the fact that C++ is commonly used for game development meaning that there are a good amount of libraries and tools we can use.
The examples of naming things you are talking about are bad habbits people have from C programming where you don't have namespaces and classes, hopefully you shouldn't find much of any of such nonsence in our codebase.
The best advice I can give for learning C++ from a background in higher level languages would just be to get experience through using it. Make sure you know how pointers work and you shouldn't have too much trouble. I'm sure you can also find guides explaining the differences from your favorite high level language, if that helps you as well.
|
|
The Uteen
Sentient
my status: very quo
Posts: 83
|
Post by The Uteen on Mar 11, 2016 8:57:34 GMT
Thanks!
Smart pointers look pretty cool, I didn't realise this sort of thing had been added to the standard library. I'll have to take a look at some more modern code (I've been meaning to take a look at the Thrive code when I get some time).
One thing I find interesting about C++ is that there are no fixed reference-types and value-types, thanks to pointers. I'm sort of surprised no higher-level languages have this feature.
Using something like LUA to support modding is great.
|
|