Among The Sleep

Seems like Kickstarter is just churning out hits lately, and this project could be the next success. It’s an original horror game where you play as a two year old boy. The early prototype videos look compelling, and I like that they are attempting a different theme with the title. Should be awesome, but they still have a ways before meeting their goal. So, if possible, please pledge your support for this game on Kickstarter. Also, rumor has it that the developers are interested in supporting the Oculus Rift. That would just be awesome if that happened. So, yeah, please back this project. Thanks.

With the first part of this series I have listed a few motivating reasons for developing a 3D game engine in the first place. In this next part I will go deeper into some of the research I have been doing for amassing the skills I feel are necessary to actually complete a project like this. As I have mentioned, one of the core reasons I am working on this engine is for knowledge building and personal development. Researching computer graphics plays a huge part in this. So I’d like to share some of the books I have been reading in the past year or so in preparation for creating my dream engine.

Real-Time Rendering

Real-Time Rendering, Third Edition (Tomas Akenine-Moller, et al): This is one of the best books I have read so far on real-time graphics for gaming. There are a lot of equations, but they are usually explained well. However, there is not a lot of code here to just straight copy-and-paste. It’s not a cookbook. It’s really more of a 1000 foot view of gaming and real-time technology. It talks about all the different lighting and shading models currently used, discusses texturing, collision detection, intersection methods, image-based effects, 3D math for gaming, etc. Really a great overview of the types of things a 3D engine has to handle. As mentioned, it’s not a cookbook. There is very little code, if at all. But I found this to give a helpful glance at a lot of topics of interest, of course with sources to find more detailed information. Highly recommended.

GamEngineArch

Game Engine Architecture (Jason Gregory): This is another amazing text. It talks about all the things that go into building a professional game and game engine. So 3D math is covered, as well as version control tools, fundamentals of coding in C++ (with cool tricks like memory alignment), main loops for rendering and game logic, debugging, character animation, collision and physics, and more. I found this book very insightful and actually made some of the topics listed a lot more understandable. I was especially surprised by some examples of main loops, as they were a lot more straight-forward than I previously thought. If you are attempting to code your own engine, this book should certainly be on the list.

Game Coding Complete

Game Coding Complete, Fourth Edition (Mike McShaffry): All I can say about this book is “Wow!”. There is an unbelievable amount of knowledge in these pages. This is the book I am currently reading, about 25% through so far, and I have already learned a bunch. This is another 1000 foot view, but they ground it with some really useful snippets of code. They give examples of different main/game loops, actor and component architecture, an event system, loading and caching resources, DirectX, scripting in LUA, collision, physics, creating an editor in C#, even network programming. This book is amazing! I’m not even finished yet and already I feel like I have learned so much. This is a must read.

3D Math Primer

3D Math Primer for Graphics and Game Development, 2nd Edition (Fletcher Dunn): I actually read the first edition, but I’m sure the updated text is just as good or better. It’s a book on 3D math for games. Certainly this is the type of book that’s great for foundation learning. Creating a good 3D engine will require a deep understanding of this type of math (mostly linear algebra) and this is a great book to get you started. Even though a lot of the equations are dense, I found the writing style to be approachable. It talks about all the stuff you would expect: vectors, matrices, orientation, transformations, etc. I would also recommend this book.

3D Game Programming

Introduction to 3D Game Programming with DirectX 11 (Frank Luna): This is one for my wishlist. I have read the older edition on DirectX 9.0c, but haven’t got around to this latest version. However, the series is one of the most recommended and highest rated books on the DirectX API. Luna’s writting style is very clear, and there is a lot of ground covered in the book. 3D math, drawing basic primatives,  texture mapping, lighting, shadowing, normal/parallax mapping, ambient occlusion, etc. I like the little things that make the demo apps very polished (like being able to switch between windowed and full-screen with the touch of a button). If you plan to use the DirectX API for your engine, then this book is an absolute must.

C++ Primer

C++ Primer (5th Edition) (Stanley B. Lippman): Although I have been learning and working with C++ for years, I read this book recently and ended up learning a lot. Keep in mind this book covers the new C++11 standard, though most of the discussion still applies to the previous standard. This is, hands down, the most comprehensive book I’ve seen on C++. Most books teach you the basics, but fail to explain the intricacies of the language. Not here. The author goes deep and shows you everything you need to know (and more). I also liked that he kept the code samples short and to the point. There is not even one sample that you are expected to type in and test. If there was, the book would probably be twice as long (and it’s already pretty long at 1000+ pages). Rather the author chose to highlight relevant structures and algorithms with as little code possible. I found this method to be very effective. If you are just starting out with C++ then I would recommend reading C++ Primer Plus first. However, if you already know some C++ and just want to brush up on your skills, this is a great resource.

Of course, I’m not going to list every book I’ve ever read on programming. These are just a few recent ones that I found useful. I will continue to post links to new books and other material that help me get closer to completing my 3D game engine. Even reading these books, there is still a lot of knowledge that can only be found by doing, and I hope future posts in this series will address that. After I get a better idea of the architecture of the engine, I can post some simple samples for review and for performance testing. Again, this is a learning process for me, so I would love to hear feedback from the community of this. Don’t be shy.

Unity 3x Essentials

I’ve been keeping tabs on Unity since back when it was a Mac only thing, and it sure has come a long way over the years. Even though I have downloaded and toyed with the program before, I hadn’t took the time to read a proper book on the engine. Now that I am having to work with Unity more for the job, I figured it was a good time to brush up on some knowledge. Although there are tons of Unity books out there, Unity 3.x Game Development Essentials seemed to have good reviews, and the price was right (only $16 for the Kindle e-book).

The book basically walks you through creating a dirt simple “game”, that you build up throughout the reading. Only the first chapter has a standalone demo to get your feet wet, the rest of the book is all one project. I found this format to work nicely, as you can concentrate on one aspect of the game design during each chapter but feel more accomplished as you built up the game. It covers creating a terrain, setting up a player controller, importing models, creating a GUI, collision detection, basic scripting to trigger events, and basically everything you would need for a simple demo. Although the game you build will not win any awards, it is functional and teaches some fundamental concepts.

What I will say is that the author did a bang-up job with the source code listings. There are tons of code snippets throughout the book and I found only one, yes one, mistake out of the whole thing. And, even then, it was a minor variable misnaming. Nothing major. This was a refreshing surprise, as many programming books are riddled with errors and non-compiling code. Bravo for that.

In general, though, I found this to be a very approachable book, even for a beginner. Of course, development experience doesn’t hurt, but it’s really not required for this text. The author clearly explains everything that is taught in the book and only at the end is some code glossed over (since it was already covered). I also liked how all the code is shown in both C# and Javascript, so the choice of language is up to the reader. Very nice.

The greatest part, I would say, is how far you can go with Unity itself in little time. I read this book in just one week and feel like I have covered more ground than I have with other engines spending *far* more time learning. So that just goes to show how solid the engine is. It’s not so much about the graphics of the engine, as it doesn’t really look any better than anything else out there. However the editor is very functional and very efficient. Especially nice is how you can create references to objects in the editor, greatly simplifying communication between different components. Overall I found it to be a great learning experience.

If you are just starting out with game development then this book is a great resource for learning the Unity engine. If you are already a developer but not familiar with Unity, this is also a great text. Granted, its not a very advanced book, so if you are already using Unity you can probably pass on it. That said, the book was very affordable and well worth the money in my opinion.

This is the first part in, what I hope to be, a long running series of articles about creating a 3D game engine. Just to be completely honest, I have never created a 3D engine before. Granted, I have worked on many games but usually in the casual and social space (read: 2D). However, I do have some years experience using other people’s 3D engines as a hobbyist. So I’m not a complete noob, far from it. But this is very much a learning process for me. I hope to detail this process, mistakes and all, in a series of articles. At the end, hopefully I will have a fully functional 3D game engine. In the process, I will log basically all the steps needed to create said engine. Maybe eventually these notes could be the basis of a book. Who knows? I think the information will be valuable, and I hope it will prove helpful to other people walking this path.

So the big question is: why would you want to create yet another 3D engine?

That is actually a good question. Before you embark on a (potentially long) journey of creating your own engine, you probably want a good reason to do so. There are tons of engines out there, some even free, and many of them will be suitable for a variety of projects. This is true. There is also the advice that says “make games, not engines.” This is also sound advice for most people. Especially if you are on a deadline from school or a client, it makes absolutely no sense to waste time building an engine. Just make the game, and finish the project. Get your grade, or get paid.

For me, however, I’d like to learn exactly what goes into a 3D engine, as I feel this knowledge will be very useful. Even if I, ultimately, end up using a pre-existing engine. So knowledge is a big part of this. I don’t mind if my engine takes years to complete. I don’t expect it to compete with the big commercial engines. I just want something I can use for my own little projects and demos, and that I have absolute full control over.

Another aspect is limitation with current options. Many of these “all-in-one” game engines will get you 90% of the way there but you will struggle and twist the engine to get that last 10%. In some cases, you will encounter show-stopping bugs that you just have no way of fixing without the source code. In other cases it just means you have to “dial back” your vision to get things working. Some engines have restrictive licenses, or complex revenue sharing models that I’d like to avoid. Some of them are just too darn expensive (I guess this is a financial limitation more than anything). Some 3D engines look great, at first, but don’t include the types of things you would need to complete a game (like a proper level editor). There are lots of reasons to be dissatisfied with the popular options out there.

More concretely, I’d like to explore how using virtual reality can aid in the game development process. So some features that I consider requirements simply aren’t available today. For example, full stereoscopic 3D rendering not only in-game, but also inside the editor. Supporting 6DOF (degrees of freedom) motion controllers to place and orient objects, again, in the editor. Intuitive 3D model editing and texturing, no external content creation tool needed. Motion capture tools built straight into the engine, so you could literally animate a character in real-time as you play the game and save those animations out. I know this all sounds very “blue sky” but these are things within the realm of possibility. I believe it can be done, and this is a motivating factor for me. Maybe your vision is different, but I think this series could be helpful none-the-less.

I’d really love feedback on how I’m doing, or topics that you might be interested to have me cover. Remember, this is as much a learning experience for me as it will be for you. Surely mistakes will be made, just post a comment and correct me, or post a fix for the problem. I really have high hopes for this series, and I want this to be as much of an interactive experience as possible. So keep reading, have fun, and let me know what you think. Thanks.

So I’ve decided to start blogging again! For any loyal readers, you might have noticed it’s been nearly 5 years since my last post. A lot has happened in that time, and I think I’m finally ready to grab the controls again.

This time I will be focusing more on my personal projects and general musings on topics of interest, and not so much trying to post about all the latest gadgets (though there might be some of that too). Mostly I want to focus on virtual reality and the related hardware and software needed to attain that dream.

I also hope to post source code and maybe some tutorials on 3D graphics and gaming and all that good stuff. Anyway, thanks for coming to my blog and don’t be afraid to comment if you have anything to share.