Friday, September 7, 2012

Web Design


I did everything including the logo design, asset art/layout and the Silverlight coding. This company wants to have a website to tell its customer what products it sells and what promotions it has from time to time. "員工專區" which means "Employee Only" allowing its employees to maintain the product introductions as well as the promotion information. The customers can search for those data in "產品與服務" which means "Products&Services".










Monday, July 12, 2010

Turn based - Connect Four

Download the game: http://cid-1af82ca31c3c2a18.office.live.com/self.aspx/Demo%20Project/Connect4Executable.zip20Project/Connect4Executable.zip

This project was made with a demo purpose, I don’t plan to distribute it commercially. I was asked to design an AI for a game called Connect 4 at one of my interviews. I implemented the design with C# scripts in Unity engine for the demo purpose. My AI can handle any size of a square board, not exactly like one of the traditional Connect 4 boards(7×6, 8×7, 9×7, 10×7) and connect any specific number of discs or checkers as long as it’s smaller than the number of columns per row( or the number of rows per column since it is a square board). However, for this demo, I set the board size to 7x7 and the number of discs or checkers to connect is 4. Like Connect 4, you can connect your discs vertically, horizontally, or diagonally. When you play, just click on anywhere in the column that you wish to put your discs in, the computer would place your disc to the currently available spot in that column for you. It is a 3D game, I made the 3D game board and discs models by myself. Appearance-wise, they may not look pretty but since this is a project to demonstrate my coding ability, I decided to focus more on coding and making the AI solid.

The core algorithm of the AI is based on the MinMax method, where the depth first search is used to look ahead in the future and the AI will then make moves based on the best result possible. A full DFS on a 7x7 board is exceptionally costly as it takes a couple of hours to complete, so to improve the AI’s performance and response time, I implemented depth limit and branch pruning( a.k.a alpha beta pruning).

Branch pruning eliminates additional searches once it has determined the best/worst case result has been found, which saves some computations, however, I found depth limit is a more effective technique in reducing the search space. I have my AI look only 3 steps ahead( 6 recursive calls) for all the available moves and it works pretty well, increasing that value does not make the AI much smarter while the computational time increases dramatically.

Since this is a very simple board game, I found implementing the above technique is sufficient enough in providing a very challenging AI to the player. However, there are some additional techniques that can be utilized to make the AI respond quicker or even improve the gameplay. For example, heuristics for selecting a better move based on the current game board is another method to reduce the computations. But the AI can be handicapped by doing so, thus taking some time to balance between making the AI more “human-like” and yet challenging is necessary.


Note: I have done a few changes here and there since I published this article. Now it has "Two players mode", "Switching players", "Menu", "SFX" and it can have an asymmetric board. I haven't updated the link for downloading the latest version, trying to port it onto iPhone right now.

Saturday, September 5, 2009

Alpha Strike - The final project

Watch the gameplay demo on YouTube: http://www.youtube.com/watch?v=95spotsNJf0
Download the game and the "How to play": http://www.giga-t.com/

My responsibilities:

The visual effects include:
1. Planes' hit reaction.
2. Planes' healing visual effect.
3. Animated thrusters.
4. Flying bullets.
5. Bullet to terrain hit reaction.
6. Bullet to water hit reaction.
7. Muzzle flash.
8. Contrails.
9. Missile trails.
10. Missile to terrain explosion.
11. Missile to water explosion.
12. Missile to plane explosion.
13. The general look of enemy base.
14. Enemy base hit reaction.
15. The damaged effects of enemy base.
16. Invincible effect of planes.
17. Level up effect( Two rings crossing each other and
scale up from the center of the plane )

The camera effects include:
1. A camera that follows the plane and pans as the plane banks.
2. A camera with wider FOV, that gives the player more sense of speed.
3. A reverse camera for the player to look behind.
4. A roaming camera in Tally screen.
5. A camera that zooms in to the cockpit to see a menu when the player pause the game and zoom back out when the player unpause the game.

Sunday, March 1, 2009

Real-Time Terrain with Geo-Mipmapping

This terrain rendering engine with Geo-Mipmapping is one of my research project. Terrain is an outdoor area, which means not much occlusion-based culling can be done to reduce the total amount of polygon being rendered.


To workaround this issue, we need a method to perfrom terrain rendering with CLOD. The concept of CLOD (Continuous Level of Detail) is not too difficult to understand, basically more details are preserved in the areas closer to the camera view than the farther ones. The key is to maintain real-time rendering performance while not sacrificing too much graphic quality.


Algorithms such as ROAM (Real-time Optimal Adapting Mesh) and Chunked Terrain were developed to compute the CLOD at run-time. I chose to implement the Geo-Mipmapping method utilizes the GPU to do the computational load instead of mainly relying on the CPU.


Essentially the whole terrain area is splitted into many smaller terrain blocks. Each block stores a vertex buffer and multiple levels of index buffers, which represent the terrain block at different resotluion. These computations are done at load-time, and during run-time, based on value of pixel-error / distance factor, a suitable LOD is selected to render the terrain block.



One of the major issue with this approach is the gap formed when blocks of different LODs are adjacent, because the shared edges are represented by different numbers of vertices belonging to each block. To seal these gaps, the index buffer of the higher LOD block is re-computed at run-time to reduce the resolution to match that of the lower LOD block, thus effectively sealing up the gaps.

The end result is the capabilty to render an area made of 2M triangles at full resolution with roughly 20k triangles made of various LOD blocks.

Highlights:
  • OpenGL API.
  • Geo-Mipmapped Terrain.
  • Vertex and Index Buffer.
  • Gap-filling between terrain blocks.

Game Engine Development

Several techniques I implemented during my 3D engine development class:


  • Terrain Following: With several vector cross product computations, the dune buggy can be positioned and oriented to follow the terrain realistically.

  • Maya Export Plug-in: By using the Maya Plug-in SDK, I wrote several plug-ins for Maya which can be used to export model and custom attributes into both XML and binary format.

  • Collision Detect: AABB, Sphere, and K-DOP collision detecting techniques.

  • Camera Views: Mouse-look, Look-At, Turn-to, Hard-attach, Soft-attach camera views with matrix computation.

  • Hierarchy Transformation: Establish and compute 3D object heirarchy to reposition parts from their local space to world space.




Friday, February 27, 2009

Real-Time 3D Animation Technology



















  • I've learned and implement several different kinds of real-time 3D animation techniques. Here is the gist of it:
    Vertex Morphing - Stores key frames and use interpolation to animate the vertexes. Memory intensive but light on the CPU.
  • Articulated - Individual animated parts are modeled as individual meshes, and bones and joints are used to animate the meshes. Less memory needed, but the joints are blocky because the joints don't share vertexes.
  • Skinning (Rigid) - Similar to articulated, but each vertex is associated instead of at per-mesh level. Needs minimal memory, but requires more CPU power. The major draw back is that deformities can happen at the joints when animating.

  • Skinning (Smooth) - A vertex can be associated with multiple bones with different weight values, this reduces the deformities at the joints but at the cost of more CPU computations.

Saturday, December 20, 2008

A.I. - Autonomous Agent - Ants Simulation

This is my research project for my A.I. class. The program simulates a colony of ants attempting to find a food source via collective intelligence.

These ants emit trace signals that other ants will follow. Once the ants find the food source, the ants follows the trails back to the nest. As the number of ants traveling along the same trail increases, so does the amount of signals, which in term causes more ants to go along the same path.

In essense, these autonomous agents follow 3 simple rules for their actions:

  1. Follow trace signal attempting to find food sources.
  2. Return to nest when food is found.
  3. Tell other lost ants the general directions of either "food" or "nest."

These "antbots" can only perform simple actions based limited environmental factors, but together as a colony they are able to find food sources quite efficiently.

Highlights:
  • Autonomous agent system.