Front end web developer coding standards
Posted by shawson in Javascript on May 6, 2011
Well put together, and generally good advice about the finer details of javascript (closures, truthy values) for someone starting out.
Adding Javascript Unit Testing/ Compression to your MSBuild
Posted by shawson in .net, Javascript, Test Driven Development on May 4, 2011
A couple of resources- I shall add to this post as I look into this myself. I basically want to add steps to my project file, so msbuild will run javascript tests (qUnit) and perform minification/ combines all the js source files.
- http://yuicompressor.codeplex.com/
- http://blogs.msdn.com/b/francischeung/archive/2010/02/13/integrating-javascript-unit-tests-with-continuous-integration.aspx
- http://www.testinggeek.com/index.php/testing-tools/test-execution/189-qunit-selenium-continuous-integration
- http://dotnet.geir-sorensen.net/2010/04/10/msbuild-custom-targets/
- http://www.simple-talk.com/dotnet/.net-tools/extending-msbuild/
Quickly Find/ Open a file in Visual Studio
Posted by shawson in .net, Visual Studio on April 14, 2011
I’m working on some massive solutions containing loads of projects at my new place and frequently have to shoot between different source files scattered all over- A colleague recently showed me a really quick way to find and open files- from the Find bar in the top ‘standard’ menu bar, you can type ‘>of’ followed by the name of the file you are after and it will bring up an auto complete menu letting you select and open the file.

Javascript profiling in IE7…
Posted by shawson in Javascript on March 11, 2011
…cannot be done with the built in dev tools, as I reminded myself today. I guess my memory painted a fonder picture of the first version of the IE debugger than it deserved. I’ve been using the IE8 debugger a lot of late as I’m working on a very JS heavy UI targeted primarily at IE users, which has some firebug-esque features, like break points/ profiling etc and I foolishly assumed such things were always there, because a web debugger without these tools wouldn’t be much use..
Anyway turns out all is not lost- after wading through a bunch of rubbish solutions I eventually found an awesome profiler (for free, of course!) which works with IE 6, 7 & 8! Check it out- “DynaTrace AJAX Edition“
Javascript development on Cloud9… unless you’re on Windows :(
Posted by shawson in Javascript on March 2, 2011
Update 2011.03.03
@rikarends from the Cloud9 team was nice enough to chat to me on Skype about my windows woes and I’m reliably informed that the Windows chunk of Cloud9 still needs a little polishing and will be up to scratch in a future release; you can follow them on twitter for news (@Cloud9IDE) – in the mean time older branches from GitHub should run fine (v0.2.0)- in the mean time you can always run their most up to date version from their hosted service at http://c9.io
Very excited to try out a new HTML5 IDE for Javascript launched this week called Cloud9- you can sign up for an account and hosting, in much the same way as GitHub, however you can also download the project to run locally via NodeJS.
I did have some trouble with this though- I ran git command to download the project to my computer, no probs, then ran the run batch file (I’m on Win7 x64) and this ran about half way then died with this little beauty;
Failed to recurse into submodule path 'support/ace'
…
All looked a bit bleak for a moment- did a bit of Googling and found other people had had this issue- dug through the launch script and found the command that gets fired on first time launch which seems to get a bunch of support packages from Git- this seems to be what failed- I CD’ed into the cloud9 folder and manually re-ran that get
git submodule update --init --recursive
And it seems second time’s the charm- everything finished downloading– that’s not to say I got it running! Also found a problem in the batch file which starts it up in bin/cloud9-win32.bat – the use of EQ on the if conditions broke the script so I adjusted line 9 to;
IF NOT %ERRORLEVEL%==0 goto exit
and line 18 to;
IF %ERRORLEVEL%==0 goto exit
Now it manages to make it through the script only to say
E:\cloud9\cloud9>bin\cloud9-win32.bat ------ Starting Cloud9 server ------ "Something failed unfortunately, please try a clean clone" Press any key to continue . . .
Digging into the script once more the command which gets fired to launch it is;
start support\node-builds\win32\node bin/cloud9.js -a "cmd /c start"
So I launched this without the “start” at the command line and the underlying error is;
E:\cloud9\cloud9>support\node-builds\win32\node bin/cloud9.js -a "cmd /c start"
2 Mar 21:05:17 - socket.io ready - accepting connections
Ajax.org Cloud9 IDE
version 0.2.0
Project root is:
Trying to start your browser in: http://localhost:undefined
So port undefined is obviously no use; I mod the batch script again to specify a port- in bin\cloud9-win32.bat line 16 I change to;
start support\node-builds\win32\node bin/cloud9.js -p 3000 -a "cmd /c start"
This sets the default port to 3000 and relaunching the batch file actually now fires it up- but still it doesn’t work. The browser lauches and I can see bits of the top menu from the UI- however in the accompanying console window I get spammed with errors such as;
Error: Command failed: execvp(): No such file or directory
at ChildProcess.exithandler (child_process:80:15)
at ChildProcess.emit (events:27:15)
at Stream. (child_process:148:12)
at Stream.emit (events:27:15)
at Array.0 (net:1004:12)
at EventEmitter._tickCallback (node.js:55:22)
at node.js:772:9
I give up! If any one gets futher, please drop me a comment!
Work Starts on my WebGL Game!
Posted by shawson in HTML5, Javascript, WebGL on February 28, 2011
Caught up in all the excitement of WebGL becoming more mainstream, I’m building another javascript game. My first offering to the browser based game community was Manic Spaceman, a straight platform game based on ManicMiner which was a little rough around the edges, but boshed out on the quick for the 8weekgame competition.
This time round I intend to go full 3d, taking advantage of WebGL, and make a desert strike style game. I considered starting from scratch, as I did with Manic Spaceman, and writing my own engine to power it all, however given that I’ve next to no 3d experience I thought I would reduce the scope a little and use an engine that’s already out there. After about a week of research I’ve settled for Three.js – I say “settled”, but it’s actually shaping up to be a pretty awesome engine. There’s are a few decent engines out there, all obviously in their infancy, but having reviewed the feature set and looked at the demo’s and read around other developers experiences, Three feels like the best choice. The other’s I considered were;
The Short List
Other contenders
I only considered open source offerings and looked for engines which
- were still being actively developed (!)
- seemed performant with high poly counts
- handle shadows/ reflections
- exposed access to GLSL
- UV Mapping support
- be relatively stable.
It was surprising how many engines had broken demo’s on their site, which never bodes well, but on the whole, they are all good offerings with almost all of them fulfilling my requirements.
While building my game, I shall be working through some OpenGL tutorials I found- a port of the well known NeHe OpenGL tutorial set, on LearningWebGL.com, which should put me in good stead to build my next game totally from scratch.
I shall post updates as I have something to show. So far I’ve written a HeightMap generator which works from a greyscale bitmap to build terrains, and I’m currently working on getting the model to follow the landscape; I’ve a long road ahead!
Random Band Generator!
Posted by shawson in .net, C#.net, Javascript, jQuery on February 12, 2011
Just a quick post to mention that I’ve uploaded the Random Band Generator- just a bit of fun I boshed together built for a mate… check it out here.
ManicSpaceMan now works in IE(9)!
Posted by shawson in HTML5, Javascript on February 12, 2011
Cast your mind back to about 6 months ago when Gareth, Martin and myself did the first 8WeekGame competition- Controversially I didn’t use XNA, but instead created a game which would run from your browser, using the new HTML5 canvas support- at the time it was a niche feature without wide browser support, but with the recent release of IE9, you can now finally play ManicSpaceman in IE! So go upgrade your browser and give it a go! Although I should note– for some reason the sounds don’t play in IE, despite me creating a whole MP3 set of the sounds specifically for it; so the best experience is still in FireFox or Chrome!
While on the subject of IE9- see here for the terribly useful developer notes on the new browser detailing all the new cool stuff it supports (css3/ html5 features) http://msdn.microsoft.com/en-us/ie/ff468705#_Intro
Finally, proper browser support for WebGL thanks to Google Chrome!
Posted by shawson in WebGL, XNA Game Development on February 10, 2011
Google released Google Chrome v9 a few days ago with native WebGL support- no more having to hack around hidden browser settings, WebGL will now work, out of the box, on one of the “main stream” browsers.
In light of this I’m doing a round up a bunch of WebGL 3d engines available at the moment (which I shall put up here when I’m done) to help me select which engine to use as the base for my next 8weekgame competition entry. I think I shall stick with the re-make of Desert Strike, but will be moving away from the original XNA I started out with, to make it totally web based (No flash plugins!) like my previous submission, Manic Spaceman
Microsoft Creators Club – Premium Account Cancellation- Microsofts best kept secret!
Posted by shawson in XNA Game Development on February 6, 2011
So I signed up for an Microsoft creators club account a while back and it just auto-renewed. I’ve not used it for a while so figured I would cancel it from robbing me of any more money! I hopped over to their site at https://windowsphone.create.msdn.com/support and after an hour of hunting through EVERY part of that site, and various forums posts with other people complaining of the same thing which pointed me to a bunch of “Account Cancellation” links which all ended in “Oops, this page has been moved!”. I was even directed to billing.microsoft.com which acknowledged the fact that I had this £30 payment going out every 4 months; I clicked on the row and then clicked to disable the service, which brings up a bunch of links to various websites, but nothing about the creators club!? So, the site basically told me what I already knew, and did nothing to help solve the problem.
I eventually came across a forum post which pointed me in the direction of a contact form: https://windowsphone.create.msdn.com/support?redirectToUrl=%2FApp. Upon completing the forum I was redirected to the app creator home page- no “thank you, we will get back to you” page, so now I can only wait and hope that someone actually picks up my mail!