62c6a4 No.27793
What are some advanced books on writing a C++ game engine?
I'm looking for something like gameprogrammingpatterns dot com that actually walks you through making a full engine, the "right" way with best practices.
Not necessarily a 3D engine or with heavy physics, I'm mostly interested in the way it's structured, how it handles memory, best practices, scripting etc.
Bonus points if it uses C++11 or higher.
____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27795
Dissect and/or mod Godot source code, the license allows you to do anything with it.
http://www.viva64.com/en/b/0321/
Sweet, caramelized Jesus on a stick, what is up with people and building shit from the ground up?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27799
>>27793
try watching "Handmade Quake" on youtube. The series stops pretty early, but what does get shown, is very good material. Other than that I dont know anything.
I have made game engines, but most of what I learned was through trial and error. Maybe make a few small games, and work your way up?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27800
>>27799
I'm already watching it but Casey is going at a snail pace. He's also writing the game in a C-style, just using a C++ compiler because of a few features. There's a lot to be learned about low-level and old-school techniques but he's not writing an engine per se. (HH is still running btw.)
I've made a couple small games in C++, so I'm not really a beginner, but trying to make larger scale projects requires more advanced techniques that make the process of creating content easier. Stuff like an Entity Component System, Commands, Scripting, Dynamic Memory Management (apparently treating C++ like C#/Java is bad and using new/delete a lot is inefficient and dangerous), etc.
I've looked at "Game Engine Architecture" but it's too high-level and more like a reference book. "Game Coding Complete" is slightly better as it does give examples but still doesn't go through with the whole implementation. I guess I have to just try and implement one by trial and error.
The problem is that with C++, even if something "just werks", there's no way of telling if you're actually doing everything the "right" way.
>>27795
>what is up with people and building shit from the ground up?
I guess it's the best way to learn? The point is to do it just once to know the whole process. Of course, using an already finished engine is better if your goal is to just release a game as fast as you can.
>godot
It's an interesting engine (way better than GMS but still free), but analyzing it would probably be time consuming and pretty difficult. It would probably be better if I analyzed something that's been proven to be well written, like the Quake engine. There's a series on remaking it on youtube (Handmade Quake), but the guy making them stopped because he got a job on UE4 (no video for a 5 months now).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27802
>>27800
Yeah, I couldn't help you with C++11. I use C99 (only because I haven't used the new C11 features yet) for my engines. I don't even understand C++.
Why don't you show me what you have made?
This is the project that I am working on right now:
http://ika.neocities.org/sigma_engine.html
It has its own CLI system, although its very primitive compared to something like the quake3 CLI.
I have actually never heard of an entity component system, but that sounds like a good way to structure your code.
If you have descriptions of the kinds of things you want to try out, why not go on writing the code? I have found that making a terrible attempt at something will teach you how to make a proper version.
Maybe if you're having a problem with falling back on C++ "just werks" features you should try writing some lower level things in C and then looking at how C++ can make it better.
I'm sure that you have good reasons to use C++, but sometimes you should try writing things the C way.
Dynamic memory management is just the tip of the iceberg, I think Casey has a section about a memory management structure.
If you are interested, these two rendering engine tutorials are pretty advanced. (and in C++)
https://www.cs.utah.edu/~jsnider/SeniorProj/BSP1/default.html
http://www.cs.utah.edu/~jsnider/SeniorProj/BSP/default.htm
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27807
>>27800
The question is why you need to know that much about engines in the 1st place. If you're building an inhouse engine that means you have a large team and can just employ an adequate person, who knows their shit to do lead the project. If you're a single dude you're more than likely killing your dev career by building engines instead.
At the end of the day engines don't seem unique at all, as far as programs go. If you're an accomplished programmer you already have an idea what to do, if you aren't... just focus on gamedev IMO.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27808
>>27800
>(apparently treating C++ like C#/Java is bad and using new/delete a lot is inefficient and dangerous)
Writing code in styles that are 40 years old is, yea, bad (in the sense that it's rather unwise).
Using RAII is a fundamental approach to resource management, and not utilizing if you're actually writing in C++ is fairly misguided to say the least.
>there's no way of telling if you're actually doing everything the "right" way.
Not true. A) You can profile, and B) you also can actually examine the output from the compiler for your code if you care to.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27810
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27818
>writing the world's millionth C++ game engine
You just stick together a UI system, a scene graph, and SDL. Sounds boring as fuck if you asked me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27820
>>27818
writing engines is fun if you enjoy programming for fun
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27825
>>27820
>you enjoy programming for fun
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27827
>>27820
FUN!?!?!?!?!?
Anon don't you know we only program in order to hurt ourselves psychologically?
We're masochists for chrissake!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
62c6a4 No.27829
>>27818
Why do people have such a hardon for scene graphs anyway?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
55552f No.29336
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
2d0684 No.34077
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
38051f No.34081
>>34077
So this is what the bookshelf of a nodev looks like.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
1ea551 No.34148
if you like the idea of making a game engine sure go for it, you'll learn a lot and if you manage something it will feel really rewarding.
Seems like you already know Casey. Most of the things you see in that stream is how actual engine programming looks like, so there's that. C is simply a better tool than modern c++ because it lets you manipulate memory as you please.
Whatever you do please don't try to do low level programming in modern c++, it's just not what it was made for.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
3a429a No.34190
>>27800
>apparently treating C++ like C#/Java is bad and using new/delete a lot is inefficient and dangerous
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
3a429a No.34191
>>34148
Like this anon says, only code an engine if you want to do it for fun. Coding your own engine is #1 cause of missing persons cases
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
577fe1 No.34193
You're best off learning general programming best practices. Not making problems unnecessarily localized is yet another lesson.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.