This workshop is intended to be a no frills primer on 3D Engine
Construction and Design. While this topic covers a vast number of
subjects, I am going to attempt to cut it down to the bare minimum so
that everyone will be on the same page as we start developing our own
game. While the techniques described here can be applied to any
language, graphics API, and pre-existing graphics engines it will be
constructed from the ground up using only C++ and the DirectX API.
Lemma 1.1 Engine
Throughout this workshop you will be presented with various lemma's
which are optional sections of reading. They are intended to give you a
better understanding of the topics discussed, and deal mostly in theory
and less implementation.
When I refer to the term engine it might seem confusing, as it has
multiple meanings depending on context. Many think of engine's as
/Graphic Engines/ such as Ogre3D or Irrlicht. However, an engine is
actually the framework of code that encapsulates a particular aspect of
a game. For example, we will also have /scripting engines/, /particle
engines/, /sound engines/ etc.
However, "engine" might also refer to the
code that connects all these specifics together into one cohesive /game
engine/. The Torque Engine is a good example of a game engine, as it
encapsulates graphics, physics, network, and more. This workshop deals,
more precisely, in game engines. But we also touch upon graphics engines
as a way to illustrate interconnectivity.
I will be writing this workshop aimed at people with a working knowledge
of some programming language, but I will not assume you are familiar
with C++ or DirectX. I do, however, expect anyone who is not completly
comfortable with C++ to work concurrently with Churroe's C++ workshop.
While specifically designed for programmers in the dev team, I hope that
any member can gloss through this workshop to get a basic idea of how
games in general are designed and structured for optimal performance.
What will we be doing, and what is the purpose?
Specifically, we will be constructing a very simple terrain loader,
using very basic 3d techniques to implement a custom camera class and a
very simple collision detection algorithm. I hope, however, that this
serves a larger purpose. My goal is to really explain how we, as
programmers, need to think ahead whenever implementing our own game
engine. We want to take advantage of the powerful OOP (object oriented
programming) aspects of C++ such as polymorphism and inheritance to
create robust and expandable code. I also hope to illustrate
encapsulation, reusability, modularity, and other concepts which are
important to help us all work together effectively on the same project.
Some less abstract milestones in this workshop I hope to include are the
following:
- Installing and configuring Microsoft Visual C++ Express and
DirectX 9.0.
- Building an Engine class shell which we will continually expand
upon throughout the workshop.
- Interfacing with the Windows API and touch upon some windows
specific topics like threading and processing.
- Covering basic 3D math concepts such as coordinate systems, vector
algebra, matrix math, quaternions, polygons, 3d spatial
transformations, etc.
- Getting a grasp of basic DirectX systems and operation through
vertex buffers, index buffers, meshes, etc.
- Learning basic 3D graphics techniques like culling, projection, etc.
I'll do my best to keep the pace depending on your feedback, so it's not
too slow and boring. (^_^);
Alright! I'm pumped, when do we start?
Right now! Lets dew eet. The first thing we want to do is get you all
setup in our IDE (Integrated Development Environment), which means
you're going to have to do some downloading. If you're on a 56k modem
you can start downloading and I'll let you know when you can get up to
make a sandwich ( or get in touch with your local broadband provider as
56k went extinct around the time of the wooly mammoth ).
First we'll be
grabbing our IDE Visual C++ Express edition from Microsoft. I chose this
for a few reasons. Firstly, it's free. Secondly, since I use Visual
Studio this lets me easily port over a lot of code. Don't worry though,
as throughout this workshop I'll be using the Express edition with you
guys (so you don't get weird compile errors or something). Thirdly,
it'll be good to have everyone on the same compiler that way we avoid
nasty hiccups like #2. And lastly, I'm comfortable with it. And since I
am going to have to answer any questions, it'll help.
So mosey on over to Microsoft's Visual C++ Express web page
And
click on the button in the upper right that says "Download". Scroll down
to the Visual C++ part and click ok. It'll download quick. Start the
setup. When you come to the screen asking if you want the MSDN I would
recommend it (even though it's like 300mb). It's basically the
documentation for the language. There is an online format so you don't
/have/ to download it. And if you're short on HD space you can feel safe
to skip it. Alone the IDE is about 70mb. Once you see it start
downloading / installing you can move on to the next step.