Permanent UUID System in Unity

UUID

Whenever you’re making a save system or you’re making cross-scene references, you might come across a need for a unique ID for all your GameObjects. You might think Unity offers a solution for this, but there’s no clean solution offered yet.

Internally, each GameObject does have a UUID, but this value changes every run. This basically makes this value unusable.

Unity provides a git repository called guid-based-reference (https://github.com/Unity-Technologies/guid-based-reference) that provides this feature, but this comes with multiple disadvantages.

  1. A prefab instance’s Guid shows up as modified compared to the prefab. If you accidentally apply all changes, then this library will die.
  2. Guids are illegible. Wouldn’t it be better to mention an important GameObject as BossCharacter┬árather than 2c138012-f543-4caa-bcd4-e4a64bbeb623?
  3. Small memory inefficiencies. There are extra 8 bytes per instance to store a reference to a byte array. The sad part is that this array is only used during Unity’s serialization/deserialization.

The Solution

Here’s how CloudCanard’s UUID system handles these issues.

Continue reading

CloudCanards World Planner

For the past 2-3 weeks, I’ve been making an internal tool to plan out the world map for CloudCanards.

WorldPlanner

For those of you who don’t know, CloudCanards is a game development project that me and my team have been working on for the past two years. It has a 2D pixel art aesthetic, but level design wise, it is a 3D Metroidvania with interconnected regions. We needed a way to efficiently plan out the open world while keeping track of which areas the player could visit with specific powerups. This led to the creation of our World Planner tool.

The entire world is represented by a graph where each node is an area and each edge is a connection between two areas. These connections might have requirements that that player needs to acquire before being able to traverse through.

What’s interesting is that the entire tool is heavily integrated into Google Firebase, allowing all of us to edit the graph concurrently. It’s pretty fun to fly around the world planning specific regions together.

Tokei is telling me that I wrote around 4,000 lines of code for this project, which is pretty low compared to the main CloudCanards repository. I was pretty surprised at how intuitive it was to implement Firebase Realtime Database into the project.

Neural Computer, a Dystopian Future

Introducing a Neural Computer. Unlike classical computers, which use boolean operations, or quantum computers, which use unitary operations, Neural Computers use human brains to solve problems. When you feed it input, a human will look at it, analyze it, and come up with a valid output.

By paying $x, you can buy a cloud instance of our Neural Computer with y units of humans to operate with. We have a grid full of multiple intelligent people, so availability isn’t an issue.

With even a small unit of our Neural Computer, you can solve traditionally hard problems such as program synthesis, visual/auditory recognition, NLP, and physical simulation. Try it out today at thiswasallajokepleasedontletthisbeareality.com

Unity Project Browser Extension – Back and Forward Buttons

If you use Unity, you might soon realize that it’s a lot more barebones than advertised. One of the missing features is the ability to travel to a previous folder in the project browser. I wanted to fix that, so I added them myself.

Using a bit of reflection magic, I made it possible to go back or forward in your folder history. I put the full source code on GitHub so you can download it in the link below:

https://github.com/creativitRy/UnityProjectBrowserHistory

Last checked for Unity 2018.2.14. Let me know if anything’s up.

Unity 2.5D Tilemap Depth

Hello, Gahwon here. Here’s another Unity tutorial!

Have you ever tried to make a 2.5D world, only to realize that your trees are rendering behind the player all the time? Well, fear not!

Although many sources exist on creating this feature using sprites, this tutorial instead uses the new Unity Tilemap to apply depth.

For those who want the whole source code, here it is.

https://github.com/creativitRy/TilemapHeightTest

Feel free to use this anywhere (probably not the sprites since I drew them and I’m not an artist).

Here’s a TL;DR version of the system: Each tile contains a height property. This height is compared with the player’s height every frame to see if the tile should overlap or not. Overlapping tiles are moved to a new Tilemap layer that is always rendered in front of the player. This layer is cleared at the start of every frame.

Continue reading