Steady Drop – Log #11

 

Collecting game data for simple statistics

After the previous iteration I’ve done on graphic and UI improvements in the game I started to think about collecting some data from the game that comes from the player actions, in order to have a sort of statistics screen that the player can check from time to time to see his progress, and furthermore in this way the game can collect useful data to base some kind of achievements system in the future. For example there will be an achievement for falling through 100 game units (or meter if you want) or for playing 500 rounds. For the achievements system, I’m planning to integrate some native stuff for Android and iOS (Play Game Services for Android and Game Center for iOS), starting with Android, obviously.

 

Implementation of the statistic system

For the implementation, I chose to create a single class that handles all the requests to store and get the data collected. The data we want to collect are mostly integer numbers handled in different manners. For example, if I want to memorize the high score, I have to tell this entity that the data tagged as “high_score” has to be saved as MAX of the previous, and on every game over I have to memorize the current score. In this way, every time I memorize a new value, the entity keep the max between the previous and the current values. In a similar way, I can memorize a counter (like to count the rounds played). What I have to do is to memorize a value 1 every  game over.

This entity relies on the DataMgr to load and save the data. The DataMgr itself is an interface to read and write values from the physical memory of the device you run your Unity application. Here some snippets I took from the StatisticMgr.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//Load and save data from the device
public void loadLocalData() {
    foreach(KeyValuePair<string, StatData> entry in dataBank) {
        string readData = DataMgr.readData(entry.Key);
        if(readData != null)
            entry.Value.setInitialValue(readData);
        else
            entry.Value.setInitialValue(0f);
    }
}

public void saveLocalData() {
    foreach(KeyValuePair<string, StatData> entry in dataBank) {
        DataMgr.writeData<double>(entry.Key, entry.Value.value);
    }  
}


//For store a new value in game
public void storeNewValue<T>(T _value) where T: IConvertible {
    Double dValue = Convert.ToDouble(_value); //numbers stored as double
    switch (mType) {
    case(StatDataType.PLAIN): //saved without logic
        value = dValue;
        break;
    case(StatDataType.SUM): //saved as increment
        value += dValue;
        break;
    case(StatDataType.MAX): //saved as max (if the current max is lower
        value = Math.Max(value, dValue);
        break;
    }
}

 

Where is the sound?

I’m still planning to make sound and music for the game but the sound iteration will take some more time. I could pay somebody to make music and sound for me, or take it from some Creative Commons site, but since I have a little knowledge of music theory in general and in the past I was into recording, DAWs, MIDI and stuff, I want to try to harness my past passions to make something out of it, before asking for external help. What I have in mind, though, is to record some real sounds and manipulate and combine it to create the sounds I need.

Stay tuned for future posts of the series, and if you are interested on other post series don’t forget to visit the blog main page 🙂

 

Game developer & designer. Unity 3D lover. Movie fanatic.

Isometric Camera with Unity

 
I like real time cameras subject so much that I already made a post on real time cameras (here) specifically on third person cameras. This time I will show you how I set up a simple isometric camera for a game prototype I made in Unity.

 

The isometric camera

Basically an isometric camera has an isometric view in which the perspectives are avoided, it’s like having a “zero-point” perspective instead of the three-point perspective you normally have on a classic first or third person camera. As you can see, there are no perspective deformations on what the camera sees, for example, with isometric view, all the edges of the cube are parallel. Technically, by having a an isometric view, the camera is already isometric, but on top of that, in games this view is classically used used with a 45° degree rotation.

This type of camera was used a lot in the past (especially on the 16-bit era) in games like Q Bert, this first Diablo, the first Fallout and Age of Empires, mainly to give more sense of three dimensional space with a minimal computational effort. Lately it is used for nostalgic reasons and for specific artistic or design choices in games like Monument Valley.

 

The camera script

The only thing you have to do it in order to use my simple isometric camera is to add this script to a Gameobject. Since the script require a Camera, it will add it for you. When the script starts, it creates all the things needed to run an isometric camera, which essentially are a target to look to and some other Gameobjects used for camera movements (which I will show you in a minute).

Then the most important part is camera settings and rotation. The camera has (obviously) to be orthographic otherwise we have perspective involved and we don’t want it. For the rotation of the camera, I chose to make the camera a child of the target and to rotate the target instead of rotating the camera itself, just because it seems more logical to me to apply the further movements and rotations.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void Awake()
{
    //Objects creation
    GameObject target = new GameObject("Camera Target");
    GameObject movableRef = new GameObject("ISO Camera Movement");
    movableRef.transform.localEulerAngles = new Vector3(0, 0, 0);
    m_IsoMov = movableRef.AddComponent<IsoMovementController>();
    m_IsoMov.init(speed, limits, invertedXAxis, invertedYAxis);

    //Camera settings
    m_Camera = GetComponent<Camera>();
    m_Camera.orthographic = true;
    m_Camera.tag = "MainCamera";
    m_Camera.orthographicSize = 20f;
    m_Camera.backgroundColor = new Color(.3f, .3f, .3f);

    //Camera positioning and objects parenting
    GetComponent<Camera>().transform.position = new Vector3(0f, 0f, -50);
    GetComponent<Camera>().transform.parent = target.transform;
    target.transform.parent = movableRef.transform;
    target.transform.localEulerAngles = new Vector3(45, 45, 0);
}

 

Camera motion

While creating this camera, I wanted to add a little bit of movements and even a rotation. To do this, I created a second script and attached to the parent of the camera target, the controller. In this way the controller rotates and moves the target (in real time), and the target has rotated (and keeps the rotation of) the camera. That’s the reason of all of those objects in camera creation.

Movements

For the movements I just taken the vertical and horizontal axis and translate accordingly but within a certain limits (setted in the inspector), in this way we can’t get outside of a certain scene or environment.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void FixedUpdate ()
{
    float h = Input.GetAxis("Horizontal");
    float v = Input.GetAxis("Vertical");

    if(!h.Equals(0f) || !v.Equals(0f))
    {  
        Vector3 trans = new Vector3(h*.5f + v*.5f, 0, v*.5f - h*.5f);
        transform.Translate(trans * speed *  Time.deltaTime, transform);

        Vector3 pos = transform.position;
        pos.x = Mathf.Clamp(pos.x, -limits.max_X, limits.max_X);
        pos.y = Mathf.Clamp(pos.y, -limits.max_Y, limits.max_Y);
        pos.z = Mathf.Clamp(pos.z, -limits.max_Z, limits.max_Z);
        transform.position = pos;
    }
}

 

Rotation

As a reference for the rotations I took the camera from the game Anno 2070, which can rotate towards the target (on the horizontal plane) of a certain angle. I wanted something similar but more defined: I wanted the rotation step to be 90°. In this way when the camera has finished rotating, you are still in a isometric view but you are looking at another side of the scene. This concept of having a rotation step I saw it on Fez, which is a 2D game, where you can rotate the camera, 90° degree at the time. It is actually a 3D game. Here’s the code for the rotations.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
void FixedUpdate ()
{
    if (Input.GetButtonDown("Jump"))
    {
       
        if (!m_IsRotating)
        {
            float c_rot = Input.GetAxis("Jump");
            Debug.Log(c_rot);

            m_IsRotating = true;
            m_DesiredRot = transform.rotation;
            m_DesiredRot *= Quaternion.Euler(0, 90*Math.Sign(c_rot), 0);
        }
    }
}

[...]

void Update()
{
    if (m_IsRotating)
    {
        m_RotationData.rot_value = Mathf.Lerp(m_RotationData.rot_value, m_RotationData.rot_sp_max, Time.deltaTime);
        transform.rotation = Quaternion.Slerp(transform.rotation, m_DesiredRot, Time.deltaTime * m_RotationData.rot_value);
        if((m_DesiredRot.eulerAngles - transform.rotation.eulerAngles).sqrMagnitude < 0.1)
        {
            m_RotationData.reset();
            transform.rotation = m_DesiredRot;
            m_IsRotating = false;
        }
    }
}

 

Final results

This camera works great (with some adjustments), for example for infinite runners or strategic games that need to have a top view of the “game board”. In order to work properly, however, the 3D models you put in the scene have to be created for an isometric view.

You can find the full Unity project right here (with a beautiful voxel model I made) feel free to use it and modify it.

Unity Project

Game developer & designer. Unity 3D lover. Movie fanatic.

Steady Drop – Log #10

Deadline changes

I had the milestone to complete the next development iteration of Steady Drop at the end of march 2017, but for the lack of time and for the efforts put in other projects (like the game I made for the Global Game Jam 2017) I’m forced to postpone this milestone and to go a little bit further with the deadlines. The project is still growing, it’s just I had little drawbacks, that’s it. I’m still adding improvements here and there, most graphical ones, and I have some “big” features I want to add before the next deadline. Like I said, I fixed most of the bugs I received from the alpha-testing phase and I’m still integrating some improvements based on the feedback I had. Goos news after all!

Visual improvements

I reviewed the color palette of the entire game, so I changed every color a little bit to make it more glued together (I used a palette generator) and to give more sense to the overall experience. But I completely changed the enemy colors: they was very similar to the avatar of the player but now, as you can see, they have their own color, and it’s more clear to the player that’s this shapes are not something related to the avatar he’s guiding down.


Another two visual improvement I’ve added are the trail behind the falling avatar and a particles generator on the bottom of the screen, they both give more sense of movement.And last but not least I’ve added a dynamic gradient un the background. So here you can see the differences between how it looked like and how it looks like now.

 

Next steps

One of the things I want to do next is to add some visual feedbacks when you lose health (or zero-gravity time) and to make some enemies a little bit more alive with some scale animations. I’m also planning to rewrite part of the UI system and replace the UI of the main menu, because I made the current placement just for the prototype, which has limited menu choices.
Next I will have to modify the tutorial (again) because I don’t like the current one, and to work on some game balance parameters like the score multiplier…a lot of magic numbers 🙂 After that, I will start to research how to integrate and produce sounds and music. It will be fun!

Just a reminder, if you want to play the alpha, just download and install this file. Steady-Drop-Alpha

Game developer & designer. Unity 3D lover. Movie fanatic.

Create a movie barcode with Python

 

I’ve recently discovered this curious blog called movie barcode (link). The image on this blog are basically created from the frame colors of a movie or a video and maybe there are some post-processing on the image to make it more artistic. When I discovered it, I really liked the idea and I started to gather information on the possible algorithm to analyse and create (from code) similar images. This is when I discovered some articles (this one, and this one) on the matter and I started to play around with the code given. Most of it was in Python so I continued to use it for this project. My idea was to analyse video source frame by frame, then find the main color for that frame and to create an image that has a vertical line (of a certain width) of that color. I know this is a different approach from the ones on the blog , but I wanted to start easy and then to expand or change the algorithms. The link of the script is at the end of this article 🙂

 

Take a video source

The first step is to take a video source and for that you can choose to take a video on a specific path of your pc or you can download it. I used this library (link) to download a video from Youtube (very easy to use). Once we have a video we can analyse it. I tested my script mostly with mp4, avi and mkv videos, I don’t know if can works with all video codecs or compression. (it’s not the purpose of my script 🙂 )

 

Analyse frame by frame

Now the fun part: find the main color of a frame. To do that I massively inspired my work on this articles (link) from Alan Zucconi, where he uses a K-mean algorithm to analyse an image and explains very well how this algorithm works. Fortunately, there are some good Python libraries to do that (details on the script) and they are easy to use, so why not. This algorithm is pretty heavy but after few seconds we have the RGB components of the main color for that video frame and after doing this process for every frame of the video, we have a list of colors. Since I choosed to make the result images of a certain maximum size, in the script I analyse only a certain number of frames. If the number of frames are more than this number I simple analyse one frames and skip N frames.

 

Creating the final image

Now what we have to do is to create an image that have a vertical line for every color of our list of colors. To do this, I used another Python library to create images, graphs and color manipulation stuff, which is a pretty powerful library that can do various things as create an image of a certain size from a list (a matrix) of colors. Here is how the matrix is created.

 

Final results

I’m pretty happy with the results so far, so I started to analyse some Youtube videos and some films with this results:

 

It’s only a matter of install the right libraries and run this script with a video and you’ll have a nice barcode. I will definitely improve this code and try to make it more artistic. Maybe in the future there will be another post on this subject.

 

Movie barcode on my Gist

Game developer & designer. Unity 3D lover. Movie fanatic.

Steady Drop – Log #9

Alpha released

 

I released the alpha of Steady Drop! It was a silent release (sadly I’m not a marketing guy :-P), which I’ve done only for people I know and for members of some Facebook groups I’m in, but It was the right time for a first slot of tests.

Right after releasing the alpha version, I started to receive a lots of useful feedbacks by the “alpha testers”. I gave them the possibility to leave a feedback in a traceable way (with a Google Form) or in a more direct and fast way. One of the last changes I’ve done right before the release was to add a button to leave a feedback on a form I made just for them. With this form I tried to gather all the informations I needed in order to progress the development in the right direction and make Steady Drop more playable and easy to use.

After all, seeing my game from another person’s perspective is the best way to find out some flaws which are invisible to me and just view the experience from another angle I didn’t considered before. Seeing what another person sees while playing your game is invaluable, and the more you have the possibility to let this happens, the more your game can improve. The only (little) drawback is that it’s required to filter in some way and extract the right signal from a feedback.

Thanks to all of the feedbacks, I listed a number of fixes, improvements and just some things I wanted to try, that I added to the task list I want to develop for the next step, which is a release of a beta version. I will also try to remove the sense of prototype while playing the game…it will be a hard one.

Right now I’m not putting so much effort on new features or bugfix, because I have other little projects I want to finish and publish (like this one). Right after finishing these little projects I will spend more time on this project and I will bring the development forward. If you want to try the alpha version of Steady Drop contact me 🙂

Game developer & designer. Unity 3D lover. Movie fanatic.

Steady Drop – Log #8

The value of the tutorial

It’s been awhile since the last devlog and from there I’ve been struggling so much in the project to create a proper tutorial.

At some point in the development (probably too late) I started thinking a way to explain to the player the main mechanics and  what are the goals of the game. There are a lot of ways of doing that (I’ve done my homework) and I thought that a short tutorial, at the first try, before starting the game, could be a good way to proceed.

I wanted a tutorial to explain the input basics and the main mechanics to the player, so in this section all the points and the game logics (talked here) and the spawn logic (talked here) have to work in a different way.

 

I started to work on this with a specific approach where the entire tutorial is a level slot (here I talk what I mean for slot) but this wasn’t really suitable for what I had in mind, so after almost forcing myself to try and develop a tutorial system that works in that way, I realize that it ain’t gonna work, so I deleted everything and started the tutorial system from scratch. After some time and some struggling, I finally have a tutorial system that “kinda” works. It’s still pretty rough but It does its job so I can refine it after the launch of the game alpha.

 

The biggest advice I want to leave is to consider designing the game and the code with a tutorial in mind, if you want one. The fact I didn’t think at all to the tutorial at the beginning of the development made me waste a lot of time to refactoring my code and redesign the levels. So, keep the rules simple and keep a simple way to explain it to the player right from the beginning of the development.

 

I think the alpha version of the game will be available in early january 2017. Stay tuned 🙂

Game developer & designer. Unity 3D lover. Movie fanatic.

Steady Drop – Log #7

 

In this post I will talk about how I put everything together and a little bit of code management.

Code versioning

Let’s begin with some things to remember: use a versioning system…and again, use a versioning system. I can’t stress this enough. Really, for every project you’re working on, use a versioning system like Git, SVN or Mercurial. It really helps keeping the project managed and it’s necessary for collaboration with other people. If you don’t know what is a repository you can start here.

My habit is to use repositories especially for work and since I saw more benefit using it I decided to use them on my side projects. For Steady Drop I used Git on BitBucket with only one branch (for now) it really helped me also giving more value of what I developed and I will develop.

 

Project structure

In the beginning the files are not well organized and the project was a little mess. At the time the code was really messed up and disorganized, since I started from a prototype. After some refactoring sessions, the code was more readable and clear but I still had one problem: the organization of the files (both scripts and assets).

I started to re-organize the project (with some Unity guidelines) doing a lot of folders to separate logically the assets and the scripts, but I wanted more for the scripts. So, I started to separate the scripts and to do a lot of folders. I was not sure if this approach could work out but then I started to separate the “core” scripts and the game specific scripts, finally giving a more meaningful project structure.

 

Reuse core modules

All that core scripts are inside a specific package so in the future I can take this package and use it in another project. But what is the best way to do it without going crazy on maintaining a “fork-like” package? Recently at work I started to use the git submodules which basically are repository that can be inserted in an existing repository (like an inception of repositories 😀 ), and I thought that I can create a module with all the core stuff and reuse it in different projects. This change will be the next “project-side” improvement and since I have already experience with multiple submodules in one project so, it will be a piece of cake to set things up for only one module.

 

Alpha is coming

The alpha of the game is going to be released in the next couple of months. The best way for me to release it is to give it to a restricted set of people, (like friends and relatives) and gather feedbacks from them. Then I will iterate once again to make things better and put some others features in the game to create (some day) a beta version.

 

 

Game developer & designer. Unity 3D lover. Movie fanatic.

Simple Third Person Camera with Unity

 

The third person camera

The camera in a game is the eye that the player use to see inside the virtual world created for the game itself. There are tons of different types of camera, but the one we are going to analyze is the third person camera (TPC from now on) which allows to see the main character moving around in the world. In our case it’s a camera that follows the player. Great examples of games that use this type of camera are Super Mario 64, Zelda – The Wind Waker, Metal Gear Solid and Assassin’s Creed.

The purpose of this article is to show how to do a camera system in Unity, with basic intelligence that follows the player and avoids to hit walls by doing auto-adjustments of the distance from the player and the ground as well. The final results are not the best ones and there are certainly other and better ways to do it, and yes, I know there are some improvements that can be done, but the main purpose of this demonstration is to give a simple starting point.

Setups

The Unity script is located here. The only things you have to do in order to test the script are:

  • In a new Unity scene add a third person controller. You can use the standard ones
  • Add at least one floor.
  • Add a child GameObject to the controller called “target” for example, and position it where you want the camera to look.
  • Add a child GameObject to the controller called “position” to identify the position of the character: some meshes may have the anchor point positioned differently, so in this way you can decide the correct position of the anchor point. It’s a optional step but it makes things a little easier.
  • Add the script to the camera and put the child objects just created under the camera script parameters in the inspector.

The code is commented and contains also a function to draw lines in the inspector to better see what is going on with the offsets and positions.

Camera position and movements

Without further ado, let’s begin with the fun stuff. The wanted position for the camera is a point that has a distanceUp and a distanceAway from the target identifying a specific point. Obviously if there is a rotation of the character, this point rotate along with it keeping its distances. Now this point is only the wanted position and we want the camera to follow this point with a little of smoothness. Simple, in positioning phase I’ve multiplied Time.deltaTime for a smoothness value.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public void Update()
{
        //For collision avoidance we need 2 values:
        // the distanceUp of the camera and the wanted position

        Vector3 characterOffset = m_target.position +
            new Vector3(0f, m_distanceUp - m_heightOffset, 0f);
           
        drawDebugLines (characterOffset);
        m_camPosWanted = m_target.position +
            (m_target.up * (m_distanceUp - m_heightOffset)) -
            (m_target.forward * m_distanceAway);

        collisionAvoidance(characterOffset, ref m_camPosWanted);

        //Positionig and orienting the camera
        transform.position = Vector3.Lerp(transform.position,
            m_camPosWanted, Time.deltaTime * m_smooth);
           
        transform.LookAt(m_target);
}

 

The collision avoidance

To keep the camera in the correct position and avoid walls that can hide the character or collide, the script makes some tests:

  • Wall avoidance: if there’s a collider near the back of the character or between the camera and the character, the camera takes the position of the collision point (improvable).
  • Ceiling avoidance: if there’s a collider above the character or above the camera, the camera changes its y coordinates to stay under the collider.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Camera Wall avoidance - raycast from the back of the character and from
//characterOffset to camPosWanted
if(Physics.Linecast(fromObject, toTarget, out m_hitWall) ||
   Physics.Raycast(m_characterPos.transform.position,
    -m_characterPos.transform.forward, out m_hitWall, 3.0f))
{
    toTarget = new Vector3(m_hitWall.point.x, toTarget.y, m_hitWall.point.z);
}

//Camera Ceil avoidance - raycast from the up of the character and from
//the up of the camera
if (Physics.Raycast(transform.position, Vector3.up,out m_hitUp, 1.0f) ||
    Physics.Raycast (m_characterPos.transform.position, Vector3.up, out m_hitUp, 2.0f))
{
    if (m_hitUp.collider.gameObject.layer != LayerMask.NameToLayer("Player"))
    {
        if (m_camPosWanted.y > m_hitUp.distance)
        {  
            Debug.Log("Ceil");
            m_heightOffset += 0.2f; //adjusting the height
        }
    }
}

 

Improvements

Improvements that can be surely done are:

  • Making a FSM and attaching it to the camera: for example the camera has state like colliding, shaking, bouncing and a following common state.
  • Improving the wall collision not to see parts of the world behind the wall.
  • Adding a colliding sphere to the camera.

 

Consider also to watching this GDC video on which a creator of the game Journey talks about common mistakes and tips on creating a third person camera.

Third Person Camera (Gist)

 

 

Game developer & designer. Unity 3D lover. Movie fanatic.

From C++ to Python

 

This post is more theoretic than usual and I will analyze briefly my experience on passing from C++ to Python and what I found interesting to notice when learning another programming language is needed.

 

Introduction

After working with C++ for a while, I had to learn Python for the first time and use it with Panda3D engine. Right from the beginning I’ve found myself thinking in C++ style a lot of times while programming in Python, especially for the first couple of weeks. Finally I realized that the first programming language you master (or maybe your favorite one), can affect the way you program and think in other programming languages. Probably this thing is also true for the spoken languages.

When you learn your first programming language, you are learning also all the best practices and the techniques of the language itself. This type of notions aren’t merely syntactical and they belong to “programming theory” or “IT theory” rather than a specific language. But when you starting to master this language you create common mind paths for creating instructions and more complex modules that belong only to the specific language you’ve mastered. Obviously these are my opinions, I’m not an expert in psychology.

 

Programming mind path

To help passing from the C++ “mind path” to the Python ones to me has been pretty easy after all, but I recalled some struggling at the beginning. Now let’s analyze the two languages to try to facilitate the journey.

First of all, let’s talk about some actual differences from Python and C++:

  • Python is run through an interpreter and is interpreted each time it runs., whilst C++ is pre-compiled
  • In Python, there is no need to declare types explicitly
  • Python uses Garbage Collection whereas C++ does not.
  • C++ supports pointers and low-level memory management.
  • C++ is a statically typed language, while Python is a dynamically typed language.

 

As you can see in the previous short list Python and C++ are both object oriented languages but they are ruled by different philosophies. Beside these strict differences that are also some intrinsic principles and styles of coding that belong to the specific language and find place in the deepest part of a programmer’s mind, the mind paths. This more “abstract” side of the differences of usage is difficult to manage at the beginning and I think it takes some time to deal with it.

 

Things to remember

Fortunately the syntactic side of the differences is less deep-rooted and can be managed more easily: there are only some little things that can make you struggle, especially at beginning of the switch. I’ve listed a series of things I found useful to “easily” switch from C++ to Python.

  • Indentation and curly brackets: in Python there are no curly brackets to define a block of code but instead of this it use indentation
  • Loops with float: in Python you can’t easily define a loop with a float increment
  • Data structure declaration: Python has built-in lists and dictionaries and you can declare it simply with “[]” for lists and “{}” for dictionaries
  • There’s no separate char in Python
  • No switch: Python doesn’t have switch statement and you have to implement it with if, elif blocks
  • While-Else: the loops have the else statement which allows to do something when you go out of the switch
  • Use less lines: Python allows you do simple things in less lines than C++. For example: a = 5 if b == 4 else 6
  • Python allows to write if statement in a single line inside an assignment. It’s not mandatory to use this feature but since you have the chance, why shouldn’t you?
  • Function pointers: in Python there are no control on pointers in general, but since the assignment works on reference, you can do similar things. When you have to use something that works like a function pointer, all you have to do is to declare a variable and assign to a function name (without the brackets) and that’s it. Since everything is a class in Python (even functions) and everything is “callable” when you have to call the function pointer, all you have to do is to call the variable.

 

References:

  • A Byte of Python – Swaroop

 

Game developer & designer. Unity 3D lover. Movie fanatic.

Steady Drop – Log #6

 

This post on Steady Drop development is about the art process and choices I’ve made.

Minimal style

During the pre-production phase I wrote down all the possible styles I could develop for Steady Drop, and like I said in one of the first posts, I was thinking to give to my game a cartoonish-like style, similar to Cut The Rope, just to mention a famous example. I finally chose a minimal style in order to emphasize the gameplay and reduce the distractions and also because it is easy to maintain.

Since the style I wanted was really simple and minimalistic, I started to create the assets on my own. I’m not an artist, but this type of style is something I’m able to work with. I wanted the main focus to be game logic and gameplay so I eliminated the unneeded and went back to the roots: the shapes and the colors. I think that sometimes all we need to recognize an object is its shape and its color, so every element in Steady Drop has its particular (geometric) shape and its inner color. I regret a bit this choice but it makes possible to speed up the assets production and allows me to concentrate more on the development.

 

The need of using a vectorial format

Having a minimalistic and geometric style for all the graphic assets led me to think using a vectorial format. The pros of using a vectorial instead of a lossy format are quite important on both technical and design side:

  • Smaller file size.
  • Changing resolution without loosing details.
  • The sharpness of the shapes are always very neat.

 

Obviously this pros are applied for my project, you don’t always need a vectorial format. I grabbed my favourite vectorial editor and I created some ideas of objects and actors of the game. And after some concepts and a lot of inspiration sessions, I came up with the (almost) final version (posted here). The problem at this stage was: I could possibly take advantage of a vectorial format in Unity?

 

Using the SVG importer

To solve this issue, I tried to find a way to use natively a vectorial format in Unity but unfortunately Unity (version 5.4) does not support vectorial formats, at least I haven’t found a native support. So, I started looking on the assets store and I found this (SVG Importer). Basically this tool imports a SVG file and convert it in meshes (I think one for any visible closed path), keeping the quality of the shapes at any resolution, I thinks even retina displays. The integration was very easy with no code required and the results are very good and I’m happy with it. I’ve only one little issue on replacing a svg texture at runtime but I solved it with a little workaround.

 

The next post will be on putting everything together and on code management. Stay tuned 🙂

Game developer & designer. Unity 3D lover. Movie fanatic.