Monthly Archives: November 2012

Game engine month

Not only is it Movember, it also seems to be the month when the major vendors for game development are publishing revisions and updates to their game engine.

  • Epic, makers of Unreal engine released their November SDK
  • Crytek, makers of the Crytek engine have released their version 3.4.3 SDK
  • and finally Unity, makers of the Unity 3D game engine have released Unity 4.0

#AltDevConf Student Summit 2012 – Day 2 Videos

Feeling a lot better today, I decided to finish what I started so with that I am back for day 2 of the AltDevConf Student Summit.

All kudos goes out to all the organisers and speakers, so thank you all. Here are todays videos:

AltDev Student Summit – Being the Voice of an Indie Company – Andrea Schmoll

AltDev Student Summit – What Software Developers Should Expect From the Games Industry – Ted Spence

AltDev Student Summit – What is Game Animation? – Mike Jungbluth

AltDev Student Summit – Essentials the Team Leads Need to See in Your Work – Benjamin Cavallari

AltDev Student Summit – A Day in the Life of a Creative Director – Jurie Horneman

AltDev Student Summit – DIY Development Jay Margalus and Phil Tibitoski

AltDev Student Summit — AAA Game Programming, A Day in the Life — Bobby Anguelov

AltDev Student Summit – The Intern’s Secret Survival Guide – Brandii Grace

AltDev Student Summit – Cultural Issues – Kate Edwards

AltDev Student Summit – I Can’t Believe I Do This For A Living: The Generalist Game Designer

AltDev Student Summit – A Day in the Life of a Games Writer – Anne Toole

AltDev Student Summit – Starting and Running a Company, From a Programmer’s Perspective – Rebecca Fernandez

AltDev Student Summit – From Playtester to CEO – Closing Keynote with Jen MacLean

Edit 16/11/2012: All links have been updated to point to final edited videos.

#AltDevConf Student Summit 2012 – Day 1 Videos

Having caught a one day cold/flu yesterday and being bed ridden for most of the day. Then somehow gaining enough energy to attend a 21st birthday party that same night. I was actually surprised to find myself waking up this morning with only 5 hours sleep for the live stream cast of the AltDevConf Student Summit Conference for 2012. In hindsight it was probably not necessary as the sessions were all recorded. It was still interesting to hear what industry veterans had to say as well as seeing some of the student projects coming out from other schools.

Here is a list of the first day sessions, in predominantly, the order that they were presented.

AltDev Student Summit – Thinking Three Moves Ahead – Opening Keynote with Ian Schreiber

AltDev Student Summit – The Cutting Room Floor – George Kokoris

AltDev Student Summit – A Day in the Life of a Tools Programmer/Buildmaster – Alex Crouzen

AltDev Student Summit – Blue Screen Of Death – Travis Sanchez

AltDev Student Summit – A Day in the Life of a Solo Developer – Mitu Khandaker

AltDev Student Summit – OOP Is the Root of All Evil – Jeff Ward

The AltDev Student Showcase – Session 1

AltDev Student Summit – A Day in the Life of an Indie PR Guy – Erik Johnson

AltDev Student Summit – A Day in the Life of Scrabble! – Sharon Price

AltDev Student Summit – Managing Up – Dustin Clingman

AltDev Student Summit – Breaking In Panel

Edit 16/11/2012: All links have been updated to point to final edited videos.

String Encrypt and Decrypt for C#

A neat little encrypt/decryption code written for c# that also serves as an initial test to see how code postings appear inside WordPress. To find out more on how to post source code in wordpress, go here.

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace ConfigurationLibrary
{
    public sealed class CryptoString
    {
        private CryptoString() { }
        private static byte[] savedKey = ASCIIEncoding.UTF8.GetBytes("YOURVALHERE");
        private static byte[] savedIV = ASCIIEncoding.UTF8.GetBytes("YOURVALHEREASWELL");
        public static byte[] Key
        {
            get { return savedKey; }
            set { savedKey = value; }
        }
        public static byte[] IV
        {
            get { return savedIV; }
            set { savedIV = value; }
        }
        private static void RdGenerateSecretKey(RijndaelManaged rdProvider)
        {
            if(savedKey == null)
            {
                rdProvider.KeySize = 256;
                rdProvider.GenerateKey();
                savedKey = rdProvider.Key;
            }
        }
        private static void RdGenerateSecretInitVector(RijndaelManaged rdProvider)
        {
            if(savedIV == null)
            {
                rdProvider.GenerateIV();
                savedIV = rdProvider.IV;
            }
        }
        public static string Encrypt(string originalStr)
        {
            // Encode data string to be stored in memory.
            byte[] originalStrAsBytes = Encoding.ASCII.GetBytes(originalStr);
            byte[] originalBytes = { };
            // Create MemoryStream to contain output.
            using(MemoryStream memStream = new
                     MemoryStream(originalStrAsBytes.Length))
            {
                using(RijndaelManaged rijndael = new RijndaelManaged())
                {
                    // Generate and save secret key and init vector.
                    RdGenerateSecretKey(rijndael);
                    RdGenerateSecretInitVector(rijndael);
                    if(savedKey == null || savedIV == null)
                    {
                        throw (new NullReferenceException(
                                "savedKey and savedIV must be non-null."));
                    }
                    // Create encryptor and stream objects.
                    using(ICryptoTransform rdTransform =
                           rijndael.CreateEncryptor((byte[])savedKey.
                           Clone(), (byte[])savedIV.Clone()))
                    {
                        using(CryptoStream cryptoStream = new CryptoStream(memStream,
                              rdTransform, CryptoStreamMode.Write))
                        {
                            // Write encrypted data to the MemoryStream.
                            cryptoStream.Write(originalStrAsBytes, 0,
                                       originalStrAsBytes.Length);
                            cryptoStream.FlushFinalBlock();
                            originalBytes = memStream.ToArray();
                        }
                    }
                }
            }
            // Convert encrypted string.
            string encryptedStr = Convert.ToBase64String(originalBytes);
            return (encryptedStr);
        }
        public static string Decrypt(string encryptedStr)
        {
            // Unconvert encrypted string.
            byte[] encryptedStrAsBytes = Convert.FromBase64String(encryptedStr);
            byte[] initialText = new Byte[encryptedStrAsBytes.Length];
            using(RijndaelManaged rijndael = new RijndaelManaged())
            {
                using(MemoryStream memStream = new MemoryStream(encryptedStrAsBytes))
                {
                    if(savedKey == null || savedIV == null)
                    {
                        throw (new NullReferenceException(
                                "savedKey and savedIV must be non-null."));
                    }
                    // Create decryptor and stream objects.
                    using(ICryptoTransform rdTransform =
                         rijndael.CreateDecryptor((byte[])savedKey.
                         Clone(), (byte[])savedIV.Clone()))
                    {
                        using(CryptoStream cryptoStream = new CryptoStream(memStream,
                         rdTransform, CryptoStreamMode.Read))
                        {
                            // Read in decrypted string as a byte[].
                            cryptoStream.Read(initialText, 0, initialText.Length);
                        }
                    }
                }
            }
            // Convert byte[] to string.
            string decryptedStr = Encoding.ASCII.GetString(initialText);
            return (decryptedStr);
        }
    }
}

Enabling dropbox public folder

So today I finally signed up for a Dropbox account, up until now I had no reason to use it. That was until I noticed a pattern where most students were using it to publish their unity games online. So with that I signed up, only to discover straight away that I could not share my links. Well not easily or straight forward as the instructions led me to believe. Just place the unity file and webplayer file into your public folders they said, then copy and display the public link to a webpage and your done.

Only problem, there was no more public folders. What had happened is recently, and by recent I mean last month, dropbox in their infinite wisdom decided to disable public folders for all new accounts. All current accounts will still work the same only new account have it disabled.

Which ultimately means they must still exist, so how to get to it and more importantly how to enable it.

Well if you’ve been reading this far, it is just as easy as following this link, you might need an account for it to work correctly. Hit the enable button and you get your public folder back.

VS2012 Model Editor

Tonight while trying to familiarise myself with some animation files in Unity3D, I stumbled across an unusual feature within Visual Studio. It all happened when I tried to run some animations on a model included within a package I had downloaded, I doubled clicked what seemed to be the animation file in a hopes that it would play the animation I had chosen. Instead, Visual Studio executed and I found myself looking at what seemed to be a modelling editor, all contained within Visual Studio. I remember thinking immediately that this was both unsual and cool and the same time. After the initial shock had settled I went to check out how powerful this editor was.

Having played around a bit inside 3DSMax, Maya and Blender, I recognised that it had implemented the basics of a typical 3D modeling tool, such as the ability to translate, rotate, scale and create primitive shapes. On closer inspection I found you could also select and choose to display either overdraw, wireframe or flat shading. Further investigation unravelled the ability to show poly and vertex count, display backface culling, choose graphics engine, scene manager and looking at the official documentation from Microsoft, I later discovered you can even create shaders using a inbuilt node-based visual shader tool.

VS2012 Model editor

VS2012 Model editor

Yr1 final assignment – game prototyping

The prerequisite of the final exam is that we form small teams of 2-3 and create a game prototype, this ideally could turn into a full fledged game later on if we decided to pursue it, although the assignment was not designed for this, it was indeed possible. Time was allocated at the beginning to go off for a few days to design and document the requirements of the game and return to present it in front of both classes and teachers. On those first few days we decided it would be best if we each proposed an idea on paper and then present this to one another and the best idea would then be further developed and presented to class. I suggested we create a 1990’s mario kart type game, mainly because I find the technology of mode 7 interesting and it wasn’t out of my capabilities at this stage of our learning. However, others in my group didnt have the strong programming experience I had acquired and were unsure it was even possible given the time frame of six weeks, which is understandable so I tried alleviating their concerns by creating a bare bones prototype. They were impressed and it did sway them towards it more.

However, after all members presented their game ideas one game stood out as both feasible and did not discriminate individual group abilities, so it was chosen. The game itself was to be a 2D platformer based on similar mechanics as n-game where time was a factor in completing the game successfully. In devising the architecture we decided to instead of using SDL again a newer framework discussed recently in class called SMFL was chosen for the engine. With enough programmers on the team and having completed the C# waypoint editor we decided to also create a tile editor using C# to aid us when designing the levels.

Upon presenting the game to class our teachers provided encouraging feedback highlighting that this game was both feasible and that others should follow this concept when creating their games. This was very motivating to hear and with that I was placed in designing the editor and the others would work on the SMFL. I decided early to place aside no more than a week or two worth of development time in creating the editor, any more seems meaningless as the editor was not the final product. The sooner I completed my part the sooner I could then assist with the SMFL side of the game.

It has now been one week coming into two since the assignment was handed to us. I can report that the editor is now working, it is reading from an external file, tiles are then updatable via the tool and finally changes are being saved out to the same or new file. There are a few notable bugs to iron out, nothing major, at this point I dont see them as showstoppers as the tool is working as expected. I am now starting to see what the others have done on the SFML side of things. From what I can gather it looks fairly good. We have a working menu and a moving player and now all thats needed is the level class to read from my editor level file. After that is done, the next milestone will be implementing collision detection.