Revisiting Global Game Jam 2018

This year in the Global Game Jam, which ran from January 26-28, I partnered up with Alex Grace, a friend from Tasmania to create a game in just 48 hours. Every year artists, coders, designers, producers and musicians meet up to create games over a single weekend. There are no prizes, it isn’t a competition – everyone does it for the fun of it. We attended the Melbourne jam site, which was among the top ten attended sites with over 300 participants (jammers).

Having participated in last year’s global game jam I had a good idea of what to expect. Without realizing it I had been in quite a large team. The average is about 2 or 3, but mine was 5 people strong. That was great because it meant that I had had another programmer with me, but this year I was more confident and wanted to try to make a game in a team where I was solely responsible for programming. You can attribute that confidence to me dedicating myself to full-time Unity development last year. Teaming up with Alex, a talented 3d artist, meant that we had a complete team between the two of us.

There were quite a few things that worked well about our weekend. First, we gave ourselves enough time to throw around about a dozen game ideas, chew over the ones we liked and what the design of each would look like. In the end I think we settled on Pirate Radio because it had a clear goal for the player – steer a boat while also managing a radio station.

Producing the game itself was in some ways relatively straightforward. There was clearly 3 different areas for me to work on: steering the boat, queueing up your playlist of songs and getting feedback from the listeners on whether those songs were chart-topping. For Alex he primarily only needed to focus on a player boat, with a variant for the police, the enemies in the game, and a boat interior of the radio studio. This meant that he was able to dedicate himself to making all the details look superb. A unique challenge was that because the boat was dynamic we couldn’t rely on any static lighting from Unity. Instead, for the interior, Alex relied on ambient occlusion from within Substance Painter to simulate ambient lighting. Another nice touch was the portholes were not transparent, and instead were just reflecting the skybox, which actually made it look like you could see outside from the internal portholes.

Even though our progress had been consistent, we still managed to come down to the wire for the deadline. The game really only felt complete in the final minutes and even then I badly wanted to do smooth out the rough edges in some post-jam updates to assist new players.

Over the next few weeks I did most of the tweaks that I wanted, though the game is still missing some highscore bonuses that I would have liked to include. After creating a trailer I posted it on itch.io because it felt like the right way to finish off the project. That turned into a fortuitous occasion; we were featured on the front page of itch.io under the “Fresh Games” section.

That in itself was a little surprising but it also meant that we then had roughly fifty thousand people see a link to the game on their homepage, 793 game page views and 263 downloads. While the click-through rate (number of links presented vs clicked) to our game was about the norm, around 1-2%, of those people that viewed it, a third of those downloaded the game.

For a game produced mostly over a weekend I consider that a win. I think the fact that people noticed us is a testament to Alex’s artwork and the idea being eye-catching – it’s about pirates! – just not those kind of pirates.

All in all, a great experience. It has definitely spurred me on in making games, but also to take care in how to present them, especially trailers and screenshots that will be a player’s first impression of a game. You can play the game right now if you haven’t already. Thanks for reading.

Hyperlinks in Unity UI using Text Mesh Pro

Well, the 2018 Global Game Jam is around the corner in only two weeks. This year will be the second year I will be participating, creating a game in only 48 hours with a small team of devs. So, in preparation for the jam I am sharing a script I will likely be using during the jam. A common task during a game jam is to include a credits page with hyperlinks attributing any resources you have used, or linking back to your own pages. Unity’s game jam menu template doesn’t include an example of how to do this however and you might have noticed that Unity’s UI Text component doesn’t provide any functionality for a user to interact with text, even if it’s only to detect a word being clicked – so creating a hyperlink is actually a little less straightforward that you might assume.

Text Mesh Pro is an asset that adds a lot of extra functionality for displaying, stylizing and interacting with text over the existing UI Text component. Last year the asset and it’s developer joined Unity, making the asset free for all developers. I modified one of the TMP’s provided examples to get hyperlink functionality in my own game prototypes. You can find a quick drag-and-drop script to get this same functionality here.

TMP has html-like tags that you can use to markup the text you enter. Of particular interest is the link tag which can be used to easily identify text from code and tag it with additional data. It doesn’t have to be used for hyperlinks, but that’s what I’ll use it for in this example.

After adding my OpenHyperlinks component you get functionality to highlight links on mouse over and open them in your browser on click.

To specify a hyperlink you add the link tag and specify the url in it’s link data (id).

To get the main functionality all we need is a IPointerClickHandler callback, Application.OpenURL and TMP’s FindIntersectingLink method:

[RequireComponent(typeof(TextMeshProUGUI))]
public class OpenHyperlinks : MonoBehaviour, IPointerClickHandler {

    public void OnPointerClick(PointerEventData eventData) {
        int linkIndex = TMP_TextUtilities.FindIntersectingLink(pTextMeshPro, Input.mousePosition, pCamera);
        if( linkIndex != -1 ) { // was a link clicked?
            TMP_LinkInfo linkInfo = pTextMeshPro.textInfo.linkInfo[linkIndex];

            // open the link id as a url, which is the metadata we added in the text field
            Application.OpenURL(linkInfo.GetLinkID());
        }
    }
}

 

We can also change the link text to a different color when the cursor is over it, just like a normal hyperlink, to give feedback to the user that it is clickable. To achieve this we need to iterate over each character and update its material’s colors if it’s visible. Invisible characters aren’t included in the character count and so will cause us to update the wrong character colors if we don’t handle that case. We will also save the original colors so that we can restore them later after the cursor is no longer over the text. Nothing particularly difficult.

List<Color32[]> SetLinkToColor(int linkIndex, Color32 color) {
    TMP_LinkInfo linkInfo = pTextMeshPro.textInfo.linkInfo[linkIndex];

    var oldVertColors = new List<Color32[]>(); // store the old character colors

    for( int i = 0; i < linkInfo.linkTextLength; i++ ) { // for each character in the link string
        int characterIndex = linkInfo.linkTextfirstCharacterIndex + i; // the character index into the entire text
        var charInfo = pTextMeshPro.textInfo.characterInfo[characterIndex];
        int meshIndex = charInfo.materialReferenceIndex; // Get the index of the material / sub text object used by this character.
        int vertexIndex = charInfo.vertexIndex; // Get the index of the first vertex of this character.

        Color32[] vertexColors = pTextMeshPro.textInfo.meshInfo[meshIndex].colors32; // the colors for this character
        oldVertColors.Add(vertexColors.ToArray());

        if( charInfo.isVisible ) {
            vertexColors[vertexIndex + 0] = color;
            vertexColors[vertexIndex + 1] = color;
            vertexColors[vertexIndex + 2] = color;
            vertexColors[vertexIndex + 3] = color;
        }
    }

    // Update Geometry
    pTextMeshPro.UpdateVertexData(TMP_VertexDataUpdateFlags.All);

    return oldVertColors;
}

 

And that’s it! I hope you find this to be a useful starter if you want to interact with your text in Unity or you wanted some quick hyperlink functionality for a game jam. Till next time.

Prototypes Preview

Over the last few months I have been familiarizing myself with different aspects of the Unity game engine. Here’s a quick breakdown on some of the things I’ve created.

Down The River - Kayaking Game

My most complete prototype out of all of these is a top-down river kayaking game called Down The River.┬áIf you haven’t already, I recommend you try it out for yourself. If you get stuck, read a bit further and try again.

The left and right keys map to turning left or right and forward simultaneously. So holding the key increases your paddle strength and forward speed but turns you off-center. The player has to learn to hold each key long enough, rather than simply tapping the keys quickly repeatedly. Players can keep a steady rhythm to go straight or vary the key presses to turn. It becomes a little QWOP-like, but manageable. Teaching players to hold the keys long enough proved difficult and required a couple of prompts. I added arrow key prompts and a ‘power’ meter to indicate a steady rhythm, but this may not have been enough. Beyond that, if I were to improve this I would track the length of player key presses in the early section of the game and prompt the user to hold each key + reach max power.

I entered my game into LOWREZJAM, which required a pixel art style – conveniently hiding my lack of art skills. It also focused on only a single mechanic, which felt great as soon as I first implemented it.

This latest prototype isn’t really a game in it’s current form, but it works well enough. It’s a roller coaster game for mobile phones, where you use your gyroscope to control the camera and roller coaster. If I bothered to complete this you would score points for tilting the coaster carriage into each corner and there would be other stars to shoot with your camera and collect along the way. It probably wouldn’t be a very challenging game for the player, but that may not be a bad thing considering how difficult my other prototypes were.

2D platformer prototype

Actually, my first prototype was a short, one level 2D platformer game. My original aim was to create a parkour inspired platformer with a more ‘realistic’ approach to movement, where motion is preserved and you can’t direct your jump (much) while mid-air. I had wanted to include sliding, different grips and ‘tricks’ a-la Tony Hawks. However, after attempting to create some art it quickly became obvious that I wasn’t going to enjoy creating my own artwork when I’m a programmer and just how much work was involved in creating the art and animations.

So I cut down the scope to use free art online, which limited my characters abilities to a simple jump and wall grip. Although I used a Unity store asset for platforming and my game was very simple I still encountered a couple of bugs with the asset – the major one that the player can’t always jump on sloped platforms. In the end, I didn’t have much success with this prototype. The movement was way too fiddly and unforgiving. It’s relatively ingrained in players that they can turn around or slow down mid-jump, Mario style and breaking that rule just feels like the game is meaninglessly difficult.

My biggest takeaway from all of this is that scoping your prototype to a manageable size is HARD – and I have to carefully plan on each game how to make do with minimal art that either I create or find online. I managed this the best on Down The River, which was a significant improvement over the platformer I did previous to that.

I’m currently working on a larger project which I will talk about in later posts. You can stay tuned on Twitter and here for more updates.

Melbourne Games Week Post-Mortem

PAXRising showfloor

Hello all! It’s been a week now since Melbourne International Games Week finished and I’d like to take some time to reflect on what I learnt this year from the “Christmas of games and game development”. Stay tuned for a future blog post on what game prototypes I’ve been working on over the last few months and my current project.

Before games week kicked off I took some time to set some goals for the game developers conferences. I had some general goals, like intentionally meeting as many other game developers as I could manage, partially with the hope that I might find an artist to collaborate with on a future project or game jam. More specifically though I wanted to understand how to market a game effectively when I am responsible for virtually every aspect of its creation. I wanted to get an idea of where games journalists find their content and what catches their eye as being newsworthy.

Regular Human Basketball Game

During Unite and GCAP, the developer conferences, I spent a significant amount of time in marketing and business related panels. One of the aspects of game dev that I haven’t learnt anything about yet is using in-game analytics to improve game design. There is some time investment in implementing the technology for any project, but presenters demoed some great examples such as using level progression info to adjust difficulty and identifying and rewarding different player styles which could greatly improve the flow of a game. One technique for identifying different player groups for analytics is using k-means clustering a data science and machine learning technique. I’m always looking for an opportunity to learn more about AI and machine learning, so I’m hoping I’ll have time to try that out for my own projects. Brackeys from Youtube has a good explanation of Unity Analytics which serves as a good introduction to analytics.

In terms of marketing, presenters really drove home that time and effort needs to be spent on trailers, store pages and the like. The reality is that thousands of people are going to be viewing this content, so it needs to be as good as it can be. These moments are also highly predictable. You know that potential players are going to view the game art, click through to a store page, watch a trailer and read the description. Each of these moments will determine click-through and ultimately whether the customer buys your game. Importantly click-through is tracked by Steam, Microsoft or whatever store you are listed on and they will promote whichever games have the best click-through rates. It’s highly important that you get this right so that you get maximum visibility from your store in your limited release window. None of this should be surprising, so the take away for me was to spend your marketing effort (and indeed your game design effort) where the most number of people will be viewing / playing.

Rumu Game

I’ve never had to think about how to interact with journalists before and to be honest, the thought is kind of scary. A simple takeaway I learnt from games week was that stories promoting your game don’t actually have to be about the game, but rather about how or why you developed it, who *you* are (if you have some kind of interesting history) or how your game ties into a current news event. For example, MsMinotaur used to program satellites before she worked on games, Hyper Light Drifter has themes that mirror its creator’s own illness. There are lots of these stories that don’t directly tie into the games, but journalists and the general public are interested in the greater context of the game.

These takeaways feel super obvious, but it’s stuff that I haven’t consciously had to think about before. It’s all part of the process of becoming a real developer though, I guess.

There were also some great games that I played at PAX AUS. Some of the standouts narrative games were Necrobarista – a playable Visual Novel and Rumu – a sentient vacuum cleaner investigating the house it lives in. There was also Regular Human Basketball – a comedic team sport about controlling a robot co-operatively to shoot a basketball. I’m also eagerly awaiting the release of The Adventure Pals which was on show again this year and which I pre-ordered last year.

So, what did you learn this games week? What games are you excited for?