Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
21. August 2011


When just starting out with Blender, figuring your way around the UI is probably the most difficult step.  One of the most difficult things to come to terms with is creating and closing windows.  This is something that changed massively from Blender 2.4 to 2.5, so a lot of the documentation out there is simply out dated.


This video shows you how to arrange Blender exactly how you want it.  Once you figure out the way things work, it is amazingly power, but it can be confusing at first.  The video is of Blender 2.59 and is shot at 1080p for maximum clarity.



Customizing Blender 2.59’s User Interface

EDIT (8/25/2011): Click here for Vimeo video.


17. August 2011

I’ve been a little to focused on C++ I completely missed and forgot to mention that a new release of Blender, Blender 2.59 was release (*cough* 3 days ago *cough*). A ton of new bug fixes, include one specifically for exporting to Unity, have been addressed.  Additionally added support for 3D Mouse(s?), Custom Keymapping, an Ivy and Tree generator.


Click here to download now.


I will check shortly to see if it works “out of the box” with Unity.


EDIT: 8/17/2011  Nope, default export didn’t work.  Can’t say I’m shocked.

EDIT2: User woodn has provided an updated importer script.  Download it, extract the .py file and extract it to your Unity install directory /Editor/Tools folder, overwriting the existing importer.

After updating the import script it would successfully import dae files, but wouldn’t automatically process .blend files, at least for me.


16. August 2011


Well if you are a student that is, yes!  Autodesk has made an absolute ton of their programs available on a 36 month license for students.  That said, there is a very big but… and we will get to it in a moment.  First off, here are the applications they made available:


AutoCAD® for Mac
AutoCAD® Civil 3D®
AutoCAD® Electrical
Autodesk® Alias® Design
Autodesk® Alias® Automotive**
Autodesk® Ecotect® Analysis
Autodesk® Inventor® Professional
Autodesk® Maya®

Autodesk® Moldflow® Adviser
Autodesk® Mudbox™
Autodesk® Revit® Architecture
Autodesk® Revit® MEP
Autodesk® Revit® Structure
Autodesk® Simulation Multiphysics 
Autodesk® Smoke®
Autodesk® Softimage®
Autodesk® 3ds Max®

That is a pretty awesome list and making them available to students for free is an absolutely brilliant idea for locking in future users down the road.  Now here are the buts…


If you are creating a game, you are violating the license.  This license is explicitly for personal learning.  The personal part even excludes use in a lab or classroom environments, however more to the point, if you want to use the software to work on a game that is going to be distributed ( even freely ) you are violating the license!  If you use the software to create graphics for a website, you are violating the license.  In a nutshell, legally, you can only use the software to learn or post your works to Autodesk’s community.  Now posting your work to a 3rd party like DeviantArt for non-commercial gain, I do not know the legal status of that.


As to who qualifies as a student, I will let Autodesk themselves answer that.


A faculty member is an employee at a primary or secondary educational institution or any degree-granting or certificate-granting educational institution or any learning, teaching or training facilities and who upon request by Autodesk is able to provide proof of such status.

A student is an individual enrolled at a recognized degree-granting or certificate-granting educational institution for three (3) or more credit hours in a degree-granting or certificate granting education program or in a nine (9) month or longer certificate program, and upon request by Autodesk is able to provide proof of such enrollment.

An Autodesk Assistance Program participant is either a veteran or unemployed individual who has previously worked in the architecture, engineering, design or manufacturing industries, completed the online registration for the Autodesk Assistance Program, and upon request by Autodesk is able to provide proof of eligibility for that program.



So if you are thinking the cost of your game just went way down because you are a student, you are completely wrong.  However, if you wanted easy free access to learn and evaluate various Autodesk products, you will love this opportunity.

15. August 2011


This began life as a post here but it became long enough and IMHO important enough, I am going to clean up the spelling a bit and repost it here.  It was in response to a fairly new developer with a question about class design.



This is one of those things that is nearly impossible to explain in a post, or hell, short of a small book.

But generally ( and yes, there are exceptions, thousands and thousands of exceptions ) you want to decouple your objects from each other as greatly as possible. You also want to keep code as self contained as possible, again, with thousands of exceptions.


A lot of the time when you are designing your classes ask yourself "If I changed this class, how many other aspects would need to be changed as well?" Then go about breaking those dependencies where possible. If two classes don't really need to know about each other, break that dependency. If two classes share 90% of their functionality, derive from a common base class.


On the other hand, you have to let common sense be a factor. One really common reason to abstract away your classes into engines and various components is so you can make switches later. For example, if you are using SDL, but want to be able to switch over to SFML at a later date, it's common to make a Renderer class, and an intermediary class over all the various objects like Bitmaps and Sprites, that both SDL and SFML provide so you can transparently change Renderers without making a code change. Reality is though, for 90+% of projects, this is just an added layer of complication and work that will never ever be used. This is where common sense has to come into play. Yes, from a purely object-oriented perspective, it is a very "pure" design that implementation details are abstracted away. From a practical and getting shit done sense, it's just a stupid waste of time.


This is where we get to the next sticking point and another area where new developers ( and experienced developers! ) get it really wrong most of the time. Global variables. See, when a new developer learns about global variables they seem like a godsend, as then you frankly don't have to design classes at all, just make everything globally available! This in a very short while makes extremely unreadable and maintainable code. Other new ( and experienced developers ) have heard about this and had it drilled into their heads that GLOBALS ARE BAD!!!! and react accordingly. Ironically enough, 9 times out of 10 this seems to always result in the same discovery... the Singleton. If you haven't yet, some day you will discover the singleton pattern and you will think it is the answer to your prayers. It's not a global, it's an object!!! Actually no, it really is just a global with a pretty layer of object oriented goop wrapped around it(**). Then you will encounter another group of people that will yell from the mountains SINGLETONS ARE BAD!!!! Which in the end leads you to engineering half a hundred "Manager" or "Adapter" classes to eliminate your dependencies on global variable and singletons. All the while, no work is getting done on your game.


Now it's time to let you in on a dirty little secret. Globals aren't bad, they are actually pretty frigging useful and important. The most important thing is, DO NOT ABUSE THEM. That is it. Chances are, you are going to have some form of global object, like perhaps a Game, App or World class, this is completely reasonable. On top of that you are going to run into code that needs to be globally accessed, such as your Audio class or Event class, which is also quite reasonable. It simply does not make sense to pass in an Audio class to say, a GameEvent, because that game event might on occasion need to play a sound. There are quite literally only a handful of things that should be made globally available but if it makes sense to be globally available, make it globally available.


But here is where the design gets tricky again, if you are making something globally available, do not make the relationship two-way, or at least not unless the two-way relationship is completely generic or via an interface. For example, if you have a game engine ( globally available ), and that game engine has a (globally available ) event queue, that at some point a game object needs to add events to, make sure that the event queue has the most absolutely minimal requirement to know anything about the game object and that the game engine itself needs to know absolutely NOTHING about the game object, as this is where your design can start to fall on it's face.


One last general rule of thumb when dealing with globally available classes, make them static whenever possible, it will lead to less potential hazards. Additionally, when make global objects provide access to other global object ( for example Game::SoundManager ), use accessor methods and const whenever possible. Keep all allocation and de-allocation specifically in the realm of the containing object.











(**) There are actually more to singletons than just object oriented globals. Yes, Singletons are global in scope but they have a couple very important properties. First of which is deferred allocation, meaning the Singleton isn't using memory until the first time it is used, unlike a traditional static variable. Additionally, a Singleton can be sub-classed as a mechanism of providing a single interface to potential disparate code bases, so for example you could have a Renderer::GetInstance(), which is sub-classed as OpenGLRenderer or DirectXRenderer, which will provide your code with a single global runtime determined instance. If you don't understand this paragraph, that’s completely fine, I'm just throwing it out there as a caveat so my over simplification of a Singleton isn't misleading... they do have their uses.

Programming Design

12. August 2011


So, for an upcoming post, I’ve decided to dive back into the world of C++ and let me tell you, I already remember why I hate this world so much.  I am an experienced programmer, well over a dozen years coding professionally and I have into a half dozen roadblocks already.  I just can’t fathom how a new developer navigates this minefield!


First off I started with CodeBlocks and SFML 1.6 and ran into a major snag right away.  Simply put, the version of MingW that ships with CodeBlocks is not compatible with the version used to compile SFML.  End result, you either need to download MingW separately from CodeBlocks and install the version that works with SFML, or you need to compile SFML yourself to make compatible binaries.  Either option is pretty much a non-starter for a new developer.


So I switched over to Visual Studio 2010 that was already installed on my machine, started a new project and …



Lovely…  It would seem that either Visual Studio 2010 SP1, installing Visual Studio Express for XNA / WinPhone, or just upsetting the gods in general has resulted in my install no longer working.  I download and install Microsoft SQL Server Compact 3.5 and no luck.  Install Microsoft SQL Server Compact 3.5 SP2 for Desktop 32 and 64 bit and finally my intellisense seems to be working again… great fun that was.


Anyways, at this point I arrive home and decide to switch to my primary development machine, which fortunately is properly configured, set up all the include and library directories in my project, copy the dll’s over into the debug folder and…




Oh for the love of god!  Guess what happened… the SFML binaries are built for Visual Studio 2008 and simply will not work with Visual Studio 2010.  End result… you’ve got to build them yourself.  This again is a complete non-starter for a new developer.  Heck, it’s a pain in the ass for an experienced developer!


So I go ahead and download the Visual Studio 2008 sources, open the sln file and let it convert to 2010 format and run a build.

Error    30    error C1083: Cannot open include file: 'QWidget': No such file or directory    c:\users\mike\downloads\sfml-1.6-sdk-windows-vc2008\sfml-1.6\samples\qt\qsfmlcanvas.hpp    9    1    qt
Error    31    error C1083: Cannot open include file: 'wx/wx.h': No such file or directory    c:\users\mike\downloads\sfml-1.6-sdk-windows-vc2008\sfml-1.6\samples\wxwidgets\wxsfmlcanvas.hpp    9    1    wxwidgets
Error    43    error C1083: Cannot open include file: 'QWidget': No such file or directory    c:\users\mike\downloads\sfml-1.6-sdk-windows-vc2008\sfml-1.6\samples\qt\qsfmlcanvas.hpp    9    1    qt
Error    44    error C1083: Cannot open include file: 'wx/wx.h': No such file or directory    c:\users\mike\downloads\sfml-1.6-sdk-windows-vc2008\sfml-1.6\samples\wxwidgets\wxsfmlcanvas.hpp    9    1    wxwidgets


…. ugh.  In the end, not really a big deal, just remove the qt and wxsample projects and everything will be fine (or install qt).  Still another monkey wrench thrown at new developers though.


Then just to make things even more enjoyable, when you compile the release dll you get:


Error    18    error LNK2019: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" ([email protected]@[email protected]@0PAIA) referenced in function _main    C:\Users\Mike\Downloads\SFML-1.6-sdk-windows-vc2008\SFML-1.6\samples\build\vc2008\Pong.obj    pong
Error    19    error LNK1120: 1 unresolved externals    C:\Users\Mike\Downloads\SFML-1.6-sdk-windows-vc2008\SFML-1.6\samples\bin\pong.exe    1    1    pong
Error    21    error LNK2019: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" ([email protected]@[email protected]@0PAIA) referenced in function _main    C:\Users\Mike\Downloads\SFML-1.6-sdk-windows-vc2008\SFML-1.6\samples\build\vc2008\PostFX.obj    postfx
Error    22    error LNK1120: 1 unresolved externals    C:\Users\Mike\Downloads\SFML-1.6-sdk-windows-vc2008\SFML-1.6\samples\bin\postfx.exe    1    1    postfx


Now this is a simple fix, add the preprocessor directive SFML_DYNAMIC to the postfx and pong projects ( not sure why this isn’t already set… ) but again, for a new developer, another show stopper.


This is the kind of stuff that really makes me not miss C++!


Oh, and for those new developers out there struggling to get SFML working with Visual Studio 2010, I’ve compiled them for you.  Just download them here (6mb zip) and extract these files to your executable directory.


See More Tutorials on!

Month List