• Subscribe Comment
  • Subscribe Posts

Unity3D – Accessors are bad- Caching is good!

Unity3D is an amazing tool; It makes development a dream. It introduces coding to novices without limiting their capabilities. It removes the headaches from coding the core engine, 3D renderer, sound system and all of the components required for a good, stable, usable 3D engine by having them already there ready for you to use.

However, Unity is not perfect.

Whilst Unity provides all the basics, and has an integrated scripting system that is actually less scripting than you might think- and more true programming- some of it’s ease of use features contain surprising bottlenecks.

During the massive upgrades required to bring the old Red Forest prototype to where it is now, a very surprising issue was discovered. Here are two surprising bottlenecks in Unity:

1) Accessing the transform member.
2) Accessing the rigidBody member.

OK so strictly speaking, these are the same- they are accessing what Unity have called Accessors. You would think these are just predefined members pointing to the objects transform and rigidBody, however, my theory suggests that:

  RigidBody rb=rigidbody;

is the same as

  RigidBody rb=GetComponent<Rigidbody>();

[update: Actually Unity themselves have said that the exact code execuded is:

  RigidBody rb=UnityEngine.Component.get_rigidBody();

which is exactly the same.]

I’ve done significant tests- now, take a look at the following:

  Transform cachedTransform;
   Vector3 velocity;
  Rigidbody cachedRigidbody;
  void Start() {
  void Update() {
    velocity=cachedRigidbody.velocity; //This is ~ 18 times faster than...
    velocity=rigidbody.velocity; //this.....

Those two should in theory be the same- however the top line is 18x faster.

Here’s the test class. Simply create a GameObject and attach a Rigidbody to it- then attach this script, and run.

Start us an IEnumerator to allow a few seconds to pass before the tests begin- just in case there’s any startup lag.

using UnityEngine;
using System.Collections;

public class AccessorTester : MonoBehaviour {

  // Use this for initialization
  IEnumerator Start () {
    yield return new WaitForSeconds (1); //remove startup lag.

    Transform cachedTransform = transform;
    Rigidbody rb = rigidbody;

    float endTime=0;
    float startTime = Time.realtimeSinceStartup;
    Debug.Log ("Reading Transform.");
    Debug.Log ("Start Time: " + startTime);
    Transform temp = transform;

    for (int x=0;x<5000000;x++) {


    Debug.Log("End time: "+endTime);
    Debug.Log(endTime-startTime+" seconds taken for 5,000,000 accesses.");

    float uncachedTime = endTime - startTime;

    startTime = Time.realtimeSinceStartup;
    Debug.Log ("Reading Cached Transform.");
    Debug.Log ("Start Time: " + startTime);

    for (int x=0;x<5000000;x++) {

    Debug.Log("End time: "+endTime);
    Debug.Log(endTime-startTime+" seconds taken for 5,000,000 cached accesses.");
    float cachedTime = endTime - startTime;

    Debug.Log ("cached is " + uncachedTime / cachedTime + " x faster.");

    Debug.Log ("Reading RigidBody.");
    Debug.Log ("Start Time: " + startTime);
    Rigidbody temp2=rigidbody;

    for (int x=0;x<5000000;x++) {

    Debug.Log("End time: "+endTime);
    Debug.Log(endTime-startTime+" seconds taken for 5,000,000 accesses.");
    uncachedTime = endTime - startTime;
    startTime = Time.realtimeSinceStartup;
    Debug.Log ("Reading Cached RigidBody.");
    Debug.Log ("Start Time: " + startTime);

    for (int x=0;x<5000000;x++) {
    Debug.Log("End time: "+endTime);
    Debug.Log(endTime-startTime+" seconds taken for 5,000,000 cached accesses.");
    cachedTime = endTime - startTime;
    Debug.Log ("cached is " + uncachedTime / cachedTime + " x faster.");


On my machine, running this code shows that accessing existing Unity accessors is around 18 times slower than using a cachedRigidbody. This was the difference between 128 ships running at 5fps, and 128 ships at 60fps in Red Forest.

So: Think about it- If you’re using a Unity ease-of-use accessor- consider switching to caching.

If you are starting a new project- or have the time to convert- consider extending MonoBehaviour and doing something like this:

First- the new ‘MonoBehaviour’:


using UnityEngine;
using System.Collections;

public class CoreBehaviour : MonoBehaviour {

  public new Rigidbody rigidbody;
  public new Transform transform;
  public new Camera camera;

  public virtual void Awake() {
    transform = gameObject.transform;
    if (gameObject.rigidbody) rigidbody = gameObject.rigidbody; //Overrides the slow rigidbody reference! (Thanks to Fabien Benoit-Koch for the tip)
    if (gameObject.camera) camera = gameObject.camera;
    Debug.Log ("Caching complete.");


Then an example script that extends from it. Note that Awake() is now a public override.


using UnityEngine;
using System.Collections;

public class CachedBehaviour : CoreBehaviour{    

  public override void Awake () //Awake needs to override.
    base.Awake(); //does the caching.
    Debug.Log ("Awake called!");
  void Update ()
    //Now you can use transform / rigidbody as normal and still gain your speed boost!

Personally I like to separate the caching from the Awake function- so I do not use Awake() in my scripts, instead, I do the caching in the Awake() method of CoreBehaviour and have that call Init(), a virtual method which I use in all of my scripts. This is preferred as it feels cleaner, however if you already have a large project the method I have just shown is going to save you a bit of time!
You need to ensure you call base.Awake() otherwise no caching will occur and you’ll get a load of null references.

How’s that for a nice performance boost and minimal interference!

Unity have posted an update about Unity 5 explaining that they are in fact removing these accessors: Unity 5 API Changes and automatic script updating

Screen Shot 2014-06-24 at 14.12.53

Red Forest – Procedurally Generated Pod Racing

Red Forest: Procedurally Generated Pod Racing -is the current working title of what was previously known as X-Speed and Red Forest.

It is a pod racer with a difference! You won’t see “With Six Tracks!” in our feature list, because upon release, Red Forest will feature INFINITE tracks. That’s right- The tracks are generated at runtime much like the levels in Worms.

Now add hover pods to that, and weapons, and upgrades, and speed! ON TOP OF THAT, Add the fact that even though we’ve not released it yet, you can still play it.

Output0 (2)

That’s right, we’re giving everyone early access for free. It is our view that the best feedback comes from the players, and it seems daft that most games miss out on this crucial feedback prior to release. This means that YOU have control over how the game improves at an earlier stage- and hopefully, you’ll enjoy the game far more for it. This is a bold risk, but we hope you choose to support your favourite games.

Right now, Red forest is limited to 10 tracks and four fully upgradable pods. The pod count will increase over time, and upon release we will remove the track limit.


Stage fright: Talking to an audience

On Thursday, 30th January 2014, I decided, last-minute, to stand up and talk about my game, Red Forest.

Anyone who knows me knows that I am an introvert. This is not a bad thing. I do not dislike socialising, in fact as two months worth of living alone without any entertainment in Manchester proved that I am quite fond of it. I merely like my time to recharge to be alone in my own mind, thinking about whatever interesting things popped up that day. Usually, it’s a GUI bug, or a new way of managing systems.

Introversion naturally causes me to feel uncomfortable in large crowds. Again, there’s nothing wrong with this, it’s just how I am wired. However, it does pose a problem when it comes to attempting to market a product. I should be out there, showing it off, and comfortably giving talks saying, Hey, this is what it is, this is how it works. Instead, I typically stick to my safe zone and keep quiet.

On Thursday, this changed.

You see, at Manchester Unity Users Group, the theme was Procedural Generation. This very theme was very, very relevant seeing that Red Forest is a procedurally generated game. I forced myself to talk to the organisers, and then I did not let myself back down. At this point, I knew it was going to go wrong, but I didn’t care.

Maybe to everyone else in the room this wasn’t a big thing. Anyone reading this who remembers their first talk knows what I am talking about – You have a room full of people staring, judging, waiting patiently to hear what you have to say. This turns your nerves into jelly – and not the wibbly wobbly nice-with-custard jelly, but cat food jelly. It’s still wibbly wobbly, but it’s not nice. and you really don’t appreciate getting it on yourself.

Normally, the first thing you would say would be “Hello, I am Damien Sturdy from Sturdy Games, and I am here to talk about Red Forest.”

What I said: “Ummmm…. So I’m showing off my racer. It’s kind of like Wipe.. I was going to say F-Zero but Wipeout works”.  About 5 minutes of me talking about how it procedurally extrudes a solid mesh along a spline and textures it, I say, “Now, this is actually available for free whilst I develop it”. Then, someone asked the first question: “What’s the site address?”.

Internally I panicked. I think I hid this well actually. I realised I had failed to give the website and that these people had no idea who the rambling fool in front of them was. I’m not particularly ashamed of embarrassment. If someone dared me to wear a dress, I would probably do it. At this point, I said, “Oh, yes! I suppose that would be really helpful for you to know! It’s DamienSturdy.co.uk, and I am Damien Sturdy. Nice to see you all”. A few people giggled. Moment saved? It didn’t feel like it.

Mistake 2, although nobody would have noticed, was that my site is SturdyGames.co.uk, not DamienSturdy.co.uk, which simply points here. It didn’t matter, because at some point that day, something funny happened with the server and I just this morning restored it. It was offline.

After around 5 minutes of internal panic, I had enough, and said, “And well, that’s my game, and it’s procedurally generated. Thank you!”

Something very bizarre happened at this very moment. Everyone there received applause, so that didn’t surprise me, but the audience seemed to pick up on my severe nerves and I got an absolutely massive applause. I walked off buzzing. People told me it was really good, and although I had decided I didn’t care if I was judged up there, it was really nice to know that it was enjoyed.


So, what advice would I give to other first time talkers?

Firstly, if you have stage fright, this is going to be hard no matter how you look at it. I found that although the fact someone I knew was there initially caused more anxiety, their indirect support made me feel more at home front of house. Take a friend for support if possible.

Secondly, you’re going to be nervous. Don’t try not to be. The audience is far more forgiving than you think, so just be as comfortable as you can be with those nerves. This may sound daft, but it is true. I sat at the back before I stood up and instead of thinking “Cack cack cack cack cack! I’m going up! Oh no, Oh no!”, I successfully forgot about the audience and thought about the content. The audience came back to mind when I realised the room was staring at me, by which time it was too late to back down! Also, be comfortable knowing that it will not be perfect. Your nerves are going to show. You will overuse “errr, umm….” but it is far more important to get this one task done.

Then, introduce yourself first. I didn’t. It was silly, and I recovered t later. My talk would have been far, far more professional had I introduced myself calmly at the start. So much so that it is likely the slip ups in the rest of the talk would not have been noticed!

Thirdly, since you are reading this, you have time to plan. If you are talking about a game, try to keep some form of dialogue going as if you were to talk about the game. Get used to talking about its positive traits. I did not know I was going to be up there until 5 minutes before it happened. Hopefully you have more preparation time.

I’ll talk again, and since stage fright doesn’t vanish overnight, I am likely to have the same nerves.

I will, however, be better prepared!


Best of all evils- Mobile phone OSes.

OK. You might want to save this post.

Yesterday, my phone decided to sign me in to every Google service with one password, without asking. I did not want to be logged into chat, or google+. I did not want my position to be known, I wanted my freshly booted phone to simply start the usual, and tell me if I have got a text message, or a voicemail, or a phonecall, or an email.


I Don’t like Google at this moment in time. They take 30% of our sales and do nowhere near the same checking of apps that Apple do, although their OS is open source, which is a good thing. Sadly their newest OS builds seem to spend a lot of time tracking your location for whatever reasons. Disabling Google Services fixes that, but then you can’t use Google Play…

I don’t like Microsoft. They’ve been far too slow to respond to how insecure their OS is, they overcharge for their OS and assume everyone is a pirate; Several OS reinstalls have been required after legal OS installs became non-authentic with no reason.

I don’t like Apple. At least, I don’t like their phone division. Let me explain this: Their phones are under-powered and over-priced. They have good software. I cannot deny this.

Sadly, today, I have to admit to something:

I currently like Apple’s software more than I like Google’s software. I also trust it more.

Apple take 30% of each sale, but they check the apps that are created. They aren’t just checked for bugs, they are checked for behavior, and if they do not meet strict guidelines, the apps are not approved, and the developers are informed. This makes a bit of a pain out of releasing apps- but the result is better, higher quality apps.

Google take 30% of each sale, and do nothing, unless something is reported. (From what I can see.) The OS is secure, and the chances of you getting a virus is around the same as on iOS, but if you install 10 apps that use a system of pushing ads, you end up with an ad-crammed phone.

I’ve always complained that Apple’s phones are underpowered. They are. For the same price, you can get an Android with quite literally double the hardware power. The other day, however I noticed something.

Open up an iPhone.

The majority of the space inside that device is battery. The hardware may be underpowered but for the most part the OS runs really, really smoothly. And then the obvious hit me:

You don’t NEED an octo-core 2.0ghz processor for a mobile OS. You just need an OS that appears to be running smooth to the end user, and shows no unexpected delays.

Use an iPhone. The UI is, for the most part, smooth, and the touch tracking is, sadly for me, a far nicer experience than on an equivalent Android device. The OS is just smooth.

Here’s an argument- one of mine, in fact!

“But I can’t customise it!”

Valid point, but then you realise it, for 90% of the population the sheer amount of tweaking you can do on an Android device is just simply not needed.

For me? I’ll jailbreak it straight away- if I want to do something with it, then I can. It’ll void the warranty but then that’s the same as Rooting your Android device.


I can’t at this time give any views on Windows Phone. I actually really hope that I would like it, despite not liking Windows, simply because for the past few years I have loved to hate Apple. For now though, I hate to say it:


I may have become an Apple appreciator…..





XSpeed update: Initial features

So, on Monday September 2nd 2013, Xspeed reached a milestone.

Features that need to be present for the v1.0 release are completed:

Tournament Mode:

Although we intended to have several tournaments, this is not a requirement of the initial release. Instead, we will add more tournaments at a later date- the initial release will have a single 6-track tournament.

Single Race:

Done.  There’s not a lot to describe here- it’s where things started.

None of the extra race types are implemented for v1.0 but that was never the plan- they were always going to be implemented later on as artwork was built.

Ship Yard:

This is implemented via the ship select screen. Ships can be purchased for currency, which must be earned by racing in tournaments.

Upgrades can be earned simply by winning races at the moment.


We want the game to run on a wide range of hardware. Instead of designing it on an Nvidia card, we’ve designed it on an Intel HD3000 to keep PC requirements down, with options to absolutely minimise rendering so the game should theoretically run on archaic hardware.

The physics type can be reduced for those on slow CPUs. At its lowest level, the CPU requirement for each ship is reduced by 400%. This allowed the game to run on a single core 600mhz phone.

You can also tweak the number of CPU players if required.


As mentioned, Currency is implemented. You earn credits by winning tournaments. You can then buy new ships.


Ships are upgraded via upgrade points instead of currency. Upgrade points are awarded per race rather than per tournament. You will continue to earn upgrade points in each race during a tournament. Upgrade points may be merged into currency at a later date but the idea of keeping them separate ensures you work hard for your ships and upgrades. If we just gave you 10K credits at the end of a tournament, you could spend it all on upgrade credits straight away and you would miss out on a lot of gameplay.


There are three different ship visuals implemented, with 20 types of ship handling. When the artwork is completed, these will be made available.

So, what’s still planned?

The above are the requirements for a first, initial, v1.0 release of Xspeed. They are the most basic functions of the game, but don’t be fooled, they are far from the final feature set.

More tournaments:

There will be more tournaments to play, with a different set of tracks and different AI configurations in each to provide a good challenge.

More ships:

20 ships will be in the very first release. Although there are 3 visible different ships at the moment, there are more configurations of each. It will be more obvious when more meshes have been built as they will be completely different visual vehicles.

The rest is from my previous “What’s the plan?” post:

Race Types:

These are different versions of the standard race. You can enter a tournament of any of these modes. I will not list the Standard Race as this is obvious- What isn’t, is what’s left:

Skirmish Race Type:

Your ships have extended shields at 10x their original capacity- but once you’re out, you’re out. This is a last-man-standing race to 10 laps. If you finish, you score 20 XP, if you don’t, you get nothing!

Death Bowl Race Type:

Ditch the track and replace it with an arena!

Your ships have extended shields at 10x their original capacity- but once you’re out, you’re out.

Try to survive. Ram, shoot, blow up the other vehicles and be the last man standing. XP is distributed as per a standard race.

New Name:

Let’s face it, Xspeed is a terrible name. It’s a shame that Red Forest no longer applies as I loved that.

With that in mind- if you guys can think of a name, we’ll choose one. We’ll pop your name high up in the credits for that one! We’ve had plenty of submissions but feel free to give us your ideas.




XSpeed needs a new name!

Well it has to be said, Xspeed is a pretty shoddy name. It needs to be improved!

So I’m looking for ideas.  Something spiffy, something punchy. It’s got to sound high-tech. It’s got to be something you’ll remember.

Provide your email with your suggestions and I’ll get in touch if we use it and get you in the credits!

OK, Loads of submissions sent. Thank you! I’ve removed the form now because a spam-bot found it, which is a bit unfortunate!

Fake CE Markings are a huge hazard!

Fake CE logo

Fake CE logo

So many of the devices you buy every day come from China that it’s become somewhat of a given. Where is it made? “Oh, Probably in China.”

Some of the stuff that China churns out is fantastic. Cheap but functional tablets, (Some not-so-functional!), £30 TV Andtoid STBs. A £5 replacement phone charger….

And here is where the problem lies. At £5.00, your phone charger is ridiculously cheap. Corners are cut in the manufacturing process. You may not realise this but your phone charger might be about to cause serious harm:


After seeing this video, I decided to search my house for power supplies baring the same mark. The search found FIVE Power supplies. Two were Set Top Box power supply, Two were for cheap Android device power supplies, One was for the Nintendo DS.

If you don’t really want to watch or do not understand that video, here is the basic message:

Cheap power supplies are cutting corners, placing components too close together, providing a risk that the full current gets sent down the charge cable and into your device- and possibly into you. This has been getting a bit of attention recently but only in the form of iPhone chargers but I can tell you it applies to SO MUCH MORE than just chargers.

How can you spot a problem device?

Apart from obviously looking at it and deciding that it’s of too poor quality to trust- a good power supply will be quite chunky to spread out the components- and fit more of them in- a massive tell-tale sign lies with the CE stamp:


Fake CE Logo

Looks fine right? You’ve seen it a million times, right?


Wrong. This and the following 6 are actually signs for “China Export” and not  “Conformité Européenne”.


More make CE logos



The correct CE logo looks like this:


CE Marking

Correct layout of CE logo


This shows the layout. the C and the E are set in their own circles, and the centre line of the E is inset slightly. If the C and the E are closer than this, it is NOT The official CE logo.

If an item is not stamped with the official “CE” stamp then it likely does not conform to many European safety measures. For instance, plastic should be fire retardant. Remove the source of heat and the fire should go out. This is NOT the case with many Chinese import devices. Tests have shown the devices continue to burn when on fire posing a significant risk to your house and your loved ones even if you are not home.

So watch yourself. Be careful. If your item has one of the previous 6 CE icons, it could be dangerous. Check before you buy!

As a precaution I have removed the 5 power supplies bearing the fake icon and I suggest you all do the same. I don’t know about you, but I love life, I love my family, and I love my house. I’d quite like to keep all three.

No more buying £5.00 power supplies!


XSpeed Dev Diary- What’s the plan, Sturdy?

So, as you can ask my wife, I’ve not really been spotted in the wild over the past couple of weeks. The reason is that I’ve upped my efforts with X Speed with the intention of getting it ready for release. There’s a slightly older playable version of the game available to play online here.

There’s a LOT still left to do, but most of the hard work is done. Xspeed now contains:

Now Completed:

  • 20 of my favourite tracks- This will be increased. The track generator is procedural to keep size down- I just pick my favourites out and stick them into the pack. I’d like to have this generator completely unlocked but due to it being almost impossible to 100% produce usable tracks it’s unlikely at the moment.
  • AI that can avoid track obstructions. Place an object on the track and they’ll see it and avoid it. No need to tell them it’s there beforehand.
  • 3 Ships – Each ship with slightly different attributes. More ships in progress.
  • 27 Upgrades per ship. As you win upgrade points you can improve on your handling, speed, or acceleration.
  • Scoring. XP earned per race based on your position, plus upgrade points scored for every 20 xp. I’m not going with the whole leveling system just yet- I’m not sure it applies, so XP is linear- oh, and this is per ship!

I’d like to go into what I’ve added over the last few days. Those of you who saw the game last week will have noticed I had completed the Ship Select screen. Well, I wasn’t happy, and redesigned the lot.

New Ship Select

The current dev version contains three ships, an upgrade screen, and a paint screen. Clicking between the two animates the rotating ship image around the screen, which gives a far more polished look.


Whenever you win a race, you score points based on 20-(Position*2). The result is that for first place, you score 20 XP. For tenth place, you get 2 XP.  XP are applied to each ship rather than the player. (This is up for discussion- I may globalise them.)

For every 20 XP, you gain an upgrade point for the ship you are racing.

Each of your ships can have 27 upgrades each. As mentioned above these can be applied to Acceleration, Handling or Speed.

You need to be careful when upgrading. Simply upgrading your max speed first will not give you an advantage; Increasing your max speed lowers your acceleration and handling. If you’ve got a track with a long straight, you can choose to have a high max speed but low acceleration as you’ll catch them on the straights, but if it’s a very windy track you’ll find the others will catch you pretty quickly.

If you upgrade your handling it’ll affect your acceleration and power slightly, so maximising your handling will allow you to take your corners brilliantly with very little drift but you’ll struggle to keep up. Failing to upgrade your handling will mean you spend most of your time trying to fight sideways drift.

Upgrade your acceleration to max but neglect the rest and you’ll have a ship that gets up to full speed really quickly, but the other ships will be faster than you.

So balance it into a ship that you can control and compete with.

The AI will match your upgrades- but they will do it sensibly.  The aim is to constantly provide a challenge. If you have got 9 upgrades, and have applied them all to Speed- the CPU are far more likely to apply 3 to Acceleration, 4 to Handling, 2 to Power- and other variations like this.

It’s worth pushing- because as you increase your speed you increase the thrill, challenge, and how you play. At high speeds you need to concentrate on the track more, but stay out of the way of fire- much easier to do at lower speeds!

With great play, it’s possible to fully upgrade each ship in 27 races, but as long as you finish 10th or above, you’ll eventually earn your upgrades. This game will not have a “Game Over!” – you just keep going until you get what you want.

Well, that’s where we are so far!


So What’s left?

Tournament Mode

[This is currently in progress!]

In tournament mode you are pitted against other ships of similar configuration to your own across tournaments of 3-5 tracks.

Winning these tournaments earn you in-game currency:

£10,000 for first place

£5,000 for second place

£1,000 for third place

£500 for fourth

£250 for fifth.

Earnings can be used to unlock ships from the ship yard, which will then become available in your garage at race time.


[Still to-do!]

The ship yard contains a multitude of new and used ships. Used ships will have slightly lower stats to new ship but are still upgradable. New ships cost more but will handle better first time and the upgrades will be more efficient.

You can purchase the same ship multiple times so that you can have different configurations without having to customise your upgrades each time.

Race Types

[Still to-do!]

These are different versions of the standard race. You can enter a tournament of any of these modes. I will not list the Standard Race as this is obvious- What isn’t, is what’s left:

Skirmish Race Type

[Still to-do!]

Your ships have extended shields at 10x their original capacity- but once you’re out, you’re out. This is a last-man-standing race to 10 laps. If you finish, you score 20 XP, if you don’t, you get nothing!

Death Bowl Race Type

[Still to-do!]

Ditch the track and replace it with an arena!

Your ships have extended shields at 10x their original capacity- but once you’re out, you’re out.

Try to survive. Ram, shoot, blow up the other vehicles and be the last man standing. XP is distributed as per a standard race.

New Name

Let’s face it, Xspeed is a terrible name. It’s a shame that Red Forest no longer applies as I loved that.

With that in mind- if you guys can think of a name, we’ll choose one. We’ll pop your name high up in the credits for that one!


And that’s where we’re at.

There’s still LOADS to do. The AI for Arena mode is already in (the whole game used to be an arena battle game!) so that’s some time saved. I expect Tournament Mode and maybe Skirmish will be in within the next 4 weeks.

We’re looking to get this released for November on whatever platforms we can wedge it onto.

Right- More next month. Thanks for reading!






X-Speed (Red Forest part 2)

Continued  from this post:

With Red Forest, I wanted a hover-racer, but I needed it to be easy to update and add extras. The amount of effort required to create each track was immense. How could I solve this problem?

X Speed



It quickly became obvious that although I liked the feeling of the simulated hover vehicles moving over bumpy terrain, others disagreed. This combined with the effort required for each track made me think:

What if I procedurally created my tracks?

I then found this post, which got me started on my idea. I could remove my terrain, lay out waypoints and generate a track to follow them. Awesome! Getting that to work well was very, very difficult at first- I’ll go into more detail on how I fixed that in a future post, because it’s quite interesting, but it doesn’t fit here.

I bought a cheap “city building” pack from the Unity Asset store and spent quite some time working on a track generator that produces quite interesting tracks with a city theme. As a result, we could no longer call the game Red Forest- now it’s called X-speed, until we can get a better name for it!

So what’s different?

  • AI ships use 75% less Raycasts than Player ships to reduce CPU usage on mobile devices. the player ship still uses all 4 for full “hover” simulation. You don’t notice the CPUs using full hover simulation so this is a massive saving for minimal change to gameplay.
  • Procedurally generated tracks: The tracks generate city pieces around the racing area giving it a populated feel.
  • Better textures: I wrote a ship shader so that each ship is a single pass render, rather than three passes is Red Forest. I wrote a single shader that takes a base detail map, and second and third texture layers that are used as paint layers. It’s specular too, so they look nice and shiny, and all in a single draw call!
  • Shadows: Unity added shadows to Unity Basic recently, and as a result, there’s a HUGE improvement in visuals on desktop platforms!
  • Better physics on the player ship: Ships now gain speed going down ramps and can better handle up-ramps.
  • SPEED: Its faster than Red Forest- more of the adrenaline pumping racing action. Not only does it feel faster, but it runs faster, too. Less CPU and GPU usage as there’s no terrain system and the internal calculations have been refactored.
  • Controls: They’re less juddery when the framerate drops, and as of the next update, keyboard control is now viable. Previously, keyboard controls were terrible and too sensitive.

You can play the current Xspeed prototype here. At the moment, the track generator occasionally puts a city piece on the track. A fix has already been prepared and will be uploaded after testing.

Gravity Ed

So, so far I’ve managed not to put a thing about my pet project, Gravity Ed, on here, which seems absolutely DAFT.


CameraZOOM-20120627110619482    ged2     ged5





Gravity Ed started life about 18 months ago when I scribbled a 1-screen puzzle on a piece of paper:





And it fast grew into a little old platformer (Here’s a playable version of the first prototype.)

I created most of the visuals myself- not bad considering I’m no artist! It took a couple of months to get to where you see it below (press E in the demo above to get the editor.)






The idea was that you’d need to use the gravity wells (You can see them when playing) to open up paths to the finish. Sometimes you could see a gravity well but you couldn’t reach it- What to do? Find an item, pick it up,  jump at the gravity well and throw it. It’ll then get carried away following the gravity well and land on a trigger, opening the door.

It was all very, very fun, but it lacked something. It looked too old, and competition is fierce, so after 8 months I decided to attempt it in Unity, where I had more mature 3D and I had better control over visuals.


Here’s a split screen; Old vs the first Unity Version:




I’ve been working with Georgina O’Neill of TheUpsideDownTree.com and Matt Hale of Hark Pictures. Between them they have bought Ed and the surrounding scenery to life. I wanted the game to feel retro, but with sharper graphics. Avoiding the loss of the retro feel and allowing sharper graphics is quite difficult, it turns out, but when you play it you FEEL the retro, but SEE modern.

The way this game is being built is unique. The images are drawn onto large pieces of paper and then scanned into Photoshop where they are polished prior to sending to me to implement. They look fantastic, and the level of detail means in the future a HD version is easy.

Ed himself is animated in Spine- meaning his legs, feet, arms were each individually drawn and scanned, leaving me to animate the guy!

It has all the gravity fun, a 3D element (visually), bad guys, puzzles… and lots of twisty fun.

Sadly this process takes time, 9 months later we are at the image below and only the first level is nearing completion.

Ladies and gentlemen, I introduce the current iteration of Gravity Ed:

(No playable version just yet- but we’re so close now!)