Working from home

Hi Everyone

Last few weeks have been interesting. We’ve been moving to a new house during a global pandemic as well as working from home for the first time.

I have to say I am really enjoying working from home, I expected it to be a lonely experience since I would be missing the banter between myself and other game developers I work with.

Using Zoom has helped prevent this. Daily video meetings make you feel you are still working in a team towards the same goal.

Once I got used to working in a quite office, I found my productivity increased. I could concentrate better, and I no longer get the end of the day headache or weekly migraines that I use to have.

Although I think this is also down to less artificial light (photophobia) and my new glasses I got from Therespecs. So hopefully when this pandemic is over this will remain to be the case.

Other steps I have taken to make working from home easier was to setup an office. This is so when I finish for the day, I don’t still feel like I am at work. I still get that distance between office and home, which is essential for a health life balance.

I will also be using this setup to do my PhD and game projects in my spare time. Just being in the room I’ve setup puts me in a different frame of mind to when I was working with my laptop in front of my TV.  I am going to make this room as a den of video game goodness, to keep me inspired and motivated during those difficult months.

So my home working tips

1) Get dressed as you would usually for a day’s work. Don’t sit around in your pjs all day, skip showers etc. because you don’t have too. Keeping to your old routine will help keep you in that “work needs to be done frame of mind”.

2) Stay in contact with your work collogues, whether through zoom/skype/face time/steam chat etc. Esp if you need help with a task. Remember your not alone.

3) Set up a place for your work and only your work.  This will help to minimize distractions, (Unless you have four cats….. enough said about that) and keep you focused.

5) Take regular breaks including your full lunch break hour. Go out for a walk if you can (while keeping your distance from others)

4) Try not to be tempted to go back into the office to get that one last thing done… I know I have broken this rule several times already but getting down time is important to your mental and physical health.

So what else have I been up to, well I made a start on my PhD proposal, I will get the first draft of this finished by the end of April and make the needed changes next month.

I have also been looking at one of my older projects that I would like to finish. My intention was to add some ragdoll physics when the player or the AI crashes however I noticed some AI bugs that I chose to fix first.

Bug fixing AI is a difficult task, which is why I recommend adding as much debugging information to your running game as possible.

In unity you can use Debug.Drawline and Gizmos. Gizmos only render from the OnDrawGizmos call, so to keep things simple especially with objects that are not inheriting from MonoBehaviour you will want a centralized method to do this from, this can be done easily using delegates.

I normally put this in my Game Controller obj, first you will need to create your delegate.

#if UNITY_EDITOR
    public delegate void OnDebugRender();
    public static event OnDebugRender DebugRender;
#endif

Then you will want to add your OnDrawGizmos method to your game controller class, and then add call your delegate

#if UNITY_EDITOR
    private void OnDrawGizmos()
    {
        if ( DebugRender != null )
        {
            DebugRender();
        }
    }
#endif

Now in your objects you want to display debug information for, choose your class where this information will lie add a method with the same arguments as your debug delegate.

#if UNITY_EDITOR
   void DebugRender()
   {
   }
#endif

Then add this method to the delegate you created in the game controller class.

    void Start()
    {
#if UNITY_EDITOR
        GameController.DebugRender += DebugRender;
#endif
    }

Make sure to remove the delegates when they are done.

    ~Avoid()
    {
#if UNITY_EDITOR
        GameController.DebugRender -= DebugRender;
#endif
    }

It is important to remember OnDrawGizmos will run when in the editor even if the game is’nt running, so you will want to add something to clean up your debug code when this occurs

#if UNITY_EDITOR
    void DebugRender()
    {
        if ( !UnityEditor.EditorApplication.isPlaying )
        {
            GameController.DebugRender -= DebugRender;
            return;
        }
    }
#endif

As a side note you will notice I use #if UNITY_EDITOR this is so when the final game is built this code is not added to it.

Will make another post soon, now I am moved into our new house I have much more time to do this kind of thing. Once my project proposal is done and I move onto my next stage of my PhD I will also post this here.

Leave a comment

Your email address will not be published. Required fields are marked *