blogs.novaleaf.com
I’m a junior

หลังจากจบมหาลัยมาผมก็เริ่มหางานที่เกี่ยวกับการพัฒนาโปรแกรมและ AI และหลีกเลี่ยงงานที่จำเจ (routine) ไม่ให้ความสนใจเรื่องเงินมากนักเพราะรู้ตัวว่าเกรดไม่ดี ไม่เก่งและที่สำคัญภาษาอังกฤษแย่มาก

                หางานใน Jobdb เจอบริษัท Novaleaf ประกาศรับสมัคร game developer ที่มีคุณสมบัติต่างๆ มากมาย แต่ก็มีคุณสมบัติบางข้อที่ผมให้ความสนใจคือ game, AI และ programming และก็มีคุณสมบัติหลายอย่างที่ผมทำไม่ได้และที่สำคัญสัมภาษณ์งานเป็นภาษาอังกฤษ แต่สุดท้ายผมตัดสินใจมาสัมภาษณ์ลองดู (ตอนแรกตัดสินใจไม่มาแล้ว แต่เพื่อนชาวเวียดนามบอกให้ผมลองไปดู ไม่เห็นมีอะไรเสียหาย ผมคิดตาม ก็จริงไม่มีอะไรให้กลัว กลัวอะไรผมมี talking dictionary) แล้วผมก็ได้งานทำ

                เมื่อเริ่มทำงานความรู้ในการเป็น Game developer แทบจะเป็น 0 และได้เข้าใจการเรียนเพียงเอาความรู้ไปสอบให้ได้เกรดช่างไร้ความหมาย สิ่งที่สำคัญกว่าคือการฝึกฝนเอาความรู้อย่างถ่องแท้สำคัญกว่า (practice make prefect)

ผมเริ่มด้วยการฝึก Programming (C#) จากเดิมที่รู้เพียงชื่ออย่างเช่น interface, delegateและ event อื่นๆ ให้เข้าใจและใช้ได้ถูกต้องตามสถานการณ์

ต่อมาเริ่มลงทำเกม ทำให้เพิ่มใช้ความรู้ Programming และ Math for game อย่างเช่น Vector และ Matrix มากขึ้น คลายกับความรู้ ม.ปลายที่เรียนมา

ได้มาทำในส่วน Spatial partitioning ที่ต้องใช้ความรู้เรื่อง data structure อย่างเช่น Tree, graph และความรู้เรื่อง Basic Geometry Math อย่างทรงกลม (sphere) กล่องที่อยู่บนแกน (Axis aligned bounding box: AABB) หาว่าทับกันหรือไม่ ห่างกันเท่าไร

ทำในส่วน Collision Detection ที่ต้องใช้ความรู้เรื่อง Geometry Math, Vector and Matrices algebra อย่างเช่น ray, line, plane and OBB (Oriented-Bounding Box) , และมีความเกี่ยวข้องกับ spatial partitioning โดยตรง

ในการทำในส่วน AI ซึ่งได้ลองทำในรู้แบบ state machine และ behavior tree ยังคงใช้ความรู้เรื่อง data structure & algorithm ทั้งในส่วน tree, graph การ search ในรู้แบบต่างๆเช่น ในการทำ path finding และใน heap, hash และ sorting ในการเพิ่มความเร็ว    AI ที่เคยเรียนมาในตอนมหาลัย (Academic AI) จะมี search ,  rule –based expert system, fuzzy logic , neural network และ genetic programming    ค่อนข้างจะแตกต่างกับ Game AI  เน้นเรื่องการ search และบางเกมส์มีใช้ rule base system(SimCity) .

จากประสบการณ์ 3 ปีในการทำเกม ในความสีงที่ผมได้(Realize) ในพื้นฐานการที่จะเป็น game developer นั้นจะต้องมีความรู้พื้นฐาน

1. Concept programming ที่เข้าใจ (ผมคิดว่ารวมไปถึงการเข้าใจ OOP : Object-oriented programming  และ Design Pattern)

2. Data structure and Algorithm พื้นฐานช่วยให้เข้าใจ Game algorithm ต่างๆ

3. Performance Optimization, การเพิ่ม speed ของเกม ถ้ามีความรู้ข้อ 1 และ 2 แล้วจะช่วยได้มาก

4. Math for game, จะเป็นพื้นฐานในการศึกษาและพัฒนาในส่วนต่างๆ อย่างเช่น Collision detection, Physics, Animation and Computer graphic(rendering) เป็นต้น ของเกมได้ง่ายๆ ขึ้น

5. English (สำหรับบางคนรวมทั้งผม) เนื่องจากแหล่งข้อมูลเกือบทั้งหมดเป็นภาษาอังกฤษ

การพัฒนาเกมต้องใช้ความรู้มากมายและใหม่ และมีสิ่งที่น่าสนใจให้ศึกษามาก  ผมคิดว่าผมยังจูเนียร์

Sarayut (Bank)

Simplicity in game design

I would like to talk about simplicity in game design and controls. Pong, one of the first games in the world, its main control was an up and down button. In the old days when game consoles had only a few buttons to press and look what great games were created with those simple controls; Tetris, Mario, Asteroids, etc.. Don’t mistaken me, I do like to play complicated games but sometimes I just miss the old “not using all buttons in the game controller game”. For example, have you ever heard of a game called Canabalt? The entire game uses only 1 button and it’s very addicting.

When I was looking more about Canabalt and found an interesting competition called “Experimental Game Play”. The concept of the competition is that each month, they will have a new theme for everyone to compete in. One of the themes that I liked most is call “10 seconds is long enough in March”. Every game was based on a 10 second rule but how to use it is different. Some games took 10 seconds to finish such as the game called “Run Jesus Run”. Other games used 10 seconds for a timer to complete specific tasks like “I can hold my breath forever”. The idea is how to manipulate the theme “10 seconds”. In my opinion, games nowadays are quite complex and that makes the controls complex too. Why don’t people use a simple concept with simple controls?

It’s not like simple game concepts aren’t sellable because if you look at VVVVVV which you only have 3 controls (walk left, walk right, flip), Canabalt (1 button game) or a game from the 10 second competition like “10 second war, by Almost” which is at sellable quality in my opinion.

To conclude, I enjoy seeing these types of games as much as those AAA games that come out and I would like to see more and more of these “small and addicting new concept games” in the future.

- Intara

The Best Batch

When rendering geometries, of course, most graphics developers know how to implement instancing and do it nicely using whatever technique to speed up their rendering performance rather than traditional single-instance rendering. So, does this mean that we should always draw every object in the game using instancing technique? If not, what should our decision be made based on?


Before answering that question we must realize that there are both cpu and gpu costs we have to pay when rendering primitives. The cpu cost is associated to API call to process primitive which is a fixed cost regardless of size, and the gpu cost is obviously for actual drawing regard to how complex the geometry is. This tells us that drawing a few large meshes might be more efficient than drawing many small ones, yes, might be.


Cpu and gpu are executed in parallel in the pipeline meaning that either of them could be the bottleneck at anytime. It’s our role to find the closest balance point for the workload to reach the maximum performance. Giving a set of mesh instances, as mentioned earlier, drawing them one by one might be more efficient
than batch them or vise versa. Then what should we use as a criteria to decide whether to batch them or not? The answer is triangle count. Let’s have a look at this example,


Suppose that we know that 500 triangles is the best number to make decision in our rendering system that gives the most balance workload to cpu and gpu. This means that if we draw objects that has less than 500 triangles, without instancing, it will be cpu-bounded because there are too many API calls, no matter how fast the graphics card is, the performance will not change. In the other hand, if we draw high poly objects higher than 500, with instancing, it will be gpu-bounded since the gpu has too much work relative to cpu work yet we won’t achieve maximum performance because both workloads are not balanced. This already answers the first question of this article about whether we should use instancing technique everytime or not. The final answer is you shouldn’t.


In summary, we pick a number, in this example 500, to be a target breakpoint where we batch meshes if they have lower poly and not batch if they have higher poly count. Keep in mind that this number is just and example and might be varied depending on many factors like hardware specifications, platform, graphics api, instancing technique used, game logic complexity etc. So how do we find the best number?, the key is measurement. There are many useful performance measuring tools to help you track down the bottleneck of your rendering. Keep experimenting
until you find the best one for your system. In advanced case, you might also want to determine this breakpoint dynamically.

- Thitipong (Nick)

Japanese Karaoke in Thailand?

If you had lived in Thailand for more than few years, you would probably have noticed that there is no good Japanese karaoke in this country! Actually, I used to think like that, however, this fact is classified as “obsolete” in term of programming after I discovered the place called “Wood Ball”.

This place is the combination of drinking bar and Karaoke. Even though most customers are Japanese, they still welcome Thais and foreigners too. A good point of this Karaoke is that it has tons of Japanese songs; if you still love or used to love animes and mangas, you will immediately fall in love with this secret place. For myself, I am very exciting to find a lot of “Pokémon” songs here such as the opening theme from year 1998 “Mezasei Pokemon Master”, year 2000 “Ok!”, and year 2003 “Advance Adventure”.

I have travelled through many Karaoke places but none of them has rare music like this. In contrast, the price is quite expensive for Thai people; however, I think I cannot blame them since their main target is Japanese people. Perhaps, I should be the one who collects enough money in my wallet before I go there.

At this point, you might already want to know more information such as location and opening time of this place. Am I wrong? Ok let’s continue.

This Karaoke is located near “Saladang” BTS station, at “Silom Soi 6”. It opens from 6 pm until 2 am of the next day. There are two types of room that you can choose: public and private. Public room is on the first floor, and private rooms are on the second and third floors. An actual price for public room is 80 baths for the whole night; nevertheless, you need to order some drinks and sing a song with other several customers. If you choose to have a private room, you need at least 5 people including yourself; each of people has to pay 500 baths. You and your friend can spend 3 hours singing songs and ordering cocktail as much as you guys want.

Ultimately, in my opinion, I think if you can find enough comrades, you should pick the private choice. This Karaoke updates songs almost every month; thus, newly added songs will always be waiting for you every time that you and friends go there.

Let’s have fun!

- Soraphol

Programmer & Ego

Have you ever noticed the feeling of superiority or a pride of being an awesome programmer?

Even though I don’t have a degree in psychology, I am pretty sure that for most people the more one accomplish in something, the more pride and ego he has. That also absolutely applies to many programmers. For me, I always think of programming as a game which you can never lose. As long as, you don’t attempt to solve things like Millenium Prize Problems. You will eventually find a solution either by code it yourself or google it somewhere.

As time pass by, you solve more and more problems without any problems (as you are an awesome programmer). Here is where pride and ego gradually stacks up in the programmers’ mind without their awareness.
There are a lot of problems associate to this. For example, I once got a comment about my work, of course, just like an instinct, I rejected it instantly and think that my way of doing thing is correct. That made me ignore some of the valuable comments in the past and I was the one who regret it at the end. Even worse ego can, in fact, even change your programming team into a nightmare if it is not deal with.

So, what can we do to prevent that?
In a team perspective, there is many articles out there for helping a team to avoid this problem. Most of them involves with the way to explain and compliment the team. Here is one guideline when you have to program as a team. How about what we can do for ourself as a personal improvement?
For me, I think the key is to avoid taking things personally. Well, this is easier to say than to do it.
Another effective way for me is to find and spend times with genius programmer, then, talk with him in the area he is specialized and realize that how stupid I am. At least, this helps me knowing that I’m not that good. Turn your ego into an inspiration to further expand your knowledge and becomes more opened to fruitful comments and advise.

Give it a try. Or if you have a better idea, I would love to hear it!

Note: I’m surprised when joining at Novaleaf though… Everyone are truly genius, yet, nice environment =)

- Chainan

I posted this as an answer to an xna forums question on what spatial partitioning to use for dynamic worlds. No sense wasting perfectly good blog-copy, right? :D

i’m developing a xna game/engine focused on a dynamic, densely populated world, and my choice is the simple grid (well, a…

- Jason

Higher dimension for collision detection

This is my idea that there should be 4D collision system in future simulation engine for ULTIMATELY ACCURATE collision detection. So at some resting time of this moment, I use it to find information about higher dimension theory.

In this world we may know that we are live in 3 dimension space and forced to live along only 1 direction of timeline. But awesome physicists (such as Einstein) found out that there are 10 dimensions in the universe (by their MYSTERY MYSTIC EQUATION(S) which we, such a foolish people, cannot read and translate it tobe our language) .
The equasions tell them that a particle, like an electron and proton , which is ingredient to make all of us into human object, living in more than 4 dimension.

Warning, don’t just open google to see page about dimension. You may confused with concept of Dimension in Physics and Mathematics (Yes, It’s really different)
I have focus on physics side. Because, like I said, I focus on collision detection. However , the more I have find. The interesting imagination make me gone out of my focus.

And Yes, This blog already go out of what I want to say. So get back and say what I want to say. Then I will talking about theory in next time (if I think someone want to read).
I want to say ,we should compute collision detection in time dimension. then we will have no problem with jumping object between each update.

Nowaday we have ray traced back method to check to make sure that object in our game not  jump pass through another ting in previos update, this is the concept of time dimension collision but it still an incomplete. It can’t check surface and volume. That make me concern on 4D collision.

The easiest idea I have is ,we must make surface into volume in 4 dimensions, And collide those volume with very freaking 4D graph set mathematics theory equation solution or whatever you can name it. Then we get 4D position (bless you we have Vector4 in XNA :D) that is the REALLY PRECISELY contact point in X Y Z and Time.

I can say that. With media that I love ,such as game and comics, make me easier to imagine many physics theory. Include this theory of dimension.
So ,conclusion ,everybody should read comics :D

- Thaina

Working atmosphere

 I think every child when they were young had a thought that “someday, I’ll create my own game”. I think most people outside the game industry will think that, to create a game you need programmers and artists.  Some people will also add musicians and game designers. But, starting a game company the problem isn’t just the ‘game’ part but it’s about the ‘company’ part as well. And being in the business department of Novaleaf gave me a lot of insight on how companies run (well, game companies).

The atmosphere here is quite nice and since we installed a new in-house made heat protector, the temperature in here is in a workable condition (consider Thailand’s heat). I’ve been thinking on what people want the work environment to be. I find the following things necessary: friendly co-workers, easy-to-travel to work stations, a game room, a dining room and much much more which Novaleaf has it all. I considered myself lucky to be able to work in such a place. :)

Anyway, I prefer to keep my blogs short so that’s it !!! See you again in my next blog.

- Intara, Business Development Officer

What do you want to know?

Today, I received an email reminding me to write a blog entry for Novaleaf’s website, which I promised to do a couple of weeks ago… After almost an hour has passed since I started a new word document titled “blog entry #1” – my document is still blank. My blog writing career is starting to look pretty grim…

While I was lost without hope, I remembered one of the “tips” on what to write in the blog, which were kindly included in the email, was to write something educational because you guys love reading blog to learn.

…No, I still have absolutely no idea what to write… So, instead, I will ask you blog reader and knowledge seeker, what do you want to know? Of course, I can only answer your questions about game programming and game development… not how to impress girls in night clubs, those are trade secrets.

But before I go, I want to give you something “educational”, so at least a few of you might learn something new today… even though it’s really only useful for those who are programmers:

      i = 0x5f3759df - ( i » 1 );

Do you recognize that magical line of code? If you do know that line of code, then you’re well on your way to become a great programmer! If you don’t remember or don’t know it, google it! I promised you, it’s educational J 

- Maethee

Software Development Manager

A new screenshot of the CAS game (intended for #XBLA).
-Tidarat

A new screenshot of the CAS game (intended for #XBLA).

-Tidarat