Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
29. May 2012



Oh joy of joys.  Tonight I get some nasty work off my plate and decide to wind down for some Diablo 3 action.  Initially I start encountering server problems and a quick check on their server status page shows that their servers are down.  Great.


So I let about an hour go by.  This being Diablo, I of course have to fight through a series of Error 37’s, but I eventually get logged in.


To be greeted by the message:


A new patch for Diablo III is available. The game will now close and apply the patch automatically. You will be able to continue playing after the patch has finished installing.


Oh joy, I love forced patching of my single player games…


Click OK and…




Lovely, “Diablo III has stopped working”.  Exactly what I wanted to see.  Then followed by this lovely screen:




“Diablo III is already running”.



From my outside perspective, it appears the game patcher is trying to restart the game to apply a patch, but the game isn’t exiting, causing the version that is going to do that patching to die a horrible APPCRASH death.


EDIT ( Fix details ):

Crash is being caused by having a client on a server at a different patch level.  For example, I ran the UK installer apparently, but I am playing in the America regions.  The patch has been deployed to the America’s but not the UK.  So when I log in to the American server, its sending me to the UK server to patch, and there is no patch available, so it crashes. You can check your install version by going to C:\Program Files (x86)\Diablo III\Data_D3\PC\MPQs.  If the folder is enGB and you are logging in to the American server, this is why you are crashing.

You will either have to wait for Blizzard to push the patch out to the UK, or re-download the game with the US client.  If you are constantly being logged in to the wrong servers, this is also probably the reason and solution.

Seriously Blizzard, amateur hour. Sad smile


And again… this is on my SINGLE PLAYER game, that I again cannot play online because of the stupid auction house, that I am never EVER going to use.


Let’s just say, as a non-WoW player, Blizzard to me is just another developer, one who is losing all of my goodwill fast!  For the record, I currently have no work around, except that is to wait for Blizzard to fix their damned game. Sad smile


If I do come across a fix for the Diablo 3 patching loop of death ™, I will post it here.


Oh, and Blizzard, CACHE MY DAMNED PASSWORD!!!  I hate entering it again and again and again while trying to get past the Error 37 messages. 



EDIT:  Well it appears when I bought it from, because I speak Queen’s English ( I am Canadian ), it gave me the enGB client!  This may be contributing to the crash, but it’s going to really annoy me if I have to download the entire thing again just to fix this!  I currently cannot select an English options other than enGB.


If I set my region to Europe, it doesn’t try to patch and the crash doesn’t occur!


Log in to and here is my download setting:




The client they sent me is English(EU) this results in your patch server being So if I want to stop being sent to the UK servers, it appears I need to download the client all over again, this time with English (US) selected. You can check yourself by opening your .agent.db file, in my case located at C:\Program Files (x86)\Diablo III.  Since it’s name starts with a “.”, you may need to set “Show Hidden Files” in Explorer to true to be able to see it.


{ "uid" : "diablo3_engb", "config" : { "expansion_level" : 0.000000, "last_played" : 0.000000, "update_progress" : 0.000000, "ptr" : false, "beta" : false, "supports_multibox" : false, "fullpath_hash" : false, "archive_override_subpath" : "", "data_dir" : "Data_D3/PC/MPQs/", "switcher" : false, "use_sparse" : false, "patch_url" : "", "priority_file_layout" : "Retail", "product" : "D3", "updater_product" : "d3_patch", "update_identifier" : "d3-update-", "update_method" : "patch on demand", "update_regex" : "(?P<prefix>d3-update-(?P<dataset>\\w+))-(?P<build>\\d+)\\.mpq$", "torrent_file_path" : "Diablo III.tfil", "manifest_file_path" : "Diablo III.mfil", "priority_file_path" : "Diablo III.pfil", "binary_version_path" : "Diablo III.exe", "binary_launch_path" : "Diablo III.exe", "binary_launch_path64" : "", "run64bit" : false, "uninstall_path" : "C:\\Program Files (x86)\\Common Files\\Blizzard Entertainment\\Diablo III\\Uninstall.exe", "installed_locales" : [ "enGB" ], "display_locales" : [ "enGB", "esMX", "ptBR", "koKR", "zhTW", "deDE", "esES", "frFR", "itIT", "plPL", "ruRU" ], "launch_arguments" : [ "-launch", "-uid", "diablo3_engb" ], "preinstalled" : true } }



As you can tell from patch_url, it is setting me to international servers and launch_arguments.



I doubt this is the problem, but this would be why Diablo 3 keeps trying to send me to the European servers!


If you are finding Diablo 3 keeps sending you to the wrong continent, log in to, check your client and see what language it is set to.  Hopefully I will find a solution that doesn’t require re-downloading everything.

18. May 2012



You often hear people say things like “It’s memory management that makes C++ difficult”, this is patently false.  What makes C++ so incredibly difficult for new users ( and experienced ones! ) is the complexity.  Note, I didn’t say difficulty, I said complexity.


Today was one of those perfect examples, one of those experiences that I want to point at and say “THIS IS WHY YOU SHOULD LEARN WITH A DIFFERENT LANGUAGE!”.  Yes, that was shouting. 



Here’s the story.  Today I had a reader request guidance on how to make a release build of my C++ tutorial.  This was a really good request, so I put it together in tutorial form.  Something quickly dawned on me… I’ve never built this tutorial in release mode.  It was pretty obvious that I hadn’t because, well, it didn’t work!   Oops, my bad.



Let’s take a look at what happened, I want to see if you can guess what the problem is.  A gold star to whoever gets it before I reveal the answer at the end of this post.  That gold star offer applies to C++ veterans and new developers alike, this is a somewhat tricky one, especially considering the starting point!



So, I was building Pang 9 ( my Pong tutorial ) in release mode.  I downloaded the project files from here if you want to follow along at home.  I simply extracted the project, then I downloaded the full SFML 1.6 SDK, imported the Visual Studio 2008 project into Visual Studio 2010 and compiled the DLLs for multithreaded release mode, and copied those DLLs into my release directory.  Code compiles just fine under release, so then I run it ( within Visual Studio ) and:





Uhoh… this can’t be good!  The offending line of code is right here:


sf::Music* SoundFileCache::GetSong(std::string soundName) const { std::map<std::string,sf::Music *>::iterator itr = _music.find(soundName); if(itr == _music.end()) { sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName)) <----- EXCEPTION IS HERE { delete song; throw SoundNotFoundExeception( soundName + " was not found in call to SoundFileCache::GetSong"); } ..... SNIP ......

Well, there is a big bad pointer right above the line, that seems an obvious candidate doesn’t it?   Well don’t waste your time on that train of thought, the pointer isn’t the issue.  The .find call seems a likely candidate too, it isn’t though.


Hmm, lets start looking there, ill set a breakpoint and trace into the _music.find() call.  Oh yeah, this a release mode only bug, so our hands our tied on the debugging side of things… great.  Alright, lets take a closer look.





<Bad Ptr>.  Oooh, that’s not good.  Obviously I’ve done a bad allocation here somewhere, but that just doesn’t make sense, not with the way this data type works.  In fact, the only place these pointers are even allocated is in this actual method, and we haven’t even got to that code yet!


For some reason, our empty map ( it hasn’t been used yet, this is the first call ), is returning a Bad Ptr instead of working as expected.  This can’t be right?  But wait… that’s a red herring anyways, isn’t it, after all our exception has nothing to do with the Bad Ptr or the std::map at all, this is just the IDE sending us on a wild goose chase. We can literally boil it down to exactly two lines of code:


sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName))


Now we are getting somewhere, we have isolated our reproduce case down to exactly a two line program!  Hmmm, both are just standard SFML calls.  Short of being out of memory, nothing here should be able to fail.  So then, what the hell is causing this problem???



// ANSWER TIME, got your guess yet?  Did you get it right and I owe you a gold star?  Let’s find out!



Well, long story short, it’s our SFML dlls built for Visual Studio 2010.  See, this is our first method call into any SFML DLL and it’s causing an explosion… but, why the heck is that???



Well, lets take a trip over to the SFML 1.6 project and check out how I built them.  All I did was download the SFML 1.6 project for Visual Studio 2008, delete all the examples and set my build mode to Release DLL and compiled everything.  Hidden between the various warnings was one very very very important but cryptic message:




A bunch of warnings as a side effect of the import process, and one extremely important warning… the ahah moment if you will:


Warning    8    warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\temp\t\SFML-1.6\build\vc2008\LINK    sfml-graphics


Say what?



Now here is the thing, with C++ libraries need to be IDENTICAL.  You link debug to debug, multithread to multithread, etc…  At the same time, you have to link Visual Studio 2010 binaries to Visual Studio 2010 binaries ( although not all versions are binary incompatible, VS 2005 and 2008 could share libraries I believe ), and this here is the source of all the trouble!


The sfml-graphics graphics library statically links to a lib called freetype, and this library isn’t compatible with Visual Studio 2010.  Download the newest version, extract it into the extlibs folder, recompile and PRESTO, problem solved.




So there you go, an unhandled exception in a call to open an audio file ended up actually being caused by a statically linked font library in a 3rd party graphics dll!



Still think it’s memory management that makes C++ tricky for beginners?  The biggest problem is, new developers run into this stuff almost immediately.  You need to conquer so much to get up and running with C++, the linker being one of the earliest and most daunting obstacles.  I honestly don’t expect anyone with a few months of programming experience to have been able to puzzle this one out.  It’s exactly these kinds of things that make people throw up their hands saying “Oh screw it, programming is too hard!”.  I don’t like a quitter, but frankly in this case… they are right!



Of course, this is by no means limited to C++.  I have had very similar experiences with Java where some XML file feeding another XML file feeding a code generator called by Maven puked out a message code like “Error, unknown problem”.  Thing is, with no other programming languages do you encounter this kind of problem until you are ready to deal with the complexity.  In C++, you start dealing with this crap on day 1.


So this, is one such reason why I say C++ isn’t a beginner friendly language!


16. May 2012






If you are going to make your game require an always on internet connection, especially for the single player game, you damned well better have stable servers!


Diablo 3 have blown it pretty big time, and things don’t seem to be getting that much better.  On the bright side, in the face of all of these Error 37’s, D3 hasn’t really affected my productivity.


If anyone but Blizzard pulled this stunt, their game would be getting 0 star reviews and shamed into oblivion.  I am curious to see how Diablo ends up being reviewed.  The worst part is, Diablo 3 is a damned good game making suffering these annoyances worthwhile… just.


What *REALLY* pisses me off though… cache my damned password!  It’s annoying enough having to deal with these errors, but having to re-enter my password every time I hit an error 37, that’s just salt in the wound!  Blizzard, if you are listening to your fans, if you can’t fix your servers, at least cache the password field!


So, if you are here killing time between Diablo error messages, could I suggest a game programming tutorial or two… Winking smile




EDIT:  20 seconds later…




Why oh why did I complain… I angered the gods, who invoked their wrath in the form a hithero unheard of Error 33. is down for maintenance.  Please try again later (Error 33).



Blizzard, seriously, you screwed up big time.



I’m pretty tolerant of DRM, I understand the motivation behind it, but this DRM that supposedly isn’t DRM, well it’s about the worst I’ve dealt with since HoMM6.  Actually it’s worse, as I could still at least play HoMM offline during the outages.


I hope every other game developer out there is taking note of the Error 37’s and 33’s and realizing what a mistake always on internet connections for single player games is!  I won’t buy another one with this feature, that’s for sure.



Oh, and if you are here from Google looking for a way to fix Error 38’s, sadly you can’t.  That ball is completely in Blizzards court.  Until they fix their servers, increase capacity or implement an offline mode ( very very unlikely ) I am afraid to say these errors are going to be a fact of Diablo life.

Totally Off Topic

15. May 2012


I promise not to let it occupy all of my life… I say as I write this at 4AM in the morning!



Actually, so far the launch has been a gigantic epic failure, not that I am shocked.  As for right now the American forums are down completely.


I signed up for a Battle.NET account ( was one of 8 people alive that didn’t play WoW ), purchased my copy from, went to activate it and:


This account does not have a Diablo 3 License attached to it.

Hmmmm… go check my email, no keys sent.  What the heck is going on?  Battle.Net says my account is active.  Turns out this is a pretty easy fix, for some reason Diablo 3 set my region to Europe, and your account appears to be region locked.  Simply go to Options->Account and change your region.




For such a massive launch, that’s a pretty stupid error message.  Well, once I set the region I at least stopped getting the “This account does not have a Diablo 3 License attached to it.” message.


Instead I get:




The servers are busy at this time.  Please try again later (Error 37).






Always on DRM for a single player game… what could possibly go wrong?





On the bright side, it looks like Diablo 3 isn’t going to be too distracting for now!


EDIT: A fair number of people seem to be having login problems.  Unfortunately beyond the fix mentioned above, there is very little that can be done.


Error 37 and 3005 apparently just mean the servers are overloaded.  All you can do in this case is keep trying.


As per the Diablo 3 support blog:


Error 37, 3005

Our servers will send an Error 37 or Error 3005 message when they are under heavy load. If you are not able to log into Diablo III and receive an Error 37 message, try logging in again. It may take several login attempts before you successfully connect.


In addition, Blizzard’s Twitter stream is directing people to this post, but it’s pretty typical connection stuff.


Sadly, most of the problems seem to be the simple fact their servers got crushed and Blizzard dropped the ball.  Hopefully they pick it up and fix things quickly.

Totally Off Topic

9. May 2012


This post is waaayyyyyy off the topic of game development but it’s one of those things I have been fighting with for months so I figured I’d share the solution in case any of you are having the same issue.


Basically with one of my laptops I would often see my computer crawl to a screeching halt, to the point of nearly uselessness.  Generally the culprit would be MsMpEng.exe chewing away at my CPU, generally maxing out a core completely.  On occasion it would be Thunderbird ( my email client ) maxing out a core, but frankly this was pretty typical Thunderbird behavior( when indexing or downloading mail it used a lot of CPU ), so I would generally ignore it an expect it to go away.  Normally I would simply kill off the MsMpEng task as well as the msseces.exe ( which would simply restart MsMpEng if not killed ) and the problem would go away.  Not ideal killing off my anti-virus, but it’s one of those “I’ll look into it later” things.


Of course, later always became later until this morning when I simply got too fed up with it.  I was about half an inch away from just uninstalling Microsoft Security Essentials and going with a different anti-virus app.  This morning, both Thunderbird AND MsMpEng were taking turns maxing out my cores, so I finally put one and one together…  The fix is remarkably easy, in Microsoft Security Essentials, go to the Settings tab, select Exclude processes and add the Thunderbird.exe process like such:






Problem… finally… solved.


Alright, now that my computer is no longer acting like a 386 with the turbo button disabled, back to making games!

Totally Off Topic

AppGameKit Studio

See More Tutorials on!

Month List