our rambling
Want to be notified of new blog posts?


Elwin Verploegen

Email Bug Reports in Unity3D (With Automatic Screenshot) February 15, 2016

By Elwin

For the Fragments of Him PC Beta we wanted to make it easy for players to send in bug reports. We wanted this to do a few things that cover most of the questions that we usually have to ask when a bug report is filed:

  • Type up a bug report
  • Send in a screenshot
  • Attach system specs
  • Automatically email it to us

Luckily, all of this is possible using C#. The following script allows the user to press F1, after which it takes a screenshot and opens up a simple GUI where the user can type in an email address (or just something to identify the user with) and a bug report. When the user clicks the “Send” button the screenshot will be attached to the email and sent to an email account that we can easily access.

Warning: Your login details can be read as plain text with relative ease, only use this when sending builds to trusted testers or when using internally.

#if UNITY_STANDALONE

using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

public class Email : MonoBehaviour{

    //email setup
    private string from = "youremail@yourdomain.com";
    private string password = "yourpwd";
    private string smtp = "smtp.yourdomain.com";
    private string to = "report@tosendto.com";

    private bool isemailing = false;
    private string email = "";
    private string body = "";

    private string filepath = "";

    void Update(){
        if(Input.GetKeyDown(KeyCode.F1)){
            //take a screenshot when opening the form
            StartCoroutine(TakeScreenshot());
        }
    }

    void SetEmailing(bool dir){
        isemailing = dir;
        Time.timeScale = (dir) ? 0f : 1f;
    }

    void OnGUI(){
        if(isemailing){
            GUILayout.BeginArea(new Rect( 100, 100, 400, 600));
            
            GUILayout.Label("Your email: ");
            email = GUILayout.TextField(email, GUILayout.Width(150));

            GUILayout.Label("Bug report: ");
            body = GUILayout.TextArea(body, GUILayout.Height(250));

            if(GUILayout.Button("Send bug report", GUILayout.Width(150))){
                SendEmail();
            }

            GUILayout.EndArea();
        }
    }

    void SendEmail(){
        MailMessage mail = new MailMessage();

        //create the resource to be attached to the email
        LinkedResource inline = new LinkedResource(filepath);
        inline.ContentId = Guid.NewGuid().ToString();
        Attachment att = new Attachment(filepath);
        att.ContentDisposition.Inline = true;

        //create the content of the email
        mail.From = new MailAddress(from);
        mail.To.Add(to);
        mail.Subject = "Debug mail";
        mail.Body = String.Format(
                "Report by: " + email + "<br/><br/>" + 
                "Bug report:<br/>" + body + "<br/><br/><hr>" + 
                GetHardwareInfo() + "<br/><hr>" + 
                @"<img src=""cid:{0}"" />", inline.ContentId);
        mail.IsBodyHtml = true;
        mail.Attachments.Add(att);

        //set up the smtp
        SmtpClient smtpServer = new SmtpClient(smtp);
        smtpServer.Port = 587;
        smtpServer.EnableSsl = true;
        smtpServer.Credentials = new System.Net.NetworkCredential(from, password) 
            as ICredentialsByHost;
        ServicePointManager.ServerCertificateValidationCallback = 
            delegate(object obj, X509Certificate cert, X509Chain chain, SslPolicyErrors sslerrors) 
                { return true; };
        smtpServer.Send(mail);
        
        #if UNITY_EDITOR
            Debug.Log("email sent");
        #endif
        SetEmailing(false);
    }

    //return a string with some essential hardware info
    string GetHardwareInfo(){
        return    "Graphics Device Name: " + SystemInfo.graphicsDeviceName + "<br/>"
                + "Graphics Device Type: " + SystemInfo.graphicsDeviceType.ToString() + "<br/>"
                + "Graphics Device Version: " + SystemInfo.graphicsDeviceVersion + "<br/>"
                + "Graphics Memory Size: " + MBtoGB(SystemInfo.graphicsMemorySize) + "<br/>"
                + "Graphics Shader Level: " + ShaderLevel(SystemInfo.graphicsShaderLevel) + "<br/>"
                + "Maximum Texture Size: " + MBtoGB(SystemInfo.maxTextureSize) + "<br/>"
                + "Operating System: " + SystemInfo.operatingSystem + "<br/>"
                + "Processor Type: " + SystemInfo.processorType + "<br/>"
                + "Processor Count: " + SystemInfo.processorCount.ToString() + "<br/>"
                + "Processor Frequency: " + SystemInfo.processorFrequency.ToString() + "<br/>"
                + "System Memory Size: " + MBtoGB(SystemInfo.systemMemorySize) + "<br/>"
                + "Screen Size: " + Screen.width.ToString() + "x" + Screen.height.ToString();
    }

    //make the shader level more readable
    string ShaderLevel(int level){
        switch(level){
            case 20: return "Shader Model 2.x";
            case 30: return "Shader Model 3.0";
            case 40: return "Shader Model 4.0 ( DX10.0 )";
            case 41: return "Shader Model 4.1 ( DX10.1 )";
            case 50: return "Shader Model 5.0 ( DX11.0 )";
            default: return "";
        }
    }

    //unity returns a weird amount of available MB, this unifies it
    string MBtoGB(int mb){
        return Mathf.Ceil(mb / 1024f).ToString() + "GB";
    }

    //take a screenshot before opening the GUI
    IEnumerator TakeScreenshot(){
        yield return new WaitForEndOfFrame();
        #if UNITY_EDITOR
            filepath = Application.dataPath + "/../debugscreenshot.png";
        #else
            filepath = Application.dataPath + "/debugscreenshot.png";
        #endif

        Application.CaptureScreenshot("debugscreenshot.png");
        SetEmailing(!isemailing);
    }
}
#endif

You should be able to just copy/paste this script into your project (name the script Email.cs) and drop that on any GameObject in your scene. Press F1 to see it in action.

Couple of notes on the script:

  • It’s set up to wait for the screenshot to be taken, and only then will it open the email GUI. This is to ensure that the email GUI is not part of the screenshot. You can extend this to disable other elements in your game if you see fit.
  • You have to ask permission from the user to get their system data! While the data we get doesn’t contain anything identifying, you should always ask for permission (or in our case, if you accept our beta key you agree that we can use this data whenever you send in a bug report).
  • I’ve set it up so it’ll only work for Standalone builds (see first and last line of the script), I have no intention of using this for our Xbox builds, but you can always modify that to be available on other platforms, just make sure that the interface still works!
  • You may have to modify the SMTP port on line 81 to whatever your host uses.
  • You must set unity to use Api Compatability Level .NET 2.0. If you do not change this the script will throw an error once you send the email.

If you have any questions or recommendations, you can get in touch with me on Twitter @elwinverploegen.

The voices behind Fragments of Him February 5, 2016

By Bas de Jonge

In last week’s blog, Elwin announced that I would be introducing myself this week, so here I am. My name is Bas de Jonge and for the upcoming 5 months I’ll be interning as a marketeer at Sassybot. Rebellious as I am, though, I won’t just introduce myself in this blogpost; instead, I will introduce you to the very talented voice actors that have brought the story of Fragments of Him to life.

For the casting of the voice actors, we teamed up with PitStop Productions. They helped throughout this entire process: setting up our casting, gathering all the auditions, and eventually recording all the voices. The casting process resulted in over 250 auditions, which were eventually narrowed down to a list of four actors, namely Jay Britton as Will, Joan Blackham as Mary, James Alper as Harry, and Katie Lyons as Sarah.

Jay Britton

Jay Britton

Joan Blackham

Joan Blackham

James Alper

James Alper

Katie Lyons

Katie Lyons

 

 

 

 

 

 

 

 

Jay Britton is a professional voice actor. You might have heard Jay in video games, on television in animated series’, or one of the many commercials. He’s a talented actor with a broad range of accents and voices, which made him the perfect choice for Will. Jay’s voice brings a lightness of tone, uncertainty, and optimism to Will at a turning point in his life.

Will’s grandmother Mary has been voiced by Joan Blackham. I personally think she has the perfect voice for Mary, and so did Mata Haggis, he says: “Mary is a complex character to portray. She is both staunch in her own opinions but also coming from a place of love. From the auditions, Joan stood out by pouring all of that complexity into a beautifully subtle performance of simple lines. There were many wonderful voices for the part, but Joan stood out immediately. She has a long history of television and film performances, and this experience shines through in her delivery.”

James Alper is the voice actor behind Harry. James has performed in theatre, film, and television shows, as well as video games. According to Mata, “James Alper has a very rich and resonant voice – the kind of voice that makes you want to smile when you hear it. James brought out emotions in the script that I had not realised were there, but immediately his reading added a new and powerful layer to the scenes.”

Sarah is voiced by actress Katie Lyons. She has previously acted in games such as The Secret World, Dreamfall Chapters, and Dirty Bomb. Besides voice acting in video games, Katie is perhaps best known for her performances in British television series Green Wing, among other appearances on television and in films. She has an incredible warmth and charm in her voice, perfectly matching Sarah’s own journey in Fragments of Him.

After the casting process, PitStop Productions have also been creating the music and many of the sound effects. The score for the game complements the emotions that the actors have brought into their scenes. Each of the actors has given a passionate, heartfelt performance for their role, and the recording sessions were days full of both tears and laughter. We are very excited to share the results with you soon this year!

Elwin Verploegen

SXSW & Certification Round One January 29, 2016

By Elwin

SXSW 2016

I’m very happy to announce that Fragments of Him has been selected as one of the finalists for the South by South West Gamer’s Voice Single Player Award. And as such we will be showcasing the game at SXSW Gaming the 17th – 19th of March. We will update you with specifics as soon as we know more about our location.

Certification Round One

Certification for Xbox One

Last week we submitted Fragments of Him for the first round of certification for Xbox One. This is simply a check on Microsoft’s end to make sure that a game meets their platform requirements and is up to standards to be released on their Console. For us this means the first big milestone after 2 years of development. While there are a couple more rounds to go, we are incredibly excited to finally get to the point where we can see the release coming up. We have since then had a report back with a couple of minor issues that we have to fix before we can give it another go.

End of an era

Saassybot_2016_Q1

After 5 months we say goodbye to Midas & Stefan, who have both successfully completed their internship at Sassybot. They have both been critical to getting Fragments of Him ready, introducing some new systems, polishing the experience and making sure that we were ready to go into certification. Midas has a promising future ahead of him and Stefan might stick around for his graduation that may include VR (unrelated to Fragments of Him). Thank you both for your awesome personalities these past several months and of course the great contributions to Fragments of Him!

As one sun sets, another rises. And as such, Bas de Jonge started his internship at Sassybot this week, and will be working with us on the marketing side of the game. He will introduce himself next week in a blog post. Welcome to the team Bas!

Elwin Verploegen

Fragments of Him coming to PlayStation 4 & Steam December 9, 2015

By Elwin

After our earlier Xbox One announcement we can now proudly add 2 more platforms where you can get Fragments of Him.

PlayStation 4

PlayStation 4

After Xbox One, we couldn’t let the PlayStation players stay behind. We will be releasing on the PSN store next year.

Steam

Steam

PC gamer? No problem, we got you covered! Next to the latest generation consoles, you’ll be able to get the game on Steam (and Humble).

You can read the full press release over here: http://www.icomedia.eu/portfolio-item/fragments-of-him-also-coming-to-playstation-4/

Make sure to follow us on Twitter & Facebook to keep up-to-date as we release more details about our upcoming release.

Elwin Verploegen

Gearing up for the release of Fragments of Him December 3, 2015

By Elwin

As we move towards release, we thought it was time for an update on the development of Fragments of Him. It has been a long journey (over 2 years), but we are starting to see the finish line. Internally, we are creating regular builds and are seeing these builds become incrementally more stable and enjoyable. In addition to that we have had private playtests that revealed opportunities for improvement. Over the last 6 weeks we have fixed a lot of bugs (295, to be exact) and we’re working hard to make sure that all of the remaining issues are resolved before we launch early next year.

Voice Acting

It finally happened!

Recording the voices for Sarah and Will.

Recording the voices for Sarah and Will.

Mata Haggis, the collaborating narrative designer, visited PitStop Productions to assist in the direction of the voice actors. Since then, the recordings have been processed and implemented. By now, all of recorded voice overs are in the game and let me tell you, it sounds amazing! We would like to eventually release the official voice acting cast in a future blog post so keep an eye out for that.

GaymerX

gx3-logo-pinkbanner1Just like last year, we will have a presence at GaymerX at the San Jose Convention Center (December 11-13). If you attend, you will be able to play the prologue over at the Arcade area (once we have an exact location we will let you know). This will be the first (and probably last) time that you will be able to hear the final voice acting before we release, so if you are around be sure to stop by!

Mata will also be attending and is on a panel with Joe Ortega where they will discuss how they addressed diversity in their work in games.

Throwback Thursday

Ah the good ol’ days of computer limitations, static characters, and unrefined gameplay. From now until release we will be releasing a before & after image of familiar (to those who played the prototype) locations. We will start this off by showing the living room of Will’s apartment.

Internship positions

It’s that time again, and this time we have 2 internship positions open, a Game Designer & Producer and a marketing position. In both cases you will be working closely with us to make sure Fragments of Him will have a successful launch, after which you’ll be working on our next project. You can read all the details over here.

Lastly, we have another cool announcement coming up towards the end of next week, so make sure to keep an eye out on our Facebook & Twitter pages for that one!