Hey /r/gamedev, I authored my own set of lua bindings here and it's developed enough that I feel willing to show a bigger audience and also ask how you all integrate Lua in your games. Specifically, what features have you used a lot or deem critical. Do you handle the bulk of your logic in Lua or ju...
I little while back, I posted a thread asking how people integrated Lua into their games. The big thing I was missing at the time was the ability to register C++ classes along with their member functions, variables, constructor, and destructor. This is done now for a game I am working on and I figur...
https://github.com/jeremyong/SDLpp I'm working independently on a game as was dissatisfied with SFML (although I loved some abstractions such as views and such) so I ported my game to SDL. What I didn't like about SDL was needing to free or deallocate everything myself which is error prone. I also d...
This cannot be understated. Effective C++ is considered a must read by virtually all C++ professionals. There are some things that have changed a bit since the advent of C++, namely, the usage of unique_ptr in lieu of auto_ptr and shared_ptr (where possible), the introduction of lambdas, noexcept practices, move constructors, the rule of 3 becoming the rule of 4 (swap being the fourth), and more template programming techniques.
There are probably a number of things I'm forgetting, but yea, Effective C++ is really excellent. I still pick it up as bedtime reading from time to time to keep myself honest.
No. Usage of tr1's shared_ptr may have been avoided mainly because there wasn't a need for a reference counted pointer.
Too much deletion happening.
The type of the pointer has absolutely nothing to do with the frequency of deletion. Please clarify this.
Memory management and exceptions are basically unused knowledge
You don't need to use exceptions to write exception safe code. And this is bad advice too. If a programmer doesn't know about move constructors, I don't want that programmer touching my codebase (until it's learned).
Also, unique_ptr allows you to provide a custom deleter, which is a semantically better (and typesafe) way to provide "custom pointer" functionality.
SFML threads are somewhat dated as they were written before C++11 <thread> was introduced. They remain there for backwards compatibility but I would recommend using <thread> (http://en.cppreference.com/w/cpp/thread)
The reason I opted not to use luabind is that luabind is a huge project with an undesirable boost dependency. IMHO, luabind is also a lot harder to use for more simple things and the most common tasks. The philosophy I had was to handle the majority of cases with the cleanest syntax possible. You're encouraged to look at the README for examples.
Also, my library has no dependencies outside of lua. My reasoning is that, lua was meant to be small and compact. Tacking on lots of cruft seemed to belie the underlying philosophy.
This cannot be understated. Effective C++ is considered a must read by virtually all C++ professionals. There are some things that have changed a bit since the advent of C++, namely, the usage of unique_ptr in lieu of auto_ptr and shared_ptr (where possible), the introduction of lambdas, noexcept practices, move constructors, the rule of 3 becoming the rule of 4 (swap being the fourth), and more template programming techniques.
There are probably a number of things I'm forgetting, but yea, Effective C++ is really excellent. I still pick it up as bedtime reading from time to time to keep myself honest.
No. Usage of tr1's shared_ptr may have been avoided mainly because there wasn't a need for a reference counted pointer.
The type of the pointer has absolutely nothing to do with the frequency of deletion. Please clarify this.
You don't need to use exceptions to write exception safe code. And this is bad advice too. If a programmer doesn't know about move constructors, I don't want that programmer touching my codebase (until it's learned).
Also, unique_ptr allows you to provide a custom deleter, which is a semantically better (and typesafe) way to provide "custom pointer" functionality.
SFML threads are somewhat dated as they were written before C++11 <thread> was introduced. They remain there for backwards compatibility but I would recommend using <thread> (http://en.cppreference.com/w/cpp/thread)
Hand-cranked flashlight please! :D j/k that could be really irritating to play with haha.
The reason I opted not to use luabind is that luabind is a huge project with an undesirable boost dependency. IMHO, luabind is also a lot harder to use for more simple things and the most common tasks. The philosophy I had was to handle the majority of cases with the cleanest syntax possible. You're encouraged to look at the README for examples.
Also, my library has no dependencies outside of lua. My reasoning is that, lua was meant to be small and compact. Tacking on lots of cruft seemed to belie the underlying philosophy.