Monday, November 3, 2008

IQ Tests Suck

Here is a question I found on the Mensa website under "Mensa Workout":
Sally likes 225 but not 224; she likes 900 but not 800; she likes 144 but not 145. Does she like 1600 or 1700?
The pattern the question designers want me to find is that Sally likes perfect squares, and so she likes 1600. But there seems to be other valid solutions:
  1. Sally likes numbers in which the sum of the digits plus the number of digits equals 12. Therefore, she likes 225, 900, 144, and, of course, 1700.
  2. (This one is for the fans of Occam's Razor) Sally likes numbers whose sum of the digits is odd. Therefore she likes 1600, not 1700.
  3. Sally likes 1700 because she likes the roots of x4 - 2969 x3 + 2521800x2 - 648810000 x + 49572000000, which is 144, 225, 900 & 1700.
  4. Sally likes 1600 because she likes the roots of x4 - 2869 x3 + 2394900x2 - 612360000 x + 46656000000
  5. Sally does "not" like 1600 or 1700, because neither number has digits which sum to 9. She "does", however, like 1800.
All these solutions are logical but only 3 out of these 6 rational solutions gives me a score.

This makes me wonder: Is Intelligence a social phenomena? Please note the fact the these questions are designed by people who are recognized by the society as intelligent, i.e people who have achieved something "great" in their lives. That implies that the society defines somebody as "intelligent" just because he thinks like the other "great" people.

What if Beethoven was born before the piano? Spielberg before the invention of the camera? Steve Jobs before the computers? So there are people alive today whose technology has not yet been invented yet, the perfect means to their genius has never materialized. And if society starts to brand, recognize and promote only the people who are like the achievers of yesterday, I think we will soon enter a second Dark Age.

Hello World

Hello, I am Edwin and I will be the guest blogger for this week.

I am an undergraduate student of Computational Biology. I study it because I believe it will speed up the progress of Life Sciences and eliminate the need for slow experimental techniques and ethics that limit it. As of now most of that dream is still science fiction, but I hope somebody will make progress.

You can read more about my academic and professional past here.

Tuesday, October 28, 2008

The Great Idea

Hi everyone,
As customary with all first posts, I will do a little intro about myself and what I do.
When Alexia and Juliana invited me to contribute to this blog, I gladly obliged, having benefited a lot from SOC, in terms of being granted incubation office space, as well as being provided with publicity opportunities. But more than just 'repaying' SOC, I wanted to contribute to the blog to share my experiences, and I hope that the blog will become some kind of 'idea' exchange, with students and bloggers contributing their thoughts and ideas on entrepreneurship.

I keep talking about "sharing experiences", basically because I'm still learning and building my business (hopefully one day it will be successful and I will be featured in the papers (: ), so I don't think I'm qualified enough to give advice. What I have done, very briefly summarized is (this will also serve as an intro about myself):
  • Graduated from SOC in July 2004, majoring in Information Systems
  • Together with my Honors Year Professor and another Prof, started DecisionWare Simulations and Games
  • Made lots of investor pitches, and none came to fruition
  • Organized a nation-wide business game competition in 2005 involving 500+ students
  • Was invited to go to Mexico (one of long-time users of our game is Universidad Panamericana) to give a talk in 2005
  • Worked with a number of government organizations on game projects including National Library Board, Asian Civilizations Museum and Ministry of Education
Intro aside, to the theme of my post, "The Great Idea". I thought it would be a good first post, since most of the time, business ventures are started on a single idea, that a budding entrepreneur and his friends discuss over tea-time or supper, which then gets drafted out as a business plan on napkins or scrap paper, then later formalized as a Word document. A simple business registration on ACRA is the next step, followed by approaching investors for funding. If that doesn't work, use the FFF method - Family, Friends or Fools to raise funds. And finally setting off with your plan to conquer the world.

I remember thinking like that while I was studying. Back then, I was already inspired by all the stories coming from Silicon Valley (1997 to 2000) about computer geeks becoming millionaires overnight. I attended talks and conferences to get ideas, and I remember this one about Technological waves (can't remember the exact name), and the speakers were talking about businesses becoming very successful because they were on the forefront of the technological trend. The one thing I remembered was at the end of the talk, a member of the audience asked, "Are you able to tell us what is the next trend?". One speaker replied, "If I knew that, I would be a very rich man!". I guess that guy asking the question wanted to get ideas for his "Great Business Idea". Well, we all know now that the dot-com bubble burst, and many companies that were built on "unique propositions" simply collapsed.

4 years on, I have come to believe that the "Great Idea" is over-rated. It is still true that you have to offer something extra, but there are many examples of successful entrepreneurs that were not the first to offer something new. From the papers recently we have Charles Wong (Charles & Keith) , Ivan Lee (Thai Express and other restaurants), and there is Google, which was not the first Internet Search Engine to be started.

The point is that it takes more than a good idea for a business to be successful. That is why I get a little irritated when people dismiss a business idea by saying "Oh, but I saw that on the Web already" or "I know another business like that". In this globalized world, nothing is truly original. So even if there is already another company doing something similar, does not mean your idea won't fly, or that your company won't eventually out perform the original company. On the flip side, you have to summon all your knowledge, expertise, connections and bring together a good team, and subsequently put in a lot of hard work into making the idea into a success.

- Kevin

Monday, October 20, 2008

Graphics - A story of convergence.

I've been quite busy with a multitude of assignments this week, and before i knew it, its the end of my guest week on this blog, so I've decided to just end off with a post on my favourite topic, graphics!

I've noticed that GPU technologies have been undergoing a rather dramatic transformation these few years. Every new generation of GPUs introduces new features and increased programmability. More and more parts of the graphics hardware now allow developers to introduce their custom code to generate some really cool effects. These pieces of custom code are called shaders by the way, and if you've played some of the latest games like Crysis, you've already seen these things in action.

But before we had all this programmability, graphics cards were monolithic, fixed function devices, much like your run of the mill calculator. It could only perform a limited range of tasks, and all of them did it the same way. So there wasn't much in terms of really cool graphics effects back in that era. But now, with programmable hardware, things have become really exciting.

Now if every new generation of graphics hardware added more programmability, there would certainly be a day when graphics hardware would become so flexible, they could be used for non-graphics applications. And in fact, that's what's happening today. Ever since programmable hardware appeared on the market, people have been programming it for non-graphics tasks. Researchers have used it for medical tomography, computer vision, molecular dynamics, financial options pricing, and the list goes on. This kind of development is termed GPGPU (General Purpose GPU) development, and it involved hacks and workarounds in shaders and graphics API (DirectX, OpenGL) to get applications to generate useful data.

The reason why developers go through all of that trouble to use graphics cards is because the hardware is incredibly good at performing a certain class of problems way way faster than a regular CPU can. This class of problems are known as stream processing problems and they have this characteristic known as data parallelism, where large datasets are broken down into smaller independent pieces that could be processed in parallel.

And real-time computer graphics is precisely a stream processing problem. Pixels were drawn onto the screen one at a time, and these pieces could be processed independently from each other. (Well, that's not quite the whole picture but just for the sake of simplifying the discussion, we'll stick to that understanding.) And so as it turns out, once we begin to think beyond the semantic confines of a pixel with programmable hardware, the GPU could be applied to stream processing problems.

In fact, if we were just to consider stream processing problems, when nVidia debuted its 8800 series GPUs, it was about 200 times faster than Intel's Core 2. Today's GPUs have hit 1 teraflops of computational performance. So the next time you're buyin a new graphics card, in a sense its like buying a compute cluster for about 500-700 bucks. And while In CPU-land, we're talking about 4-6 CPU cores, a GPU device these days can have up to 256 streaming processors. That's a lot of computing power.

And I think it is this combination of increasing programmability and stream processing capabilities that have led to the convergence that were seeing today. And this convergence has taken many different forms.

GPUs are becoming increasingly versatile beyond graphics applications. There's nVidia's CUDA (Compute Unified Device Architecture) where developers can write stream processing applications in C. Then there's nVidia's new PhysX driver that enables games to run complex physics calculations on the GPU. Also, there is currently a research explosion in shader development. And a recurring theme in many publications involves bringing traditionally non-realtime graphics techniques into the gpu, making them real-time. In fact there has been a lot of talk about real-time raytracing. So, we're seeing a lot of things that were traditionally CPU implementations being switched over to the GPU.

The distinctions between GPUs and CPUs have begun to blur out. Intel has predicted a future where GPUs will become fully programmable and it is attempting to jump ahead of the curve, with the Larrabee project, a device that's speculated to comprise of up to 32 lightweight x86 CPU cores. A well known industry figure even went as far as to speculate the death of standard graphics APIs in the future, as anyone will be able to come up with their own graphics APIs with fully programmable hardware. There are even rumors that AMD is planning on creating a fusion chip combining CPU and GPU into a single chip.

Well, between speculation and fact, its hard to tell what's really going to happen next. But I have a feeling this theme of convergence will continue to resonate in this field.

- Shijun

Friday, October 17, 2008

Software Engineering @ Electronic Arts

Before I started my time at EA, I was fully expecting to be doing simple supportive tasks, like documentation or managing build systems and so forth. Work that didn’t involve laying my hands on the actual game, because quite a few companies in the ATAP list don’t have the practice of giving interns full access to the company’s crown jewels.

And boy was I wrong. One of the first things I had to do on the job there was dive into the FIFA Online 2 source code and documentation. That’s more than 400,000 lines of C++ code with lots of proprietary subsystems to support the game, a nebulous implementation to say the least. It was a very daunting task, even till the end of my internship, I only managed a rough understanding of just the major parts of the code.

But one has to admire the technical achievement of those 400,000 lines of code. FIFA Online 2 is a networked game for up to 6 concurrent players that could run consistently at 30 frames per second. I’ve taken CS4344 (Networked and Mobile Gaming) before, and in that module you learn about many techniques for making games perform correctly in a networked environment, and it is no easy task at all. And although FIFA Online 2 shares many similarities with its console siblings, deep inside, it’s a different beast altogether because of these online constraints. Making a game like FIFA Online in a best-effort communications environment like the internet, meant that a lot of mechanisms had to go into the game to make it resilient to network delays and loss events. And it’s not just about coping with the characteristics of a network, it’s also about 400,000 lines of code running in REAL-TIME. I don’t know about you, but that’s a feat of engineering to me.

A lot of my time at EA is about absorbing all that engineering innovation that went into the product and applying them to the things I did. I worked on a couple of In-House tools, created my own custom builds of the game, designed a small code library for tool development, unified 2 different database access technologies under a single library, and I even started a Wiki server for documentation. So as you can tell, all that involved a spectrum of development skills. I’ve added a couple of videos to give you a better idea of what FIFA Online 2 is about.





That's JC, one of the producers at the Singapore Studio.

Some screenshots of the game

To further illustrate, my company has graciously given me permission to talk about one particular in-house tool I did at EA. And we call it the FIFA Asset Verification Tool. A tool for ensuring that assets were correctly integrated into the game. Assets, by the way, are game dev lingo for artwork, 3D models in this case, and the studio has a rather complicated asset pipeline that turned the Maya artwork that the artists did into resources that were loaded by the game. Often artists needed to verify their work in the game and before this tool it was a rather cumbersome process. Furthermore, they couldn’t mix and match soccer players with various team uniforms and animations.

FIFA Asset Verification Tool


The tool exposed many hidden functions in the game by loading a custom-built DLL of the game and initializing the various database, rendering and animation subsystems to generate what you see in my screenshot. From a technical perspective, this tool involved:
  • Win32 Programming
  • Software Engineering
    • Code-reuse via the concept of DLLs
    • Software design that enabled 2 separate applications to work together
    • Advanced C++ programming.
  • Working with EA proprietary subsystems for Rendering and Animation.
  • Some Computer Graphics
  • ODBC and EA Proprietary Database access.
But the really important point for talking about this tool is that about 60% of the stuff that went into the tool came from things I had to learn while on the job. That’s 60% of stuff that didn’t come from things I learnt in school. And I think that “60%” is really a defining aspect of what ATAP (Advanced Technology Attachment Programme) is all about. ATAP is a platform for students to learn beyond the classroom, but it is also a glimpse into what it takes for one to be ready for the industry. And I think that our time here in SoC can only gear you to be prepared for that “60%”, to equip you with solid fundamentals that will enable you to remain relevant throughout your career.

If I were to map those fundamentals into the modules we learnt in school, here’s what I believe geared me for my internship:
  • Software Engineering (CS2103)
  • Database Systems (CS2102)
  • Computer Networks (CS2105)
  • Operating Systems (CS2106)
  • Computer Graphics (CS3241) 
  • Game Development (CS4343)
  • Networked and Mobile Gaming (CS4344)
The thing about making games is that it is first and foremost about software engineering. And to be a good software engineer, isn’t just about being good at programming, it’s also about being able to design software that’s easily understood, it’s about working smart and working as a team with colleagues from many different backgrounds. Making games draws from many different disciplines, from Psychology & Sociology to Marketing & Creative Arts. Computer Science is just one link in that chain.

In summary, here are the key takeaways from my post about the internship.

  • Self-paced learning approach
  • Unfettered access to source code and EA technology
  • Learn and apply things not encountered in school.
    • Windows Programming
    • Software Engineering Practices in terms of code reuse and library design
    • Game Architecture and Networked Gaming design
    • Advanced C++
I’d like to end off with a comment that my mentor at EA once said over lunch. It was during my first weeks as an intern and he was asking if I participated in any open source development, or if I made any games, or embarked on any personal projects. Sadly, my answer to all of the above back then was no, and he replied firmly: “Well, get involved!”. I'm getting myself involved now, thanks to these guys at EA. With that, I'd like to thank Chris Chua, Nigel, Venky, Alex, Haibing, Megan, Kee, BK, Adrian and the rest of the EA gang. This post is dedicated to you guys.

- Shijun