avatar

Mercury Shift Devblog: Code Catch up

In this post we will be looking at some of the things the code department has been doing during the last months. Mic built some cool tools for the Unity Editor and Rika was busy implementing player functions. But let’s go into more detail:

Code

For this part of the megapost, we will be documenting the progress of the code department.

Above all, there’s bugfixes. Mic and Rika fixed so many bugs recently. Countless things they have solved, busy bees. So let’s get started.

 

Building the user interface

Rika worked with Robin on a UI for our game. Although Unity is working on their own GUI system, we weren’t sure when it will come around and save our day. On the design of it there is not too much to say, but the backend is a pretty nifty one. First off, Rika wrote a own input manager. When working with gamepad input, this happens a lot. Known issues with the existing one were a problem for us, as the registration of the gamepad triggers (usually the shoulder axis trigger on a controller) did not work as we needed it. The triggers register as one single axis, which can lead to confusion over status. The inputs sometimes register as negative and positive axis movement. So pressing both buttons at once sets the input to zero.

So via xinput Rika built our own input manager. For further comfort, we build a preset-manager. The user can save various keybindings and switch between them, or just use the standard.

User Interface Input Manager

Navigating the UI is also a tricky thing. The mixture of inputs whilst navigating the menu gave us a hard time for the first iterations. The mouse position was overriding most of the other controls, which led to odd behavior. Disabling the mouse interaction, as soon as other input devices are being used works great now. Should you run into trouble while using the interface, please let us know. It’s still in beta state and we’re aiming to make it a real enjoyable experience.

Nested User Interface User Flow

The navigation is nested, which means that upon opening you end up with the primary navigation (1). Selecting one of the points brings you to the next level (2). If you select between the tabs, you end up navigating the entries like (3).

See it in action here:

User Interface GIF

You can switch between Mouse, Keyboard and Gamepad for controlling the UI at all time. Escape on the Keyboard, B on the controller and clicking outside of the menu with the mouse bring you back a level.

Next up: The Winscreen

Rewarding players after they finished a level was something we kept pretty simplistic up until this point. There was orange juice involved.

We do have a difference in elevation for our levels. We arranged the levels in a specific order. The players are following a path of ups and downs. Although the levels themselves represent this journey, we are now using the winscreen to emphasize it.

Every time the players finish a level, they are leaving through a door. This door did not lead anywhere specific before the update, so we were wondering for a while what to do with it. Now, the players arrive in a room, that is a transition level.

By choosing the door to the left, they repeat the level, by choosing the one on the right they continue to the next level.

Furthermore the players receives stars according to their performance in the past level. The collected points are collected and counted. The player with more collected points receives a confetti shower.

Winscreen in Mercury Shift 3D

The winscreen is a method to obscure the loading time of the next level. While the players are fooling around in the screen, the next level is preloaded.

By leaving the room through the left door, you restart the level. By using the right door, you start the next level. This kind of transparent UI is pretty intuitive and works very well so far.

Unity Editor scripting: Tools

Mic is making all our lives easier. Most of our leveldesign and art work is done in Unity. Unity3D has a powerful editor scripting capability. We are working with various tools, either purchased ones through the Asset Store or selfmade.

Vertex Painter

One of these self written tools is a Vertex Painter. Although there is a painting tool in the store, we have been longing to use a slightly more sophisticated solution. It supports a falloff as brush. Painting soft edges is now possible by using a gradient that’s stretched between two spheres and act as three dimensional brush. With the outer opacity set to zero you have a soft brush. Its interface looks a bit like this:

Vertex Painter for Unity

After painting, you can save the mesh and the paint is not only available in the scene, but as an asset.

Layers and Shortcuts

With a lot of assets in the scene and a mind-boggling hierarchy, scenes are becoming harder to navigate. To make things easier, Mic wrote an second layer system. This system works on top of the Unity-Layers and is Editor-only. While Unity’s built-in system works well, it also affects objects in game. Some layers have to contain specific objects. This second layer system is for sorting and filtering only. You can mark objects, add them to the layer and hide and show them on demand. Sometimes the gamedesigners don’t need the artists’ objects and the other way around.

Alternative Layer Manager in Unity3D

Shortcuts follow a similar idea. With a stuffed backend, we sometimes have to navigate to a specific folder. Those folders can be deep down in the hierarchy, so a small set of shortcuts solves this problem. Just mark any of the folders as target and it’ll be a available via one click.

So those features have been enriching the game in the last months. There are even more updates on the verge that we haven’t been talking about, but that’s going to be here soon. Next up are the artists, GIF and PNG heavy thread upcoming!

This entry was posted in Code, Devblog and tagged , . Bookmark the permalink.