Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
1. September 2013

 

One of the oldest and most popular articles on my site is I want to be a game developer… now what?  It offers a collection of advice for new game developers.  I keep intending to update it but frankly, not enough changed.  The following was recently posted on GameDev.net:

 

https://www.gamefromscratch.com/post/2011/08/04/I-want-to-be-a-game-developer.aspx
This article was written 2 years ago, and is very informative about each game development language, but 2 years sounds like too much for how events quickly change now, XNA is partially dead, more books released, etc..

Is there a newer article of that kind of information? and is C++ still a bad choice (with the introduction of SFML 2.1 and SDL 2)?

 

Which got me to thinking about what all has changed since I wrote that guide.  The following was my answer.  Of course, I have no idea how many thousands of things I forgot to mention.  All told, the world hasn’t changed all that much, languages don’t really move all that fast.

 

Truth is, I keep meaning to update it, then look at the state of the game development world and there hasn't really been enough changes.  I will be doing a v2 eventually, but in summary, here is what's changed since the article was written:

C++

-----------------------------------------------------------------------------

SFML 2/2.1 released.  Frankly it's not all that different.

SDL 2 was released.  Again, not massive changes.

Gameplay3D engine released  Site Link My Look

Hands down the biggest change to C++ ( and over the last two years ) was the release of C++11.  This completely changes the C++ book recommendations.  C++ changes a lot about the language, especially how it should be taught.  Some books did a horrid job updating to the new standard ( just bolting on the new features ), while others did a better (less lazy) job.  I will probably do a post specifically about C++11 books at some point in the future.

C#

-------------------------------------------------------------------------

XNA was put out to pasture by Microsoft.  Fortunately, Monogame also got a lot better.  XNA is still an option, just not as good of one as it used to be.

PlayStation Mobile was released and C# based.  SDK Link (My Tutorials)

Unity 3D is now free.

Mono for iOS and Android 100$ cheaper

C# 5 released.  Outside of parallel programming functionality (async), not much changed.  Nowhere near the change of C++ for example.

Java

-------------------------------------------------------------------------

Slick2D is dead or abandoned.

Java took a few hits in terms of deployment due to security concerns ( Apple yanked it for example ).

LibGDX is probably the strongest option in Java now.

Don't believe there were any major language updates ( 1.7 then and now ), just service releases.

Python

-------------------------------------------------------------------------

Um.... anything?

Otherwise there would be a few things I would mention that weren't as relevant 2 years ago.

Misc

---------------------------------------------------------------------

Rise of the Lua game engines.  Add Dreemchest to that list as well.

In the mobile space, Lua just simply put got big.  Lua is also the scripting engine of choice for CryEngine, Gameplay and Project Anarchy.  Lua is a very very very good starting point for people looking to just start out.  Corona is now available free and at the same time, is more expensive...

HTML5 got a little bit more viable ( but still limited ) Flash suffered some major blows ( but still viable ).  There are now a number of solutions that make appifying HTML5 applications possible, such as CocoonJS.  Tons of libraries exist for HTML5 game development..

Previously niche/limited game maker software ( GameMaker, Construct2 ), as well as cross platform tools like Haxe (tutorial series) or LoomScript ( my look ) have made cross platform game development a hell of a lot easier.

The 3D engine space saw a bit more activity.  As mentioned earlier, RIM released GamePlay3D.  On top of that Torque was released for free, CryEngine leaked it's developer information in a hack attempt... ( thanks for that btw... :( ) and Project Anarchy (my look) was announced and released.  Project Anarchy is a bundle of Havok's game developer technology released completely free for mobile development.  On the 3D game engine space the story is Unity Unity and Unity.  Frankly Unity had a good year, made partnerships with pretty much every single platform available and is available in a free version for pretty much every platform now.

Grand total, not all that much happened, not really enough to full write a v2 version, hands down the biggest changes in the last two years:

C++ 11

XNA killed

Unity took over the world.

I miss anything?

 

Anything else I missed in the last two years of game development?

Programming


27. August 2013

 

YoYoGames have released update 1.2 for their popular GameMaker cross platform 2D game engine, which was used to make such titles as Hotline Miami and gamemakerlogoHome.  Included in this update is one pretty bold claim…  New YoYo compiler runs projects up to 100x fasterI!  That’s a pretty big claim, and I have to say… if you’ve got room for a hundred fold improvement in speed… you had some pretty serious issues before hand!

 

 

Anyways, here is more information from the release:

 

 

  • New YoYo Compiler Runs Projects Up to 100x Faster
  • New Shader Support Allows Creation and Cross-Platform Publishing of Shaders

 

YoYo Games today announces the general availability of GameMaker: Studio version 1.2. With today’s update, developers will be able to harness the full speed of the CPU with the new YoYo Compiler, allowing projects to run up to 100x faster across all native platforms supported. Fully-integrated, totally cross platform Shader support allows developers to write shaders once and then deploy them across all platforms that support them.

 

"Today’s update raises the bar in the visual quality and the complexity of games that can be made in GameMaker: Studio,” said Russell Kay, chief technology officer at YoYo Games. “Our goal with today’s update and all future enhancements to GameMaker: Studio is that the imagination be the limiting factor in the game development process, not the technology.”

The YoYo Compiler

The YoYo Compiler unlocks new possibilities in CPU-intensive areas such as artificial intelligence, procedural techniques, real time lighting, enhanced physics, real time geometry deformation, collision and data manipulation, immensely raising the quality bar. The YoYo Compiler is free for customers of GameMaker: Studio Master Collection and is otherwise available as an add-on priced at $299.

Cross Platform Shader Support

Fully integrated, totally cross platform shader support allows full access to low level shaders, while still letting GameMaker: Studio do the heavy lifting. The built-in editor has been extended to have full color syntax highlighting and “intellisense” for shaders, making creation a breeze.

 

The rapid adoption of GameMaker: Studio as the preferred 2D games development framework has exceeded YoYo Games’ expectations. Today, GameMaker: Studio has been downloaded more than one million times and is quickly approaching 20,000 daily active users. To learn more about the GameMaker: Studio family of products and to get GameMaker: Studio version 1.2, please visit www.yoyogames.com.

 

Certainly an important release for GameMaker developers.

News


13. August 2013
SDL_logo

 

If you thought SFML took a long time to reach 2.0 you’ve not seen nothing yet!  Today SDL 2 was finally released, after being in development for about a decade.  If you have never heard of it before, SDL is a cross platform game development library that gives access to graphics via OpenGL or DirectX, as well as low level access to audio, keyboard, mouse and joystick.  It is written in C, works in C++ and has bindings for about every language ever invented.

 

 

 

 

Here is the list of major new features:

   - Full 3D hardware acceleration
   - Support for OpenGL 3.0+ in various profiles (core, compatibility,
   debug, robust, etc)
   - Support for OpenGL ES
   - Support for multiple windows
   - Support for multiple displays
   - Support for multiple audio devices
   - Android and iOS support
   - Simple 2D rendering API that can use Direct3D, OpenGL, OpenGL ES, or
   software rendering behind the scenes
   - Force Feedback available on Windows, Mac OS X and Linux
   - XInput and XAudio2 support for Windows
   - Atomic operations
   - Power management (exposes battery life remaining, etc)
   - Shaped windows
   - 32-bit audio (int and float)
   - Simplified Game Controller API (the Joystick API is still here, too!)
   - Touch support (multitouch, gestures, etc)
   - Better fullscreen support
   - Better keyboard support (scancodes vs keycodes, etc).
   - Message boxes
   - Clipboard support
   - Basic Drag'n'Drop support
   - Proper unicode input and IME support
   - A really powerful assert macro
   - Lots of old annoyances from 1.2 are gone
   - Many other things!

 

Android and iOS support is pretty huge, as of course is full 3D hardware acceleration.  You can read the full announcement here.

 

One other major change with the move to 2.0 is the switch from the GNU GPL license to the much more friendly zlib license.  This means you can now statically link to SDL.

 

You can download SDL here.

News


12. August 2013

 

So today on Safari Books Online came a book that was a complete flash from my past.  Computer Graphics: Principles and Practices 3rd edition has been released.  What’s so special about this book?

cgpap3

Three things… 

 

First, it was the textbook I used to learn computer graphics a very long time ago.

Second, it was one of the only ( incredibly expensive ) books I had to purchase for school that I actually found valuable.  ( Code Complete was the other book, if you were curious )

Third, it’s one of the only dead tree books I have kept.  I am almost entirely digital these days, so you have to be a good book for me to keep you around, especially given the size of a few of the condos I’ve moved into over time, I’ve gone through a lot of book purges!  When you consider how incredibly out-dated it had become, the world of graphics has changed a great deal since the second edition of the book was released in 1990!  On top of that, all of the code examples where in Pascal, using a library I’d never heard of at the time, or used since.

 

Fortunately with the release of the 3rd edition, I now have one less piece of dead tree fighting for space in my house!  There are a few things to know about this book, it’s has no code for OpenGL or Direct3D, it’s not really about that.  The book actually uses WPF for it’s examples, but don’t worry, the concepts are easily applied elsewhere. The entire point of this book is to teach graphics programming concepts, not really about the implementation.  If you don’t already know one of those APIs, you are going to want to pick up an additional book on your graphics library of choice ( if needed. )  That said, this will make you **understand** what you are doing with either of those graphics libraries.  You will find when reading this book, it doesn’t really matter what programming languages or library you use, you will be able to digest and adapt to your tools of choice without a lot of effort.  This book has been almost completely re-written at this point, and does cover the modern graphics pipeline.

 

What does it cover?  Well, just about everything actually.  That’s why I kept it around all these years.  For example, here is the Table of Contents:

  1. Introduction
  2. Introduction to 2D Graphics Using WPF
  3. An Ancient Renderer Made Modern
  4. A 2D Graphics Test Bed
  5. An Introduction to Human Visual Perception
  6. Introduction to Fixed-Function 3D Graphics and Hierarchical Modeling
  7. Essential Mathematics and the Geometry of 2-Space and 3-Space
  8. A Simple Way to Describe Shape in 2D and 3D
  9. Functions on Meshes
  10. Transformations in Two Dimensions
  11. Transformations in Three Dimensions
  12. A 2D and 3D Transformation Library for Graphics
  13. Camera Specifications and Transformations
  14. Standard Approximations and Representations
  15. Ray Casting and Rasterizations
  16. Survey of Real-Time 3D Graphics Platforms
  17. Image Representation and Manipulation
  18. Images and Signal Processing
  19. Enlarging and Shrinking Images
  20. Textures and Texture Mapping
  21. Interaction Techniques
  22. Splines and Subdivision Curves
  23. Splines and Subdivision Surfaces
  24. Implicit Representations of Shape
  25. Meshes
  26. Light
  27. Materials and Scattering
  28. Color
  29. Light Transport
  30. Probability and Monte Carlo Integration
  31. Computing Solutions to the Rendering Equation: Theoretical Approaches
  32. Rendering in Practice
  33. Shaders
  34. Expressive Rendering
  35. Motion
  36. Visibility Determination
  37. Spatial Data Structures
  38. Modern Graphics Hardware

 

… so as you may be able to tell, this isn’t a short book.  In fact it’s 1264 pages in length, which would be why this isn’t a proper review, I am not done the book.  In fact, it’s one of those book I will probably never read entirely front to back.  Instead I jump in to the areas I need, unless of course I struggle with the concepts being taught, then I tend to read the entire chapter until I’ve gotten the subject down.  Of course, I read chapters from time to time just for something to do.

 

That’s another great part of this book.  I am no math wiz, I have forgotten far too much, so with many pure math texts I struggle.  This is why this book is very good.  It’s not simple by any means, but it doesn’t just throw an equation at you and leave you scratching your head.  Things are introduced in escalating difficulty, but if you have a late high school or first year university math education, you should be OK.

 

The math is fully explained over the course of the book.  If you have trouble parsing out equations, they are explained fairly well in the book including how to decipher them.   The book doesn’t magically make math easy, but it does do an effective job of explaining it, so that even a non-genius can make sense of things.  Here for example is the excerpt on Euler Angles, and is typical of how things are explained:

 

Example taken from book:


 

11.2.2. Euler Angles

Euler angles are a mechanism for creating a rotation through a sequence of three simpler rotations (called roll, pitch, and yaw). This decomposition into three simpler rotations can be done in several ways (yaw first, roll first, etc.); unfortunately, just about every possible way is used in some discipline. You’ll need to get used to the idea that there’s no single correct definition of Euler angles.

The most commonly used definition in graphics describes a rotation by Euler angles (φ, θ, ψ) as a product of three rotations. The matrix M for the rotation is therefore a product of three others:

1

Thus, objects are first rotated by angle φ in the xy-plane, then by angle θ in the zx-plane, and then by angle ψ in the yz-plane. The number φ is called pitch, θ is called yaw, and ψ is called roll. If you imagine yourself flying in an airplane (see Figure 11.1) along the x-axis (with the y-axis pointing upward) there are three direction changes you can make: Turning left or right is called yawing,pointing up or down is called pitching, and rotating about the direction of travel is called rolling.These three are independent in the sense that you can apply any one without the others. You can, of course, also apply them in sequence.

jet

 

Figure 11.1: An airplane that flies along the x-axis can change direction by turning to the left or right (yawing), pointing up or down (pitching), or simply spinning about its axis (rolling).

Writing this out in matrices, we have

2

3

With the proper choice of φ, θ, and ψ, such products represent all possible rotations. To see this, we’ll show how to find φ, θ, and ψ from a rotation matrix M. In other words, having shown how to convert a (φ, θ, ψ) triple to a matrix, we’ll show how to convert a matrix M to a triple (φ′, θ′, ψ′), a triple with the property that if we convert it to a matrix, we’ll get M.

The (1, 3) entry of M, according to Equation 11.14, must be sin θ, so θ is just the arcsine of this entry; the number thus computed will have a non-negative cosine. When cos θ ≠ = 0, the (1, 1) and (1, 2) entries of M are positive multiples of cos φ and – sin φ by the same multiplier; that means φ = atan2(–m21, m11). We can similarly compute ψ from the last entries in the second and third rows. In the case where cos θ = 0, the angles φ and ψ are not unique (much as the longitude of the North Pole is not unique). But if we pick φ = 0, we can use the lower-left corner and atan2 to compute a value for ψ. The code is given in Listing 11.1, where we are assuming the existence of a 3 × 3 matrix class, Mat33, which uses zero-based indexing. The angles returned are in radians, not degrees.

Listing 11.1: Code to convert a rotation matrix to a set of Euler angles.


  1  void EulerFromRot(Mat33 m, out double psi,
  2                             out double theta,
  3                             out double phi)
  4   {
  5    theta = Math.asin(m[0,2]) 
//using C# 0-based indexing!
  6    double costheta = Math.cos(th);
  7    if (Math.abs(costheta) == 0){
  8       phi = 0;
  9       psi = Math.atan2(m[2,1], m[1,1]);
10    }
11    else
12    {
13       phi = atan2(-m[0,1], m[0,0]);
14       psi = atan2(-m[1,2], m[2,2]);
15    }
16
  }


It remains to verify that the values of θ, φ, and ψ determined produce matrices which, when multiplied together, really do produce the given rotation matrix M, but this is a straightforward computation.


Inline Exercise 11.3:

Write a short program that creates a rotation matrix from Rodrigues’ formula (Equation 11.17 below) and computes from it the three Euler angles. Then use Equation 11.14 to build a matrix from these three angles, and confirm that it is, in fact, your original matrix. Use a random unit direction vector and rotation amount in Rodrigues’ formula.


Aside from the special case where cos θ = 0 in the code above, we have a one-to-one mapping from rotations to (θ, φ, ψ) triples with –π/2 < θ ≤ π/2 and –π < φ, ψ ≤ π. Thus, the set of rotations in 3-space is three-dimensional.

In general, you can imagine controlling the attitude of an object by specifying a rotation using θ, φ, and ψ. If you change any one of them, the rotation matrix changes a little, so you have a way of maneuvering around in SO(3). The cos θ = 0 situation is tricky, though. If θ = π/2, for instance, we find that multiple (φ, ψ) pairs give the same result; varying φ and ψ turns out to not produce independent changes in the attitude of the object. This phenomenon, in various forms, is called gimbal lock, and is one reason that Euler angles are not considered an ideal way to characterize rotations.

 



If you can make sense of the above, you will be good with this book.  This sample is pretty typical of how things in this book are covered.  So if you are looking for a text for learning or brushing up on computer graphics Computer Graphics: Principles and Practices is probably one of the best.  With the exception of Physics, and library specific instructions, this book has pretty much everything you might need to know.

General Programming


30. June 2013

 

Some time back I purchased Codea for my iPad.  Codea is a Lua based game programming kit for creating iOS games on the iPad and frankly it’s really kinda cool.  That said, actually typing code on the device is a bit of a pain, so I looked coming up with an alternative.  It worked, but it certainly wasn’t ideal.  Today I was on the AppStore and I noticed Codea had an update and added something called Air Code, which allows you to connect to Codea using your web browser.

 

Using Air Code is really easy, in Codea on your iPad, open the side menu and select AirCode:

1

 

Then it will tell you the address to open in your browser.  Your computer and iPad need to be on the same network for this to work:

2

 

Open that address in your desktop browser and a list of your available projects will be displayed:

image

 

You then select the code file to edit and the editor appears:

image

 

As you code in the browser, it updates live on the iPad:

3

 

That is very very very cool.

Right now the editing functionality in the browser is quite limited.  It’s basically a text editor only now.  Hopefully in the future they add intellisense support and possibly debugging.  This is a very nice start though, and easily gets around the lack of keyboard support.  Nicely, this process doesn’t require a Mac either, any web browser should work fine.  Coding on one screen and seeing the changes reflect live on the other is actually a very intuitive way to code.

I did run into a small bug, in that focusing away from Codea to check email, when returning I could no longer connect via browser.  Shutting down and restarted Codea fixed the problem.

So, if you have an iPad and another PC and want to create games, Codea is a very cool product and worth checking out!

Programming News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List