2012年12月15日 星期六

GDC China 2012

GDC China 2012:MDA
Sissy fight
mechanics: how to play, rule
Dynamic : game circle- equal to scourge
Aesthetics : what is interesting part. fellowship, challenge(tactics, problem solving), narrative (drama)

Playtesting and metrics: getting the most out of your usability testing

In a week recruit player outside

Learn what are player doing.
Why players do things
Player feeling

Isolate player
Designer/producer behind them.

Significant - record status -upload to db ex: player dead

In testing phase
100% record
In release

Find game imbalance
Find Economic imbalance
Find excessive high failure are
Find weapon imbalance

Communication with design
Give designer direct access
Rapid reporting
Data analysis is time consuming
Technical concerns on post release
- sampling rate
-massive amount
-storage capability
-analysis time
Data logging works best with a single programmer.
Verify QA has adequate time
Rely on player

Real time survey modification :survey monkey

Data overload

Tableau: visualization software

EA: the business of art production - 7 critical precepts
Scanning zbrush
Character : dns mapping light map, reflection map
average 5 artists in one game

Manage artists
1. Clarity
Should only one target
Reference can plentiful, not target
If possible visual target should put in the game

2. Iteration
Speed? As fast as your can think
Fast enough to visual explore
Safe enough to allow experiment
Not require other to initiate

3. Feedback
Usual, consumer, peers
Timeline: concept phase (12weeks
Preproduction 7month), entering production. Per-alpha.
Feedback should be early and frequent

4. Standards
Head1.0, head2.0
One format convert to many platform. Format, method, vocabulary

5. Pipeline
上海, 印度,奧蘭多,溫哥華。
Pipeline compete
Don't just build by your own
Confirm everything is down before outsourcing

Need smooth communication

If you hire smart people, he want to do everything, we should let service provider or expert do. Capture team in Vancouver, 2 motion capture,80 cameras

Ubisoft Shanghai start to develop mobile platform, stop the relation with Gameloft.

Production value:
Story, atmosphere, character, unique flavor, epic moment, rewards, buzz, polish

Receive professional playtesting report
It is easier to hand over iPhone to somebody.

Agile but Scrum

Pipeline: See modification without waiting anyone

Version checking, and would download through wifi.

Production: First playable presentation in keeping the practice of designing the core game play.
1st 30min player experience

Validation: something playable every 2 weeks at least.

Launch/soft launch
Post launch

Concept: prototype, know the game engine

Preproduction: focus on control, camera / character , sign and feedback.
Insist reviewable version everyday
Real data driven at least 2 core feature
Never believe a feature will be be polish / graphics / fps will be better in last month

Production/soft launch
Priority and ready cut functions

Mobile project: motivation
Clear objective
Everybody understand and agree
Build the communication, everybody contribute their idea on game design.

Small steps in the dark, embracing the continuous prototyping

Prototype: an interactive experiment

Conventional prototype: 2-24 weeks, help understand the game , demo and video

21 m dev
3 full time developer
Custom engine 5 month using Flash

Purpose of prototype
- fiill the gap of kinwledge
- destruct magic trick
- camera , weapon, pacing

One code base to every platform

Prototype outcomes
Unified vision and concept

Porting to new engine in 2 weeks
Survived many algo and design

The problem?
Problems keep appearing, even after 2-24 weeks
Too many assumptions
Prototype should be continue

When you innovate, new unexpected question will show up

The hardcore game rising
Cmune: investor Skype, rovio

7m registered
1.3 MAU

5 lessons in 5yrs(from 5 people)
1. Listen your mind, console game is big market
FPS multi billion game genre
1/4 are fps in Facebook game

2. Never underestimate new platform

3. Never underestimate the complexity to do cross platform games
Keep learning: your client 20 people
Unity difficult to master, easy to prototype. Plugin install experience can be optimized. Content release is a part of growing a game
Invest your the worth community.

Prediction: 1,.core gaming will be top grossing on web/social
2. Immersive console like game
3. Cross platform
4. New leaders from Asia/china
5.game as service will allow global communities to connect, learn and create

iOS / android Facebook maybe decrease more and more user. Wanna transform from pc play to web to mobile. Facebook wanna provide more support because many user leave from here.

The last 10%- from naughty dog
Polish: Remove, find affect

-Gameplay related issues
-Presentation issue
-fix we tend to statue quo

Shoot for perfect

Per production production alpha beta gold

Allocate 20-25% to polish in schedule.

Rapid iteration
Aim a pipeline with fast iteration time
Direct communication with people.
Don't assume it will get fix with an email .
Encourage Collaborative

Don't fear change

Rolling deadlines:
Too many overlap,

Tiered approvals
Multiple people must approve as you go
A high level person looking for polish daily
Balance polish vs time
Understand what to look for


Focus social : pvp, social cooperation
9 yrs
Html5 games market

Did casual game and get success

1-day retention >30%
Draw something like get 1M users

Game IV
1.complex layered strategy /optimization

2. Monetization
Speed up not energy
More resource / units more revenue

HTML 5 always keep up to date
Native app do not that will affect balance

3. Social
Really social pvp trading chatting
Sending resource

Pvp in focus

Hattrick - soccer manager game

Time sensitivity
PVP cross platform can

Enable fast prototype

6.passion required


The iteration treadmill

Time lost waiting for builds

More tweaking
Asset testing in game

Ambition goal
See change immediately

No cheating
Target hardware+ target frame rate

Fast games. Fast workflow

Work in smaller chunk, resource be compiled separately, and upload runtime.

Running game listen on tcp/ip port
Message are JSON

Deploy to console
File transfer not adapted for sub second upload

Sol: a file server on PC-console load app files from here

big resource:
Compile slowly
Separate them

Slow resource
Light map, navmeah
Separate baking from compiler

Reload code
C++ tool support reload exe

A compiler database
Shader depends on another shader.
Store information from pervious .

Check binary version, if mismatch recompile

Android earn more money than iOS .
You can earn 200-300w rmb/m in Android

One key register
Login via sns: QQ, 微博

Uncharted 3 effects
2005 in naughty dog

Scheme based macro language

Process split btw ppu spu
Complexity in ppu and than in spu

New system iteration time
- fast iteration == more effect

Shader flexible

100% asynchronous spu

DC data compiler
Particle - dc data - DC - network - engine - display

Noodler shader editing
Vertex frontend define input attribute

Output into ex: normal
Each node are cg function
Automatically split into vs &fs
Automatic space conversation
Made artist manage their cycle
need programmer help artist

Water: use to follow surface move

Gpu cycle is limited for particle
Less particle but more process form one particle

Preupdate: sort collision
Build geometry
Render list
Use byte code: 16 vector register, create and update

Cull build geom
Cull view frustum

Spawn order good than distance sort, sort for emitter set
Reverse spawn sort

Want to run on all spus
Don't want to have ppu

Deform surface
Animate the deformation
Match lighting with background
Sample depth buffer to particle space, and than will project on the sand
Ztest disable cull front face
Transform world to particle
Add wpos and invScale factor to vertex shader

U3 use partially deferred rendering
Use stencil value to avoid drawing on FG


2012年12月2日 星期日

振奮!! 堅持自己的想法,然後說服別人

今天早上收信聽到一個振奮的消息,三天前我在開發者論壇抗議關於API設計上的問題,雖然有很多人給了我折衷的方法,但我還是堅持我的作法是最佳solution,"如果我們有最佳的方法,為什麼要委屈自己用不是這麼好的作法?"。越來越多人贊同我的意見... 過了一天的安靜~ 終於,我們讓API往前進步了一步...雖然英文不是很好,但是心是與世界並齊的。感謝Flash論壇的開發者們,今天我們讓世界變的更好。

Ernesto Sirolli: Want to help someone? Shut up and listen!

當世界遭遇到 糧食、交通、能源等等問題,能幫我們解決問題的並不會是政府、大學,而會是企業家。



他需要的是夥伴~~~在Richard Branson的自傳中前兩頁,沒有半個字是"I",但卻出現了32個"We"。

2012年11月30日 星期五

Direct3D Drawing in WPF

In Windows8, you can use SurfaceImageSource, VirtualSurfaceImageSource, SwapChainBackgroundPanel to let DirectX content into a XAML app.

Visual Studio 2010 has removed Microsoft.DirectX support, so if we wanna use D3D in WPF, we need to leverage SlimDX or SharpDX.

However, when you use older Windows version, ex: Win7, WinXP, you only can adopt D3DImage.

D3DImage Lock, unLock image, and copy backbuffer to this image.

You can download the sample code here: https://github.com/DaoshengMu/WPFd3dImageCpp










2012年11月28日 星期三

Flash constrained mode: Targeted at devices that only support PS_2.0 level shaders like the Intel GMA 9xx series

Earlier versions of FlashPlayer 11 support hardware rendering for devices manufactured after 2008. The constrained mode extends this support to all devices released since 2005. 

How does it work?
In order to make your application work in constrained mode you just should set the second parameter of stage3D.requestContext3D() when requesting the context, in the following way:

stage3D.requestContext3D(Context3DRenderMode.AUTO, Context3DProfile.BASELINE_CONSTRAINED);

Targeted at devices that only support PS_2.0 level shaders like the Intel GMA 9xx series.

  • You are limited to 64 ALU and 32 texture instructions per shader.
  • Only four texture read instructions per shader.
  • No support for predicate register. This affects sln/sge/seq/sne, which you replace with compound mov/cmp instructions, available with ps_2_0.
  • The Context3D back buffer must always be within the bounds of the stage.
  • Only one instance of a Context3D running in Constrained profile is allowed within a Flash Player instance.
  • Standard display list list rendering is driven by Context3D.present() instead of being based on the SWF frame rate. That is, if a Context3D object is active and visible you must call Context3D.present() to render the standard display list.
  • Reading back from the back buffer through Context3D.drawToBitmapData() might include parts of the display list content. Alpha information will be lost.




2012年11月11日 星期日

Top 5 - Game Engines Of The Future

2012年10月21日 星期日

Android take picture, crop picture, select picture by using intent

Take Picture
public static Uri takePhoto( Activity act )
  //Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  //act.startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
  Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  Uri mImageCaptureUri = Uri.fromFile( new File( Environment.getExternalStorageDirectory(), "tmp_contact_" + String.valueOf(System.currentTimeMillis()) + ".jpg") );
  cameraIntent.putExtra( android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri );
   cameraIntent.putExtra( "return-data", true);
   act.startActivityForResult(cameraIntent, PICK_FROM_CAMERA);
  catch( ActivityNotFoundException e )
  return mImageCaptureUri;
Crop Picture
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
      if ( resultCode != RESULT_OK )
       File f = new File( _imageCaptureUri.getPath() );
       if ( f.exists() )
      switch ( requestCode )
      case CameraCaptureAPI.CROP_FROM_CAMERA:
       final Bundle extras = data.getExtras();
       if ( extras != null )
        final Bitmap photo = extras.getParcelable("data");
         AlertDialog.Builder alert = new AlertDialog.Builder(this);                 
         alert.setTitle( getString( R.string.confirm ) );  

          alert.setPositiveButton( R.string.confirm, new DialogInterface.OnClickListener() {  
             public void onClick(DialogInterface dialog, int whichButton) {  
              PictureUploadAPI.uploadPicture( photo, ProfileViewActivity.this );

           alert.setNegativeButton( R.string.cancel, new DialogInterface.OnClickListener() {

                 public void onClick(DialogInterface dialog, int which) {
                     // TODO Auto-generated method stub
       File f = new File( _imageCaptureUri.getPath() );
       if ( f.exists() )
      case CameraCaptureAPI.PICK_FROM_FILE:
      Intent intent = new Intent( "com.android.camera.action.CROP" );
      _imageCaptureUri = data.getData();
      intent.setDataAndType( _imageCaptureUri, "image/*"); //!!! important
      intent.putExtra("outputX", 96);
      intent.putExtra("outputY", 96);
      intent.putExtra("aspectX", 1);
      intent.putExtra("aspectY", 1);
      intent.putExtra("scale", true);
      intent.putExtra("return-data", true);
         startActivityForResult(intent, CameraCaptureAPI.CROP_FROM_CAMERA);
      catch ( Exception e )
       Log.d("pick picture", e.getMessage());
      case CameraCaptureAPI.PICK_FROM_CAMERA:
      Intent intent1 = new Intent( "com.android.camera.action.CROP" );
      intent1.setDataAndType(_imageCaptureUri, "image/*"); //!!! important
      intent1.putExtra("outputX", 96);
      intent1.putExtra("outputY", 96);
      intent1.putExtra("aspectX", 1);
      intent1.putExtra("aspectY", 1);
      intent1.putExtra("scale", true);
      intent1.putExtra("return-data", true);
         startActivityForResult(intent1, CameraCaptureAPI.CROP_FROM_CAMERA);
      catch ( Exception e )
       Log.d("pick picture", e.getMessage());
Select Picture
 Intent intent = new Intent( Intent.ACTION_GET_CONTENT );
 intent.setType( "image/*" );
      startActivityForResult( intent, CameraCaptureAPI.PICK_FROM_FILE );
 catch( Exception e )
     Log.d("browse picture", e.getMessage());


2012年10月14日 星期日

The San Francisco Games Revolution Is Over

舊金山一直都是產業革命的出生地,遊戲曾經是他們最感興趣的投資項目,Facebook、iOS、Android、Social game,甚至後來的Gamification應用無不都帶來了巨大的成功。不過它已經被改變了:
Social: 被過於高估,不持久。
Price: 開始有了削價競爭。
Scale: 規模太大,平台太多。
Behaviourism: 有些模式沒辦法一直反覆使用,玩家發覺後,這東西價值就變低了。

最後的競爭利器: Graphics! Graphics! Graphics! 九零年代到2006年,Graphics一直都是工作室彼此的主要競爭項目,成本不斷被堆高,到了現在竄出頭的mobile game、social game,還是要靠Graphics來決鬥。


2012年10月12日 星期五

Performance tips on JavaScriptV8

2012年10月7日 星期日


中國大陸使用手機上網的行為研究: 中國大陸使用手機上網的比例已經超過70%,特別是1~3小時的破碎時間,如果仍在做桌上型裝置的網路遊戲我個人覺得有點堪憂。不過他研究的手機上網行為內,遊戲並沒有排進他的排名,可見想用手機上網玩遊戲的比例亦不高(但另外一篇則排進10%),再者如果有看網路女王的趨勢分析,其實另外一點需要再挑戰,就是ARPU還是有3:1的差距...


2012年10月6日 星期六

Android GridView ImageAdapter

public class ImageAdapter extends BaseAdapter {
 private Context _context = null;
 private PhotoItem[] _photoArray = null;
 public ImageAdapter( Context ctx, PhotoItem[] imageArray )
  _context = ctx;
  _photoArray = imageArray;

 public int getCount() {
  // TODO Auto-generated method stub
  return _photoArray.length;

 public PhotoItem getItem(int pos) {
  // TODO Auto-generated method stub
  return _photoArray[ pos ];

 public long getItemId(int position) {
  // TODO Auto-generated method stub
  return 0;

 public View getView(int pos, View convertView, ViewGroup parent) {
  // TODO Auto-generated method stub
  View gridView;

  if ( convertView == null ) // if it's not recycled, initialize some attribute
   LayoutInflater vi = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   gridView = vi.inflate( R.layout.image_item, null);
   ImageView imageView = (ImageView)gridView.findViewById( R.id.imageItemView );
   imageView.setImageDrawable( _photoArray[ pos ].getPhoto() );
   gridView = (View)convertView;
  return gridView;



2012年9月27日 星期四

AMD CodeXL: OpenGL and OpenCL Debugger and Profiler

AMD CodeXL is a new tool for OpenGL and OpenCL developers. CodeXL includes a GPU debugger, a profiler for both GPU and CPU and offers OpenCL kernels analysis capabilities. CodeXL is available as a standalone application for Linux (64-bit) and Windows (32 and 64-bit). An extension for Visual Studio is also available. http://developer.amd.com/tools/hc/CodeXL/Pages/default.aspx

2012年9月26日 星期三

Android customized button

drawable/ return_btn.xml values/ style.xml

Create drawable/return_btn.xml in drawable folder


Create values/style.xml in your value folder


Add ReturnButton style in your layout

2012年9月23日 星期日



 private static final String DB_PATH  = "/data/data/com.xxx.xxx/databases/";
 private static final String DB_NAME  = "xxx.sqlite";

 SQLiteDatabase database = this.getReadableDatabase();
 try {
  //Open your local db as the input stream
   InputStream myInput = ctx.getAssets().open(DB_NAME);
   // Path to the just created empty db
    String outFileName = DB_PATH + DB_NAME;
     //Open the empty db as the output stream
     OutputStream myOutput = new FileOutputStream(outFileName);
      //transfer bytes from the inputfile to the outputfile
         byte[] buffer = new byte[1024];
      int length;
      while ((length = myInput.read(buffer))>0){
       myOutput.write(buffer, 0, length);
      //Close the streams
  } catch (IOException e) 
      throw new Error("Error copying database");

2012年9月11日 星期二

Chat List show/hide keyboard

_chatList.setOnTouchListener( new OnTouchListener()

      public boolean onTouch(View v, MotionEvent event) {
      // TODO Auto-generated method stub
           //close keyboard
            _chatText.getWindowToken(), 0);

            //open keyboard

     return false;


2012年8月27日 星期一

Head in the Clouds: The reasons of OnLive's failure

  • OnLive的最高同時上線人數大概1800位,註冊用戶2萬人。但是OnLive每個月卻有五百萬美金的的服務開銷。想想每個使用者平均要花多少錢才能回本,這是一個失敗的business model。
  • 錯誤的策略,這些console主機仍然是被玩家使用中的。OnLive卻仍想要賣服務給這些已經有主機的玩家。
  • 網路頻寬問題: 許多註冊用戶被發現他們並沒有去依照OnLive的需求來升級頻寬。
  • 如果你給一個人免費服務,他們會覺得這東西的價值是比較低的,遊戲主機的business model會運作的原因是當你購買了一台主機,用戶會想證明自己的投資是對的就會購買更多的遊戲。但對於OnLive的用戶因為沒花到錢,所以也不急著要付費投資他,包含去申請符合OnLive要求的網路頻寬。
  • OnLive的針對用戶是core gamer和搶先玩家。但是他們不會滿意OnLive的performance,包含lag和畫面失真等不可避免由於網路頻寬造成的結果。OnLive所提供的軟體不是最熱門最新的遊戲,這些核心玩家是不會有興趣的,反而這樣的服務會吸引casual玩家(對於最新遊戲或是購買最新硬體沒這麼熱衷的玩家),但這種玩家通常頻寬不會太好。
  • 本身的硬體更新每次費用都會非常昂貴。
  • 它不是console平台的掌握者,它沒辦法掌握硬體的升級,說服玩家只要用低規的硬體就可以遊玩高級的遊戲。
  • 隨著Graphics processor越來越便宜和精巧,以及效能越來越好。越來越多輕薄的手機終將會超越現今的console,然後在家裡的TV上用它們遊玩高級遊戲。
  • 當一切策略錯誤後,沒有將目標鎖定到專一特殊的領域。例如,Gaikai專精提供game demo服務。


2012年8月25日 星期六

Android: Async-Http library

Android Asynchronous Http Client
A Callback-Based Http Client Library for Android

Http Send:

// http send
AsyncHttpClient _clientPost = new AsyncHttpClient();

RequestParams params = new RequestParams();
params.put( "type", "" + type );
params.put( "text", message );
if( CookieManager.getInstance().getCookie(HttpAPI.uriAPI) != null )
     String cookieStr = CookieManager.getInstance().getCookie(HttpAPI.uriAPI);
     _clientPost.addHeader( "Cookie", cookieStr );
_clientPost.post( addr, params, new AsyncHttpResponseHandler() 
   public void onSuccess(String response) 
      catch (JSONException e) 


Http Get:

// http get
AsyncHttpResponseHandler _responseHandler = new AsyncHttpResponseHandler() 
  public void onSuccess(String response) 

if( CookieManager.getInstance().getCookie(HttpAPI.uriAPI) != null )
   String cookieStr = CookieManager.getInstance().getCookie(HttpAPI.uriAPI);
   _clientGet.addHeader( "Cookie", cookieStr );
_clientGet.get( addr, responseHandler );

2012年8月23日 星期四

Build OGRE with dependency

Dependence file Updated 19 Aug 2012 is not work.
Boost link error for OGRE 1.8 build


2012年8月21日 星期二

WebGL - Three.js + impactJS


Using three.js to render a game made with impactJS and box2D

2012年8月18日 星期六

Android chat room copy/delete text

// long press click
public boolean onItemLongClick(AdapterView arg0, View arg1,
     final int pos, long id) {

                // AlertDialog can try to move to global variable, can avoid to multiple creating.
                AlertDialog.Builder dialog = new AlertDialog.Builder(ChatActivity.this);
                String strCopy = getResources().getString(R.string.copy);
                final String strDel = getResources().getString(R.string.delete);
                String[] options = { strCopy, strDel };  // copy and delete items
                DialogInterface.OnClickListener actionListener = new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                      switch (which) {
                      case 0: // Copy
                       String copyTxt = _list.get( pos ).getText();
                       //place your TextView's text in clipboard
                       ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); 
                      case 1: // Delete
                       AlertDialog.Builder delete = new AlertDialog.Builder(ChatRoomActivity.this);
                       delete.setTitle( strDel );
                          // if confirm to del item, remove it from list and update adapter
                       delete.setPositiveButton( R.string.confirm,  new DialogInterface.OnClickListener() {  
                              public void onClick(DialogInterface dialog, int whichButton) {  
                               _list.remove( pos );
                       delete.setNeutralButton( R.string.cancel, null );
                       Toast.makeText( ChatActivity.this, "undefine this type in ChatActivity", Toast.LENGTH_LONG ).show();
                dialog.setItems(options, actionListener);
                // end AlertDialog create

       return true;




  • 這本書百分之五十的版稅捐給交大校友會,另外百分之五十捐給兒童扶助基金會...這決定太棒了,因為年輕學子一定是未來的希望,我們要多幫助他們。
  • 當初潘健成董事長從馬來西亞來台灣交大唸書,其實也很平凡的想說畢業後回馬來西亞工廠上班,一個月領個三萬元,實在沒想說要創業。
  • 他在研究所的時候替教授所開的公司做事,常常沒什麼時間去上課,這間公司在未上市公司潛力曾經位居第二名,不過管理階層出了問題。很多都是高層的親戚,朋友。甚至一個主管跟他說,我們不賺錢也沒關係,只要把我們募資來的好幾億元放到銀行生利息就夠了,要不然就是六塊買進DRAM再12塊賣出可以翻賺一倍。....這種不是在認真經營公司而是在玩金錢遊戲的例子,也促成了潘董對於他日後群聯電子所警惕的。
  • 第一筆大生意是做成全球第一顆USB快閃記憶體系統控制單晶片。後來發現成品比較好賺就開始做隨身碟。
  • 年輕很難給別人信任,但如果你言之有物且做的東西是好的,對方反而會記得你。成功的定義:今天的成功是由於昨天做了對的事情,在每天做很多對的事情,那每天都是做的很成功。
  • 28歲時候被前公司控告侵權,公司的資金被扣押,董事長去拜託合作夥伴能夠將現金能夠提早付給他們,積極地面對媒體,最後終於和解。科技公司難逃侵權,遭到Sandisk告侵權,不像其他廠商跟著和解,因為不甘本業被收取權利金,最後也打贏了。
  • 找保護傘,引進重要股東。找上東芝,它替他們解決了很多難關,讓外界直覺群聯很厲害,無論是資金與專利上。但在東芝的保護緩衝期,仍然要不斷地補專利。
  • 持續為善,賺錢本來就是要花,但要花在該做的地方,幫助年輕人念書、創業,讓越來越多人能夠替社會帶來希望。
  • 以技術發展為基礎,挑正值長期耕耘的客戶。遇到小廠以劣質品競爭,放掉大中華區,找真正有品牌的客戶。做生意就像待人處世,不佔客戶便宜,賣貴了,下張訂單要還給他。
  • 創業夥伴,找可以長久的夥伴,創業有成後,一起打天下的夥伴也沒有分開。在學校認識的朋友是最好的,夥伴選對了麻煩也就少了。

2012年8月13日 星期一

PlayCanvas WebGL 3rd Person Multiplayer Demo

D.E.M.O. screenshot

兩個禮拜製作。這個demo與以前不一樣的是做到了multiplayer,支援mouse lock, full screen,在Chrome還支援gamepad。Chrome真的是一個很適合發展HTML5的平台。對於有1.3 billion的潛在玩家,並且相較於triple-A專案的開發成本低的HTML5 platform,能不趁早涉入嗎?

Source code: https://bitbucket.org/playcanvas/scifi

2012年8月11日 星期六

Introduce to Chrome plugin

In this diagram, it describes how was the Chrome been designed. If we want to develop some plugins on Chrome, we have several ways.
  1. First, we could use NPAPI which Firefox also follow it interface. (Out of process plugin)
  2. Second, we could choose to write NaCI which support native code( C/C++) be compiled to nexe and be executed on the Chrome sandbox, it would bring some performance benefits because we could enjoy the performance from native code. NaCI provides PPAPI which is different from NPAPI because PPAPI is in order to focus on high performance for 3D/2D rendering, and Google has recommended it to Mozilla but Mozilla not yet decided to support it.
  3. Third, Chrome has some in-Process-plugins that are internal plugins. They could enjoy the PPAPI .

Flash player on Chrome
Chrome provides the Flash Player Pepper in order to let chrome be convenient to maintain and keep it is secure. BTW, Chrome make it be in-process-plugin type and utilize PPAPI in rendering. Flash Player Pepper is different to Adobe Flash Player which use NPAPI interface.

Chrome wants to use PPAPI to involve NaCI, Flash Player and WebGL, because they all support OpenGL ES 2.0. However, it restricts the future of Flayer Player on Chrome due to Stage3D is still possible to support D3D11. With NPAPI based flash player on Windows:  Stage3D->AGAL->DirectX->SwiftShader, but with PPAPI based one: Stage3D->AGAL->OpenGLES2->IPC channel->OpenGLES2->DirectX->SwiftShader, there are a lot of tasks be translated, therefore, it would bring performance hit.

Layout engine:
  • Chrome: Webkit
  • Firefox: Gecko


2012年8月10日 星期五

Android: progress dialog and thread


ProgressDialog _progressDialog = ProgressDialog.show(

               FriendListViewActivity.this, "", getString( R.string.progressing )

               , true, false );


ProgressDialog _progressDialog = ProgressDialog.show(

               FriendListViewActivity.this, "title mssage", getString( R.string.progressing )

               , true, false );

        new Thread(){ 
            public void run(){ 
                catch (Exception e){
                    pDialog.dismiss(); //關閉dialog
        }.start(); //開始執行緒

runOnUiThread(new Runnable() { // Correct!! 
    public void run() {
        //modify View object


2012年8月8日 星期三

OpenGL 4.3 spec and Adaptive Scalable Texture Compression Extension (ASTC)

Aug.6th is the 20th anniversary for OpenGL. Khronos revealed OpenGL4.3 spec and compression texture format -ASTC in Siggraph 2012.


OpenGL4.3 spec has been released:


OpenGL 4.3 compute shader:

2012年7月27日 星期五

Turbulenz WebGL Engine using Quake 4 assets

2012年7月26日 星期四

Photoshop Overlay

Target: lower layer texture
Blend: upper layer texture

Overlay = (Target > 0.5) * (1 - (1-2*(Target-0.5)) * (1-Blend)) +
(Target <= 0.5) * ((2*Target) * Blend)



2012年7月21日 星期六



1980-90 年代,台積電, 宏碁, 華碩替台灣建立了半導體以及個人電腦的經濟體,讓台灣賺進了大量的外匯,也擠身亞洲四小龍,那時也奠定了科技島的美譽。那時的時空背景會這麼成功的原因是我們與國際接軌了,我們在跟美國矽谷的創新作了一樣的事情,我們走的是朝陽的產業,是未來獲利十分看好的產業。

2000年代,.com網路產業興起,從美國湧起的Yahoo, eBay,這時台灣沒有缺席,Kimo, yam, PChome帶領台灣面對挑戰,雖然後來Kimo被Yahoo收購, yam變得比較沒這麼影響力,PChome後來經過幾次轉型變成大型的網路購物平台,這些網路公司都帶來台灣非常優秀的研發能量,這些技術力一樣是跟國際接軌的。


2008年開始,社群網路崛起,Facebook席捲全球,中國人人網,日本mixi相繼出頭。台灣這次沒有人成功。或許是國內人口數沒這麼多,社群網站發展不起來。不過人口數,文化背景並不是絕對先天上的劣勢,Rovio在2011憑著Angry bird席捲全球,芬蘭國家只有500萬人,我們有2000萬人口,我們一定也有機會!

2010年,智慧手機的App經濟體被蘋果賈伯斯所建立完成。全世界的人都對它開啓了掏金夢,Rovio因為Angry bird市值56億英鎊,Instagram 十億美金被Facebook收購, Omgpop因為DrawSomething被Zynga以2.1億收購。這次台灣尚未發生一個巨額的併購案,或是因為App而締造一個產業,不過周遭很多聲音都在努力着,期待他們成功的發生。

創新的事業是由年輕人所創造的,如果年輕人過得很辛苦而又不肯站出來突破,告訴世界我們要的是怎樣的生活,那又有誰能保證你十年後會過得怎樣呢? 如果是不敢冒險,那麼二三十年前的年輕人又有誰能成功呢?我們現在能過的尚有一定水準其實是他們給的...以前的年輕人或許害怕未來會與對岸戰死而勇敢冒險,而我們卻因為害怕失敗而不敢冒險,勇敢點~~放手一搏吧!就算一百個人只有一個人成功,成功的人還是會張開雙手歡迎失敗者的,因為他知道在挑戰未來的路途中,我們是一起走過來的夥伴。

2012年7月17日 星期二

Texture compression on GPU

  1. Reduce texture memory size, it can reduce gpu memory bandwidth to read texture while rendering, and compressed format can have better performance because it use less memory.
  2. Fast decompress, it compressed on the GPU card, and while rendering it be decompressed at least once per frame.
  3. Fast random access,  if a texture cover a mesh but the mesh just can be seen on one side, GPU will only decompress the part of texture which can be seen. Therefore, if we do well in Hidden Surface Removal that can help us reduce GPU card loading.

old D3Dnew D3DOpenGLD3D supportOpenGL support
ATI1BC4RGTC110.03.0 (or via extension)
ATI2BC5RGTC210.03.0 (or via extension)
-BC6HBPTC_FLOAT11.04.2 (or via extension)
-BC7BPTC11.04.2 (or via extension)
Reference: http://renderingpipeline.com/2012/07/texture-compression/

2012年7月13日 星期五

Mobile design matters - iOS and Android

Mobile design matters - iOS and Android
View more presentations from Light Lin

2012年7月10日 星期二

Friend fumction in C++ class

// in the header file

void changeVar();   // define it.

class testFriend


friend void changeVar();  // declare it


     int m_i;


// in the cpp file

void changeVar( testFriend&i )  // implement it




// in the main file

int main()


 testFriend test;


2012年7月9日 星期一

Android ListView pull to refresh library


2012年7月4日 星期三

Google I/O 2012 - GRITS: PvP Gaming with HTML5

2012年6月25日 星期一


Haxe: One language, everywhere.

Haxe (pronounced as hex) is an open source programming language
While most other languages are bound to their own platform (Java to the JVM, C# to .Net, ActionScript to the Flash Player), Haxe is a multiplatform language.

2012年6月21日 星期四



2012年6月19日 星期二

Mac can't detect your Android device


adb kill-server ; adb devices

If you installed EasyTether, it will interfere with ADB, you should disable EasyTether. 

Disable EasyTether:
sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext 
Enable EasyTether:
sudo kextload /System/Library/Extensions/EasyTetherUSBEthernet.kext

2012年6月17日 星期日




2012 22%玩家表示自己每周在这类游戏中投入时间达3小时左右,而2011年的这一玩家比例则是14%。同时拥有平板电脑和手机的用户每周游戏时间甚至更长。Kindle Fire和iPad等平板电脑在过去12个月中为移动领域引进了1100万新玩家。

虽然玩家在这些游戏中的平均消费额已从2010年的29.21美元降至2011年的21.24美元,但平板电脑游戏玩家同一时期的平均消费额却从 20.37美元增长至25.47美元。从总体上看,同时拥有两种设备的玩家更具盈利性,他们过去两年中在此类游戏中平均投入达34.57美元。

Game Developer Magazine in May 2012


Game Developer Magazine:
53% 移動裝置遊戲開發商表示正在使用或是即將採用 Unity3D 遊戲引擎。14% 的開發商使用 Unreal Engine,另外有 10% 使用 cocos2d。
銷售成績最頂尖的開發商當中,39.8% 使用自行開發的遊戲引擎。
Game developer magazine 的調查還有一項:每五位開發商有 4.45 位使用遊戲引擎的首要原因是為了加快開發速度。

Kingdom Rush 的開發商回答了開發相關的細節,他們的 web 版本使用 Flash ActionScript 開發
  • 沒有使用像是 PushButton 之類的 flash game engine,而是自行開發塔防專用 (tower defense) 遊戲引擎。
  • 僅使用三套小小的 3rd party library,看起來其他部分都是自行開發。


2012年6月10日 星期日

Android ProgressDialog

When you want to wait some wasting time function, and show dialog, you will need ProgressDialog


Android get C2DM registration_id

  1. Emulator doesn't support it
  2. Your device must later than Android 2.2
  3. Have log-in Android market first
  4. Eclipse use Google API 2.2, not Android SDK2.2
  5. Registration_id max_size is 4096 byte 
Important: C2DM has been officially deprecated as of June 26, 2012. This means that C2DM has stopped accepting new users and quota requests. No new features will be added to C2DM. However, apps using C2DM will continue to work. Existing C2DM developers are encouraged to migrate to the new version of C2DM, called Google Cloud Messaging for Android (GCM). See the C2DM-to-GCM Migration document for more information. Developers must use GCM for new development. 


2012年6月3日 星期日


  1. 網路產業環境是很激烈的,在六年內霸主換了將近一半。
  2. 中國網路公司大躍進,從2004年一家到現在有了三家。
  3. 2004年的領先群有兩家遊戲公司(Shanda, NcSoft),ㄧ家遊戲平台(NHN)。 [NHN同時也有搜尋服務平台],到了2010年專門的網路遊戲開發公司不見了,易主成兩家遊戲平台(Tencent, NHN)。
  4. 雖然領先群很多都易主了,但是大家總市值其實都成長了兩倍,營收甚至是漲了五倍。 



新的遊戲Business Model

以前可能人們會覺得單機遊戲通路是個負擔,盜版也是個問題,積怨過久,製作端往往放棄了製作單機遊戲的熱忱。但現在好的遊戲還是經得起考驗,以往id software帶起的share software方式,現在革新成現在這個形態。

Humble Indie Bundle,優秀的獨立開發者共同將受到玩家歡迎的作品協力販售,在三天內已經賣出33萬套。一套平均售價7.82美金,支援Linux, Windows, Mac。再者購買時其實只是買到其中的四款遊戲,但如果你的出價比平均售價高!就能夠得到第五款遊戲,如此產生了網路競標行為,售價會越來越高,我前天看的時候平均售價是7.67USD。

2012年6月1日 星期五

Mary Meeker's 2012 annel internet trend report

KPCB Internet Trends 2012

2012 KPCB Internet Trends Year-End Update


  1. 我們活在一個正在進化的時代,以前習以為常的習慣到了這兩三年都換了面貌。 
  2. Desktop internet與mobile internet的用戶數已經出現黃金交叉了,但是收益比還是將近3:1,所以mobile市場還有很大的爆炸潛力被開發。
  3. Android的市場成長幅度是iPhone的四倍(2012年底是六倍)。
  4. 從行動電話轉換到智慧手機的用戶群還有六倍的潛在客戶。
  5. 使用電子閱讀器的成年人三年內從2%變成29%
  6. 行動裝置的上網速度每年都在成長進步,今年更是成長了10%
  7. Mobile device的出現其實幫助了eCommerce的成長。
  8. 全球行動裝置的 App+Ad三年內成長15倍。
  9. 廣告的投注在行動裝置上目前相對偏低,未來會大幅增進,並且行動裝置使用數也會成長。
  10. 廣告在行動平台上的有效曝光度顯得偏低,需要找一個好的方式。
  11. 使用者在行動平台的消費金額比桌上裝置而言弱了三倍。
  12. iPad達到兩千萬台的時間(一年)只花了iPhone的一半。