Posts

Showing posts from 2016

Tips on Improving the performance (fps) for your Unity game. (General topics)

There are several ways to improve the performance of a game when using Unity. Some tip and tricks are listed blow. I will go into more detail on each topic listing pros and cons and even alternatives in the future. Some of these tips will improve performance dramatically and some may only add 1 or 2 fps. However if all these tips are used, your game should see a performance boost! Through the Unity UI system: Almost every UI element has an Image(Script) component and within this component is a Raycast Target toggle. If this is checked it will hold Raycast information that you may not intend on using and un-checking this can improve performance when building a large UI system. When I created an inventory UI system the unchecked vs checked performance boost for around 50 UI elements was 5- 15fps on Android. An example: With Raycast Target checked I can use the code below to get or set information about a click/touch from a GameObject. I will go into more detail about AddListene

Setting several textures as one texture biased off of a 2d array. aka how to use Texture2D.SetPixels().

Image
When using a 2D grid based map system using the design within this tutorial it will help Unity only have to render one texture rather than several hundred. Hopefully this will teach you how to set individual textures into one texture. Since I'm not going go into detail on how to create this map generation a great tutorial to learn how to set up grid based maps for your game can be found here . Some code from the tutorial can be used to help get you up and running, this is below, just copy paste in to Unity. It will create a 2d array of type int named wallMap and fills it with ones and zeros. Please note this only creates an outside 'wall'. This example works using Texture2D. This code was taken from Sebastian Lague, for more information on how to use it please see the tutorial mentioned above. public int width, height; public string seed; public bool useRandomSeed; [Range(40, 70)] public int randomFillPercent; [Range(0, 10)] public int smoo

Level Design

Image
Spent some time creating a basic map. I am not an expert, I am learning like everyone else but the main idea is to get the player use to the game play and mechanics of your game. This particular picture is not my final version just a version to hopefully give creators some inspiration. Remember when making a level map to think of the simple things that make your game fun and to teach the player about those things. An example: in this game I want to encourage exploring. As such, I want to reward the player for going the 'incorrect' way with health or ammo or a secret mini boss (later in the game). Think of the fun things you like in games and how developers may have done this, then add those ideas to your own game. OneNote was used for this but I've used graph paper in the past which may actually be better for size and sense of scale than OneNote.

Taking a screenshot and setting as a background image

Image
I spent some time trying to take a screenshot of my randomly generated levels and set the image as a background in an effort to minimize the amount of textures the camera views. The thinking is currently I can have up to a 100x500 grid of textures making at worst 50,000 textures the camera has to render. If I can create my level map then take a picture of it and set that as the background then remove the textures it will help with rendering. This proved a bit harder than I thought due to how unity handles camera size and orientation. As you can see from the video I got it to work in theory and in practice but the image is not going to scale correctly once applied as a texture. I will need to set up some math so it scales properly. For those who would like to see my code: using UnityEngine; using System.Collections; using System.IO; // This script is attched to the capture camera NOT the MainCamera. public class CameraScreenCapture : MonoBehaviour { public GameObject theBackg

New RunJumpAndGun Game

Image
Here is a sneak peek at my newest game. This is the first game where I bought some assets from the Unity asset store. Of course, I bought the asset because of the name, Jimmy . But really I love the look. I found many more amazing assets at  http://opengameart.org/  and spent the weekend making animations and set dressings. This is all super early development but I'm trying to post once a week and show my process of game creation. Last weekend's progress was spending hours looking for free art that I could use with the idea I have.  

Dungeon Traveler

Image
Dungeon Traveler This game started completely different as a collaborative effort. However, since the original game was not flushed out and the team fell apart I adapted it into a click/tap based game. As of current, it's mostly done but when play testing it on my Android phone I have frame rate issues in the later levels. Oddly enough this issues don't occur on PC or WebGL so it might be due to my phone being over 2 years old. Nevertheless it should work on every Android device so I'm going to try a technique mentioned  here  and  here  from http://catlikecoding.com. Plus that means I get to learn something new and most likely very useful. And if i don't like that i'm going to redo it completely, going for an old school Final Fantasy or Pokemon visual style for fighting.

Find Bigfoot

Image
Find Bigfoot This is the first game I ever published. It is on the Google Play store,  Find Bigfoot . I wanted it to be something simple and quirky. The main goal of this game was not the game itself but learning the process of publishing something using Unity 3d. I made many mistakes, so many that i can no longer update this game to the Google Play store. I definitely learned from those mistakes and I make sure that each project I work on is more complicated, hopefully meaning I learn more than the last project.