Tag Archives: GitHub

Progress Report: September 2019

As announced in the last update, there’s nothing new this month I can present. But since it’s been quite a while since the last video, I recorded a short play session to show how everything is fitting together so far:

The video chronologically demonstrates the following:

  • Attacking an enemy ship
  • Player taking damaged, which is visually reflected in the ship graphics
  • Defeating enemy ship, winning gold
  • Sailing to port
  • Repairing ship with gold the player just earned
  • Buying and selling some items at the trader
  • Going out at seat again, attacking another ship (player ship graphics now are back to “pristine” since the ship has been repaired) and defeating said ship
  • Spawn lots of ships, pressing the interaction button -> menu pops up that let’s player chose preferred action

Other News

I already finished my other project, which means I’m back at Devils of the Sea again!

I always wondered, how emulators were made/what they exactly had to do to get games running.
So, I decided to develop a prototype of a CHIP-8 emulator for Unity.

The project was super interesting and I learned a ton! Anyone can check out (pun intended) the source code over at GitHub.
But be aware that it’s just a quick proof of concept and there’s not much code quality to speak of. Please don’t take this as an example how things should be done.

ST2U2DNavMeshImporter (Oops!… I did it again♪)

For the tilemaps, I’m using Thorbjørn Lindeijer’s Tiled and Sean Barton‘s SuperTiled2Unity. Since I just made a project to bake 2D colliders into NavMeshes, I went ahead and created a SuperTiled2Unity importer that automatically creates a NavMeshSurface with the correct position, rotation, size and all the necessary components.

All that’s left to bake your NavMesh after importing the tilemap is the press of a button!

You can find the project here: https://github.com/SharlatanY/ST2U2DNavMeshImporter

Here’s an example of an imported tilemap. All I did after the import was, to press the “Bake 2D”-button:

The project is published under the MIT license, so, you’re practically allowed to use it in whatever way you wish.

NavMeshSurface2DBaker

Currently, Unity only offers the ability to generate NavMeshes (the objects telling the path finding system where NPCs can move) from 3D obstacles. Since I’m developing a 2D game and would like to make use of Unity’s inbuilt path finding, this posed a problem.

That’s why I developed a solution that worked for my case. When everything worked, I thought to myself that it wouldn’t take too much additional effort to polish this a little, make it more multi purpose (e.g. I only needed it to detect polygon colliders and had no personal need for also handling circle colliders, etc.) and easy enough to use so it might be useful to other people as well.

What I ended up with is a solution to easily bake 2D colliders into a NavMeshSurface.

Supported colliders:

  • BoxCollider2D
  • CircleCollider2D
  • PolygonCollider2D
  • CompositeCollider2D
  • TilemapCollider2D (For those to work, you have to make them part of a CompositeCollider2D, though!)

You can find the end result here: https://github.com/SharlatanY/NavMeshSurface2DBaker

Here’s an example of a baked NavMesh for a hex tilemap (red tiles have a collider):

The project is published under the MIT license, so, you’re practically allowed to use it in whatever way you wish.

Unfortunately, as is often the case, I was very, very wrong about the effort it would take to make the project more useful to others as well.
Getting it to work for my specific use case took about a day of work, making it more general purpose, easier to use ,cleaning up the code, setting up the GitHub repository, adding instructions and a project example, writing this blog post, etc. took at least two more full days of work.

Now, I’m torn about how I should handle such things in the future.

On one hand, I’m really very happy to have made something that might be of use to others (I’ve seen people looking for exactly this functionality multiple times) and to give something back to the community. After all, there’s lot’s of people out there that helped me out in one way or another and even if it’s not always possible to pay them back, this feels like a way to at least pay it forward.
On the other hand, polishing and releasing this made the task more than 3 times as long as it would have been if I just stopped at the point where it was good enough for my own purposes.

If we’re honest, the project I’m trying to create is way out of scope and a monumental task that will still take me years to finish.
I only work on this in my spare time and when I feel like it because I know I’ll never finish it as soon as I have the feeling that I must work on it.
Currently, I’m on vacation and make quite good progress. But during the rest of the year, I maybe get to work on this project somewhere between 1 and 2 full days a week (likely closer to 1..) on average. Which means that making the NavMeshSurface2DBaker presentable and releasing it cost me about half a month of normal (=non vacation) development time.
With all the things that I already know still have to be done and the rate at which I discover new things that will also have to be done, I’m not really sure if I can afford and justify such escapades.