A new interview is here! Let’s talk with Fuglesang:

20160220-Splashjam 2016-36-3

Tell us who you are and what do you do on the team.

Hi, I’m Andreas. I’m the CEO but also work as a programmer. I co-founded Moondrop in late 2009 and took over the role as CEO in 2011.

 

What is the most difficult part of your job?

Since I function as two roles in the company, it can be hard to juggle priority between tasks. Sometimes both roles require immediate attention which in turn makes everything just take more time.

 

And the part you enjoy the most?

My heart lies with programming so that is definitely the part I enjoy the most. Finding simple solutions to complicated problems and writing understandable and maintainable code is what I strive for. Over the years I’ve become less tolerant of over-engineered code unless it has a known purpose in the future and must be that way. I mostly thank attending Game Jams for this as it helps me stay pragmatic.

 

You made your own engine in the past, and now you are using Unity. What are the pros and cons of one way and the other?

Today, 3rd party game engines are so mature that there are few reasons to write your own. There are even different engines for various skill level and ambitions. The big disadvantage of using 3rd party engines is the potentially long wait for bugs to get fixed and features to be added, and that can delay your own progress. But it’s insignificant compared to the time it takes to write your own engine. I think you should only write your own because of these reasons:

  • To learn about the inner workings of a game engine.
  • Your game needs a feature that a 3rd party engine doesn’t have and can’t support.
  • You have the knowledge and skill required to make an engine (you probably don’t).
  • You have a lot of time and money, and one of the above is true.

 

What IDE (Integrated development environment) you use? What are your favorite add-ons and for it? How do they help you on your task?

With Unity, I use Visual Studio because of its no-fuzz integration. Just install them and start working. But my favorite ones to use for everything else is Sublime Text and Atom. I like how bare-boned they are and that you can simply add the features you need. Amphora was written using only Sublime Text.

My favorite add-ons:

 

What feature of Degrees of Separation do you feel more proud of?

There is no particular feature I feel more proud of as I think most of it is (and forever will be) half-finished. If anything it might be what I call “SimpleState” which is in practice a state machine. It’s simple (hence the name) but has a lot of utility if used correctly, especially to write maintainable code.

using UnityEngine;
using System;

[Serializable]
public class SimpleState<T> where T : struct, IComparable, IConvertible, IFormattable
{
	[SerializeField]
	private int _state = 0;
	[SerializeField]
	private int _previous_state = 0;

	public int value { get { return _state; } }
	public int previousValue { get { return _previous_state; } }
	public int count { get { return _Count( _state ); } }
	public int previousCount { get { return _Count( _previous_state ); } }

	public EnumState( )
	{
		//--
	}

	public EnumState( T state_ )
	{
		Set( state_ );
	}

	public void Clear( )
	{
		_previous_state = _state;
		_state = 0;
	}

	public void Set( T state_ )
	{
		_previous_state = _state;
		_state = Convert.ToInt32( state_ );
	}

	public void Add( T state_ )
	{
		_previous_state = _state;
		_state |= Convert.ToInt32( state_ );
	}

	public void Remove( T state_ )
	{
		_previous_state = _state;
		_state &= ~Convert.ToInt32( state_ );
	}

	public void Toggle( T state_ )
	{
		_previous_state = _state;
		_state ^= Convert.ToInt32( state_ );
	}

	public bool Is( T state_ )
	{
		return (_state & Convert.ToInt32( state_ )) != 0 ? true : false;
	}

	public bool IsOnly( T state_ )
	{
		return _state == Convert.ToInt32( state_ ) ? true : false;
	}

	public bool IsNone( )
	{
		return _state == 0 ? true : false;
	}

	public bool Was( T state_ )
	{
		return (_previous_state & Convert.ToInt32( state_ )) != 0 ? true : false;
	}

	public bool WasOnly( T state_ )
	{
		return _previous_state == Convert.ToInt32( state_ ) ? true : false;
	}

	public bool Any( )
	{
		return _state != 0 ? true : false;
	}

	public bool WasAny( )
	{
		return _previous_state != 0 ? true : false;
	}

	new public string ToString( )
	{
		char[] b = new char[32];
		int pos = 31;
		int i = 0;

		while( i < 32 )
		{
			b[pos] = (_state & (1 << i)) != 0 ? '1' : '0'; pos--; i++; } return new string( b ); } private int _Count( int state_ ) { int i = state_; i = state_ - ((i >> 1) & 0x55555555);
		i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
		return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
	}
}

using UnityEngine;
using System.Collections;

public enum PlayerStates
{
	None = 0,
	Idle = 1<<0,
	Walk = 1<<1,
	Jump = 1<<2
}

public class EnumStateTest : MonoBehaviour
{
	private EnumState<PlayerStates> _state;

	private void Start( )
	{
		_state = new EnumState<PlayerStates>( PlayerStates.Idle );
	}

	private void Update( )
	{
		// Check if player wants to/can jump
		// Check if player wants to/can move

		if( _state.Is( PlayerStates.Jump ) )
		{
			if( _HasLanded( ) )
			{
				if( _PlayerWantsToMove( ) )
				{
					_SetAnimation( PlayerStates.Walk );
					_state.Set( PlayerStates.Walk );
				}
				else
				{
					_SetAnimation( PlayerStates.Idle );
					_state.Set( PlayerStates.Idle );
				}
			}
			else
			{
				_ApplyDrag( );
			}
		}
		else if( _state.Is( PlayerStates.Walk ) )
		{
			if( _PlayerStoppedMoving( ) )
			{
				_SetAnimation( PlayerStates.Idle );
				_state.Set( PlayerStates.Idle );
			}
			else
			{
				_ApplyMovement( );
			}
		}
		else if( _state.Is( PlayerStates.Idle ) )
		{
			if( _PlayerWantsToJump( ) )
			{
				_AddJumpForce( );
				_SetAnimation( PlayerStates.Jump );
				_state.Set( PlayerStates.Jump );
			}
			else if( _PlayerWantsToMove( ) )
			{
				_ApplyMovement( );
				_SetAnimation( PlayerStates.Walk );
				_state.Set( PlayerStates.Walk );
			}
		}
	}
}

 

What is that amazing thing about Degrees of Separation you love the most?

The broad range of people that can play the game. It’s purposefully designed this way since we take inspiration from how Disney, Pixar, Nintendo and others make their products, and how well the concept works for this is amazing.

I also have high expectation of the combination of how the exploration and the puzzles will work together. This has not been fulfilled quite yet and I’m excited to see when we get closer to completing the game.

 

Share a screenshot you love, and tell us why. It can be inside Unity Editor, in-game, or showing your favorite software tool!

IMG_07012014_012104

The original character art made by Monica Rong (http://monicarong.no/) in cooperation with Owe has been my favorite one since we started with the concept. To me, it perfectly portrays the vision, and it’s the soul of the game.