Showing posts with label Shijun. Show all posts
Showing posts with label Shijun. Show all posts

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

Wednesday, October 15, 2008

Electronic Arts Singapore

For some reason that's beyond me, the awareness among the student body, of what Electronic Arts does in Singapore seems to be just localization. Semester after semester when the school begins a new ATAP intake hardly anyone applies for an EA internship (ATAP = CS3880 Advanced Technology Attachment Programme). And after what I've been through for 6 months, I'm nonplused! I thought everyone would be jumping at the chance to work for EA.

So, with these three posts I'd like to get everyone properly acquainted with EA’s Singapore presence. I'll be talking about some of the things that EA does, followed by my next post, where I'll mention some of the things I did as a Software Engineering Associate, and lastly I’ll end off by talking about how fun it is to work for a gaming company like EA.

EA Singapore is a hub for many of its Asian initiatives from publishing to localization, including development, adapting many major titles for Asian gaming markets and EA recently established a new Asian Development Studio this year, right here in Singapore.

Yes, that's right, EA makes games here in Singapore. It joins 25 other worldwide studios, and I was among the first batch of interns they accepted. Considering that only 3 interns were accepted, I certainly felt very lucky. After all, this is EA we're talking about, one of the world's biggest (if not the biggest) interactive entertainment companies in the world. AND THEY HAVE A DEVELOPMENT STUDIO IN SINGAPORE!!

The EA Asia Studios is a full-fledged development studio staffed with a multi-national team of game development talent. Coupled with EA's global resources the Singapore studio works on some of EA's biggest titles, among which includes FIFA Online 2.

FIFA Online 2 is EA's biggest online game franchise, currently deployed in South Korea with more than 6 million subscribers. More than 6 million!! Now tell me another internship opportunity that will let you put the name of a PUBLISHED game with more than 6 million subscribers in your résumé. I think that fact alone should be reason enough to apply for EA, because it’s hard to get a job in the gaming industry when companies out there are seeking for a couple of years of development experience and a published game under your belt.

Of course FIFA Online 2 won't just be a name in South Korea. The open beta for Singapore will be launched later this year along with Malaysia, Vietnam & Thailand, with other Asian countries in the pipeline. By then we won't just be looking at 6 million gamers. All of that excitement is taking place right here in the Singapore studios.

And as an Intern, you will get to experience all of that excitement. Interns are fully-involved in studio tasks. You will become an integral part of the development process to take corporate objectives further. You will receive complete ownership in your areas of responsibility with support from many wonderful colleagues. You will be exposed to an extremely rich learning environment with unfettered access to proprietary EA technology. Man, talking about all this makes me miss my time there.

If you do end up being lucky enough to be accepted at EA, the onus will be on you to turn your time there into a wonderful experience. There's no spoon feeding, no textbook, no lecturer or tutor to show you the ropes. EA will put everything on the table and you can do whatever you see fit, but EA will be watching what you do with what has been provided. So in a sense, it isn’t just an opportunity to learn from the best and improve your skills as an engineer, it’s probably your first job interview. Albeit one that lasts for 6 months. If you’ve proven yourself, your journey in the gaming industry would have just made its first few steps and believe me, it’s hard to get a foot in that door.

Lastly, all work and no play makes EA employees dull people. We wouldn’t be able to make good games if we don’t know the meaning of fun. So at EA, we’re a close-knit group that makes an effort to enjoy ourselves and relax. And that means lots of FIFA, lots of Rockband, Happy Hours, staff benefits, special team events, and so on. When you join EA, you’re not just getting yourself into a 9-to-6 desk job, you’re joining a new family, and like a family, we take care of one another. I continue to be a part of this family even now that I’ve left the company, and I’m more than happy to be telling everyone about the EA experience.

I hope by now I've caught your attention. If nothing else, here are the key takeaways from my post. If you're lucky enough to be an intern at EA, we'll be talking about

  • Exposure to international aspects of business issues in the gaming industry
  • An internal glimpse at how one of the best in the industry makes games
  • Working with wonderful colleagues who have an endless amount of experience and knowledge to impart to you.
  • Rich learning opportunities. There's no limit to what you can learn from the company.
  • Close-knit, fun-loving working environment, where everyone’s treated like a family member.
In my next post I'll be talking about the technical aspects of my work at EA just to provide another perspective on the internship experience.

- Shijun

Monday, October 13, 2008

Greetings...

Hi everyone, I'm Shijun, this week's guest blogger. I must say this blog is a very interesting initiative, and having read the other entries from fellow guest bloggers, I only hope my posts will be as useful.

In any case, I'm currently a 4th year in the Computer Science stream and I absolutely can't get enough about Computer Graphics and Game Development. I've done some simple shaders, and did a few things in game development, but most fortunately, I spent the first half of the year as a software engineering intern with Electronic-Arts, a company which I'm sure needs no introduction. I'll be making posts about my experience with Electronic-Arts and about Graphics and Game Development in general. Of course, I don't claim to be any kind of expert, but I do hope what I have to say will be of some value to some of you.

Oh, and do let me apologise ahead of time for any lack of finesse in my posts. As you can probably tell, I'm not a very skilled blogger.

- Shijun