Friday, October 17, 2014

Why aiming for 60fps or full 1080p is a pointless goal.

So yet again on the web I've seen posts by journalists that 1080p is worthwhile, and that devs should be spending all their time trying to make full 1080p/60fps games, and yet again, it gets my back up...

A few year back I did a post about the mass market, which was an article I did way back in 2004 ( A new direction in gaming), and it seems to me this is the same thing, coming up again.  I mean, seriously, who do you want to buy your games, a handful of journalists, or millions of gamers?

Making a full 1080p/60fps game can be hard - depending on the game of course, but ask  professional devs just how much time and effort they spend making a game run at 60fps, while keeping the detail level up, and they'll tell you it's incredibly tricky. You end up leaving a lot of performance on the table because you can't let busy sections - explosions, multiplayer, or just a load of baddies appearing at the wrong time, slow down the game even a fraction, because everyone - no matter who they are, will notice a stutter in movement and gameplay. And that's the crux of the problem. Even a simple driving game, where it's all pretty much on rails, so you know poly counts and the like, has to leave a lot on the table, otherwise if there is a pileup, and there are more cars, particles and debris spread around that you thought there would be, the it'll all slow down, and will look utterly horrible.

Take a simple example. Your in a race with 5 other cars, cars are in single file, spread out over the track - as the devs expected it to be. Your in the lead with a clear track. So lets say the devs had accounted for this, and are using 90% of the machines power for most of the track, and on certain areas, they reduce this to account for more cars and effects - like the start line for example. But suddenly, you lose control, and spin, the car crashes and bits are spread everywhere along with lots of particles. Now the other cars catch up, hit you, and it gets messy. Suddenly, that 10% spare just wasn't enough. it needs a good 30-40% to account for particle mayhem, and damage, and the game slows down. As a gamer, its not dropped from 60 to 30 - or perhaps even lower depending on how many cars are in the race (like an F1 race for example). Now, 30fps isn't terrible, and even 20fps would be fine - probably, but the thing is....the player has experienced the 60fps responsiveness and now its suddenly not handling the same way, and they notice.

The problem is people notice change, even if they don't understand the technical effects or reasons behind it. So going from 60 to 30 will be noticed by everyone, even when you compensate for it. It is much harder to notice going from 30 to 20 when there is frame rate correction going on, but many can still "feel it".

So, if I'm saying you shouldn't do 60fps or full 1080p (if the game struggles to handle it), what should you do? Well, what people really notice, isn't smooth graphics, but smooth input. Games have to be responsive, and it's the lag on controls that everyone really notices. If you move left, and it takes a few frames for that to register - everyone cares, not just hard core gamers. But if a game responds smoothly, then if your at 60 or 30 - or even 20! then gamers are much more forgiving. This is mainly because once you're in the thick of the action, they are concentrating on the game, not the pretty graphics or effects. I can prove this too, even to hard core devs/gamers.  Years ago when projectors first came out they were made with reasonably low res LCD panels, and you got what was called the "Screen Door" effect. Pixels - when projected, didn't sit right next to each other, they were spaces between them. Now when you started a film, you'd see this and you would end up seeing nothing BUT the spaces. However as soon as you got into watching and more importantly, enjoying the film, that went away, you never saw the flaws in the display, because you were concentrating on the content.

The same is true of games, sure you power up a game and ooo...look, its super high res, and ever so smooth! But 10 minutes later, your deep in the game and couldn't give a crap about the extra pixels, or slightly smoother game, all you care about is the responsiveness of it all. If it moves when you tell it to, your happy.

So what about the 1080p aspect? Well years ago when 1080p started to become the norm, and shops had both 720p and 1080p large screen TVs in store, I happened to be in one, where they had the same model, but one 1080p, and on 720p hanging right next to each other, playing the same demo. I went right up to them, and could still hardly tell the difference. These were 2 50" displays, yet with my noise almost touching them, it was hard to tell where the extra pixels were. Now, if you have a 1080p projector, and are viewing on a 2-3 meter wide screen, I'm pretty sure you'll notice, but on a TV? when your running/driving at high speed - no chance. Every article about resolution in games shows stills, and this is the worst thing to use, as that's not how you play games. It's also worth remembering, that at that moment in time your noting playing, so your not concentrating on the game, your doing nothing but search for extra pixels, so it's yet another con really.

So whats the benefit to running slower, at a slightly reduced res? Well, 1080p at 30fps means you can draw at least twice as much. That's a LOT of extra graphics you can suddenly draw, and even if you don't need/want to draw that much more, if makes your coding life MUCH simpler. You no longer have to struggle to maintain the frame rate, or worry about when there is a sudden increase in particles or damage - or just more characters on screen.

What about resolution? Well 720p is still really high-res. There are still folk getting HD TV's and watching standard def TV thinking it's so much sharper than it used to be! The mass market usually doesn't "get" what higher res is until they see it side by side, and once things are moving and they are concentrating on other things, they will neither know, or care.

At 720p, 30fps you can draw over 4 times as much 1080p, 60fps. That's a LOT of extra time and drawing. Imagine how much more detailed you could make a scene with that amount of extra geometry or pixel throughput. Even at 3times, you could leave yourself a massive amount of spare bandwidth to handle effects and keep gameplay smooth.

2D games "probably" won't suffer too much from this problem, although on mobile web or consoles like the OUYA they will as the chips/tech themselves just isn't very quick.

So rather than spend all your time with tech and struggle to maintain a frame rate most gamers won't notice, shouldn't you spend all your time making a great game instead? If you're depending on pretty pixels to make your game enjoyable, it probably isn't a great game to start with, and you should really fix that.

Games with pretty pixels sell a few copies, truly great games sell far more, and while it's true that games with both will sell even more, the first rule of game development is that only games you release will sell anything at all, and while playing with tech is great fun, constant playing/tuning doesn't ship the game.









Wednesday, September 17, 2014

When Scotland changes forever.....

In a world of history, a truly historic event is rare, but that's what Scotland gets tomorrow. On the 18th of September 2014, we the people of Scotland, get to vote on Independence. We get to decide whether we break away from the United Kingdom, or whether we stay. But either way, things look like they'll change, for the worse or better is anyone's guess.

The Stay together campaign is promising loads of new powers from Westminster, and that the UK will stay strong, in both military and monetary might. They say everything a Yes vote promises is dangerous, and too big a risk to gamble on. Perhaps their right.... perhaps.

Or perhaps not. The Yes campaign obviously states the exact opposite, that staying will continue the downward spiral of Scotland, and more and more power and money going to Westminster. They will continue to take Scotland's Oil and squander it, while giving little or nothing back. They also say the so-called powers that are on offer, will never appear and not to trust them.

A couple of years ago, I started out firmly in the No camp, but over time came over to be a resounding Yes. So what changed my mind?

Well, at the start I was concerned with things like defence, and thought that being an island nation, we can defend our borders better together,  and that leaving would make travel ultra complicated - at least for a few years.

But over time I realised that just like with other nations, partnerships could be done for defence - and probably will be, while travel disruption will actually be fairly minimal as I'm still on a UK passport - that isn't going to change.

The other thing I came to realise was that Scotland is just as capable of running her affairs as Westminster, after all there have been both Scottish Prime Ministers, and Scottish Chancellors. We're a smaller country with amazing natural resources, something Westminster really want to keep a hold of, and I do wonder if it wasn't for Oil and renewable energies (not to mention some place to keep their nuclear arsenal), would they care so much?

I also don't trust the current promise of new powers, because while the "current" leaders may indeed be sincere, there is no way they can promise. Any set of powers MUST go through current parliamentary procedures and be approved by both the House of Parliament, and probably the house of Lords. Back bencher's of all parties - not to mention some grass roots members, have expressed distress - and no small disgust, at additional powers being promised without proper discussion and review. So chances are, whatever comes - IF they come at all, won't be what they are promising, nor what No voters are expecting.

The ironic thing is, that the SNP wanted "Devo-Max" (which is what the offer of new powers is) was on the ballot paper as an offer, but Westminster refused, saying if MUST be a yes/no only. If it was on, I suspect it would have been an easy victory for No/DevoMax folk.

There's also the argument of Money, and what currency to use. I'm indifferent to this at best. We can of course use the English pound, or we could use the Euro or even just make our own. I don't really care either way. I suspect it'll be a few years uncertainty, and then stabilise. Scotland is, or would be, a wealthy nation. Oil rich, great renewable energy, and we export more than we import.

Why does the Better Together campaign think Scotland would struggle? What other Oil rich country struggles? And this isn't even considering the renewables. Scotland is currently on track to have 100% of it's power generated by renewable energy - we're already at 40%.

Not that I actually think we'll win to be honest. While there have been huge - HUGE Yes rally's, I also think those voting No are more the kind to just watch, stay at home... then vote No. I know this because many of my older relatives are no's, and they are exactly like this. On top of this there is also the undecideds, and they may well swing it either way.

But the thing I'm truly excited about, is the level of engagement on this vote. Unlike a general election where the public believes their vote counts for nothing - especially in Scotland, everyone here feels their single vote could swing things, so they HAVE to take part. It's amazing. There has been a 97% registration rate - unheard of in any election, and they are expecting 80-90% of these to actually vote. That's astounding.

So, yes.... I'm looking forward to tomorrow, to take the leap and cast my vote, and while I don't "think" we'll win - I'm certainly not sure, and I'm excited to hear the voice of Scotland - virtually ALL of Scotland.

So I'll vote Yes, and I'll hope everyone else wants to take that leap of faith with me, believe that Scotland is best suited to govern Scotland, because while it might be a tricky road ahead, nothing truly worthwhile is ever easy, and this is something worth taking that leap of faith for, not just for me, but my kids and my kids kids.

Wish us luck, no matter how the vote goes!!

Sunday, August 24, 2014

The beginners guide to Ray Tracing

So, I was asked recently on Twitter how Ray Tracing works, but it's not something that you can easily explain in 140 characters, so I thought I'd do a small post to explain it better.

So... the basic idea in rendering a scene in graphics, is to have a near and far place, and the corners of these two planes defines a "box" in 3D space, and that's what you're going to render - everything in the box". Orthographic projections use a straight "box", where the far plane is the same size as the near plane, whereas perspective uses a far plane that is bigger than the near one - meaning more appears in the distance than closer to you (as you would expect).

Doing Ray Tracing, is no different. First create a box aligned with the Z axis, so the planes run along the "X" axis. something like.... (values not real/worked out!)

Near plane  -100,-100,0  (top left)  100,100,0 (bottom right)
Far plane     -500,-500,200  (top left)  500,500,200 (bottom right)

This defines the perspective view we're going to render.

Now, how you "step" across the near plane, determines your resolution. So, let's say we're going to render a 320x200 view, then we'd step 320 times across the X axis, while we step 200 times down the Y.
This means we have 320 steps from -100,-100,0  to  100,-100,0 (a step of 0.625 on  X). And you then do the same on Y (-100 to 100 giving a DeltaY of 1.0). With me so far?


So, this image shows the basics of what I'm talking about. The small rectangle at the front is the near plane, and the large one at the back; the far plane. Everything inside the white box in 3D is what we consider as part of our view. If we wanted to make a small 10x10 ray traced image, then we'd step along the top 10 times - as shown by the red lines. So we have the 8 steps and the edges, giving us 10 rays to cast.

So lets go back to our 320x200 image, and consider some actual code for this. (this code isn't tested, it's just pseudo code)

float fx,fy,fdx,fdy;
float nz = 0.0f;
float fz = 200.0f;
fy = -500.0f;
fdy = 2.0f;
for(float ny= -100.0; ny<100;nydata-blogger-escaped-a="" data-blogger-escaped-colour="CastRay(nx,ny,nz," data-blogger-escaped-f="" data-blogger-escaped-fdx="" data-blogger-escaped-fdy="" data-blogger-escaped-float="" data-blogger-escaped-for="" data-blogger-escaped-fx="" data-blogger-escaped-fy="" data-blogger-escaped-fz="" data-blogger-escaped-nbsp="" data-blogger-escaped-nx="-100.0;nx<100;nx" data-blogger-escaped-ny="" data-blogger-escaped-pixel.="" data-blogger-escaped-pre="" data-blogger-escaped-raytrace="" data-blogger-escaped-vec4="">
NOTE: Sorry - Blogspot's editor has utterly nuked the code. I'll fix it later....

As you can see, it's a pretty simple loop really. This gets a little more complicated once the view is rotated, as each X,Y,Z has it's own delta, but it's still much the same, with an outer loop of X and Y dictating the final resolution. In fact, at the point the outer X and Y loops are usually just from 0 to 320, and 0 to 200 (or whatever the resolution is).

Assuming we have a background colour, then the CastRay() would currently return only the background colour, as we have nothing in the scene! And when you get right down to it, this is the core of the what ray tracing is. Its not that complicated to define a view, and start to render it. The tricky stuff comes when you start trying to "hit" things with your rays.


Lets assume we have a single sphere in this scene, then the cast ray function will check a collision from the line nx,ny,nz  to  fx,fy,fz with our sphere (which is a position and radius). This is basic maths stuff now - Ray to Sphere collision. There's a reasonable example of ray to sphere HERE.


So once you have that code in place, and you decide you've hit your sphere, you'll return the colour of your sphere. Pretty easy so far. So what if we add another sphere into the scene? Well, then the ray cast will now simply loop through everything in the scene no matter what we add; spheres, planes, triangles, whatever. 


Now we have a scene with lots of things being checked and hit, and we return a single colour for the CLOSEST collision point (giving is the nearest thing we've hit). This is basically our Z-Buffer! I means things can intersect without us having to do anything else. The closest distance down the ray to the intersection point, is the nearest thing to us, so that's the one we see first.


The next simplest thing we might try is reflections. In realtime graphics, this is pretty hard, but in Ray Tracing, it's really not. Lets say we have 2 spheres, and the ray we cast hits the 1st one, well all we now need to do is calculate the "bounce", that is the new vector that we'd get from calculating the incoming ray, and how it hits and bounces off the sphere. Once we have this, then all we do is call cast ray again, and it'll fly off an either hit nothing - or something. If it hits something, we return the colour and this is then merged into the initial collision and returned. Now, how you merge the colour, is basically how shiny the thing is! So if its VERY shiny, then a simple LERP with a 1.0 on the reflected colour would give a perfect reflection, where as if it's 0.5, then you would get a mix of the first and second spheres, and if its 1.0 on the original sphere, then you would only get the original sphere colour (and would probably never do the bounce in the 1st place!)


So the number of "bounces" you allow, is basically the level of recursion you do for reflections. Do you only want to "see" one thing in the reflection, then one bounce it is. DO you want to see a shiny object, in another shiny object? Then up the recursion count! This is one of the places Ray Tracing starts to hurt, as you can increase this number massively and doing so will also increase the number of rays being case, and the amount of CPU time required.


We should now have a shiny scene with a few spheres all reflecting off each other. What about Texture Mapping? Well, this is also pretty simple. When a collision occurs, it'll also give you a "point" of collision, and now all you need to do is project that into the texture space and then return the pixel colour at that point. Hay presto - texturing. This is very simple on say a plane, but gets harder as you start to do triangles, or spheres - or displacement mapping, or bezier patches!


For things like glass and water, you follow the same rule as reflection, except the "bounce" is a refract calculation. So instead of coming off, the ray bends a little as it carries on through the primitive you've hit. Aside from that, it's pretty much the same.


Now... lighting. Again, in realtime graphics, this is tricky, but in Ray Tracing it's again pretty easy. So lets say you've just hit something with your first ray, all you now do is take this point, and create a new ray to your light source, and then cast again. If this new ray hits anything, it means there's something in the way, and your pixel is in shadow. You'll do this for all light sources you want to consider, and merge the shadows together, blending with the surface pixel you hit in the first place, making it darker. And that's all lighting is (at a basic level). Area lights. spot lights and the rest get more interesting, but the basics are the same. If you can't see the light, your in shadow.


So how do you do all this in realtime? Well, now it gets fun! The simple view is to test with everything! And this will work just fine, but it'll be slow. The 1st optimisation is to only test with things in your view frustum. This will exclude a massive amount - and even a simple test to make sure something is even close to it, will help. After this, it gets tricky. A BSP style approach will help, and only test regions that the RAY itself intersects. This again will exclude lots, and help speed things up hugely. 


(no idea whose image this is BTW)


After this...well, this is why we have large Graphics conferences like SigGraph, professionals from the likes of Pixar and other studios and universities spend long hours trying to make this stuff better and faster, so reading up on ideas from these people would be a good idea.


Lastly....  There is also some serious benefit to threading here. Parallelisation is a big win in Ray Tracing as each pixel you process is (usually) totally contained, meaning the more CPU cores you have, the faster you'll go! Or, if your really adventurous you can stick it all on the GPU and benefit from some serious parallelisation!!


Wednesday, January 01, 2014

Improving the runner

So, I thought it might be fun to look back at some of the changes we've made to the runner, why, and what impact it's had on performance. Back when we started, the main complaint with Game Maker was that it was too slow, and that for more complex games, it just didn't cut it. This is clearly not the case any more, so what's really changed? Well, this only really effects the c++ runner, but lets take a look see what we did...

WAD

When we started on the PSP port, the 1st thing we did was to remove all the compression from the output. The game was in fact doubly compressed (which is nuts BTW - it's not like it's going to get magically smaller again!), and on the PSP this lead to loading times of around 40 seconds to a minute is even very simple games. So, we changed the whole output, altering it into an IFF based WAD file, and this meant it could be loaded incredibly quickly, and was ready to go as soon as it loaded. This was a huge change code wise, and touched every element of Game Maker. However, this change alone meant games would load either instantly, on in a few seconds.

Virtual Machine

Game Maker was originally split into 2 parts, scripting, and D&D (Drag and Drop), and believe it or not, there were to totally separate code paths for each. On top of this, everything was compiled on load, meaning there was another noticeable pause when games loaded. So, first thing that was done, was we changed the script engine to use a virtual machine, this meant we could optimise small paths of code rather than huge chunks - twice. This gave a modest boost - not as much as we hoped, but this was due to the way GameMaker dealt with it's variables, and how things were cast, and we were stuck with that. The next thing we did was to remove the D&D path, and then compile all D&D actions into script so they could then be compiled in the same manner. Lastly, we pre-compiled everything. This removed the script from the final game - and finally removing the worry of simple decompilation, but it also sped the loading of a game up yet again. It was not at the point, where a windows game would load and run almost instantly.


Rendering

There's quite a number of changes here, so I'll break it down a little further. But basically, the old Delphi runner had some major CPU->GPU stalls, and so we had to look into fixing them.

Hardware T&L

This was introduced on GM8.1, and it's was the first real boost for performance. All later versions of Studio also use this "Hardware Transform and Lighting" mode. By using this, the GPU does all the transformations, and leaves the CPU free for running the game. Up until we switched it, after you submitted a sprite, DirectX then used the CPU to transform all the vertices into screen space before passing them onto the GPU - this places severe limits on how much you can push though the graphics pipeline, so it was changed on the first version of GM8.1 we released.

DirectX 9

The first thing we did was to upgrade to DX9, this meant we were on a version which Microsoft still maintained properly, and gave us access to more interesting tools down the line - like better shaders. While doing this, we also introduced a proper fullscreen mode, and while this may not seem like much, when in fullscreen mode, things do render slightly quicker. Also...DX9 is just a little faster than DX8, and the upgrade is a pretty simple process (takes time, but its simple enough).


Texture pages

One of the biggest problems with Game Maker, was that every sprite, every background was given it's own texture page, and while this might seem like a good idea as it means you can easily load things in, and throw them away, it utterly destroys any real performance. So, we set about putting all images on texture pages (TPages), but this was more complex as Game Maker allows non-power of 2 images.

Standard methods involved sub-dividing images down, splitting them in 2 each time until you allocate the sprite, and fill up the whole sheet. This is very fast, and very efficient. However... we needed something more. So what we did was create a multi-stream, virtual rectangle system which would clip to everything as you added any sprite of any size. I came up with this years ago, and it was incredibly powerful, and very fast - but it was recursive, and complex. Still, having written it before, I did it again and we had a very nice texture packer for any size of image.

Next we noticed that current Game Maker developers were incredibly wasteful of images. They would have huge sprites with nothing but space in them, so they could be aligned easily with screen elements. A cool fix for this, was to crop out anything which had a 0 alpha value. You basically search the sprite for a bounding box that isn't 0 alpha, and then crop it, and remember the all the offsets to enable you to draw it again as normal. This is a cool trick, that helps us pack even more onto a page,which then helps with batching as well.


Batching

Speaking of batching.... Since the old version changed texture all the time, it could never hope to batch more than a couple of triangles at once, and this meant the CPU was forever getting in the way. Modern graphics hardware wants you to send as much as you can in one shot, then to go away and leave it alone!

So, the first thing we did was go through and change all the primitive types. The old way (TriFan) is unbatchable, and so you would always be stuck with 2 triangles per batch, and that's useless. So we changed them to the most batchable prim we could use, TriList. I wrote a new vertex manager that you could allocate vertices from, and it detected if there was any changes, or breaking in batches, so all the engine had to do, was draw, and the underlying API would auto-batch it for us.

Couple this with the new texture pages, and if you were just drawing sprites, you had a good chance of actually drawing multiple sprites in one render call. In fact, many games (like They Need to be Fed) can render virtually the whole game in one render call depending on the size of the texture page.

There are still some things which can break the batching (obviously), but with careful set up, rendering sprites is no longer the limiting factor of your game.


Blend States

Blend states are always tricky, and in the past I've tended to using a layering system - something that might appear in later versions of Studio or more likely GM: Next, as it helps manage state changes much better. However, we got a shock early in the year when we discovered how GM users actually manage state, and so we worked hard to hide the pain of management from our users.

Now a user can simply set state and reset state as they see fit, and aside from the GML call overhead, we handle all the blend state batching behind the scenes. For example, if you set a blend state, draw something, reset it, then set it again, draw something and then reset it, we recognise this, and both items will be drawn together in a single batch, making the rendering code much more efficient without the developer ever having to care.

It'll also handle more extreme cases, where you set blends several times, then set a different one, and then set more blends several times. The engine will also recognise this, and will only submit 3 batches - or however many blend state batches are actually needed. This is incredibly powerful, and a major playing in rendering performance.


Static Models

In the past, whenever you created a D3D model, it didn't actually create anything, it just remembered the prims and commands you sent, then replayed them back dynamically. This meant 3D rendering was terrible, and you would struggle to get above a few thousand polys.

We actually introduce this new concept in GM8.1 although it was more of a pet project for me at the time. Now its a staple of how you should work. Studio will now let you build fully static models, meaning that when your finished creating them, you'll be left with a single vertex buffer (or multiple depending on lines and points), that will simply be submitted to the hardware when you want to draw something.

This is basically as fast as it's possible to draw on modern hardware, you create a buffer full of vertices and submit them but simply pointing to the buffer. This is what all modern games do, its what engines like Unity does. With this addition, you can quite literally draw models with hundreds of thousands of polys at hundreds of frames per second (depending on your graphics card of course!)


Shaders

Although a recent addition, this is a powerful performance tool. Up until this point, special effects would be done on surfaces, then processed by the CPU, most of the time, painfully so! But with all the previous optimisations in place, shaders were finally able to get their place and show you what the GPU was really able to do.

From effects such as shadows, to environment mapping, to more 2D effects such as outlines, colour remapping or even full shader tilemaps all meant that the CPU got more time to work on the game, not spend time trying to make things look pretty, especially when there was a much better way of doing it sitting there doing nothing.


string_execute()

Yeah... this old one. Well, this was a popular command, mainly because it let you be really lazy in the way you coded, and yeah.... it's not a terrible thing, but it was one of the worse performance hogs, and folk using Game Maker had come to rely on it, meaning it was pulling performance down for everyone. So why was it so bad? Well, unlike code when you executed it it had to compile the string every time before running it, and this was incredibly bad. Lets have a quick look at what's involved when compiling.

Lexical Analysis. First it had to scan the string, break it down into tokens allocate memory for it and store a parse tree. Even a very simple string like "room_goto(MenuScreen)" means we had to parse the string, looking at each character, and breaking it into several tokens. room_goto command token, find and verify the syntax of the command, and evaluate the contents of the brackets - in this case; MenuScreen, which is also stored as a token. These are then stored as a parse tree, so that equations and evaluations are calculated correctly. So if you gave a calculation like "A = instance3.x+((instance.B*12)/instance2.C)", it would be evaluated correctly when executed.

Compilation. This then transforms the parse tree into byte code. Previously, it was transfered into a stream of tokens, and the engine just run these, but with the virtual machine, we now compile into byte code. This memory also has to be allocated.

Running. Now the new script can be run. First it sets up a code environment (again, more code allocation), complete with the current instance so it can store things correctly, then the VM takes over and runs the code.

Freeing. This is the real crime. Once all this work is done, and the script has been run.... it's all thrown away. All the different memory blocks are freed, and when you try and run it again, it has to do this all again.

Knowing this... it's no wonder this command was such a hog. And file_execute was even worse, as it had to load the thing first, before doing any of this - and disk access is ALWAYS slow.  So this is why this command was removed. You should never need it if you code properly anyway. It can be great for tools, but when everyone just sees it as a command they can use....well, they just blame Game Maker for not being quick enough so it had to go.



Conclusion

Now, there are obviously countless other optimisations in the runner, from ds_grid get/set being made much quicker, to the total rewrite of the ds_map, allowing for huge, lightning fast dictionary lookups, or from the way variables are now handled so that the VM can access them much quicker, or how YYC now translates everything into C++ so it can be natively compiled and thereby lifting the what little lid there was left.

And don't forget, we're a multi-platform engine, and each platform gets the same kind of treatment as the windows one does. Each platform has it's own quirks, it's own set of performance enhancing toolset, like for example the total rewrite of the HTML5 WebGL engine, that does things in a totally different way just so it can push things a little better for that platform, or the windows RT platform, that has a custom DX11 engine design and optimised just for RT devices. Each platform is taken on its own merits, and enhanced to best fit that device.

But no matter how you look at it, GameMaker: Studio has move well beyond the mere learning tool it was once designed to be, it's no longer only use by beginners, or bedroom coders looking for some fun, it's now used by professional developers around the world because it delivers, fast, cross platform development, with a truly fast engine, that's always being improved.



Tuesday, December 31, 2013

2013 - The year of travelling.

2013 kicked off with a trip to CES where we had been invited to take part in MIPS presence at the show. Sandy, knowing my utter love of all things MIPS asked if I'd like to go, and I jumped at the chance! Russell felling left out begged to come as well. He's never been to CES and was itching to see the largest consumer electronics show on earth. Sandy relented and before he booked everything, I asked if I could pay to take my better half with us. I'd never been to Vegas, and suspected I'd never get back, so thought this an ideal opportunity to do all the tourist things out there in one go. We stayed at the New York, New York hotel/casino and it was an experience to be sure. I hired a car for a couple of days and we took trips out to the Hoover Dam and the Grand Canyon, both on my life "to-do" list..

The MIPS hotel suite was odd though, Russell and I turned up and no one knew why we were there, or what we were supposed to be doing. However, the head guy appeared a little later, and knew what was going on, and just told us to set-up somewhere. We were there to help support the sale of the chips and devices, to show that there were free tools available that supported MIPS. By this time, we had the free MIPS version out, so it was a good sales pitch I guess. There wasn't actually that much for us to do, so we just hung around for a while, then met up with my wife, and headed over to the show. CES is massive, and it was great fun wandering around, my wife Frances took great delight in getting as much free stuff as was possible.

Once we got back we had some serious catching up to do, as the race was on to get ready for this years GDC. Work had finally started on the YoYo GameMaker Compiler (YYC), and this was to be what the big push for GDC was this year. Yet again, the bulk of the work fell to Russell, as he was "Mr Compiler" in the team.  The games guys were to do a new set of example games, and this year they out did themselves making the lovely looking Angry Cats Space game. We also put together a great video of indie hits created using GameMaker, including Spelunky, Hotline Miami and quite a few others.

It was decided to get a proper stand this year, something Russell and I were overjoyed about, as we wouldn't have to carry the stand over there this time! But with only a couple of weeks to go and lots of meetings stacking up, Sandy suddenly felt we didn't have enough folk to man the stand, so ask Malcolm and Geoff to come as well. With 6 of us there for the whole show, and Jaime (our lone US presence) pitching in to help, we were well staffed, and ready for the rush. The stand looked great, and once again we had lucked out on the stand location, right next to the indie games expo.

Everything went as planned, although we adjusted things a little as the show went on to draw more folk in, but it was another busy show, with lots of interest. We had some great meetings while we were there as well and came back ready to press on with the compiler and 1.2 update changes.

1.2 had some pretty large features, the compiler being one of them, but we also added Shader support, and had intended to add a proper source level debugger, but as I was also doing the initial shader support, this slipped, which was a shame as it's why we had added cross platform networking support prior to GDC. Still, the shaders were going to be a huge deal, and when paired with the compiler, we figured we would finally be able to stand up to anyone comparing us with Unity. The speed up with the compiler - in some cases, was monumental, while in others, hardly noticeable, but this was to be expected as it depending on just how much scripts and loops you did.

Perhaps the largest change however was that we had finally outgrown the office, and had been looking around for a while for some place we could move to. This place came in the form of Dundee One, and was about as prestigious an office space as you would find in Dundee. While we cracked on with the work, Sharon our new head of finance was given the task of overseeing the move. This included planning it all, liaising with architects, electricians, builders, and building managers. This almost broke her, but the results were spectacular. While Russell and I were asked for general layouts, and plans, she did all the hard graft, and the office has been acknowledged as being one the best in Dundee and surrounding area. It's a fantastic place to work, and we still can't believe we get to go there every day!

At the start of July, a few of us went down to the Develop awards as we had for the first time been nominated for the tools we've spent so long creating. Stuart and a few of the guys were already down there, as we also had a stand at the Develop conference. Sharon, Russell and I however went down for the evening, and we invited Tom Francis (of Gunpoint fame!) to join us, and much fun, and many a drink was had by all.

Only a week later however, and I was off on my 4th trip of the year. this time part holiday, and part business. I had decided to take myself to SigGraph, a huge 3D graphics show that tours around the US each year. I'd been to a few of them over the years, and they are always hard going, but great fun. The "hard going" part, is the sitting in a dark room for a week, listening to folk drone on about stuff your only half interested in, but someone at work has asked you to attend as it was of interest to them, and being on a work ticket, you felt obliged. This time however... would be different. Being there on my own buck, I could ignore the boring talks, and just attend the ones I was interested in.

Pixar stand - where I got a Renderman walking Teapot!
As I was attending a conference the week after, Sandy had graciously volunteered to pay for my flight over, and as luck would have it, I found a dirt cheap business class seat out of Amsterdam and so for the first time ever, I went in some luxury to the US. Talk about how the other half live.... it was a fantastic trip, and one I now look for whenever I go, although it's not always possible, it's brilliant when it happens.

So I spent a week in LA at SigGraph, met a couple of friends, did some great holiday things and attending what turned out to be more like DVD extras live events (which was great fun too), I then headed up to San Francisco for Casual Connect. Unlike most trips to the US I'd now been here a week, so was actually in time sync and was looking forward to a show where I was actually awake! However, Casual connect was hard going and almost broke me. Stuart came through to help out and with Sandy and Jaime, we should have been in good shape, but everyone else had meetings to go to, and that left me on the stand for 4 days, from around 8am to 7pm, it was a total killer. Even Stuart who did have meetings to break things up agreed, but that's what shows are all about, so we finished up and went back to the UK exhausted.

Yet, only a few week back, and Russell, Stuart and I were due to head out once again to GDC Europe in Cologne. Unlike last year, where we flew into Amsterdam and got a train from there to Cologne, this time we found direct flights, and so were all pretty keen to go. But with the V1.2 release looming, Sandy told us someone had to stay back to help push it out, and so as Russell was involved in it far more that I was now, he volunteered and we rushed around to change tickets and hotel bookings to take Gavin instead.

So mid August, just 2 weeks after I had returned from the US, I was off again this time to Europe and Cologne. We had a lovely stand this year, and it really stood out compared to everyone else's, in fact, quite a few came up to ask where we got it from. The show went fine, although we felt it was a little quiet compared to the last couple of years, and certainly compared to the US one, but we still made some good contacts and had fun doing it. We got to go to Gamescom as well, which is always good, particularly as it's on the business day, and it's totally empty, not the mad rush that the public get to see.

So job done, we packed up and took ourselves out for a last relaxing evening out before heading back, when a Microsoft evangelist called Kristina Rothe tweeted me and ask if we were around, I'd said we were just having dinner and would be having an early night as we were leaving tomorrow, then made the mistake of inviting her over if she was in the neighbourhood - thinking that she'd be miles and miles away. But no, she was virtually around the corner and so appeared about 20 minutes later, and to be fair, we had a lovely drink, meal and a chat. She then invited us out to a party she was going to and said she could get us in, and we thought sure... one drink will do, and then we can head back.

The devil woman snares another victim
As it turned out, she was the devil in disguise, and the party was awesome, and fun... and I drank WAY too much, something I never - ever do. I made an utter fool of myself and managed to spray beer all over the host, who was a total gent and never even beat me up for it. It was a fab night, and we finally headed back to the hotel after a second party turn out to be closing down when we got there. I failed to drink enough water during the night and awoke the next day with a massive hangover, mainly I think due to dehydration! A nightmare trip to the airport followed, along with a long wait at a starbucks waiting on the flight to board. I did however manage to eat, and drink something, so by the time we got home, I was more or less back to normal again, where I vowed - like everyone else "Never again".

V1.2 was released a few days later, and went down incredibly well. Users were especially excited about the new shader support, and have been having fun with it ever since. We also shipped YYC as a new module something again customers felt should have been free. Back in the day when I use to use products like Blitz basic - or just BASIC for that matter, compilers were always viewed as an add on you paid for. The basics worked just fine, and the compiler was an optional extra that give you a boost when you needed it. These days with the internet giving so much away for free, many users forget the time and effort that goes into something like this and demand it be reduced in price - usually to a point where they specifically can afford it.

Iconic view from the Empire State Building
Still, everything was going well, when all of a sudden a few things clicked into place, and we were all off again on another trip to the US. Russell, Sandy and I were due to head out mid September to various meetings, first on the east coast in Boston, then down to Washington, then up to New York. It was a pretty quick trip taking in a couple of cities a day, but fortunately I was only doing the East coast and the guys then left towards San Francisco without me. Having never been in New York before I was pretty excited to take in some of the sights, and to finally meet up and have dinner with Jesse Freeman. After a great dinner, wonderful conversation and a good sleep, I was able to take in some of New York's sights before heading back to Boston by train for my flight home.


Once I got back, I joined in the started work on 1.3 - along with some other projects, and started to get back into the groove. At home however, I'd started a new GameMaker project that initially got some folk over excited. The Your World project started out life as an Ant Attack map loaded, but quickly evolved into the city scape that is so well know with another game - which shall remain nameless. It didn't take very long to get it up and running, and being a personal project at the time, I had great fun showing it's progress and trying out new things. I didn't realise the interest in it however, until Left on a holiday with my wife to Erik Ruth's wedding in Washington (Trip 6!) when the media got hold of it, and coverage exploded! My Twitter followers more than doubled in a matter of days, and interest in the project took off. We decided to rain things in. We decided that we would try and do something more with the project that as a toy for me to play with, and so Your World was born. There was a necessary lull in exposure to the project as we refactored it, and created our own assets, but in doing so, we created a fully open source world that was free, and had a built in editor for folk to play with.

Our trip to Washington was also great, and the wedding was fun to go to - much tamer than a Scottish wedding BTW! No one got knifed, or drunk themselves to death, but it was fun all the same. We also managed to spend some time with them a couple of days later going around the museums and malls. Both of us loved sightseeing around Washington, spotting all the landmarks we'd seen on so many TV programs, and would go back again in a heartbeat!

Back at work again, and we carried on working towards the 1.3 build, while I also did some other browser work, and helped get the new Your World project going.With very little free time, I was looking forward to a long weekend away and Amsterdam(Trip 7!), once again with my wife. I'd been through Amsterdam a few times, but had never managed to spend any time in it, so a few days walking around there at the end of November were a welcome break. With the canals and lots of tiny unique shops, its a very relaxing place to wander, and we had great fun doing just that.

Coming back from there Russell was pulled onto another project, and I started pulling together the brand new Early Access build. This was a new version of GameMaker that would live alongside the current one, with the idea that all the new - and probably broken features, would go into this one, while we kept the main build as stable as possible. over the year and a half of Studio's development, a huge number of features have gone into it, and as a result, it's definitely had some stability issues. We tackled them as soon as we found them, and the beta branch worked okay for that, but we don't feel it was enough, so over the last few versions, we've kept a totally separate code branch that we simply merge fixes into, and we feel that's helping to keep the main version much more stable.

But we do still want to get new features out there so users can try, and test them. We now have tens of thousands of users - hundreds of thousands if you include the free version, and we simply can't test as much as all those users can, so the decision was made to create a new version, explicitly designed to house new features - complete with the lovely blue icon.

However even though this is supposed to be an unstable branch, this first version is actually pretty stable in itself, and the feature set is utterly desirable. Lots of hard work has gone into the 1.3 release, and includes things like FLASH asset importing, the source level debugger (finally making an appearance), and full extension support for iOS and Andorid. On top of this, there are some major updates to the IAP api, Push notifications - probably the most requested feature, have finally been added, and some new events as well. This makes the first Early Access build one of the most desirable versions of GameMaker: Studio ever, and it's something we pushed hard to get out before Christmas so that everyone could have some fun with it.

So there you go...2013 has come, and gone, and it's been a totally mad year. I've done move travel this year, than I have in the past 3 put together, but it's been great fun - and it turns out, I love to travel, which is just as well really. 2013 certainly ended much better than 2012 did, and we have the foundation of an amazing 2014. Things are already afoot to give some surprising and exciting news, and while there's huge amounts of work still to be done, we're excited and ready to do it - here's looking forward to a great 2014!



Monday, December 30, 2013

2012 - The launch of GameMaker: Studio

At the end of 2011, we set to work making a new product, GameMaker: Studio, with the intent that we could show it off at GDC in San Francisco in March. This gave us only a few short months to pull everything together, although this time, most of the hard graft fell to Russell. He had to convert all the nasty automated build scripts we had, into something that could work in a product, which wasn't an easy task.

We recoloured the IDE again so that it once more looked like a newer product and set about making the necessary IDE changes. Also part of this major release was bringing our Mac exporter up to date, and making it complete. Up until now, it worked just enough for the games we released, which were fairly simple so far. On top of this we also decided to add Box2D physics into the product to help mark it as a major update from the original.

To help squash bugs, we also released it as an open Beta, allowing all developers to play with it and help us track down bugs. This did result in several large "bug only" releases, but helped the stability a lot.

During this time, I was asked to speak at GDC on an HTML5 track by Darius Kazemi, something I was please to do. I love to do public speaking, particually when it's something I can actually speak with authority on! So while all this was going on, I was also preparing my slides for my first GDC talk, and the games guys were putting together a couple of demos for us to show off.

So in March, we were ready to head off. Geoff designed some large banners for the stand - a significant step up over our first stand at GDC Europe the year before, and Russell and I took them on as oversized luggage. That was a challenge! I searched for a week or so to find bags they would fit in, and ended up with 2 very large Ski bags, each of which could fit half the stand. Still once it was on the plane, it wasn't too much effort, but getting a Taxi big enough to take us to the hotel was fun.

Having not been to San Francisco before, I had expected to get Sunday free, but we hadn't finished splitting the demos, or written our scripts for our talks Sandy had decided we would do, so we actually spend the whole of Sunday in Sandy's hotel room finishing it all off, ready for the show. Sandy, his better half Caitlin, and Michel Cassius however, went out for a day of shopping, leaving us to plod on. We finished in time for us all to have a nice meal together at night, and we were finally ready for the show.

GDC 2012, San Francisco
It turned out to be an extremely busy show at that, and even though we booked late, we had lucked out on the location of the stand, and were directly across from Google, so there was lots of foot traffic. We got lots of interest, and loads of folk downloaded the beta to give it a whirl so we came back feeling good about the future.

But now the hard work of wrapping it all up into a fully viable product began, and there were quite a few late nights to make it happen. One thing we've tried hard to do, is avoid lots of crunch. Sure, it comes with the territory, but there is no excuse for excessive crunch, and while we work hard to achieve the deadlines we set, Sandy has always been flexible when it comes to them, making sure the product comes first, but without killing the staff - something we're all immensely grateful for.

Studio marked a major milestone for YoYo Games, with this product we were firmly looking to the professional developer; that is, a developer that wants to make money from his games not just for fun. Because of the effort involved, and the new target audience, the price was a lot more than the current community thought it would be, and they weren't happy. This was to be expected though, these guys were basically folk who bought Game Maker for $15 and many had been getting free updates for years. To suddenly have to pay hundreds of dollars seemed like a rip off to them, yet to a professional developer, a couple of hundred dollars with no royalties seemed like a deal that was too good to be true. But if YoYo was to grow, we needed these professionals to take us seriously, and shows like GDC were all about raising awareness of who we are and what we are doing.  Of course,we'd seen this already with GameMaker: HTML5, but it came back with a vengeance for Studio.

This isn't to say everyone felt like this, no, it was mostly the very old core GM devs who simply felt that YoYo should more or less be giving everything away for free - or close to it. But Game Maker was no longer a hobby project by a one man band, YoYo now had staff, offices and bills to pay, and this meant it had to be realistic on pricing, but that didn't matter, and suddenly everyone was a marketing expert.

While all this was going on, I'd decided to create a Deluxe version of Simply Solitaire at home, to see if it would help kick it back up the charts a bit. I had also merged the products into one, as previously we had 2 code bases, one for phone, and one for tablet. This was a nightmare, so I merged them into one, and created a new Pro and Free version. This went on sale at the start of April, but aside from now simplifying our code (and finally giving both Landscape and Portrait versions in one app), it failed to boost the app up the charts, which was a shame. One thing it did do though, was get a complaint from someone who owned the trademark of Simple Solitaire Deluxe, something we obviously knew nothing about. So we quickly rebranded as Simple Solitaire Pro and pushed out an update. The owners of the Deluxe trademark were friendly enough and this satisfied them and Apple.

We plodded with the work, and on and Studio was finally released on 22nd of May and we were finally able to draw a breath. Sales went well, when out of the blue YoYo got an invite to display at Google I/O, so Russell, Malcolm and Sandy all headed off while the rest of us carried on. We finally got another payment system in place, and hoped that this would solve all our problems - it helped a lot, but didn't quite.

Around July we had a very interesting call with Steam, and as they were about to open up a new software store, they were interested in getting GameMaker on there. Now, Sandy had been very rude to them the last time we spoke - things just weren't right for us to do anything, so it was a little embarrassing, but Valve are a great company, and everything was laughed off and smoothed over, and it was decided we would be one of the very few launch products for their new store. We asked when it was launching, and they just laughed again. Valve time is well known for being whenever they are ready, so we never felt much of a rush. We said we would look to add Steam Workshop support - something they were utterly thrilled at, but we had to make certain restrictions in the runner, and so the infamous Sandbox mode appeared. This was to protect users from rogue code, and to make sure everything was secure.


Russell was busy with other things, so I set to work making a new Steam version, when all of a sudden we got another slightly panicked call saying it had all been pushed up, and we had just a month to launch. We debated how much time we had, and how much I had to do, but we decided to just go for it, and put everything we'd planned into it. This included Steam workshop support and the the new Player app. I took the sample app they provided as it had both Mac and Windows support, and stripped it back, then added the player support, including downloading of subscription games, and playing them. This turned out to be a mistake, the sample app must have been written by an intern, as it was pretty nasty, and the Mac code was done totally wrongly. Russell took over the port of the Mac version and fudged it enough that it worked - if only just.  It was extremely hard work, and the whole month was basically crunch - something none of us wanted, but we had to be ready when Steam was.

I finished up all the new licensing system, plugged in the DLC engine they used and managed to get the whole of GameMaker and the exports onto Steam, Sandy was ecstatic, and Steam...well, it got delayed by about a month. Typical. Still, our work was done, and while I was off on holiday, Steam launched their Software store. We got some great press from it, and the new Free version we created for it's launch went down well. On top of that, we appeared to be the only bit of software that had implemented the Steam Workshop, so steam were extremely pleased with us as well. It might have almost killed me, but it was certainly worth it.

While all this was going on, Stuart and Sandy had been working hard with Microsoft, and we had added window 8 Javascript support, and we had started work on windows RT support - for native support on desktop, and phones/surfaces. Unity had announced this as well, but in typical Unity fashion, they announced a lot, and delivered very little. We on the other had managed to deliver what we promised, and Microsoft were also extremely pleased with what we delivered.

Enter November, and possibly the darkest hour - as it were, of my time here. The DRM bug. The "skull and crossbones" had been added to keep hackers at bay, and it had done just that since it's launch (and it wasn't for their lack of trying either) - which was quite an impressive feat, but additional checks were added by the team and in certain cases these simply failed, and resulted in false positives springing up. The additional code simply wasn't tested properly and a few users - only around only 0.02%  if memory serves were hit bit this. Most were able to restore from backups, but a couple weren't. We got a fix out within 2 days, but the damage was done. It was blown up out of all proportion, and folk were shouting how stupid it was and that they would never use GameMaker again, even when most of the folk complaining it turned out, never used it anyway. While the original code was mine, the bug that cause it wasn't, but the outside world needed someone to blame and it fell on me, which was fine. One thing about being outspoken in other cases, when things go wrong, you have to take it on the chin no matter who is to blame.

However they were right about one thing... my personal fight with the pirates had blinded me to our paying customers, and no matter what protection you put in to a product, it should never, EVER hurt a legit user, no matter how small the number. It was a painful lesson for me, not least because I'd seriously upset Sandy, and he's put a lot on the line for YoYo over the years, so his disappointment in the resulting news scandal was something I was quite upset over. We removed the offending checks, and then removed all other checks that could hurt an end user. In fact, the protection went totally passive. It still checks itself, and the various licenses, but it now only records and stores the issue for later analysis, and while we do now know who has a cracked copy, we haven't decided what to do about it yet.

So while 2012 was mostly a positive year with some astounding releases and work, it ended on a low, partly because I knew how out of proportion the whole DRM thing was, but mostly because I'd disappointed Sandy, and he has enough on his plate than to deal with stuff like this. So lesson learnt, I was looking forward to 2013 and getting back to the great foundation we'd built with Studio.


Sunday, December 29, 2013

2011 - When it all starts to change.

Early in the new year we also released Mr Karoshi, which went on to win Android game of the year at a Pocket Gamer event, and as Russell finished off the Android runner, Stuart and the team started to work to get all our games released on the Google store as well.

So, up until now, the real focus was the runner, and getting it onto consoles and other platforms, but now the decision was made to update Game Maker 8, and see what we could do with that. We hadn't really touched the IDE at all, but I'd used Pascal years ago and quite liked it, so thought this should be relatively simple - how wrong I was.

Delphi is a totally different beast, and one that has numerous quirks waiting to bite you when you least expect it. Still, I was excited to take on Game Maker, and see what I could do with it. When I first started looking at it, it quickly became apparent that the room editor needed work, it's lack of zoom made doing lowres games a nightmare as small tiles were incredibly tricky to place. I've since discovered the reason for this is that Mark never uses the room editor, but a defines everything in text, and loads it in. This explains alot. He also said he didn't think it was possible to get enough speed from the rendering of the room to allow it to zoom, but that was never a concern for me. Pascal as one thing going for it, that being when you need to, you can drop assembly code right into the middle of pascal, and it all just works. Also, being an old sod I've written enough scaling sprite routines that I didn't view any of this a major challenge, so I basically rewrote Marks room drawing Delphi code, in pure assembler which then gave me the speed required to add zooming - probably the most requested feature at the time.

PokerSquares HTML5
While working on 8.1 Sandy also decided to take the plunge and try and get something running on HTML5. We had always had the browser plugin for GameMaker, but the bounce rate on it was horrendous, and it hardly ever worked thanks to all the browsers changing every couple of months. So, Sandy got Russell and I to see if we could deliver a prototype - a proof of concept that would prove it could be done. This was mainly so he could show it to some interested parties who had started sniffing around looking for web engines.

Russell took on the compiler side, and I set about learning Javascript and HTML5. This was the first time we had written a runner from scratch, and it was pretty frantic work, yet in onto 2 short weeks, we had a one of our latest games - Poker Squares, running in a browser. To put this into perspective, it took us 3 months(ish) to clean up the C++ runner when we first got it, yet in only 2 weeks, we were able to get the framework of a brand new runner - enough so that a game would actually run. Not to blow our own trumpet, but that was damned impressive, and very cool. Russell then took this demo and showed it around at GDC in San Francisco, and the response was pretty good, so much so, that after 8.1 was released, we decided to jump on the HTML5 bandwagon and see what we could do.


Still, we had to get 8,1 out of the way first, and it was about this time we started "leaking" images, and teasing the community with what was coming - something I LOVE to do. We got Andrew to leak this little image and everyone started to get excited, knowing an update was coming, and then over the next couple of months we leaked some more details, images and the like. Another big feature was the auto-updater, so we could release new versions more quickly, and make sure everyone gets them. Traditionally, this has never happened in Game Maker, and folk have been stuck with much older versions.

While I was looking at this, Russell finished off the Android runner, and Andrew, Geoff and the rest of the games guys started churning out games. Russell then joined me on the final push of GameMaker8.1 and we released it (I think) on the 15th April, 2011. This was a free update and moved everyone from Softwrap to our own DRM.

We added quite a lot to it in the end, and over the next year, added even more features and upgrades, from new Font rendering code, to much, MUCH faster 3D rendering. However... some of this came at a cost, and the addition of the "TV" logo was much debated. This was something we discussed with the community as the initial idea of the .EXE timing out didn't exactly go down well. So, we listened, and we discussed, and the TV logo is what came out of it - for the Free version, and only on final .EXEs; that and a nag screen. It still wasn't hugely popular, but then, those who complained, were usually those who had no intention of ever buying - so what do you expect. By way of compensation however, we DID add in some pro-only features like sprite rotation, and the zooming room editor and this did help quiet folk down.

Food first.... planning later
Once 8.1 was out the door, and we had a couple of stabilising updates out, we turned our focus to HTML5 again. With the proof of concept, we saw that not only was a HTML5 engine possible, but very practical, and so Sandy decided he wanted a full blown HTML5 version of GameMaker to sell. We set about planning it all, and Russell, Sandy and myself went over to meet with Mark in Utrecht and talk through what would be involved, and how much time it would take. Our goal was GDC Europe in August - or at least have something to show there.

It took us around 3 months to do a full rewrite of the runner and most of GameMaker's functions - there's a hell of a lot of them, not to mention the work on the IDE to make it look different. Fortunately, we weren't alone in this, Chris Harrison joined us; this time, and eegeo rescue case - these were members of the original team who were rescued from Realtime Worlds by some of the original investors. Anyway, Chris joined us and help port the many thousands of functions over.
Paul Cosgrove also joined us to help with a new Website update (and yes...I missed when Lee Turner joined us, I'm not exactly sure of the date he joined).

GDC Europe August, 2011
While we were ploughing into the work, the games guys soldered on, and produced more and more games, something that would stand us in good stead later on. With the bulk of the work done, we were finally able to use the IDE to create GameMaker games, and with a simple click, export them to HTML5, so so GameMaker: HTML5 was born. YoYo booked it's first ever show stand, and with some bad posters and makeshift banners, we wend over to GDC Europe to flog our wares.
This was another milestone for YoYo Games, and things went down pretty well, although the main driving message was - "That's really cool, but can you export to iOS and Android as well?". Bugger... Yes we could, but it wasn't built in, there were a complex set of build scripts that the games guys used to create games, and that certainly wasn't what the public would want.

Still,the show wasn't over yet, and thanks to a deal Stuart had done with Sony and for the Experia Play, we were now supposed to go on stage during the public days of Gamecom - a scary prospect. We watched the doors open from inside, and the masses descended into the halls at a run - usually in full games attire; Mario, Zelda and the like, so we sat to one side trying to stay out the way until we were required to fight our way through them to get to the stage.

We were to demo They Need to be Fed and the new special update that had been released, or rather I was expected to play it on a big TV in front of a (now) rather large crowd while Russell commentated. While waiting, I decided some practise would be good, as I hadn't played any of these levels before. Sandy got up on stage and did an intro - which he loves to do, then stepped back and let Russell and I embarrass ourselves. Still, didn't go too badly I guess, and was pretty good fun in the end, it's just as well I don't get scared in front of crowds isn't it!

We came back to the office to regroup, and realised that yes.... once we finished GameMaker: HTML5, we needed to start on a new product, one that did everything.....GameMaker: Studio.

GameMaker: HTML5 went on sale in September, and was selling well when, without any warning, our Paypal account blew up. We'd suddenly hit an automated limit, that looks for "spikes" in sales and then limits the account automatically (or so we believe). Many others have had this, and getting your cash from them turns out to be an utter nightmare, it has in fact taken us 2 years to get back into a working relationship with them, and we've been very careful to try and keep them updated on everything they need so as to make sure the aren't surprised by anything.

This caused a week of utter panic, as we suddenly couldn't sell anything, and in just a week, Lee managed to implement a new payment system and get us going again. This isn't to say it was without problems though, the design was (obviously) rushed, and we did get issues with it, but we dealt with these as best we could and moved on.

So 2011 saw us move from a small team, into a larger stake, and release 2 new tools in the form of GameMaker: 8.1, and GameMaker: HTML5, as well as releasing our first batch of games on Android, and having a huge hit on iOS in the form of Simply Solitaire - it was a busy old year, not like any of the coming years would be any less mind.....




Saturday, December 28, 2013

2010 - A fresh start....

So here we are, the start of a new job, a new office and everyone raring to go. With only 4 of us there initially, it felt like a large space to fill, but it was cheap, and we had room to expand.

When we started, GameMaker 8.0 had just been released, and we weren't really looking to touch the IDE or windows platform at all, our sights were firmly fixed on getting games onto consoles - something we still really want to push, but has never managed to happen fully for us.

Russell also suddenly got pulled onto GM4Mac, as the guy that was writing it, slowed down to a crawl, and Sandy had been desperate to get it out the door for years now. With Russell now pushing it full-time as well, this was now suddenly a distinct possibility.

We finally made good progress on the PSP with our first game Green Tech by David Galindo was heading into the dreaded Sony submission process. This wasn't something any of us were looking forward to. Then something else happened.... Sandy suddenly wondered if it would be possible to get games onto the iPhone/iPods. The Apple app store had started to take off, and he was wondering if the runner would work okay on these new touch devices. He brought up his iMac got us an iPad, and I set about doing the first port, and inside a month I had the initial version running pretty well.

Come September, and we showed off this new work in progress, and set the a benchmark for new ports - around a month for the core of the work, and then a few weeks for all the frills. While over the years as new features go in, this now takes a little longer, it's still a fairly quick process compared to many other platforms.
Since it had been one of our test games for a long time, we felt it only fair to let Chad Chisholm's Sky Diver be our first iOS game, and so we got Geoff Gunning to spruce up the look and feel of it, and submitted it to Apple. 

This was definitely one that made us nervous, Apple had just announced new rules for apps, and that games had to be written in C++/Objective C. Now the runner obviously was, but the games were script, and so we weren't sure how they were going to view these games. We knew that this was mainly targeted at Adobe's Flash, but it could have an aftershock that hit lots of other games. The first time, the game failed submission - not a big surprise for our first game through, but the only mistake was an icon or something, nothing major. It passed on the second attempt, and GameMaker's first cross platform game went live.

During the port of Skydiver, Realtime worlds had gone pop. The excessive spending, bad planning, and the refusal to let anything else out the door before APB hit them where it hurt. The whole My World team was let go, and the APB guys were sorry to see it, but were living in a little dream world, sure it wasn't going to happen to them, when a month or so later - it did. The whole company folded, and suddenly there were around 300 coders, artists, designers and testers out looking for work. Stuart Poole a producer on My World came in to see if we could use his skills, and it didn't take long for him to make himself useful, he helped push Skydiver through production and submission and came in full time shortly there after.

We started looking for another game, and this time pick Andrews "Maddening" game. It was different, looked nice, was pretty good fun, and actually a pretty small game meaning we could port it quickly. We did have to help Andrew optimise it quite a bit, as the rendering  wasn't great, but after that was done, it ran no problem at all. This was also the first game we had featured, as it suddenly appeared in the New and Noteworthy on the iPad - another first.

We then started to think about a little Christmas present for the community, and so started work on Simply Solitaire. This was to be a basic card game, just as a promo to what GameMaker can do. Geoff did a set of "wobbly" cards, which set the games unique look and feel and Andrew did his best to break my brain, by adding bugs into the most complex way of writing a simple card game ever devised. I jumped in and tried to help sort it out, but as this was my first real use of GameMaker, it was a shock to the system, not least because the way Andrew coded was nuts. Growing up with GameMaker, he doesn't think the way a traditional games coder does, and that makes his game code a little strange - to say the least. Still, after much cursing and swearing, and calling him Susan, we got it working and submitted it to Apple and it made it in time for Christmas.

Then something unusual happened in France. We've never been able to figure out exactly what or why, but it took off. Certainly Christmas helped, lots of new iPad owners were looking for free games, and this helped push the downloads up. In one day a alone we got over 77,000 downloads. Over Christmas we got to not only the number one card game, but the number one FREE game in several countries. It was a staggering achievement for something that was supposed to be a test - a promo. The only reason for making it, was for the YoYo Games logo in the background.

Solitaire HD - Number one FREE app
On the 28th December, it hit the Number one free app in the US, and we had a massive number of users for the 1st time. We decided to try and push out a quick fix for a minor issue, and in pushing too hard, made a fatal mistake. We simply didn't test enough, only Stuart and I really tested it, and 2 people testing for a few days, compared to the now hundreds of thousands is no comparison. It blew up - badly.We lost our top spot as reviews reported it was broken, and users were warned not to update. Sandy wasn't happy, and decided it had done it's job anyway, so to just ignore it and let it die.

Russell and I however, had other ideas....  We really wanted to try out the new in app advertising, and figured with the number of users Solitaire had, it could be interesting - and we didn't really want to let our biggest hit so far die either. In very early 2011, we fixed the issues and added a small advert in the lower right hand corner and push out the update to see what would happen.

The result totally surprised us. Aside from fixing the issues and keeping our users happy, we suddenly started getting in good money from advertising. In fact, not just good - great money from advertising - at which point Sandy forgave us for ignoring him, and promptly told us to add it to the other games. It's always been a problem; how to monetise users on a free game, and in this case, ads work - but they don't always. We tired adding adds to Skydiver and Maddening, and then suddenly realised that, yeah.... ads don't always work, but Solitaire was still doing well, and we still had a great user base, and income from it. Even when talking to some ad companies, they've been surprised at the number of impressions we've gotten per day, and have wanted a bit of that action. 

In January, Sandy also decided he wanted to get onto Android, and so while Russell set about doing that port, the PSP version of Green Tech was finally ready to go. Malcolm Collins - another rescue case from Realtime Worlds pushed the game through submission (physically sometimes, or so it felt), and it was finally ready to be released. It didn't do amazingly, but it was our first game on console, so we were reasonably happy, but we still really didn't like the submission process.

We hoped this was just an issue with the first game only, but time would tell, and tell badly...

Friday, December 27, 2013

2009 - A long road ahead....

Coming to the end of another year at YoYo Games, and it's hard not to reflect on how we're doing, and how far we've come in the short time I've been there. As I feel the need to ramble... I'm going to go back to where I was before, how I got here, and just how much we've accomplished in this short time.

Demo shown to Ordnance Survey
So, back in 2009 I was working for Realtime worlds doing a project called My World, this was a large GIS (geographical information system) based engine. That is, a 3D world based on real world digital map data. Dave Jones had brought me into the company back in 2005 and I founded the project, and was the sole member of the team for about a year, before Russell Kay joined me. In that time, I got the basics working and we presented the concept to Ordnance Survey, the owners of the UK map data. They were incredibly interested, and gave us even more data to test with, basically we got the whole of Scotland for free from them, and the project moved on. Meanwhile Russell joined and things gathered pace as we scaled everything up. We put together a demo and showed it to investors and (eventually) Realtime Worlds got around $80 million in investment from various places. All was going well, and the team grew as the project grew in importance and everything was right with the world.

A few years in however, and it all started to go pear shaped. The folk they brought in to manage the team never really understood it, and little groups formed within the team. There was very much a "them" and "us" culture. The "them" were mainly a bunch of juniors, and the producers, they loved meetings, bureaucracy, and doing jack shit basically. They were forever refactoring things, trying to make everything perfect and basically making no headway at all. The "us" were some of the original team, and basically those who knew what they were doing; We wanted as few meetings as possible, and to just wanted to get things done and get something out the door, knowing nothing is ever perfect. However, as time went on, the producers and management put more juniors in controlling roles and basically took over, and the project was doing it's best impression of a swan dive. So... come mid-2009, and I was at the point where I didn't see any reason to do free work at home any more, and started looking for something else to do.

Enter Mark Ettle (CEO of Cobra Mobile), an old boss, and a good friend from the old DMA Design days. He told me about a guy that was after some basic porting work, and wondered if I was interested. Now, a lesson I learnt a while back is that while doing a fulltime job, it's virtually impossible to do anything major at home that isn't aligned with work. Your brain just doesn't like being pulled in two different directions, and so I figured that if I was going to stand a chance, I'd need someone else this time, to help when I slackened off. So, I persuaded Russell to help me, and I met with one Sandy Duncan in June of 2009, midway through a road-trip holiday I was having, touring England on my own (which was great fun BTW). In the initial meeting with Sandy, he told me about GameMaker, and that he had this C++ runner that he was looking to port to the PSP and his plans he had for it all, while I described the experience Russell and I had, and what we could do for him. All this went well (obviously) and Sandy sent us the source for us to look at.

It was horrible, utterly horrible.

The runner had been commissioned so that it could go cross platform easily as the original (written in Delphi), was totally unsuitable. However, it had been farmed out from the company hired to do it, to an intern, and was written in MFC (Microsoft Foundation Classes). This is as about un-portable as you can get. The code was also horrible, not only written by a junior with very little experience, but designed to be very closely based on the original Delphi version, with special classes/code to try and emulate what the Delphi did, instead of making it a proper C++ project. Russell and I spent months just removing the MFC and cleaning it up to the point where we could even begin to start porting it - there are still areas we've never touched, that are still just horrible.


However, port it we did.... and several months later, we had it running on the PSP and showed Sandy when he paid us a visit to Dundee. He was ecstatic to say the least. Part of his dream for YoYo was getting games to play on other platforms, and many, MANY folk said he'd never manage it, but we had. What's more, we were running on a very low powered system, meaning it was all upwards from here.

In early 2010, things at Realtime Worlds had progressed beyond the point of stupidity, the "juniors" were now running pretty much running the show, making sweeping choices that crippled everything without understanding anything. My only amusement in all this was that decisions they had overridden years ago, were now coming back to bite them in the arse. Things I had told them simply wouldn't work some 3 years back and had been told was was an idiot, were as expected, coming true, and they were having to rewrite loads of stuff to fix it. I said it then, and I'll say it again, if you hire experienced folk, you should really listen to them.

Anyway, enough was enough, I was looking for an out, so I approached Sandy and we started to look at setting up an office in Dundee to work on GameMaker and all it's ports, and in early March 2010, I started working at home, finishing off the PSP runner along with Russell. We worked like this for about 3 months or so before we found an office, and it was just in time too. We were getting to the point where we needed to be sitting next to one another, Skype just wasn't viable any more.

Russell and I on the first day at the new office
So we opened the first office and Russell, myself, Andrew McCluskey (Nal) and Kirsty Scott started full-time in a brand new office, inside Abertay University. Andrew was hired from our community, as a GML programmer, and initially was simply doing tests for us. As time progressed, he became the first member of the games team, porting community games to other platforms - along with his own. Kirsty came in as our Community Manager, and manned the help desk, while Russell and I plough on with the port.

So... here we are, the beginnings of YoYo Games in Dundee, and the start of a wonderful road to wander down. In the 3 and a half years I've been there, we've done an amazing amount of work, games and tools.

I'll carry on rambling tomorrow, where the fun really begins!