99 Levels To Hell enters Steam Greenlight

We need your help!

We just put 99 Levels To Hell on Steam Greenlight and we need all the upvotes we can get,
You want the game on Steam right?!


Up Vote 99 Levels To Hell on Greenlight Here





  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry featured on Amazon Appstore

Just heard from EA that Amazon have featured us on their webstore. It'll be quite interesting to see some sales numbers since kindle seems to have grapped quite a large market share on the tablet market. We'll post some numbers later (if they are interesting :))


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry is out on Android



Finally "Harry the Fairy" has passed EA's QA and has been released to Google Play.
Get it here http://bit.ly/LhT3WZ

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Cover story on Eurogamer

New cover story "99 levels to hell" on EUROGAMER.

Check it out here on eurogamer.dk

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

“99 Levels To Hell” Starts Alpha Funding

The game has been in pre-alpha for about a month and we are proud to finally release the Alpha.

Desura Digital Distribution


The Alpha features:
  • 1 Pet
  • 2 Boss Fights
  • 2 Dungeons
  • 20 Levels
  • 5 Enemies
  • 9 Weapons
  • Gold
  • Bombs
  • Shop
  • Portals
You can support the further development of the game by buying early access.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

99 Levels To Hell (pre-alpha build 0.0.3)

I've been really busy this week so here is a new build!


Change-log Pre-Alpha 0.0.3:

Enemies:


  • Fixed "gets stuck"
  • New animations
  • New timed shooting and animations
  • New Sounds

New Lighting (optimized):

Level Spawn:


  • You wouldn't get the same level in the first 10 level
  • Added two more levels
  • Added more special chests and shops (higher chance of getting new weapons and protectors.)

First Pet/Protector:


  • RedOrb, protects you and kills enemies on hit

Art:


  • More art for the first Dungeon "The Castle"
  • Fixed resolution, Barrels, Boxes, Weapons
  • Added shadow, Ladder, Pillars

Weapons:


  • BlueStaff got bouncing bullet

First Boss fight:


  • Knight On Wheels!!

Build:


  • Window mode and more resolutions
  • The game ends at level 10.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

See how we build levels for "99 Levels To Hell"

The editor is almost done, just added portals.

We made this short video showing how we build levels.




Follow development closer here

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

New game in development!

This will be good news to the fans of "Angry Viking". Zaxis Games is starting development of "99 Levels To Hell" a bloody DungeonCrawler/Shooter with roguelike elements.



Shoot and dig your way out from a buried castle. The only way out is down, through HELL.

The game will feature:
10 different environments.
20+  bossfights.
100+ levels that spawn at radom.
50+ monsters.
50+ powers ups and weapons
2 player on one screen (old school)
Shops, portals and more..

More info at http://99levelstohell.blogspot.com/



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Let me debug in your GUI


Here's a script I made to be able to see debug stuff while testing a game outside of the editor i.e. webplayer. It adds a button on the top right corner to turn on/off the debug window.

Should be pretty easy to use, just put it on some gameobject, and alter the "maxlines" value to fit your need.

using UnityEngine;
using System.Collections;

public class MyLog : MonoBehaviour
{
static string myLog;
static Queue myLogQueue = new Queue();
public string output = "";
public string stack = "";
private bool hidden = true;
private Vector2 scrollPos;
public int maxLines = 30;

void OnEnable()
{
Application.RegisterLogCallback(HandleLog);
}

void OnDisable()
{
Application.RegisterLogCallback(null);
}

void HandleLog(string logString, string stackTrace, LogType type)
{
output = logString;
stack = stackTrace;
string newString = "\n [" + type + "] : " + output;
myLogQueue.Enqueue(newString);
if (type == LogType.Exception)
{
newString = "\n" + stackTrace;
myLogQueue.Enqueue(newString);
}

while (myLogQueue.Count > maxLines)
{
myLogQueue.Dequeue();
}

myLog = string.Empty;
foreach (string s in myLogQueue)
{
myLog += s;
}
}

void OnGUI()
{
if (!hidden)
{
GUI.TextArea(new Rect(0, 0, Screen.width / 3, Screen.height), myLog);
if (GUI.Button(new Rect(Screen.width - 100, 10, 80, 20), "Hide"))
{
hide(true);
}
}
else
{
if (GUI.Button(new Rect(Screen.width - 100, 10, 80, 20), "Show"))
{
hide(false);
}
}
}

public void hide(bool shouldHide)
{
hidden = shouldHide;
}
}

Hope you like it. If you make any improvements, please share.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry the Fairy Reviews

These are all of the reviews we've found of Harry the Fairy so far.
Please let us know if you come across any we haven't seen.



http://www.appspy.com/harry-the-fairy-review  4/5
“Now this game is probably meant for younger players, but with controls such as these and some clever uses of machinery, older players will probably gain some enjoyment out of this title as well.”

http://www.148apps.com/reviews/harry-fairy-review/ 
"It's Magic" 4/5

http://appcroc.com/iphone/harry-the-fairy-review/  4/5
" In short, this game’s a cracker!" 

http://app-score.com/harry-the-fairy/  8/10
"Its gameplay is extremely fun and unique." 

http://appadvice.com/appnn/2012/03/quickadvice-harrythefairy  4/5
”...with the catchy music, the high quality graphics, and the myriad of achievements to earn, this is a game that is worth downloading.”

http://blog.appzapp.net/en/2012/03/16/harry-the-fairy/  4/5
”The new Chillingo game will get you hooked pretty fast – thanks to the enchanting background music and the amazing graphics that create a wonderfully sculptured fairytale world.”

http://ifanzine.com/harry-the-fairy-review/  3.5/5
”Harry carries a clean and formidable presentation”


“This one is really for people who want to solve puzzles and take there time about things.”

http://www.familyfriendlygaming.com/Reviews/2012/Harry%20the%20Fairy.html  86/100
”I hope to see more games like Harry the Fairy in the coming months. It was a joy and a pleasure for me to play and review Harry the Fairy.”

http://www.unigamesity.com/get-harry-the-fairy-on-iphone-a-high-quality-puzzle-experience/ 
“Really a game to remember and a game to love from start to the end.” 
“it’s unique, it’s humorous and it totally deserves the low price of 99 cents you have to pay for it. Totally recommended!”

http://www.mytoptrailer.com/show.php?channel=CGRundertow&vid=xgOLxM0Eg5I 
“Harry The Fairy is a side scrolling action game with a very old school feel.”

http://apptudes.com/2012/03/21/harry-the-fairy-a-magical-adventure-by-chillingo-win-promocode-with-comment-or-tweet/  4/5
“With a winning combination of exceptional graphics, lovable characters and addictive gameplay, Harry the Fairy its a great add to any casual gamer’s library.”

http://www.macworld.co.uk/ipad-iphone/reviews/?reviewid=3345733  4/5
“With an emotional soundtrack and dark graphics, this game will keep you on edge, leaving you anticipating what's coming next. The graphics are quite stunning: everything down to each separate blade of grass has been utilised to show off your iOS device at its best.”

http://www.gamezebo.com/games/harry-fairy/review 3/5
“ The game follows a formula to a tee and doesn't stray from it. The controls are great, the audio and visuals are solid, the gameplay offers light challenges and solid design.”



And yet Harry is sad, why?





  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Free stuff because we love you

To celebrate the release of Harry the Fairy we have decided to make our previous games free for a week or so. Angry Viking is about deathmetal, blood and viking rampage. Smack a seal is about...smacking seals.
Get them by clicking the icons in the column to the right. Enjoy.



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry the Fairy Gameplay video

Hi all now that Harry is out all over the world, its time to show some gameplay so you don't need to spend your hard-earned .99$ blindly. Get the game here

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry the Fairy Released

Finally Harry the Fairy is out. Although only in New Zealand at the moment, but it will be avaliable within the next 23 hours everywhere else. Here's the game intro:

Thanks to everybody who bought or will buy it. You rock!

Here's a screenshot from the Chillingo site:

And here from the App Store:





  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Harry the Fairy trailer released

Harry the Fairy will arrive on an app store near you on march 15th. You don't have to wait to get your fairy fix though, we just released the trailer.

If you want to know more we did an interview for iFanzine.com http://ifanzine.com/interview-with-zaxis-games/

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Automatically locate all unused unity assets

Did you ever work on a unity project where either you or a co-worker did not uphold complete and total order with regards to cleaning up the project folder. If you're one of those rare specimens that has never experienced a touch of kaos, don't read on!

On the other hand if you, as I, from time to time postpones the cleanup to another day, I've made a handy little editorwindow that should make the cleanup process a lot less tedious.

Basically it reads from the editor log after you have build a project, and then compares the included assets with all assets in your project. If an asset exist that is not used in the final build it is listed. It is also clickable so you can easily find it.

The unused assets are organized in 3 folders. "editor", "plugins" and "some other folder". This is helpful for me, as there is a lot in the "editor" folder that I use, but that is not used in final build.

It also lists which .dll's are included in build. If you need it, fine. If not, just delete that part.

DISCLAIMER: It does not locate unused assets in the "Ressources" folder, since everything in there should by default be included in the build. It's a tool to help locate the unused, but should be used with a bit of common sense.

Place the following in the "editor" folder:
 using UnityEngine;  
using UnityEditor;
using System.Collections;
using System.Collections.Generic;

public class CleanUpWindow : EditorWindow
{
bool groupEnabled = false;
List<string> usedAssets = new List<string>();
List<string> includedDependencies = new List<string>();
private Vector2 scrollPos;
private List<Object> unUsed;
private Dictionary<string, List<Object>> unUsedArranged;
private bool needToBuild = false;

// Add menu named "CleanUpWindow" to the Window menu
[MenuItem("Window/CleanUpWindow")]
static void Init()
{
// Get existing open window or if none, make a new one:
CleanUpWindow window = (CleanUpWindow)EditorWindow.GetWindow(typeof(CleanUpWindow));
window.Show();
}

void OnGUI()
{
if (needToBuild)
{
GUI.color = Color.red;
GUILayout.Label("Are you sure you remembered to build project? Because you really need to...", EditorStyles.boldLabel);
}
GUI.color = Color.white;

if (GUILayout.Button("Load EditorLog"))
{
loadEditorLog();
}


if(!needToBuild)
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.BeginVertical();
if (groupEnabled)
{
GUILayout.Label("DEPENDENCIES");
for (int i = 0; i < includedDependencies.Count; i++)
{
EditorGUILayout.LabelField(i.ToString(), includedDependencies[i]);
}
}
EditorGUILayout.EndVertical();
scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
EditorGUILayout.BeginVertical();

if (groupEnabled)
{
if (unUsedArranged != null)
{
foreach (KeyValuePair<string, List<Object>> objList in unUsedArranged)
{
if (objList.Value.Count >= 1)
{
GUILayout.Label(objList.Key.ToUpper());
for (int i = 0; i < objList.Value.Count; i++)
{
EditorGUILayout.ObjectField(objList.Value[i], typeof(Object), false);
}
}
}
}
}
EditorGUILayout.EndVertical();
EditorGUILayout.EndScrollView();
EditorGUILayout.EndHorizontal();
}

}

private void loadEditorLog()
{
UsedAssets.GetLists(ref usedAssets, ref includedDependencies);

if (usedAssets.Count == 0)
{
needToBuild = true;
}
else
{
compareAssetList(UsedAssets.GetAllAssets());
groupEnabled = true;
needToBuild = false;
}
}

private void compareAssetList(string[] assetList)
{

unUsed = new List<Object>();

unUsedArranged = new Dictionary<string, List<Object>>();
unUsedArranged.Add("plugins", new List<Object>());
unUsedArranged.Add("editor", new List<Object>());
unUsedArranged.Add("some other folder", new List<Object>());

for (int i = 0; i < assetList.Length; i++)
{
if(!usedAssets.Contains(assetList[i]))
{

Object objToFind = AssetDatabase.LoadAssetAtPath(assetList[i], typeof(Object));
unUsed.Add(objToFind);
if (objToFind != null)
{
unUsedArranged[getArrangedPos(objToFind)].Add(objToFind);
}
}
}
}

private string getArrangedPos(Object value)
{
string path = AssetDatabase.GetAssetPath(value).ToLower();

if (path.Contains("/plugins/"))
{
return "plugins";
}
else if (path.Contains("/editor/"))
{
return "editor";
}
else
{
return "some other folder";
}
}
}
You,ll need this too:
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;

public class UsedAssets
{
public static string[] GetAllAssets()
{
string[] tmpAssets1 = Directory.GetFiles(Application.dataPath, "*.*", SearchOption.AllDirectories);
string[] tmpAssets2 = Array.FindAll(tmpAssets1, name => !name.EndsWith(".meta"));
string[] allAssets;

allAssets = Array.FindAll(tmpAssets2, name => !name.EndsWith(".unity"));

for (int i = 0; i < allAssets.Length; i++)
{
allAssets[i] = allAssets[i].Substring(allAssets[i].IndexOf("/Assets") + 1);
allAssets[i] = allAssets[i].Replace(@"\", "/");
}

return allAssets;
}

public static void GetLists(ref List<string> assetResult, ref List<string> dependencyResult)
{
assetResult.Clear();
dependencyResult.Clear();

string LocalAppData = string.Empty;
string UnityEditorLogfile = string.Empty;

if (Application.platform == RuntimePlatform.WindowsEditor)
{
LocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
UnityEditorLogfile = LocalAppData + "\\Unity\\Editor\\Editor.log";
}
else if (Application.platform == RuntimePlatform.OSXEditor)
{
LocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
UnityEditorLogfile = LocalAppData + "/Library/Logs/Unity/Editor.log";
}

try
{
// Have to use FileStream to get around sharing violations!
FileStream FS = new FileStream(UnityEditorLogfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader SR = new StreamReader(FS);


string line;
while (!SR.EndOfStream && !(line = SR.ReadLine()).Contains("Mono dependencies included in the build"));
while (!SR.EndOfStream && (line = SR.ReadLine()) != "")
{
dependencyResult.Add(line);
}
while (!SR.EndOfStream && !(line = SR.ReadLine()).Contains("Used Assets,"));
while (!SR.EndOfStream && (line = SR.ReadLine()) != "")
{

line = line.Substring(line.IndexOf("% ") + 2);
assetResult.Add(line);
}
}
catch (Exception E)
{
Debug.LogError("Error: " + E);
}
}
}
Note that script files might not be shown as unused since the unity build includes then.
Here's an example: Unity Package

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Evolution of a fairy!


When we started development of “Harry The Fairy”, the game was called “You Got Snail” - yeah what a title, right.


The first ideas of the game was to make rather complicated puzzle game with a snail.
The idea was that the snail could swallow objects and take on the objects abilities, or spit the object out and make them stick together.



What we hadn't figured out, when designing the game, was the controls. We were pretty new at designing games for handheld devices, we had only done one title before Angry Viking, which was a joystick and button game.

Our controls were way to complicated to implement on iPhone, and when we had a working prototype, no one could figure out how to play the game.

So we went back, way back, and started with the basic design. Move controls, making the snail fly gave us a lot of freedom. We could use the phones accelerometer to control the snail, so when you tilt the device the snail moves in the direction you tilt.  























This proved to work great. We still wanted the snail to be able to pick up objects and interact with the environment.
But after playing the game with only the move control touching the screen to pickup objects seamed some how unnatural. It was more fun to push things around.

So we kept what worked and killed what didn't, the snail.
The reason for having a snail as protagonist were gone, so we changed setting and hero.

Introducing Harry The Fairy.
Harry is a small forrest fairy, his friends gets kidnapped by some evil machines and dragged under ground.


















Harry went through several passes, from a simple ball with wings, through a real hero with a hat, till the final Harry, a happy slightly scared green fairy with butterfly wings.
It was important for us to keep Harry a bit nervous - he is travelling the some pretty scary caves.
First we removed the small wings to give him more room to move. But it was weird to see a green "ball" fly around, and the character didn't really make any sense, so we gave him big butterfly wings. The butterfly wings help Harry stand out from the surrounding environment, and give him a nice silhouette you can recognize even when he is scaled way down.


















Harry uses his wand to free his friends from the cages they are trapped in at the end of each level
So how does Harry interact with the environment?
The first element we added was the Barrel and the Breakable Door.




The hero can push the barrel around, if the barrel hits a breakable door the weight of the barrel forces the door open.
This gives way to the first few puzzles, really simple once.
Find barrel push on to door, escape and save friends.

To add even more complexity to the puzzles we added the Hatch.










The hatch works like a door, you can push it from underneath. This way we close off certain parts of the level.
The hatch can also be used to guide the barrels towards a breakable door.

We now added the first real enemy, the Drill. The drill can destroy barrels.




That's all for now, the next post will go even deeper into these game elements and tell how we used them to create puzzles. 
And show more elements of the game.

Thanks for reading.

/Bo

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Batch replace gameobjects in Unity

When creating Harry the Fairy, we often found ourselves having to replace hundreds of prefab instances so I created this little script. It replaces a number of gameobjects with another and gives you the possibility to save all the transform values i.e. position, rotation and scale.

C# Script must be placed in "editor" folder.


using UnityEngine;
using UnityEditor;
using System.Collections;

public class ReplaceGameObjects : ScriptableWizard
{
public bool copyValues = true;
public GameObject NewType;
public GameObject[] OldObjects;

[MenuItem("Custom/Replace GameObjects")]


static void CreateWizard()
{
ScriptableWizard.DisplayWizard("Replace GameObjects", typeof(ReplaceGameObjects), "Replace");
}

void OnWizardCreate()
{
foreach (GameObject go in OldObjects)
{
GameObject newObject;
newObject = (GameObject)EditorUtility.InstantiatePrefab(NewType);
newObject.transform.position = go.transform.position;
newObject.transform.rotation = go.transform.rotation;
newObject.transform.parent = go.transform.parent;

DestroyImmediate(go);

}

}
}

Here's a visual walkthrough:

Go into Custom ->Replace Gameobjects


Select any number of gameobjects and drag them into "Old Objects".
Then, from the project pane, drag the gameobject that you want to replace with into "New Type".


Press "Replace"


Enjoy :)

/Kristian
And credits to Michael L. Croswell

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

The Art Of The Fairy, Environment


Harry The Fairy is an 2d adventure, action, puzzle game for iPhone, iPad and Android.


To render the 2d graphics and help us make sprite atlases in unity3d, we used Sprite Manager 2 from http://www.anbsoft.com/.

This is a short run-through of how we did the environment graphics for the game.

The game is set in the caves under a forrest. Here our hero has to save his friends from the evil machines.
The idea was that the hero shouldn't feel at home in the caves, he is clearly out of his element.
The caves are meant to be frightening without being too scary.

We wanted the game to look hand-drawn more than 3d or realistic, so all the concepts and art pieces are painted in photoshop.

This early concept shows a dark and gloomy cave. Not many colors and a bit cold.

This captures the feeling we wanted pretty good and became the most importent concept drawing.
But before we could design the final pieces we had to decide on the shapes of the the walls.

We had to find some shapes that could shape the caves organically and overlap without it being to obvious, where they overlapped each other.

It looked great, but it was to dark and colorless.
We wanted to emphasize the difference between nature and the evil machines a bit more.
So the environment needed more color and the machines should stay almost colorless.
The machines used only one “warning” color, yellow.

We made the walls look more like earth/dirt, but still with some gray stones. We also made objects, such as roots, grass and mushrooms to use for decoration.


The focus was to make an organic environment, that looked natural and not made of boxes.
Each of our two walls had their own mesh collider, to make the interaction with the environment natural.


The deeper you go underground the more dangerous the environment gets. Here lava-walls were created from the same shape as the dirt-walls making it possible for us to use the same mesh colliders.


The machines were made of small parts put together to create wheels, levers, doors and hatches.


As a way to close off the cave from the parallax background, we used a dark piece of stonewall. This way we could make some areas seem like narrow tunnels and others like big open caves.



All these elements was build into two sprite atlases.

Finally we added a dark shadow mesh around the level to close off the cave.


I hope you found this useful, feel free to email me with questions.

/Bo


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Nearing release of Harry the Fairy

So…the release candidate Harry the Fairy has been approved and has passed QA at Chillingo, so the release date is getting closer.


We've been working on/off on this title since medio 2010. The first 6 month or so, we mainly just had sporadic discussions on setting and gameplay, but no actual prototyping work was done since we were finalizing Angry Viking as well as doing tedious work-for-hire jobs - had to find a way to pay the bills. 

But when time allowed it, we did get some work done on Harry. When we got funding by the Nordic Game Program to do this game it was under the working title "You got Snail" and the gameplay was a mix of World of Goo, Angry Birds and The Incredible Machine. We did some prototyping and realized bit by bit that our design did not match the affordances and constraints of the smartphone platform. We killed a ton of darlings, and ended up with a "non-touch" tilt-gameplay. That design decision also caused a change in protagonist - from snail to fairy. 


We're really happy about the end result and hope you will like it to. If not, you have no taste…Thanks to Chillingo and producer Kieren Smith for the cooperation until now. At first we're releasing to iOS, but Android is on the roadmap.

Now fly Harry, fly

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Reducing build size in Unity games

Creating games with Unity, having a large number of custom levels, while trying to get under that App Store and Android Market limit of 20mb? This is a problem we've faced a few times, and finally i've gotten around to look into creating a method to minimize the size of the final build by serializing the scenes and just instantiating prefabs at level load. We are currently working on a game which will more than likely have 100+ levels, and this method will help us cut down drastically on the final build size. The game has a one-button type gameplay and currently has the very ingenious working title “Rollers”.

The current version limits itself to instantiating prefabs that does not differ from the blueprint, although it should be a rather simple fix to do that, I just don't need it myself :)

You need to use JSONFX to complete this tutorial

In this example I have a number of worlds, each with a number of levels.


Each of these levels contains a number of walls (All instances of a wall prefab with the tag “Wall”)



Additionally the level has a gameobject called info with the following monobehaviour attached: Basically the only this here is we have the ability to mark each level with a specific world, not at all necessary for everybody, but I need it :)
using UnityEngine;
using System.Collections;

public class LevelInfo : MonoBehaviour
{
public GameEnum.WorldEnum World;
}

public class GameEnum
{
public enum WorldEnum
{
World1,
World2,
World3
}

public enum PrefabEnum
{
PrefabWalls
}
}

The following script must be placed in a Assets/Editor folder, and adds a menuitem under Tools/CustomHelpers. It runs through the currently open scene, locates all prefabs with tag “Wall” and serializes the scene to a textasset which is placed in a corresponding folder.
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.IO;

public class SerializeScene : ScriptableWizard
{
public string Folder = "Levels";
string assetPath;

[UnityEditor.MenuItem("Tools/CustomHelpers/Serialize Scene")]
static void SerializeOpenScene()
{
SerializeScene ss = (SerializeScene)ScriptableWizard.DisplayWizard("Serialize Scene", typeof(SerializeScene));
}

void OnWizardCreate()
{
//Find Levelinfo and extract info on which world the level belongs to
LevelInfo li = FindObjectOfType(typeof(LevelInfo)) as LevelInfo;
GameEnum.WorldEnum world = li.World;

// Get the path we'll use to write our assets:
assetPath = Application.dataPath + "/Resources/" + Folder + "/" + world.ToString() + "/";
Debug.Log("Save at " + assetPath);

// Create the folder that will hold our assets:
Directory.CreateDirectory(assetPath);

FindAssets();

// Make sure the new assets are (re-)imported:
AssetDatabase.Refresh();

}

private void FindAssets()
{
List<GameObject> objList = new List<GameObject>();

LevelData newLevel = new LevelData();

//Trim string to leave out folder information
newLevel.Name = trimStringToSceneName(EditorApplication.currentScene);

//Walls
GameObject[] walls = GameObject.FindGameObjectsWithTag("Wall");
Debug.Log("We found " + walls.Length + " walls");

addObjects(walls, GameEnum.PrefabEnum.PrefabWalls, ref newLevel);

string newObject = JsonFx.Json.JsonWriter.Serialize(newLevel);

FileStream fs = new FileStream(assetPath + newLevel.Name + ".txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.Write(newObject);
sw.Close();
fs.Close();

}

private void addObjects(GameObject[] objList, GameEnum.PrefabEnum prefabEnum, ref LevelData level)
{
for (int i = 0; i < objList.Length; ++i)
{
//Only look for instances of prefabs
if (PrefabType.PrefabInstance == EditorUtility.GetPrefabType(objList[i]))
{
GameObject root = EditorUtility.FindPrefabRoot(objList[i]);

//Only add to list if its the root to make sure the same object is not added several times
if (root == objList[i])
{
Debug.Log("It's the Root");
level.AddNewPrefab(objList[i], prefabEnum);
}
else
{
Debug.Log("It's not the root, so we dont add it to list");
}
}
else
{
Debug.Log("NOT A PREFAB");
}
}
}

private string trimStringToSceneName(string path)
{
string sceneName = string.Empty;

//Removing all but levelname + ".unity"
string tmpString = path.Remove(0, path.Length - 13);

//removing ".unity"
sceneName = tmpString.Substring(0, tmpString.Length - 6);

return sceneName;
}
}

You will need these classes as well:
using System.Collections.Generic;
using UnityEngine;

public class LevelData
{
public string Name;
public List<SpawnType> ObjectsToSpawn = new List<SpawnType>();

public void AddNewPrefab(GameObject newObj, GameEnum.PrefabEnum prefabEnum)
{
Vector3 pos = newObj.transform.position;
ObjectsToSpawn.Add(new SpawnType(prefabEnum, pos));
}
}

public class SpawnType
{
public GameEnum.PrefabEnum PrefabType;

public float PosX;
public float PosY;
public float PosZ;

public SpawnType()
{
}

public SpawnType(GameEnum.PrefabEnum prefabEnum, Vector3 _transformVector)
{
PrefabType = prefabEnum;
PosX = _transformVector.x;
PosY = _transformVector.y;
PosZ = _transformVector.z;
}


public Vector3 GetVector3()
{
return new Vector3(PosX, PosY, PosZ);
}

}


Ok, so now we're able to serialize a scene, saving the type and location of prefabs, and tag it with the corresponding world. Now we need a scene which is able to deserialize the textassets and instantiate the prefabs. Create a new scene called LevelLoader, create an empty gameobject, name it “Loader” and give it the following LevelLoader script.



using UnityEngine;
using System.Collections;

public class LevelLoader : MonoBehaviour
{
public TextAsset LevelToLoad;
private LevelData levelData;
// Use this for initialization
void Start()
{

levelData = JsonFx.Json.JsonReader.Deserialize<LevelData>(LevelToLoad.text);
Debug.Log("leveldata loaded from textasset and deserialized");

initiateLevel();
}

private void initiateLevel()
{
GameObject wallParent = new GameObject();
Transform walltransform = wallParent.transform;
wallParent.name = "Walls";

foreach (SpawnType go in levelData.ObjectsToSpawn)
{
//You need to have you Prefabs placed in a "Prefabs" folder
string resourcePos = "Prefabs/" + go.PrefabType.ToString();
Object objLoaded = Resources.Load(resourcePos);
Vector3 pos = go.GetVector3();

GameObject newObj = Instantiate(objLoaded, pos, Quaternion.identity) as GameObject;
newObj.transform.parent = walltransform;
}
}
}
The above code creates an empty gameobject called walls to use as a parent for all the instantiated prefab, feel free to make this more dynamic. I'll do it myself at a later stage but for the time being it suits my needs. This should allow you to instantiate any number of levels by serializing them and then just include a single scene in your final build that can deserialize it and spawn the relevant gameobjects. Screenshot of the Leveloader scene with the instantiated prefabs:


Hope you found this helpful, although it's mainly a proof of concept. I'll make it more dynamic when I get around to it.

Here's an example: Unity Package

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

From deathmetal to fairydust

Creating games for the app store and getting them noticed can sometimes feel as trying to make your voice heard in a gym hall filled with screaming children. With more than 100k games to compete with, you need a high quality game, a keen eye on PR and a §#!^load of luck.


The load of luck seemed to be a bit hard to affect in any way, and getting a high quality game was just a matter of putting in the effort needed, but the PR was something we could affect.

The logical consequence for us was to enter a store filled with big brightly colored, non-challenging games featuring cuddly, big-eyed protagonists with a game about a featureless black & white viking on a murderous drug-induced rampage accompanied by the most aggressive death metal music south of the north pole and buckets and buckets of blood.

If we were going to go niche, we would be SO niche that we would basically need every last member of our target demographics to buy the game in order for it to be profitable, although we, in hindsight, might not have realized that fact from the start.



Angry Viking is the mutual lovechild of Bo and Jeppe and was released in June 2010. Although the quality of the game might have been somewhat lacking at the time, the niche approach seemed to yield an acceptable number of downloads. That number rather quickly plummeted though, it would seem that metalheads with an affinity for mindnumbing violence has quality demands as well...

At the time we released the game on Android we had drastically increased the quality of the game and got a lot better reception, even though Pay-Per-Download games seem to have a hard time on the Android Market. Our current version rating is 4+ on both iOS and Android, but the next time we're going for a niche market, we're going for 5% of a demographic instead of 0.1%.

In our current project we've shifted from blood, metal and vikings to a timid fairy named Harry. From 3D to 2D. From deathmetal to chimes and eerie classical music. From black, white and bloodred to earthcolors. Basically no similarities exist between the two games.



When cleaning up our project folders after Angry Viking was released we found a folder named “PR & Marketing” which was completely empty, that pretty much sums up our approach at the time - We would make the game and then just leave it to be discovered by its own devices, which is a faulty attitude at best...

We decided that we were no good at making ourselves noticed so we turned to Chillingo/EA to ask if they would be interested in working together on “Harry the Fairy” which they were. This leaves us with doing what we do best and love doing – making games.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS