Dev Update

hi there!

A huge amount going on behind the scenes! We have a number of projects on the go and are ramping up for a really big start to 2015!

We are currently building up to a greenlight launch for Street Fist 2 our new exciting project. So there’s going to be an awful lot going on in the next few months. Lots of updates to come!

.OBJ sequence exporter script – PyMel

We’ve started moving towards some VFX based work and have been using Adobe After Effects for a lot of our comping and motion graphics work. Some 3D effects in AE required a sequence of animated .OBJ files to be loaded, one 3D object per frame (as bone data cannot be stored in .OBJ files).
To prevent the 3D artists having to export hundreds of files out of Maya one by one I decided to write a script to automate the process.

OBJSeq

This simple script allows you to set an export path, choose how many frames of animation to export and what to call the files. This then exports all of the objects in the scene into an OBJ Sequence for use in After Effects and other programs.

The script can be downloaded here if you want it!:
https://dl.dropboxusercontent.com/u/14324914/XD%20Studios/Obj_Sequence_Exporter.py

– Giles
Resident Tech Artist

Welcome to our new blog!

Thanks for stopping by! Below you’ll find lots of tips and tricks, tutorials and Development updates from us here XD Studios. We hope you like what you see as we will adding loads of content as we go along. If there’s anything you’d like to see just comment on a post and ask!

PS. We are always looking for new people to work with so be sure to check out our website to see what services we offer. http://www.xd-studios.com

Script Components Library for Unity Game Engine

The programmers here at XDStudios have started to build up a useful library of custom script components. These components help speed up the development of our games by a considerable amount (something that is of vital importance to us in our ManicMonday game jams).

For example, we got fed up of re-writing simple buttons that do very little (bring up a website/play button etc.). So instead, we wrote a simple button component called “XDButton” (I would advise you to prefix a unique identifier in front of all your components) that you provide a callback function (ButtonDown or ButtonUp callback) and that function gets called when whatever action you selected is executed. Simple right…? But this has saved us from having to create a new script for every button we want to use and writing (even if it is a small amount) some code to make it work. This of course is only a small simple example – we have components that handle monster tasks such as Facebook integration, object pooling and UI utilities etc.

Example of our XDbutton and XDFacebookWrap components working together

 

As a quick tutorial on writing a useful component (and personally, one of my favourite components we have created) I will show you how you can make an on screen debugger for unity – this is very useful for android and iOS development!

 

1. Start by creating your on screen debugger script. In this example I have called it “XDOnscreenDebugger”.

 

 

2. Next we need to create a class within XDOnscreenDebugger that will hold the debug string and the time to keep it on screen. For this example I have called it “DebugMSG”. Also, create a list of DebugMSGs (don’t forget to add “using System.Collections.Generic” at the top of your C# script!!) to the on screen debug class.

 

3. Next we need some way of updating the time alive of the message and also a function which easily tells us if the message should be removed or not. Go ahead and add two functions “public void UpdateTimeAlive(float delta_time)” and “public bool HasTimeExpired()” to the DebugMSG class.

4. It is always handy to set the text colour for the output so create two member variables for the ‘XDOnscreenDebug’ class. Also, in the Awake function set the GUIStyle text colour to the colour chosen in the editor. For this example I have defaulted it to green

5. At this step it will be handy to create our Scene GameObject to check the colour selection is working. Go ahead and create a new empty GameObject and attach your

onscreen debug component to it. Your inspector (with the empty GameObject selected) should look as follows

 

6. Now that you have your text colour chosen, we need to be able to update the lifetime of the on screen messages so that they will be removed from the list when they expire. We do this in three steps:

  1. Loop through the objects on the list
  2. Update message current time alive by passing in Time.deltaTime
  3. Check if they have expired – if they have remove them from the list

Go ahead and add this to the on screen debuggers update method.

7. Now that we have our list updating, we need to display it! To do this we will use the OnGUI function in the onscreen debugger class. To draw the strings we simply loop through the message list and use the GUILayout.Label method passing in the string to render and the style used. The GUILayout will handle the display of the messages and will put them one after another in a list style.

8. Now that we have all the functions in place to update the messages lifetime and remove them if their time has expired and also to draw the debug messages we need a way to add them to the list. To do this add a public static method to the on screen debugger such as:

public static void Log(string log_message, float lifetime = 10.0f)

 

This will give every message a default life time of 10 seconds and is an optional input to the function. Here is the code for this method:

 
 

Note that we have checked to only debug on screen if development build has been chosen! (to make development build active go to File -> Build Settings -> and tick ‘development build’).

Your on screen debugger is now complete! To test, simply attach a script to your camera (or any object) that will call your on screen debuggers static function “Log”. For us this would be called as following:

XDOnscreenDebugger.Log(“This is a debug message”);

 

This will result in the following message being displayed in the top left hand corner like so (I have called the function 5 times to demonstrate the automatic multi line):

 

Now you have a very useful on screen debugger that can be used in any Unity project! This is especially useful for android and iOS development where you can just simply log to the screen and see debug messages on the tablet/phone instead of having to sieve through many many lines of useless debug information output via command lines etc.

Hope this helps!

Nick Cullen

XD Studios.

Vertex Based Animation Shader in Unity Game Engine

Today I stumbled across some nicely animated models of food on Polycount.com. Another user was questioning if the objects were in fact using bones due to the complexity of the animations. I decided to take some time to explain a basic method for creating more complex vertex animations to help show how you can create some very nice animations without the need for bones.

 

 
 
Here is a basic version of the chicken in Unity, with vertex colours displaying for debug purposes.

 

The vertices which have been painted green are translating in the Y axis and the vertices painted red are translating along their normals. Giving two different movement effects. You can stack movements up like this to create some really convincing animation, just like how Davision3D(Polycount.com user) has.

 
 

The animations are done by offsetting each vertex position using a sine wave (sin(time)) masked by the colour of the vertex. This means that using vertex colours you could stack upto 4 different types of movement in one shader by using the RGB and A channels of the vertices.

 

code snippet:

 

This effect can be used to add movement to many objects in a scene which would be too insignificant to use bones on. Grass for example, could have a swaying effect added to it, masking the tip of the grass with vertex colours would ensure it only swayed at the top and not at the root. If you;d like to know more just comment below.

 
 

Giles Ruscoe

Technical Artist

XD Studios

Joint based Facial rigging in the Unity Game Engine

For the last few days I have been working on facial rigging. I decided  to make a rig for a character that Giles (one of our Artists) finished a couple of weeks back, and I wanted to try and make something fairly complex, because why not. I needed the practice.

The rig, needed to be robust, look good, work within a game engine (so no complex deformers etc.), and have lots of features and functionality. In other words as far as you can take a rig within a game engine of the shelf. Below you can see a short animation made with the rig:
 

 

The above animation was very easy to make with the rig, as the rig did most of the grunt work for me, and after about 5 minutes of playing around i got a pretty nice example. The rig has a large set of primary controls, including separate jaw, lip, cheek, eye and eyebrow controls, and a full compliment of secondary animation controls, which allow the animator to fine control of every major location on the face.

The primary controls are driven by CV curves and blend-shapes, and the secondary controls drive the facial joints directly. Blend shapes were created for every major pose, like frowning, smiling, pouting, etc. Below you can see the primary controls in yellow, and the secondary controls in grey.

 

 

And here you can see the rig functioning:

 

The rig is fairly hard to break, as the all of the primary controls are locked down to within a realistic range of motion. The secondary controls can produce some undesirable results, but with a bit of common sense, there shouldn’t be any issues. Comment if you;d ike a more in-depth breakdown!

 

Jamie Kavanagh

Designer

XD Studios

Flocking Algorithm in Unity Game Engine

I’ve been implementing flocking in Unity for the last couple of days, ready for our upcoming title, Gone Huntin’. Using flocking algorithms, we can get groups of entities to simulate the behavior of flocks of birds in flight, by getting them to group and move as a single unit. I’ve created a simple unity project demonstrating flocking, available here, https://github.com/arp2600/flocking-test, based on the implementation documented in this post http://harry.me/blog/2011/02/17/neat-algorithms-flocking/.

 

The flocking behavior is achieved by using multiple independent entities, called boids, each following three basic rules. These rules are, cohesion, separation, and, alignment.

 

Cohesion:

Boids try to group together. Every frame, a boid finds all the boids within a certain radius of itself, the cohesion radius, and takes the average of their positions. The boid then attempts to move toward this point.

 

Separation:

Boids attempt to maintain a minimum distance from each other. As with cohesion, every frame, a boid finds all the boids within a certain radius of itself, the separation radius. For each neighbour, the boid calculates a vector pointing away from the neighbour, with a magnitude inversely proportional to the the neighbours distance from itself, and adds it to a sum vector. The mean average of this sum vector is then calculated, and the boid attempts to move in that direction.

 

Alignment:

Boids try to all move the same direction. Again, for each neighbour within a certain radius (in my example project I use the cohesion radius again), the neighbours velocity is added to a sum. This sum is then averaged, and clamped to a maximum value (this prevents the boids accelerating infinitely), and the boid attempts to move in that direction.

 

The affect of each of these components on the final behaviour of the flocking may then be controlled by weighting each one independently.

 

George Roger

Game Developer

XD Studios

News!

Hello!

There has been a pile of stuff happening in the Studio recently and thankfully its been all positive! 

We attended and successfully exhibited at the Welsh Games Development Conference, where we showed of our Manic Monday games Poppin Pirates and Tempest Sky as a tech demo for Gone Huntin’. The reception was amazing and a big thanks goes to everyone who attended and who helped set it up.

We had a suprise for attendees with a 2-player version of Tempest Sky which had queues to play it. A Satisfying sight for any developer!

Alongside the successful exhibition we also gave a talk, with Martin McCarthy taking to the stage to tell the audience about how awesome Manic Mondays are. The response was one of much interest and admiration for the teams efforts and has helped to drive us forward with the experiement.

We hope to really build on the success of the conference and continue to grow our public profile over the coming months as we prepare to release Gone Huntin’. 

There’s loads more going on and we will be keeping you in the loop every step of the way. So get involved on Twitter (@xdstudios) and Facebook we love to hear from you and value all the feedback we get. Stay tuned!

Manic Monday Game Jams #1

XD Studios are holding weekly in-house game jams every Monday, with the aim of creating new games every 1-2 weeks. These games will be quick, fun and free for the world to play. We hope to improve our skills as a company, promote synergy within our team, and hopefully create games that people will love to play.
We will set new goals and challenges each week, which will inform the tone of the game created. For example, our first game, Tempest Sky, was created with the following goals in mind:

 

  • Utilize high resolution sprites, rendered out from 3D models
  • Have a functional “Share to Facebook” button
These goals go alongside the obvious primary goals we have set for each Manic Monday, which are:
  • Create a fully functional game in the time provided
  • Full compliment of art, UI and sounds
  • Working control system
  • As bug free as we can make it
  • Make it releasable on the target platform
What makes Manic Mondays Manic?
 
Manic Mondays are essentially 14 hours of pure development, broken up into two hour sprints; every team member states what they will achieve in the next two hours, and then we go and do it. The coders code, the artists art and the designers design. Using this method, especially within our small team, we find that we get a whole lot more done than if we were to just do dailies once every morning. It gives everyone an incentive to get their work done on time, and also helps with project and personal management.
Tempest Sky
Tempest Sky is a side-scrolling arcade Sci-fi shooter. The Player takes control of the Tempest Sky, mankind’s most powerful weapon, and takes the fight to an army of invading alien ships. The game design was inspired by classic Sega Megadrive era shooters, with a modern mobile twist.
The player fights waves of incoming enemy ships whilst avoiding environmental hazards, such as huge factory buildings and giant defense lasers.  The players most vital tool for survival is the Chrono-shield, a powerful artifact which not only absorbs incoming fire, but also slows time to a crawl around the ship.
4aef3-tpsk

Tempest Sky is an idea a few of us had at the very beginning of XD-Studios. Two of our team entered a Game Boy game jam for fun, creating the original incarnation of Tempest Sky over the space of about a week, using the Unity engine. It was limited to Game Boy specs, using only four colors, with a screen res of 160 x 144 pixels. If you want to play it you can find it HERE.

 

Tempest Sky: Genesis
The new Tempest Sky has been made using the teams new 2D sprite production pipeline, which we are developing for use with our current main production title, Gone Huntin’. It essentially allows us to create very pretty 2D sprites by rendering out 3D models from 8 different angles. This allows us to maintain a very high level of visual fidelity in the game, without sacrificing performance at all. By trialing it with Tempest Sky, it allows us to get some experience with the system and iron out any problems we come across.
d5aa3-player
The Tempest
Game Jams are inherently fun and incredibly useful and we feel by incorporating them into our studio culture that we are fast tracking each members leveling up. It helps avoid single project fatigue and allows the creative expression we as designers yearn for. If you want to find out more, you can attend our talk at The Wales Games show in Cardiff on the 11th of July or feel free to contact us!