It's Time to Leave Boxing, Pacquiao

April 11, 2016

Last Sunday, Manny Pacquiao beat arguably the best welterweight, Timothy Bradley in their third match.
This is kind of fight which I don't like personally, I like both of them but they have fought twice before. Pacquiao has shown he was better in both occasions, though Bradley got the decision in their first fight.

This third fight was still a good fight, both of them are high quality boxer but their second fight was much better, and higher pacing. This time, Pac was slower and more inactive than before, but he is still faster than Timothy Bradley which is a fast boxer himself. Fortunately, Pac's strategy of counter punching was effective. He was able to deck Bradley twice, though the first knockdown was more of flash knockdown.

I always rate Bradley as the best welterweight outside of Mayweather and Pacquiao, and he is a top 10 pound for pound. I just think that Pacquiao's style is bad for Bradley. As good as Pacman is, he can't fight father time. He is slowing down and as someone who has other priority in life (politics), he should leave boxing for good.

There was no one like Pacquiao, an 8 divisions world champ, and it will be really hard to exceed it

My First Few Months With Unreal Programming

March 26, 2016

I am a newbie in game development world. This past few months I have been researching Unreal Engine 4 (UE4) with my friend.
We found that game development is still hard and time consuming but UE4 does help a lot !!!

C++ Programming In UE4 Is Nice

I am not an expert in C++ but doing C++ programming with Unreal is nice.
It uses macro to make C++ becomes more "modern", like marking a class to be reflectable, supporting delegates and events.

Similar to managed languages like C#, Unreal has reflection and garbage collection. So any classes derive from UObject can be garbage collected automatically.

The current Unreal version (4.10.x) needs Visual C++ 2015 so it also supports newer C++ syntax.

Blueprint Is A Good Visual Scripting Language

Blueprint is UE4's own scripting language. It is visual based and supposedly friendly for non-programmer. Obviously Blueprint runs slower, but in some cases like animation, you will need to use Blueprint to manage states.

Blueprint is a very good visual scripting system however, C++ is more friendly for programmers like myself. Doing a simple function can be much longer if we use Blueprint. Fortunately, UE4 has comment mechanism which is useful for grouping list of Blueprint nodes.

As for Blueprint usage, my current approach is try to code all classes in C++ first. If a C++ class needs to be editable in editor, then we will create Blueprint class derives from it.

Documentation is Relatively Good

There are a lot of things to learn in game development with Unreal, so a good documentation is really needed. Coming from .NET background, I find that MSDN is much more complete. There are a lot of class without explanations in UE4 doc, but overall it is acceptable.

Community Is Active

Fortunately even if documentation is not complete, the UE4 community is really active. For most cases, if I'm looking for explanation of API and I can't find it in documentation, I'll just search in Unreal forum.

Special mention should be given to Rama. I found that he created a lot of helpful articles on wiki and answered a lot of UE4 questions as well.
Although he is a contributor to UE4 code, he seems to be an outsider, and he is a spiritual healer as well !!!

Unreal Editor is Slow and Requires A Lot Of Memory

Visual Studio 2015 loads fast but it still requires a lot of memory (more than 700 MB in my case).
Unreal Editor, which is IDE for UE4, loads slower and requires much more memory.

Debugging Is Slow

For editing and designing purpose, you will use Unreal Editor directly.
However for normal debugging session, your code will launch Unreal Editor so it takes more time to test and fix code.
One more thing, testing workflow in UE4 isn't that good. It doesn't support TDD approach, and loading test cases needs to close and reopen Unreal Editor.
I commented on UE4 testing workflow here, but apparently they don't have any roadmap for this testing issue.

So far we believe that choosing UE4 as our engine is a correct move.

Integrating Gravity Form With WP Offload S3

March 20, 2016

Gravity Form is a very useful plugin for form input.
However recently we realized that it didn't handle file upload properly if we use WP Offload S3 plugin. It will still attempt to store file to local file system. This was an issue for us as we use PaaS, and server instances can be swapped anytime.

Luckily Gravity Form provides filter which we can use too hook our own function.

To use it, you just need to include the above file from theme's function.php .

The above code is adapted from Gravitate's post.

Development Environment with Docker

March 19, 2016

It is undenieable that Linux is the most popular server choice, and some software even don't run on Windows officially (Redis, HAProxy, etc).
For this past 2 years, for normal web related purpose, I have been using tools like Docker and Vagrant. Special thanks to my ex-colleague, who introduced me to this approach.

With Vagrant (and Virtual Box), you will run your code inside a headless server environment. Thanks to docker, you can separate your main processes easily, without installing the actual dependencies directly in Linux VM.
The good thing of this approach is you can try different setup (like Nginx or Apache) easier. Normally I just use Docker Compose to specify dependencies in a YAML file.

The best of all, I still code on Windows.

Adventure in Game Development

February 18, 2016

Time flies fast, I am 30 years old at the moment.
Felt like yesterday I graduated from university, and here I am standing behind the desk, doing daily programming.

One of the reason I went into Informatics was to be a game programmer.
Unfortunately, game development is very hard, and most jobs in programming fields were desktop (now mobile) and web development.
The job security in game industry is not good as well and there was very few local game developers back then.

A good thing happened during Game Developer Conference (GDC) last year, game engines cost went down, and one of them Unreal Engine 4 was set free though it is still royalty based.

Nowadays I don't have any ambition which is rather shitty.
However we only live once and I'm at the point where chasing an old dream is worth a try.
So I've been studying Unreal Engine 4 with my friend for the past few months in our spare time. I'm still a noob but I hope our adventure will be a fabulous one !

Git LFS Error

February 11, 2016

I often get git process error when commiting with git lfs turned on.

Not sure what caused this, but generally I solve it by deleting index and index.lock, then performing "git reset"

I Will Forget : Elastic Beanstalk Deployment Took Forever

February 4, 2016

PaaS like Amazon Elastic Beanstalk (EB) in some way makes deployment easier.

However it is not always working smoothly.
This afternoon, when I performed "eb deploy", for some reason the new version was not deployed successfully. The deploy process took really long time, and in the end it failed.

I did have experience with this, normally what I do is just terminate the actual EC2 instance associated with EB. If the minimum healthy instances is smaller than the number specified in EB environment configuration, then EB will create new instance. This approach will work however if your minimum instance is 1, it will cause downtime.

To avoid downtime, we can increase minimum instances to 2, which will force EB to create new instance. After a new EC2 instance is created, we can change the minimum back to 1, and then delete the EC2 instance which has issue.

Digital Tutors is Pluralsight Creative Now

October 29, 2015

Today Digital Tutors changed its brand to Pluralsight Creative.

The good thing is Digital Tutors subscriber can access whole Pluralsight library as well !!

This is awesome for me, as Pluralsight has more programmer oriented videos.

I still remembered, back in 2013 they acquired Tekpub, and since then Rob Conery became a Pluralsight content creator.

Let's hope they won't increase the subscription fee !