Developing Universal Apps for Windows 8 and Windows Phone 8 using Unity3d

1. Introduction
The amount of quality apps and games on both Windows and Windows Phone is rapidly increasing, and the similarity between the platforms when it comes to development is really close. Creating a Windows 8.1 app or game, and then porting it to Windows Phone 8.1 is usually a small task.

2. What is Universal apps
Universal app is a project type that enables you to create an app once that shares code, and generates an app packaged for both Windows Store and Windows Phone Store – as a result from the Windows platform convergence movement. This doesn’t mean that there is a magic button that just creates a package for the other platform – since you still need to account for the different form factors, handle certain launchers that only makes sense on a mobile device and so on.

But we are at a level where most of the function calls of the SDKs are similar, they share the revenue model, installs across devices, shares the in-app purchases, got the same pricing structure, will get linked in the store. If you buy the app on a Windows Phone, it will also be available on the Windows Store.


As you can see in the screenshot above, there is a small text below the game pictures, on the right side:

Unity3d ( exports Universal Apps for FREE (no need to have a PRO license) – as I did with my game Truck Trials. And in this tutorials, I will show you the steps required to export and find the packages.

You can read more about Universal Apps here:

3. Exporting
Using Unity3d, exporting is very simple. In your unity game project, go to the export

When you export the Universal App, it will generate a Visual Studio Solution that contains three projects. One for Windows, one for Windows Phone and one Shared project that contains logic that is shared between both platforms.

You can then build and generate the app packages from the Visual Studio solution. One will be fore Windows Phone 8.1 (ARM), and another for Windows 8.1 (ARM and x86).


4. Publishing

Follow these great guides for a step-by-step guide to publish your app.

Windows 8:

Windows Phone 8:

Posted in Tutorial, Windows 8, Windows Phone | Leave a comment

Truck Trials released for Windows 8.1 and Windows Phone 8


My latest game for Windows 8.1 and Windows Phone 8 is released, and can be downloaded for free here:
image image

The game takes you to a trial track where you have to maneouver a heavy truck through harsh environment, hills and jumps as fast as you can! You are free to design and change the look of your truck, change your name and play both in Time Trial and online 1 vs 1 race.

I got the inspiration for the logo from the american interstate road signs, and added a truck grill and mirrors to make it look a bit like a truck, but at the same time have similar looks to the NBA, NASCAR, NHL, MLB, NFL++ logos.

left-43868_640 image

It’s a connected game, so you need to be connected to the internet to be able to play. An account will be created for you when you first start the game.


30 tonnes, 200 km/h, 20 meters up in the air, welcome to Truck Trials, a high pace, side scrolling physics based racing game!

Create, design, and race a heavy truck against random players in the biggest truck trial racing tournament ever!

Unlock truck parts, put them together and give them a color to create a truck that fits your style! The top three players will see their design nicely lined up on the throne in the ranking screen!

Play against random players, win and earn credits, and become the ultimate truck racing champion!

Race against time! Can you beat your personal record?

The game requires internet connection. When playing for the first time, an account will be created for you.

TOUCH: Tilt your truck by touching on the left side of the screen, accelerate/break/reverse with gas pedal.

KEYBOARD: Accelerate with W, break/reverse with S, and tilt the truck with A and D – or use the same set up but with the arrow keys.

image image

Posted in Uncategorized | Leave a comment

Support Norse Noir: Loki’s Exile, a classical point ’n click adventure game on Kickstarter!


Some of the guys behind awesome games such as Anarchy Online, Pets vs. Monsters, The Secret World, My Kingdom++ has gone live with a classic style, hand-drawn adventure game (hence Day of the Tentacles, Kingdoms Quest, Sam & Max, Indiana Jones) on Kickstarter.

Being a big fan of these types of games, I found it right to spread the word to help them make this project a reality. I really want to play this game and see what’s behind this strange setting of a story.

It seems like the game takes place in what looks like the typical American 20s, with art that gives me the good old adventure game feeling – and it seems to include magic, what more can I ask for?

We need more classical adventure games, so if you are an adventure game fan like me, you should help them by supporting them on Kickstarter:



The Story (copied from Kickstarter):

In Norse Noir: Loki’s Exile, players take on the role of one Lars Kristiansen, an immigrant from Norway to the United States who is facing rough times. Once a low-level courier for the local mafia famed for his amazing luck, Lars is now relegated to making money as best he can as a street magician, offering shows three times weekly at the local watering hole The Cold Trout. After a sudden change of leadership in the local racket Lars has found himself scraping lately to make ends meet… ends that may be coming a lot sooner than expected.

In-game screenshot In-game screenshot

Our story opens with Lars in dire straits, tied to a chair in the back room of the local pawn shop and staring down an angry mobster with a chip on his shoulder and bat in hand – Apparently he’s missed a few too many payments on an outstanding loan he owns, and the mafia is ready to collect. After a brief encounter with the lethal Swahn sisters, current overseers of the city’s underbelly, Lars is given only a few days to scrape together the rest of the money he owes, or it could be curtains.

In his quest for cash, Lars quickly stumbles across a series of events that leave him questioning himself, his friends, and even the very nature of reality itself. With muscle-bound mooks breathing down his neck and a mysterious pendant that seems to be making him public enemy number one, Lars is going to have to do some quick thinking, fast talking and probably some swift running if he wants to make it through this adventure!

With a solid focus on fun, humorous writing, Loki’s Exile aims to be a family-friendly adventure title that appeals to all ages.


Posted in Uncategorized | Leave a comment

Trolls vs Vikings available for Windows 8.1


For the past few months I have been lending my helping hand to the game developers at “Megapop” to create a Windows 8.1 version of the game “Trolls vs Vikings”. It has been a really fun project to work on, and it feels good to finally see it published in the Windows Store!

Megapop is a Norwegian startup with a really talented crew – solving every challenge we met quickly. The company was established in 2012, and was founded by some of the most experienced and innovative online game developers in Europe.

You can download the game from Windows Store here:



iPad Screenshot 1

iPad Screenshot 3

iPad Screenshot 4

iPad Screenshot 5

Posted in Game programming, Gaming, Windows 8 | 2 Comments

Starcomet Online released for Windows 8.1 and Windows Phone 8


I’m happy to announce that Starcomet Online is now released for Windows Phone 8 and Windows 8.1!

The game can be downloaded for FREE from the following stores:
image image



In a distant galaxy, a new and very special comet is born – the Starcomet.
For the next million years, it will travel across the universe to visit many different galaxies and find their secrets.

Explore 6 galaxies with 50+ puzzles to solve and find its secrets!

Race against players all over the world in real-time multiplayer races. Level up your comet, unlock customization possibilities and reach for the stars!

Who will have the highest level?
Who will be the best racer?
Who will have the coolest comet?
Who will rule the galaxy at the top of the Hall of Fame?

Millions of customization possibilities – Shape and customize your comet with 50 colors, 50 shapes and 8 rare artifacts to create a unique and awesome comet nobody else has.

Create a name, and get known in the galaxies of Starcomet Online!



Posted in Uncategorized | 1 Comment

Setting up a DirectX 11 project in Visual Studio 2013 (and Visual Studio 2012)

image   image

A question I keep receiving is how to use Visual Studio 2013 (or 2012) with the DirectX 11 (June 2010) SDK, so DX can be used on apps outside the Windows Store framework.

So, I decided to post a quick solution on this.

Luckily, it’s very simple.

What we will do is to first make sure the DX SDK is installed, then create a new VS 2013 project and set the right paths.

I) Install the DirectX 11 (June 2010)

II) Create a new empty Visual C++ project


III) Set the proper directories/paths in Project Properties
Right click the project and select properties, and the project properties window will pop up.


First of all, make sure the Configuration is set to All Configurations:


Now, select VC++ Directories from the list:

The last thing we need to do is to set the Include directory, the Libraries directory and optionally the executables directory:

EXE: $(DXSDK_DIR)Utilities\bin\x86
Inc: $(DXSDK_DIR)Include
Lib: $(DXSDK_DIR)Lib\x86;$(LibraryPath)

This is done by clicking the dropdown arrow on the end of the text fields and clicking edit:

In the popup, click the right side of the text box to set the path, or paste in the path above:



Do this for the Executables Directories, the Include Directories and the Library Directories properties.

Good luck and enjoy DirectX 11 development in Visual Studio 2013 ! Smile

Posted in DirectX, DirectX11, Visual Studio 2012, visual studio 2013, VS12, VS13 | 2 Comments

The Making of Starcomet Online


The Starcomet Project started in July 2013 where I wanted to learn both Unity3d and how Unity3d works when it comes to multiplayer games.

It started out as a simple Game Jam game where I spent a few hours on how I wanted the game to work. But after a while I actually enjoyed playing it so I decided to continue working on the game and finish it up (I tend to try and complete most of my projects) – creating a few worlds, making a complete backend in Windows Azure to store player info for the multiplayer games and so on.

In other words, the game is created in Unity3d, and exported as a Windows Store game – a just for fun project! Smile

The game is currently only available to Windows 8.1 users, but a Windows Phone 8 version is under development (BETA stage).

See Section X for info about the download, or just follow this link (takes you to the Windows Store):


I .  T H E   C O M E T
The comet is what the player controls in the game, and it’s really just a few particle engines combined. Your job is to fly this as fast as possible, and try to maintain max speed as much as possible.

Two particle emitters are used create the front, and two to create the tail. In addition to this, the player has the possibility to add an artifact that can add another shape or look.

These are fully customizable by the player. By playing the game, more colors and shapes to create the comet you want will be available – by either playing the game, or buy from the Star Shop.

The comet is driven by forces, pulling the comet down (gravity). This force can be channeled as a forward driving force by the player, making the comet move forward instead of down, or even up if adding much!


Every time you make a modification to the comets path, it needs to build up the acceleration.

The controls are simple, just press space or touch the screen to apply a force. Gain speed by going as straight as possible (either up, to the sides, or down). Turning a lot will make the comet loose some of the speed and thus, needs to accelerate again.

It’s based on the typical helicave game, where you need to fly a chopper through a cave.

A simple formula is used to modify how fast the comet will move forward. In other words, try to fly as straight forward as possible to reach the goal.



I I .   N A V I G A T I N G
Navigating is simple. You need to find goal, and the direction to the goal is always present by a direction arrow:


Follow the arrow, and you will find the goal!

The arrow is a plane surrounding the player, and is rotated toward goal.

It checks the position of the goal, and calculates the angle of the vector towards goal, every frame.

(GTA style.. Smilefjes)


But, the direction to the goal is only that, a direction to the goal. You will need to navigate the space, avoid obstacles, find keys and so on to get there. So simply following the arrow won’t always help!

Luckily, there is another tool you can use to fid your way, and that is a path made of stars. It can be seen in every level. Following this path will take you to the goal – but the rest is up to you! Smile

The star path is a spline curve that moves from the start of the level, bending through the environment and ending at the goal. A particle emitter moves on this path to spawn the stars so the path is illuminated by stars.



I I I .   C O M P L E T I N G   L E V E L S
Completing levels is as simple as getting to the goal as fast as possible.

This means you will need to find a path that is as straight as possible to the goal. Every level got different types of puzzles to solve, from flying fast, to navigating a labyrinth of asteroids and rocks.


Most of the levels contains a set of Orions that can be collected to save 0.5 seconds. By collecting 3 of them, 1.5 sec will be deducted from your total time!

When completing a level, the total time is used to give the player a rating based on their performance (stars).

The game comes with 5 galaxies in total, each with multiple levels inside. But plans for expansions is in place, if the game gets any downloads!


Also, by completing the level, the player earns Starcredits – an in-game currency that can be used to buy items from the store!



I V .   C U S T O M I Z E
A big part of the game is the possibility to customize and create your own comet. You can buy new colors and parts from the store, and unlock them by playing the single player game.

There are three main types of customization, colors, shapes and artifacts.

The colors lets you give each part of the comet their own color, the shape modifies the physical look and the artifact can do a lot of different stuff (like adding dust from the northern light to your tail, or make the comet solid ++).




This is implemented in a simple way, just a lookup on the selected ID, and then change the material based on that for each of the 4 different particle engines. Also, the selected colors of the comet modifies how the explosion will look!


The materials are all in the same folder, with the ID as the name for easy lookup.


In this way, I have the possibility to change the look and how the shape will blend with the backgrund by just changing the materials shader and texture – creating many unique looking shapes with a lot of different possibilities.

V .   M U L T I P L A Y E R
The multiplayer race mode of the game is simply two (or four in later versions) comets that race against each other in real time. Create a unique looking comet, set a nickname and race against players from all over the world.

The selection of what level the players will compete in is random, but in one of the next versions, I will create shorter and simpler tracks for players with a low level, and longer and more complex for the veteran players.

The players gain XP by completing matches. The winner will get the most, but the looser will gain some. Also, the in-game currency Starcredits is also awarded.

The mechanism is very simple, the players customizations, tranformation, time and placements are communicated between each player in a peer-to-peer environment. When the player starts a multiplayer session, the player is given a unique room if no other rooms are available, or joining an existing room (automatically happening behind the scenes).

Starcomet Online skjermbilde 0

A timeline on the bottom of the screen is used to see where the other players are relative to you, and the view on the top-left is used to display who you are racing against, and what level they are.

To get smooth transformations between the players, the positions are interpolated between the last know position on the server, and the current local position. This is then communicated with the other players in the same room.



V I .   B U I L D I N G   W O R L D S

The game got one Unity scene for all the levels as there is a lot that is similar between everything – and then a prefab is created for each different level containing the position of the goal, each orions, keys (if any), doors (if any), the landscape and so on. When the game starts, the engine knows what prefab to load based on the level ID, and then instansiates it to the scene that represents the level.

Each of these prefabs are made in the Unity editor for simplicity (phew, didn’t need to write a Level editor for this game!!)


The items are just placed out in the prefab, and stored for loading by the game engine. Each item are tagged based on what they are (like solids, orions, goal) so the player can interact with them properly.

All these items are created as separate prefabs, so to add a wall, or a direction changer, or a key, all that is needed is to drag the proper prefab to the levels prefab and place it. The ground is created with the polygon tool.

Starcomet Online skjermbilde 2


V I I .   B A C K E N D   I N   W I N D O W S   A Z U R E
The games backend is hosted in Windows Azure using various services like Mobile Services and VMs. These can be simple lookup tables that tells us what level we are – based on total XP, how much XP we have, what unlocks has been done and what items from the store has been bought.

Also, transaction history and time stamps are stored for security reasons.
image image

The Windows Azure Mobile Services are free to host on a project on this scale, but if you are creating a big game with a lot of users, more options are available.


Also, a news feed located on the Main Menu of the game is displayed, so that I as the creator of the game can communicate with the players with different messaging. This can be news, known bugs (critical), competitions and happy holiday wishes.

I also added a function to the News System that enables me to give the reader of the news message an item. This can be like Santas hat on Christams eve and so on.

To handle in-app purchases I creaded a custom plugin project with a project for each of the plaform I wanted to support. This solution is created using Visual Studio 2013, and produces a DLL file that needs to be put in the plugin folder of the game.


I also created a test project for Windows Store, simply to test the plugin.

The Windows Azure Mobile Service is connected with a unique Live ID, enabeling a more secure login solution to the services using the bound Microsft Account on the device to create a game account.

Then the plugin was written for each platform – mostly the same as the two platformas are pretty similar, but a few modifications had to made for each.

V I I I .  S H O P
The game comes with a shop, where you can create a premium subscription, and buy additional Starcredits.

The game is created in a way that you can earn Starcredits by just playing the game a lot. But, also, the player can buy more if a desired item is needed quickly.

I like to enable the player to play a lot and buy the needed items instead of buying it if he/she wants.





I X .   D O W N L O A D
You can download the game for FREE here:

A Windows Phone 8 version is in the development.

X .   T H A N K S

A special thanks to Thomas Beswick for helping me when needed (Unity was a new tool for me), to Tuuli for support and mybrothers Olav and Paul for testing.

Also, thanks to all the testers in the Beta Program – more versions are on the way so be ready! Smile

Posted in Uncategorized | Leave a comment