Museum Digital Transformation: Talk And Workshop Materials

Museums are research institutions that often have a multi dimensional mission: research, preserve, teach, communicate. Digital tools can sometimes help in maintaining this mission: how and when has been the topic of the conference and set of workshops Museum Digital Transformation held in Florence on the 12th and 13th of April 2018.

I both had a talk (together with Alice Filipponi) and taught a workshop. Here you find links to all the slides and supporting materials I used.

Talk: Museums And Learning

Slides of the talk Museums and Learning – an open dialogue through digital transformation:

Here are two videos presented during the talk:

Workshop: Designing An Applied Game For Your Museum

Workshop exercise booklet

Slides of the workshop:

And here is a public link to a folder with supporting materials.

Thanks!

I hope this material can be helpful. I wish to thank Alice Filipponi, Francesco Pallanti, Pino Panzarella and Matteo Bicocchi without whom these projects and events would not have been possible.

As a way to keep in contact I publish every month or two a newsletter with new research on applied games. You can subscribe here. :-)

 

Social Share Toolbar

Getting Google Sheet Data Updates In Unity

Separating data from Unity code is one of the main ways to keep your project maintainable and resistant to change. Anyone who has experience in game development knows how quick iteration in a constantly changing universe is a necessary part of the process.

(Yes, you are the cat.)

In case your game has a substantial narrative part, facilitating writer/developer interaction is also very important; I was reminded how common is this need by a recent interview of Leigh Alexander The Most Important Part Of Writing A Video Game Is The Tools, on her writing experience for Reigns: Her Majesty.

Writing for games has specific needs and contexts (see a detailed post of mine Videogame Dialogues: Writing Tools And Design Ideas), and so its important for the writer and the developers to quickly see how the text appears in the context of gameplay.

Supposing your writer is updating a Google sheet, I provide you with a very simple way to automatically get an updated textual asset at each Unity run, so making it easy to check how it feels in game.

The solution is simple as Google lets you download any shared doc in CSV format by just requesting the correct URL; you can also specify a target sheet in a multi-sheet document. What is a little bit tricky is that whenever your writer is using newlines, commas or quotation marks, this may break the CSV format.

What is cool of the solution is that it creates a textual asset of the downloaded content, so that say as long as you are running in Unity’s editor, you download the updates, but as soon as you build, the app will use the asset.

You find a complete solution as a Gist on Github :-)

Follow me on Twitter where I post about game design, game development, Unity3d, applied / serious games.

Social Share Toolbar

How to get “share on social” in Unity

I’m writing this post because a reference solution for how to create a Unity button that allows to “share on social” text and images, opening the default “pick a social” screen on mobile apps does not seem to be sufficiently indexed, so my colleague Matteo Bicocchi and I had to struggle in order to put together a complete solution. Here I just re-post information we found elsewhere (in different posts) together with a linear procedure, so I hope to save time for some of you reading :-)

90% of the solution is simply getting this library unity-native-sharing from GitHub and following its setup instructions, in our case the only resulting call is:

NativeShare.Share(I18n.T("SHARE_GRAFFITI_BODY"), mediaPath, null, 
  I18n.T("SHARE_GRAFFITI_SUBJECT"), "image/jpg");

Before finding this simple solution we went through a nightmarish set of experiments that half worked, Android manifest conflicts and Android Studio bizzarries, all stuff that using the above plugin will spare you.

The only case the plugin doesn’t cover is this: on IOS, Instagram by default does not appear among the apps with which you can share your image (it does by default on Android). But the integration to get also Instagram is below.

Share from Unity to social on mobile

Special handling for sharing to Instagram on IOS

For solving the Instagram case we used an additional “plugin” that you can deploy together with the one above; it is just a header and implementation (2 files) and a bridge call from Unity, of the kind

  if (Application.platform == RuntimePlatform.IPhonePlayer)
  {
    InstagramShare.PostToInstagram(I18n.T("SHARE_GRAFFITI_SUBJECT"), 
      LocalScreenshot.EncodeToPNG());
  }
  else
  {
    NativeShare.Share(I18n.T("SHARE_GRAFFITI_BODY"), mediaPath, null, 
      I18n.T("SHARE_GRAFFITI_SUBJECT"), "image/jpg");
  }

Now this will still not work by default (you will be warned by XCode on run) because of a permission problem:

canOpenURL: failed for URL: “instagram://app” – error: “This app is not allowed to query for scheme instagram”

Again here is the solution, which is to edit the plist file in XCode. And below there is how to automate the plist change from Unity: put this code in a class saved in an Editor folder:

 [PostProcessBuild]
 public static void ChangeXcodePlist(BuildTarget buildTarget, 
   string pathToBuiltProject)
    {
        if (buildTarget == BuildTarget.iOS)
        {
           [... other changes ...]

            // Change value of CFBundleVersion in Xcode plist
            PlistElementArray array = 
              rootDict.CreateArray("LSApplicationQueriesSchemes");
            array.AddString("instagram");           

            // Write to file
            File.WriteAllText(plistPath, plist.WriteToString());
        }
    }

That’s all. So thank you so much to the solvers of the three problems above, and you should now have a complete solution. :-)

Follow me on Twitter where I post about game design, game development, Unity3d, applied / serious games.

 

Social Share Toolbar

My Games Of The Year 2017

With Daniele Giardini we wrote our GOTY lists here. They are almost totally disjoint! 😀

Social Share Toolbar

Presenting A Board-game On Platform Cooperativism

I’ve posted on Gamasutra the full story of creating Coops & Dragons, a board game on platform cooperativism which is free and available on Github.

I also published a “how to play “video:

Social Share Toolbar

A playable showcase of applied games created by Open Lab

We just created a web page which lists the main applied games we created in the last four years. These are all playable, either as direct link in the page or by requesting a link, for games unreleased or still in private beta.

We learned about game design, development and domain modelling from each project. Each game has been effective in some application, and we thank all the people we worked with that made this possible. Learning from many and always new :-) mistakes, we refined our process along the way.

We now cover all aspects of creating applied games, from creating a concept, to domain modelling with the field experts, to mechanics and multi platform release.

We worked with museums, research centres, private companies, NGOs – always with people with specific, refined knowledge and expertise, focusing the game design process on their core knowledge. This process generates original, unique game play experiences.

I hope you will work with us to create more games, using this wonderful medium for making learning complex topics a more accessible and universal experience.

Open Lab Applied Games Website

Social Share Toolbar

All Mailings Done On Applied Games

Here are all mailings done on applied games, in case you missed some.

And here you can subscribe. :-)

Open Lab Games mailing

Social Share Toolbar

Talk “Applied and Persuasive: Playful Learning In Museums” (video with slides)

Here is the talk I gave at the Museum Digital Transformation conference in March, 2017:

 

 

Social Share Toolbar

Unity: Dense Auto Increment Your Build Number Across Scenes

I was looking for a way to have a build number in Unity so that:

  1. I want a “build” number to be dense, at least as dense as commits
  2. it should auto increment on run
  3. it should auto increment from whatever scene you are launching your game
  4. it should be possible to decide to show it or not in every scene
  5. it should totally take care of itself – so when I get feedback on a new build I can always ask the tester which build is she using, and I don’t go “damn it I forgot to increase the build number!!”

The idea is simply to have an editor script that changes a prefab (so that you can place it in every scene, but has a global state) each time you run. Here is my code, which you can fit to your needs (this also does the life-saving “save scene before run” which you may pick too):

// Author: Pietro Polsinelli - http://designAGame.eu
// Twitter https://twitter.com/ppolsinelli
// All free as in free beer

using TMPro;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace OL
{
    [InitializeOnLoad]
    public class AutoSaveOnRun
    {
        static AutoSaveOnRun()
        {
            //Thanks https://twitter.com/andrewlukasik for the "+=" fix.
            EditorApplication.playmodeStateChanged += () =>
            {
                if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
                {
                    GameObject build = AssetDatabase.LoadAssetAtPath("Assets/__Scripts/Tools/Components/Build/Build.prefab",
                        typeof(GameObject)) as GameObject;

                    if (build != null)
                    {
                        TextMeshProUGUI bn = build.GetComponent<TextMeshProUGUI>();
                        if (string.IsNullOrEmpty(bn.text))
                            bn.text = "1";
                        else
                        {
                            bn.text = (int.Parse(bn.text)+1).ToString();
                        }
                    }
                    
                    EditorSceneManager.SaveScene(SceneManager.GetActiveScene());
                    AssetDatabase.SaveAssets();
                }
            };
        }
    }
}

P.S. More approaches

In order to change the build on compile and not on save, I now use this code in the (also very useful) stop-play-on-compile class:

// Copyright Cape Guy Ltd. 2015. http://capeguy.co.uk.
// Provided under the terms of the MIT license -
// http://opensource.org/licenses/MIT. Cape Guy accepts
// no responsibility for any damages, financial or otherwise,
// incurred as a result of using this code.

// Modified by Pietro Polsinelli. 2017. https://twitter.com/ppolsinelli

public class ExitPlayModeOnScriptCompile
    {
        static bool increasedBuildForThisCompile;

        // Static initialiser called by Unity Editor whenever scripts are loaded (editor or play mode)
        static ExitPlayModeOnScriptCompile()
        {
            Unused(_instance);
            _instance = new ExitPlayModeOnScriptCompile();
        }

        ExitPlayModeOnScriptCompile()
        {
            EditorApplication.update += OnEditorUpdate;
        }

        ~ExitPlayModeOnScriptCompile()
        {
            EditorApplication.update -= OnEditorUpdate;
            // Silence the unused variable warning with an if.
            _instance = null;
        }

        // Called each time the editor updates.
        static void OnEditorUpdate()
        {
            if (EditorApplication.isCompiling &amp;&amp; !increasedBuildForThisCompile)
            {
                increasedBuildForThisCompile = true;

                GameObject build = AssetDatabase.LoadAssetAtPath("Assets/__Scripts/Tools/Components/Build/Build.prefab",
                    typeof(GameObject)) as GameObject;

                if (build != null)
                {
                    TextMeshProUGUI bn = build.GetComponent&lt;TextMeshProUGUI&gt;();
                    if (string.IsNullOrEmpty(bn.text))
                        bn.text = "1";
                    else
                    {
                        bn.text = (int.Parse(bn.text) + 1).ToString();
                    }
                }
            }

            if (!EditorApplication.isCompiling)            
            {
                increasedBuildForThisCompile = false;
            }

            if (EditorApplication.isPlaying &amp;&amp; EditorApplication.isCompiling)
            {
               Debug.Log("Exiting play mode due to script compilation.");
                EditorApplication.isPlaying = false;
            }
        }

        // Used to silence the 'is assigned by its value is never used' warning for _instance.
        static void Unused&lt;T&gt;(T unusedVariable)
        {
        }

        static ExitPlayModeOnScriptCompile _instance = null;
    }
}

Yet another approach is to identify the build number with a platform build (I don’t use that because I want density): https://gist.github.com/andrew-raphael-lukasik/36a30f0955d7cdc758e394dc4e7266bf.

Follow me on Twitter where I post about game design, game development, Unity3d 2D, HTML5, applied / serious games.

 

Social Share Toolbar

Several useful writings on writing for games

I just posted on Gamasutra a curated list of recent and less recent posts / videos on writing for games – here :-)

Social Share Toolbar