Huy Minh Ha

Software development, Tech and other stuff

Fri 28 October 2016

Run specific code when Editor starts

Posted by Ha.Minh in Unity   

Sometimes we want to execute code whenever we hit Play button in Unity Editor. The reason for this usually is that we want to enforce some workflow automatically such as getting specific environment information (e.g. git hash, date) and fill it in a prefab or something. We could do ...

Read more...





Mon 10 October 2016

The power of checklist

Posted by Ha.Minh in Productivity   

Why

  • The world has become more complex
  • Our brain has not changed much

Examples

  • Checklists in aviation help alleviate accidents
  • Checklists in construction makes the failure list very low

Benefits

  • Checklists verify that the necessary minimum gets done Because sometimes the most important stuff is the simple ones.
  • Checklists free ...

Read more...


Sun 02 October 2016

Generate one-time password from the command line

Posted by Ha.Minh in Programming   

One-time password is pretty common these days for any type of account that offers two-factor authentication. We can use an app to generate OTP but it would be troublesome if we lost the app or the phone. Fortunately there's a simple way to generate OTP programmatically using libraries such ...

Read more...


Thu 29 September 2016

Unity singleton

Posted by Ha.Minh in Unity   

First of all, please remember that Singletons are generally not recommended due to various obvious disadvantages:

  • Hard to reason about code
  • Encourage coupling
  • Potential concurrency issue

However, in game development it's super useful to have singleton for many types of global system, including but not limited to:

  • Sound system ...

Read more...


Sun 25 September 2016

Maple.js Deconstructed

Posted by Ha.Minh in Programming   

Maple.js is a simple event-based multiplayer framework using Node.js

Deconstruction

  • Maple provides a base class for Client and Server. Your specific game code should inherit these base classes.
  • The supported functionality includes:
    • Connect/Disconnect
    • Ping server
    • Handle arbitrary message
    • Sync client server update tick on every frame
  • The ...

Read more...


Sun 25 September 2016

Osmus Deconstructed

Posted by Ha.Minh in Programming   

Osmus is a tech demo of a HTML5 multiplayer game inspired by Osmos.

Deconstruction

  • Osmus uses node.js for the server and HTML5 Canvas with Javascript on the client side. The simulation code is shared between client and server.
  • Regarding network, Osmus uses socket.io. Socket.io is quite stable ...

Read more...


Sun 11 September 2016

Autoformat C# code from command line

Posted by Ha.Minh in Programming   

We all need a tool to format code automatically according to project's convention. Using an IDE like Visual Studio, Xamarin or MonoDevelop, we can format code easily. However, it's not always convenient to fireup the IDE just for formatting some code, and also having a tool on the ...

Read more...