We found 47 Reddit comments about Game Engine Architecture. Here are the top ones, ranked by their Reddit score.
Hey! This is a really cool project idea, especially for a tutorial, but there are some things in the code that concern me.
Before I go any further, a disclaimer: You are not your code.
I work in the industry at a very big studio as a gameplay programmer, and there are a couple parts of this code that I saw right when opening the github that made me want to comment about code quality.
In Animated Sprite - you take in a file path and load an image directly from disk. This, on a large scale, will cause problems at load time. It could be ameliorated by doing all asset loading up front and maintaining a manager to dole out references to them in memory instead of from disk.
Secondly, Enemy inherits from Animated Sprite. This breaks a few rules, specifically the IS-A relationship in inheritance (also covariant problems. This is why the industry as a whole favors composition over inheritance. An enemy that is renderable might have a sprite to render with, but it wouldn’t BE a sprite.
There are other criticisms, but I’ll stop here. What I wanted to say was – Caveat Emptor. This is a fun project to learn what goes into a game, and no one here should quit based on these criticisms, especially if it inspires your passion. Rather, use this as an avenue to learn good software practices that can actually land you a gig in the industry.
A good resource for this project might be Game Programming Patterns or Game Engine Architecture.
Sorry if this came across offensive, but since this is r/learnprogramming, I figured it was a good chance to learn.
First of all, I wouldn't recommend learning game coding by looking at a codebase, the biggest reason being that all games are different and are using different techniques (obvious one being 2D vs 3D, but you have tons of differences between a FPS, a RTS, an open-world, etc).
I would recommend to find books or articles that explain why a certain technique is usefull, the coding language doesn't really matter, the technique itself is what is important (As you are saying it's for learning purposes and I don't think it's quite interesting to understand data-driven programming, cache optimization or 3D APIs optimization for C++ when you are first trying to understand a game structure).
I can recommend two really good books :
I've been working on games for quite a long while so I picked it up here and there.
I haven't gone through this particular series myself, but I've browsed through it and his (thebennybox - everything he makes is high quality) series on creating a software renderer, and they are fantastic!
This is by far my favorite book:
I'd recommend thebennybox's video series first, the book may not be quite as beginner-friendly.
First, I would buy
I find tutorials to be decent for learning how to perform simple tasks which don't require much variation or novel problem solving. As it turns out, making games is pretty much the exact opposite of that. I know from experience that it can be frustrating to find information on stuff like architecture and system design for games, but a lot of that is pretty much tribal knowledge, learned by professionals on the job or by hobbyists as they make projects.
I recommend reading articles on Gamasutra for more advanced topics, and I also recommend the book Game Engine Architecture by Jason Gregory. I think really the best thing you can do is try to do a more complicated project and as you run into problems you have trouble solving on your own, then research that specific topic. It's worth trying to solve the problem on your own first though, as while it may involve reinventing the wheel somewhat, it's also the best way to learn.
Might as well start this with a book for programmers despite not having fully read it but it has given me a lot of insight on many things about game engines and how things should be done.
Game Engine Architecture by Jason Gregory
> do I need to learn one of Unreal/Unity to work for a game company?
build something in C or C++ or even java
have you read this ?
have you learned opengl https://learnopengl.com/
have you read any of the books suggested here
are you familiar with the concepts here
you might want to consider watching his videos
^ those are all C++
or the first 43 videos of here
videos "Handmade Hero Day 001 - Setting Up the Windows Build" through "Handmade Hero Day 043 - The Equations of Motion"
^ those are all in C
the important thing is to just start making something
learn, develop skills, and build a portfolio
read the story of Stardew Valley
^ no unity, no unreal .. just a CS grad teaching himself to make games
I think Game Engine Architecture by Jason Gregory (Naughty Dogs Lead Programmer) is a really good book for Game Devs working in programming. Not sure how it compares to 3D Game engine Design since I haven't read that. But the book by Gregory is really good and covers a lot in depth.
You want example code? View the videos of the guy who rebuilt Cave Story (or at least parts of it, with a level editor, enemies, etc.). Or check out Handmade Hero. I think there's a Handmade Quake now, too. If you're really serious about game engine design, buy the book.
The reason I suggest other people's stuff is I spent a lot of time building code bases I called engines, not building actual games. I've made and published exactly one complete game that has about 10k views on Newgrounds.com right now.
There are better people to get advice on what to do right from. I'm a professional web developer now and know plenty about where I went wrong.
But I'll gladly chime in more advice if you're willing to hear it. I'd say the biggest difficulty people have when writing any complex code (whether it's games, infrastructure systems or business applications) is you reach a certain point where knowing how to code isn't enough. You have to know how to think critically about problems. That goes back to the problem space vs solution space ways of seeing things, which isn't really taught in school.
Games are a really difficult problem, that also have really difficult solutions. If you just straight into the solution space (let me start coding modules, oh, I probably need something that renders fonts at angles, etc. etc.) you're not going to get anywhere. In order to build complex things like games, you have to get better at programming for sure in order to make so many things work together, but unless you get really good at figuring out your problem space - what exactly it is you're trying to actually solve -you're going to waste a lot of code and time.
And that's one reason most people suggest you start very small. You should be able to code something like Pong in less than a day, probably less than an hour for sure. Even something like Extreme Pong should be mostly easy for you to churn out. But many people struggle with that.
As an aside, I will say that writing a library to perform easings made my life a lot easier. A lot of what takes place in a game can be considered an "tweening animation" of a value from one state to another.
I used those for in-game animations, to stretch and skew objects, etc. but that's often more about bringing out the flavour of a game as opposed to the core mechanics. (Like you want an object that falls, but falls violently and shakes when it hits the ground? Chances are that doesn't make a ton of sense from a physics standpoint, so you have to script it. Easings would be one way to script the y-axis value to mimic that behavior.)
Thanks for the book link. He is also coming out with a 2nd edition in July this year.
As for them not having producers with strictly that job title, I recall a story by a Naughty Dog programmer that he observed one of the senior programming leads working on some basic user interface code close to the game's shipping deadline. He was surprised at the time that the lead was writing code that would typically be done by a junior programmer at other companies. He told the story to illustrate that the idea of doing whatever grunt work it takes to ship a title and a feeling of responsibility for a feature from start to finish is pervasive at Naughty Dog. Jason Gregory also said that you can look at it as them having more producers than any other company, rather than none, since everyone shares the responsibility.
In a similar vein, Valve is famous for having a relatively flat structure with no managers.
Of course, every company is different and Naughty Dog's approach is not necessarily superior. They can get away with it because they hire high caliber employees. What works for them may not work for most.
[Game Engine Architecture] (https://www.amazon.com/Engine-Architecture-Second-Jason-Gregory/dp/1466560010) is pretty good, and has C++ code in it (I think)!
I can only think about "Game Engine Architecture Second Edition" by Jason Gregory Lead programmer at Naughty Dog :
If you don't mind reading or shelling out a bit of money, Game Engine Architecture is still a great resource
I'll start off with some titles that might not be so apparent:
These 2 books provide much needed information about making reusable patterns and objects. These are life saving things! They are not language dependent. You need to know how to do these patterns, and it shouldn't be too hard to figure out how to implement them in your chosen language.
That's a fantastic book! And, he just recently released a new version.
Get this book, it covers everything you want to know.
A huge and detailed, but very good video series of an entire game engine and game is Handmade Hero.
I've heard the book Game Engine Architecture on a few lists as being good.
As always one of the most recommended books will help you: Game Engine Architecture by Jason Gregory It does require some programming knowledge however, but it will show you the inner workings of an engine and how they are made.
I sugget to take a look at [this book] (https://www.amazon.com/Engine-Architecture-Second-Jason-Gregory/dp/1466560010/ref=sr_1_3?s=books&amp;ie=UTF8&amp;qid=1517561114&amp;sr=1-3&amp;keywords=game+engine&amp;dpID=51P2wXledgL&amp;preST=_SY291_BO1,204,203,200_QL40_&amp;dpSrc=srch)
Also, you can look (for example) [here] (https://docs.unrealengine.com/latest/INT/Engine/) to get familiar with engine subsystems.
Hope that helps
For anybody interested in a discussion on the modern usage of Quaternions with respect to game development, see Jason Gregory's Game Engine Architecture.
Writing an engine isn't a trivial task. I don't mean to put you down or make you feel bad but it kind of sounds like you don't totally understand what a game engine does.
If you do want to write an engine, I would suggest starting with the renderer and expanding your understanding from there. The features of your engine depend upon what kind of game features you want to support. Particles? Visual effects? 3D sounds? Dynamic Resource management? and all of that behind the gameplay code.
Just get a square to show up on the screen. While you're working on that, check out a few books on game engine programming. There are a ton on amazon. This one is really good:
If you need some more help getting started let me know! Engine programming is fun and rewarding but building one from scratch can be a monumental task.
If you're planning on pursuing this as a career, there are tons of incredible opportunities for people experienced with lower-level 3D APIs. Making your own engine serves as a fantastic learning experience, and would be a huge investment in your future.
Below are some of my favorite books/resources right now that may help you along the way. These might not be immediately useful to you right now, depending on where you're at, but together they have more than enough knowledge for you to go far in 3D Computer Graphics.
For OpenGL stuff, check out Anton Gerdelan's tutorials and open.gl.
For some general game design books, I may recommend:
Unity is the bee's knees.
I've been messing with it casually for several years, and got serious in the last 2-ish years. I like it because I get to use C#, and that's the language I know best. Only problem in it's using some weird limbo version of .NET 2, that's not actually 2.0 but is also 3.0 is some places? I think it's because it's using Mono 2.0, which is some subset of .NET. It's weird. They're moving to 4.5 soon anyways so I'm hype for that. I'ts been a lot of fun regardless, I get to apply a different knowledge and tool set from my day job. Not to mention it feels great when you actually get something to build and actually work.
So anyways here's a list of resources I've found over the years to be super helpful:
Things on Reddit
I am a game engine programmer in the industry right now, do C++ and pick up Game Engine Architecture for a nice overview of many of the core subsystems of an engine. Java is a cake walk post C++, and still a worthy language - just not the industry standard.
Consoles and PCs are more alike than ever, but it's still not close enough. For example, the unified memory architecture (with the onion and garlic buses) means that somebody programming on PC versus Xbone/PS4 means that they need to think differently.
> They are also on the same x86 Architecture as modern PC Gaming has been.
100% irrelevant and shows you don't really know what a programmer is doing when they are writing code. We don't use assembly language any more.
Source: I do programming and have read this (brilliant!) book: http://www.amazon.co.uk/Game-Engine-Architecture-Second-Edition/dp/1466560010
I ordered these for our company library, based on recommendations for/from other programmers (of all levels).
ISBN | Title
978-1568814247 | Real-time Rendering
0321486811 | Compilers: Principles, Techniques, and Tools (2nd Edition)
1482250926 or 0123742978 | Essential Mathematics for Games and Interactive Applications, Third Edition 3rd Edition
978-1482264616 | GPU Pro 6: Advanced Rendering Techniques
1466560010 | Game Engine Architecture, Second Edition
978-1482243567 | Multithreading for Visual Effects
978-0123750792 | Physically Based Rendering: From Theory To Implementation
Read books, read through repos on github, and most importantly: write your own!
I recommend Game Engine Architecture if you want a very broad but extremely useful reference guide.
Books. Game Engine Architecture, for example.
"Game Engine Architecture"
and "Game Programming Patterns"
come to my mind.
Hey! I'm doing the game design focus and have / am working at some indie studios.
The focus isn't nearly enough to get a job in the industry, you need to teach yourself a lot more.
What kind of games? Mobile games? Browser games? Desktop/console games?
If you're into building games entirely from the scratch and have it run on desktops and mobile devices, I'd suggest trying out the SFML framework (C++). They have some nice tutorials on their GitHub Wiki
Keep in mind that those are just the basics. If you prefer some more comprehensive literature, I'd recommend the following books:
Game Coding Complete
Game Programming Patterns
Game Engine Architecture
I agree with your sentiments that game programming in Rust is new, so it may slow me down. But I' am in no rush to put out a game. I'd be very interested in really getting to know how game engines work; even bought a book. I' am also interested in learning Rust for its potential utility in my job anyway.
>Game Engine Architecture, vol 2
Fuuuck that's a pricey book
Maybe this book might help you with the essentials: http://www.amazon.com/Game-Engine-Architecture-Second-Edition/dp/1466560010
So Game Engine Architecture looks pretty good, although it looks like it is for 3d game programming. Is there something like that, but for 2d game programming?
I'll take a look at them. Thank you :)
EDIT: Are you referring to this one and you probably mean Game Coding Complete ?
Well if you want to be the next Carmack, get cracking! :) You have a lot of ground to cover, such as: mathematics (matrices, linear algebra, etc), physics, artificial intelligence, real-time processing, multithreading, architecture, networking and protocols, rendering, sound, and much more!
It is certainly possible with enough time and dedication to develop your own engine. It's just that there are so many excellent engines already out there, that you would be competing with projects that have already invested many thousands of hours and have loads of titles already developed for them. Why not get involved with an existing project to start?
BTW I really like your idea of creating a FPS with one room and focusing on making that environment the richest possible, exploiting a wide variety of techniques. Do it!!
Is your ultimate goal to create an engine? Or to create a game? Remember, the engine is in many ways a means to an end - it's not much use without a game that uses it!
Either way, I think you would be well advised to get involved with one of the open source game engine projects, and start contributing. Once you've learned how they work, you will be in a much better position to design your own. And realistically, you can't really just design an engine without a game - you need to know how games work in the first place, and what features and architectural decisions and designs make for a good engine.
For programming, what kind of programming is he into? Here are some cool programming books and things:
Read game engine architecture
3D Math Primer
Game Engine Architecture
I'd like to recommend these two.
Based on the roadmap link posted elsewhere in the thread:
From personal knowledge, I'd also check out Udacity's course:
and maybe Coursera's (personally did not care for it, but might as well list it):
As for architecture, I haven't really seen any great lectures on doing this. I'd recommend checking out the book of the same name to get a high level overview of the features larger engines consider, and perhaps check out the source of some larger engines to get the best idea.
I'd recommend this book, though if new to coding it may be a bit overwhelming https://www.amazon.com/Engine-Architecture-Second-Jason-Gregory/dp/1466560010/ref=pd_lpo_sbs_14_t_0?_encoding=UTF8&amp;psc=1&amp;refRID=NC95XNX16602MDF2SG80
Hey Big_cow, congrats on your new job - I envy you and hope to join you shortly, as I am currently on a similar path (26, currently not in the industry but working my way in - started about 3-4 months ago).
I have a question/request for advice: I'm a non-gaming software engineer (around 3 years experience, currently doing DevOps at a healthcare-IT startup; no college degree). My current trajectory/plan is to write a few (3-4) games of varying levels of completion (some just for learning, maybe one as the "crown jewel" of my portfolio) with Unity and Unreal, and a game engine (not on par with Unity or Unreal, but one that fundamentally handles the basic functionality like rendering, physics, and AI to the extent that I could write a simple platformer or shooter game to prove it works - I'm currently working my way through this book), then try my luck in the industry.
Do you think that me already having experience programming will make a big difference? I see other game programmers like John Carmack, the Eidos folks who wrote Deus Ex: Mankind Divided, or the GTA V team and feel absolutely intimidated. Do you think I'm in for a serious struggle in terms of finding a job?
Since some other people are trying to be cute, start with this wikipedia page here: https://en.wikipedia.org/wiki/Software_design .
I don't know of any online tutorials for the process of game development, but I am aware of a book named Software Engineering for Game Developers which goes over the process, step-by-step, of designing, outlining, and implementing the software part of a game. Note that this is one of the most dry, boring books on games I have ever read, but it's not about game design, it's about game development, and outlining software requirements is not a topic many people get excited about.
Basically, they go through the process of creating a requirements document which is a glorified to-do list of everything that the game needs to do, dividing those specific requirements into "stripes" which are different levels of completeness of your game, and then from there deciding on the best way to chop up the concepts into objects. The book is a monster 1000 page beast, but if you're serious about needing a step-by-step process, you won't get better than this.
My suggestion (if you don't purchase or, ah, otherwise obtain a pdf of the book) would be to simply start with this glorified To-do list that lists every feature your program should have in version 1. Then write up all the subfeatures that those features will require. Then divide all these items into groups where it makes sense and make each group an object (or object hierarchy). Do some research and see what parts might already exist, such as rendering, graphing, input, GUI, or serialization libraries, and incorporate them into the design. If you don't know what, exactly, goes into a game, try looking up a book such as Game Engine Architecture which will outline all the different parts that a game engine needs.
Then write the program.
Note where your design was insufficient or flawed, and don't worry about keeping the list intact--add or remove items as needed. Wash, rinse, repeat: the more you practice this on new programs, the easier it will be as you gain experience with what needs to be written out and what can be ad-libbed. The more advanced tools (such as UML et al) will be useful later, when you have more complex projects with more moving parts, that need to be explained to other programmers.
Until then just stick with lists.
Here you go.
I should have said "basic" instead of "simple." As in this is a fundamental thing your game engine should be capable of. It is simple in that it's not a unique problem, it has been solved before and there's no reason you would have to reinvent the wheel here.