realtimecollisiondetection.net – the blogCoding wisdom and rants of Christer Ericson2016-02-26T07:57:49Zhttp://realtimecollisiondetection.net/blog/?feed=atomWordPresschristerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=1072011-02-20T19:24:37Z2011-02-20T19:10:38ZOne of the most popular articles I’ve posted on the blog was the one on salaries in the games industry from back in 2008. What made the article extra interesting was that I mined the public H1-B visa database for games companies. Unlike salary surveys, where people can claim arbitrary wages (and the submitted salaries are never posted), the H1-B data contains actual wages! In other words, it is a rare opportunity to get some objective data points on industry salaries.

Since some time has passed since I posted the article I thought it would be interesting to repeat the process, which I did, and here are the results.

Game industry salaries from the 2009 H1-B database

This data below is based on the “H-1B Efile Data” 2009 txt file (a huge zipped text file, link). I mined the file for games companies I recognized, and I converted hourly data into yearly salary using the conversion

yearly salary = hourly salary * 37.5 hours/week * 52 weeks.

Converted salary data is marked with (*) in the table below. While I tried to be thorough, I may have missed a game company or two in that huge data set. Unlike last time, I decided to show all job categories (so programmers, artists, designers, etc).

For programmers it would also be interesting to compare game industry salaries against companies like Google, NVidia, Intel, Netflix, Microsoft, Facebook, and Apple. For artists, relevant comparisons could include Pixar, ILM, Digital Domain, Dreamworks, to name a few. All these companies have salary data points in the H1-B database. I have not performed this comparison, however. I may do so at some later point, or perhaps someone else will step up to the plate and do so.

Unfortunately no Microsoft data went into the table below as it is near impossible to distinguish a Microsoft game developer from a Microsoft Windows (or whatever) developer in the H1-B data. There are a few exceptions that stand out as game developer positions, but I didn’t try to extract all of these. Some include “lead vehicle artist” ($85,000), “technical art lead” ($95,000), “general manager (live games)” ($230,000), and “general manager (windows live games)” ($220,000). I can say, though, that the average programmer salary at Microsoft (across all job categories) is $92,400.

Employer

State

Job title

Wage

Disney Online

CA

Director, Technology

$157,500

Electronic Arts

CA

Technical Director

$150,000

Blizzard Entertainment

CA

Senior Software Engineer II

$150,000

Popcap Games

WA

Game Designer (Commercial Designer)

$146,250*

WMS Gaming

IL

Director Of Product Marketing

$145,000

SCEA

CA

Sr. Graphics Programmer

$140,000

Papaya Studio

CA

Computer Systems Analyst

$140,000

Blizzard Entertainment

CA

Art Director

$136,700

Electronic Arts

CA

Senior Software Engineer I

$131,000

Zipper Interactive

WA

Lead Software Engineer

$130,800

Take-Two Interactive

CA

Software Engineer (Development Tools)

$130,275

SCEA

CA

Staff Software Engineer

$126,799

SCEA

CA

Sr. Staff Software Engineer

$126,026

Electronic Arts

CA

Lead Animator

$125,751

Playdom

CA

Software Engineer

$125,000

Electronic Arts

CA

Database Architect

$125,000

Disney Online

CA

Director, Internal Communications

$125,000

Blizzard Entertainment

CA

Global Manager, Localization

$124,600

Electronic Arts

CA

Lead Engineer, Real-Time Strategy Group

$124,440

Electronic Arts

TX

Principal Project Manager (Engineer)

$123,000

NCsoft Corporation

CA

Lead Animator

$121,540

NCsoft Corporation

CA

Lead Animator

$121,540

Namco Networks

CA

Lead Programmer

$121,534

Disney Online

FL

Manager, Software Engineering

$121,050

SCEA

CA

Staff Graphics Software Engineer

$120,000

Electronic Arts

CA

Producer I

$120,000

Electronic Arts

CA

Lead Configuration Management Engineer

$120,000

Activision Publishing

CA

Financial Analyst

$120,000

Activision Publishing

CA

Senior Software Engineer

$120,000

Electronic Arts

CA

Software Engineer

$116,792

Electronic Arts

CA

Technical Director

$116,792

Electronic Arts

CA

Technical Director

$116,792

WMS Gaming

GA

Principal Software Engineer

$115,000

Blizzard Entertainment

CA

Sr. Software Engineer II

$115,000

Rockstar Games

NY

Art Manager And Director

$114,754

Electronic Arts

CA

Manager Applications – Bids

$114,275

Blizzard Entertainment

CA

Sr. Artist II

$110,800

NCsoft Corporation

CA

Lead Effects Artist

$110,510

NCsoft Corporation

CA

Lead Effects Artist

$110,510

Epic Games

NC

Lead Programmer

$110,410

Titan Studios

WA

Senior Programmer

$110,000

Secret Level

CA

Software Engineer

$110,000

Secret Level

CA

Software Engineer

$110,000

Insomniac Games

CA

Senior Designer

$110,000

Activision Publishing

CA

Senior Database Administrator

$110,000

Activision Publishing

CA

Senior Oracle Database Administrator

$110,000

Electronic Arts

CA

Global Audit Manager (Accountant)

$109,095

Activision Publishing

CA

Programmer Analyst

$109,000

Crystal Dynamics

CA

Sr. Tools Pipeline Programmer

$108,500

Activision Blizzard

CA

Design Specialist

$108,000

Blizzard Entertainment

CA

Sr. Cinematic Artist II

$107,000

Disney Online

CA

Senior Flash Developer

$106,808

California 7 Studios

UT

Senior Game Engineer

$106,000

Electronic Arts

CA

Mngr, Ecommerce & Marketing Analytics

$105,186

Total Immersion

CA

Producer (Art Production)

$105,000

SCEA

CA

Staff Business Systems Analyst

$105,000

Rockstar San Diego

CA

Cinematic Lead Animator

$105,000

Rockstar San Diego

CA

Programmer

$105,000

Disney Online

CA

Sr. Bus. Intelligence Syst. Reporting Eng.

$105,000

Electronic Arts

CA

Software Engineer II

$104,894

Electronic Arts

CA

Software Engineer (Lead Programmer)

$104,894

Electronic Arts

CA

Software Engineer III

$104,894

Electronic Arts

CA

Software Engineer II

$104,894

Electronic Arts

CA

Software Engineer II

$104,894

WMS Gaming

IL

Senior Developer II

$104,701

Activision Publishing

CA

Senior Software Engineer

$104,000

Blizzard Entertainment

CA

Cinematic Artist II

$103,200

SCEA

CA

Sr. Software Engineer

$103,042

Activision Publishing

CA

Design Specialist

$103,000

SCEA

OR

Software Engineer

$102,894

Ubisoft

CA

Director Of US Licensing

$102,000

Electronic Arts

CA

Software Engineer III

$102,000

Big Fish Games

WA

Senior Software Engineer

$101,700

Electronic Arts

CA

Software Engineer III

$101,693

Valve Corporation

WA

Software Engineer

$101,608

Valve Corporation

WA

Software Engineer

$101,608

Blizzard Entertainment

CA

3d Artist

$101,400*

Rockstar San Diego

CA

3d Artist

$101,000

Disney Online

CA

Manager, Web Analytics And Reporting

$101,000

Electronic Arts

CA

Lead Character Technical Animator

$100,776

Electronic Arts

CA

Systems Engineer II

$100,469

WMS Gaming

IL

Senior Software Engineer – Online

$100,000

WMS Gaming

IL

Senior Software Engineer – Online

$100,000

THQ

AZ

Shared Services Director

$100,000

THQ

TX

Art Director

$100,000

Rockstar Games

NY

Senior Product Manager

$100,000

LucasArts

CA

Project Manager

$100,000

LucasArts

CA

Senior Software Engineer

$100,000

High Moon Studios

CA

Programmer

$100,000

Blizzard Entertainment

CA

Sr. Cinematic Artist II

$100,000

Activision Publishing

CA

Software Engineer

$100,000

Epic Games

NC

Programmer/Physics Simulation

$99,999

WMS Gaming

IL

Lead Gaming Software Engineer

$99,992

SCEA

CA

Product Manager

$98,613

Electronic Arts

GA

Software Engineer

$98,280

SCEA

CA

Staff Database Administrator

$98,000

Crystal Dynamics

CA

Programmer – Animation/Physics

$98,000

Electronic Arts

CA

Lead Vfx Artist

$97,302

Obsidian Entertainment

CA

Lead Technical Engineer

$96,990

SCEA

CA

Computer Artist

$95,019

LucasArts

CA

Gameplay Engineer

$95,000

LucasArts

CA

Core Engineer

$95,000

LucasArts

CA

Core Gameplay/AI Engineer

$95,000

Electronic Arts

CA

Senior Software Developer

$95,000

Activision Publishing

CA

Design Specialist

$95,000

Activision Publishing

CA

Business Operations Specialist

$95,000

Activision Publishing

CA

Senior Systems Administrator

$95,000

Activision Publishing

MN

Business Operations Specialist

$95,000

SCEA

CA

Sr. Web Site Technologist

$94,000

SCEA

CA

Lead 3d Modeler

$94,000

High Moon Studios

CA

Senior Programmer

$94,000

Blizzard Entertainment

CA

Cinematic Artist I

$93,808

Zipper Interactive

WA

Software Engineer

$93,600

Blizzard Entertainment

CA

Sr. Animator

$93,500

Ubisoft

CA

PR Mngr (Editorial Talent Rel. Dir.)

$93,011

Ubisoft

CA

PR Dir. (Editorial Talent Rel. Dir)

$93,004

Electronic Arts

TX

Senior Character Artist

$93,000

Blizzard Entertainment

CA

Sr. Cinematic Artist I

$92,310

SCEA

CA

Compiler Engineer

$92,000

SCEA

CA

Senior Game Designer

$90,824

Disney Online

CA

Software Engineer

$90,473

Electronic Arts

CA

Mngr, Global Royalty Analysis And Mgmt

$90,313

Insomniac Games

CA

Animator

$90,064

Blizzard Entertainment

CA

Senior Technical Artist

$90,001

SCEA

CA

Senior Web Technologist

$90,000

Namco Bandai Games

CA

Principal Artist

$90,000

Namco Bandai Games

CA

Senior Engineer

$90,000

Electronic Arts

CA

Lead Animator Multimedia Artist/Animator

$90,000

Electronic Arts

TX

Senior Concept Artist

$90,000

Edge Of Reality

TX

Graphic Design Specialist

$90,000

Edge Of Reality

TX

Senior Graphic Designer

$90,000

Edge Of Reality

TX

Lead Graphic Designer

$90,000

Blizzard Entertainment

CA

Computer Graphic Designer

$90,000

ArenaNet

WA

Web Programming Team Lead

$90,000

Rockstar San Diego

CA

Programmer

$89,980

Rockstar San Diego

CA

Programmer

$89,980

Electronic Arts Mobile

CA

Senior Software Engineer

$89,939

Electronic Arts Mobile

CA

Associate Producer I

$89,939

Electronic Arts

CA

Senior Designer

$89,939

Playdom

CA

Software Engineer

$89,253

Electronic Arts Tiburon

FL

Software Engineer III

$89,211

Blizzard Entertainment

CA

Sr. Cinematic Artist I

$89,107

Disney Online

FL

Software Engineer

$89,006

THQ

CA

Senior Programmer

$89,000

Electronic Arts Mobile

CA

Senior Database Engineer

$88,400

Electronic Arts Mobile

CA

Senior Database Engineer

$88,400

Electronic Arts

TX

Craft Director

$88,130

SCEA

OR

Sr. Graphics Programmer

$88,000

SCEA

CA

Software Engineer

$87,508

SCEA

CA

Sr. Sw Application Engineer

$86,356

Blizzard Entertainment

CA

Senior Software Engineer I

$86,112

Zynga Game Network

CA

Software Engineer

$85,717

Zynga Game Network

CA

Systems Engineer

$85,717

Zynga Game Network

CA

Lead QA Engineer

$85,717

Zynga Game Network

CA

Software Engineer

$85,717

Electronic Arts

CA

Software Engineer II

$85,717

Electronic Arts

CA

Software Engineer

$85,717

Electronic Arts

CA

Software Engineer II

$85,717

Electronic Arts

CA

Software Engineer II

$85,717

Electronic Arts

CA

User Experience Designer II

$85,717

Zynga Game Network

CA

Senior Database Administrator

$85,000

WMS Gaming

IL

Software Engineer

$85,000

WMS Gaming

IL

Software Engineer

$85,000

THQ

TX

Senior Programmer

$85,000

Take-Two Interactive

CA

Quality Assurance Manager

$85,000

SCEA

CA

Developer Support Engineer

$85,000

Naughty Dog

CA

Senior Production Artist

$85,000

Naughty Dog

CA

Senior Production Artist

$85,000

Just Games

CA

Bio-Physiology Specialist

$85,000

Jailed Games

CA

Bio-Physiology Specialist

$85,000

Activision Publishing

CA

Marketing Analyst – Brand

$85,000

Disney Online

FL

Software Engineer

$84,970

Electronic Arts

CA

Senior Environment Modeler

$84,798

LucasArts

CA

Character Artist

$84,115

Electronic Arts Tiburon

FL

Ass. Computer Graphics Supervisor

$84,000

Rockstar Games

NY

Senior Web Designer

$83,000

Electronic Arts

CA

Animator

$82,867

Epic Games

NC

Multimedia Software Project Specialist

$82,774

Electronic Arts

CA

Computer Graphic Artist

$82,423

SCEA

CA

Software Quality Assurance Engineer

$82,000

SOE

WA

Graphic Designer (Artist)

$81,850

Electronic Arts Tiburon

FL

Software Engineer

$81,550

Blizzard Entertainment

CA

Sr. Cinematic Artist I

$81,515

Blizzard Entertainment

CA

Cinematic Modeller

$81,307

Rockstar Games

NY

Associate Producer

$81,000

NCsoft Corporation

WA

International Development Manager

$81,000

Blizzard Entertainment

CA

Senior Software Engineer

$80,974

Ubisoft

CA

PR Mngr (Editorial Talent Rel. Dir.)

$80,800

THQ

IL

Senior Production Artist

$80,000

THQ

NY

Senior Production Artist

$80,000

SOE

CA

Oracle Database Administrator

$80,000

Insomniac Games

CA

Gameplay Programmer

$80,000

Disney Online

CA

Senior Financial Analyst

$80,000

Ubisoft

CA

Editorial Talent Relations Director

$79,960

Disney Online

CA

Senior Business Systems Analyst

$79,695

LucasArts

CA

Character Technical Director

$78,000*

Activision Publishing

CA

Software Engineer

$77,513

High Moon Studios

CA

Senior Programmer

$77,200

Disney Online

CA

Associate Technical Staff

$77,025

Disney Online

CA

Associate Technical Staff

$77,025

SCEA

CA

Technical Artist

$77,000

Electronic Arts

CA

Computer Graphic Artist

$76,814

Disney Online

NY

Flash Engineer

$75,920

Activision Publishing

CA

Programmer Analyst

$75,700

SOE

CA

Software Engineer

$75,599

Ubisoft

CA

Int’l Product Manager

$75,000

Manifest Games

CA

3d Artist

$75,000

Electronic Arts

CA

Level Designer Multi-Media Artist/Animator

$75,000

Activision Publishing

CA

Software Engineer

$75,000

Electronic Arts Mobile

CA

Senior Software Engineer

$74,984

Electronic Arts

CA

Product Designer

$74,984

Blizzard Entertainment

CA

Technical Artist

$74,900

Blizzard Entertainment

CA

Cinematic Artist

$74,401

Blizzard Entertainment

CA

Cinematic Artist

$74,400

Electronic Arts Mobile

CA

Database Administrator II

$74,110

LucasArts

CA

Character Artist

$74,100*

Electronic Arts

CA

Software Engineer

$74,100*

Crystal Dynamics

CA

Artist (Computer Graphics Animation)

$73,911

Crystal Dynamics

CA

Artist (Computer Graphics Animation)

$73,911

Gearbox Software

TX

Lead Design Specialist

$72,500

SCEA

CA

Environmental Artist

$72,451

Konami

CA

IT Data Center Manager

$72,000

Electronic Arts Tiburon

FL

Software Engineer

$72,000

Electronic Arts

CA

Computer Graphic Artist (Modeler)

$71,600

Zynga Game Network

CA

Software Engineer

$71,594

Electronic Arts

CA

Software Engineer I (Console Engineer)

$70,200*

Take-Two Interactive

CA

Software Engineer

$70,179

Electronic Arts

CA

Software Engineer I

$70,179

SOE

CA

Database Developer

$70,000

Ready At Dawn

CA

Technical Artist

$70,000

Edge Of Reality

TX

Senior Level Designer

$70,000

Double Fine Prod.

CA

3d Character Animator

$70,000

Activision Publishing

CA

Computer Graphic Artist

$70,000

SCEA

CA

Account Support Coordinator

$69,000

High Moon Studios

CA

Programmer

$68,683

High Moon Studios

CA

Programmer

$68,683

Epic Games

NC

Lead Designer

$68,411

Electronic Arts

CA

Computer Graphic Artist

$68,224

Gearbox Software

TX

Lead Design Specialist

$68,000

Blizzard Entertainment

CA

Cinematic Artist

$67,017

Petroglyph Games

NV

Game Programmer

$67,000

High Moon Studios

CA

Network Administrator

$66,600

Take-Two Interactive

NY

Director, Financial Compliance

$66,331

Activision Publishing

CA

Software Engineer

$66,000

Activision Publishing

CA

Programmer Analyst

$66,000

Electronic Arts Tiburon

FL

Software Engineer

$65,900

WMS Gaming

IL

Software Engineer

$65,000

Naughty Dog

CA

Senior Production Artist

$65,000

Naughty Dog

CA

Senior Production Artist

$65,000

Insomniac Games

CA

Gameplay Programmer

$65,000

Insomniac Games

CA

Gameplay Programmer

$65,000

Electronic Arts

CA

Lead Character Artist

$64,958

Electronic Arts

CA

Artist

$64,958

Electronic Arts

CA

Software Engineer I

$64,350*

Blizzard Entertainment

CA

3d Artist

$64,350*

Blizzard Entertainment

CA

3d Artist – Environmental

$64,350*

Blizzard Entertainment

CA

Data Analyst

$64,350*

Activision Publishing

CA

Programmer Analyst

$64,200

Ready At Dawn

CA

Senior Programmer

$63,500

Ready At Dawn

CA

Senior Programmer

$63,500

Konami

CA

Mobile Programmer

$62,500

Electronic Arts Tiburon

FL

Software Engineer II

$62,400

Electronic Arts

CA

Concept Artist

$62,400*

Blizzard Entertainment

CA

3d Artist

$62,400*

Namco Networks

CA

Network Systems Analyst

$62,109

Capcom Interactive

CA

Localization Manager

$61,235

WMS Gaming

IL

Software Engineer

$60,910

Electronic Arts

TX

Software Engineer I

$60,450*

Blizzard Entertainment

CA

Software Engineer

$60,450*

Blizzard Entertainment

CA

Associate Environmental Artist

$60,450*

Activision Publishing

CA

Software Engineer

$60,450*

Activision Publishing

CA

Software Engineer

$60,450*

Activision Publishing

CA

Software Engineer

$60,450*

Electronic Arts Mobile

CA

Development Manager

$60,029

Electronic Arts Mobile

CA

Software Engineer

$60,029

Electronic Arts Mobile

CA

Software Engineer

$60,029

Electronic Arts

CA

Software Engineer II

$60,029

Zynga Game Network

CA

Artist/Animator

$60,000

WMS Gaming

NV

Software Engineer

$60,000

Namco Bandai Games

CA

Senior Production Artist

$60,000

Double Fine Prod.

CA

Graphic Designer (Sr. Visual Effects Artist)

$60,000

Blizzard Entertainment

CA

Environmental Artist

$60,000

Activision Publishing

CA

Design Specialist

$60,000

Take-Two Interactive

MD

Software Engineer

$59,197

Nintendo

WA

Video Game Senior Artist

$59,100

LucasArts

CA

Associate Engineer

$58,500*

Electronic Arts Tiburon

FL

Computer Graphic Artist

$58,050

WMS Gaming

NV

Associate Gaming Software Engineer

$58,000

ArenaNet

WA

Network Programmer

$58,000

ArenaNet

WA

Programmer

$57,200

Namco Networks

CA

Network Engineer

$57,000

Electronic Arts

UT

Software Engineer

$56,550*

Blizzard Entertainment

CA

Level Designer

$56,305

Namco Bandai Games

CA

Senior Production Artist

$56,000

Big Fish Games

WA

Software Design Engineer In Test

$56,000

Big Fish Games

WA

Software Development Engineer In Test

$56,000

Activision Publishing

NY

Programmer Analyst

$56,000

Big Fish Games

WA

Associate Internet Marketing Specialist

$55,890

Big Fish Games

WA

Internet Marketing Specialist

$55,890

Playdom

CA

Graphic Designer

$55,000

Page 44 Studios

CA

Database Administrator

$55,000

Neversoft Entertainment

CA

User Interface Programmer

$55,000

Electronic Arts Tiburon

FL

Lighter

$54,558

Disney Online

CA

Game Designer

$53,404

Activision Publishing

CA

Programmer Analyst

$52,650*

Activision Publishing

NY

Programmer Analyst

$52,650*

Activision Publishing

NY

Programmer Analyst

$52,650*

Take-Two Interactive

CA

Graphic Designer

$52,416

Take-Two Interactive

CA

Graphic Designer

$52,416

THQ

TX

Senior Production Artist

$52,000

NCsoft Corporation

WA

Producer

$51,600

ArenaNet

WA

Localization Project Manager

$51,000

Electronic Arts

CA

Software Quality Assurance Analyst

$50,700*

Blizzard Entertainment

CA

Associate Environmental Artist

$50,700*

Blizzard Entertainment

CA

Associate Environmental Artist

$50,700*

Blizzard Entertainment

CA

Associate Cinematic Artist

$50,003

Neversoft Entertainment

CA

Entry-Level User Interface Artist

$50,000

Neversoft Entertainment

CA

Entry-Level Multimedia Artist/Sound Design

$50,000

Namco Bandai Games

CA

Senior Production Artist

$50,000

Electronic Arts

CA

Animator

$48,750*

Big Fish Games

WA

3d Animator

$47,570

Epic Games

NC

Lead Artist/Graphic Designer

$47,507

Backbone Ent.

CA

Animator

$47,500

THQ

CA

Software Engineer

$47,220

Just Games

CA

Art Manager

$47,050

Blizzard Entertainment

CA

Associate Web Scripting Engineer

$46,800*

Activision Publishing

CA

Design Specialist

$46,800*

Blizzard Entertainment

CA

Associate Community Manager

$46,500

Papaya Studio

CA

3d Character Animator

$46,000

Namco Bandai Games

CA

Production Artist

$45,000

Gearbox Software

TX

Graphic Designer

$45,000

Electronic Arts Tiburon

FL

Associate Technical Artist

$44,850*

Papaya Studio

CA

Computer Graphic Artist

$44,000

MTV/Harmonix

MA

Financial Operations Analyst

$43,680

Electronic Arts Tiburon

FL

Assistant Development Manager

$41,808

Valve Corporation

WA

Bi-Lingual Customer Support Representative

$41,080

Blizzard Entertainment

CA

Associate Software Engineer

$40,950*

Playdom

CA

Graphic Artist

$40,000

Namco Bandai Games

CA

Business Communications Editor

$40,000

High Impact Games

CA

Graphic Designer/Animator

$40,000

ArenaNet

WA

Concept Artist

$39,000

Caveat comparison shopping

Like last time, I feel compelled to point out that before you go ask for a raise because of something you read here, remember that the salaries above do not include or reveal factors like other compensation (bonuses, profit sharing), location and cost of living, seniority, job responsibilities, talent, etc.

]]>2christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=1052011-01-24T06:37:28Z2011-01-24T06:37:28ZI used to get 10+ spam user registrations every day on this blog. Not a total flood, but very annoying nonetheless. Today I get none! All thanks to a few lines of code I hacked into wp-login.php. Wanna know how? Read on.

Hacking wp-login.php

You can find, and edit, wp-login.php from within WordPress. Go to “Manage” and “Files” and just select it. Inside this file will be code for registering a new user. Depending on what version of WordPress you’re running, the registration code may look a bit different. Somewhere though you will find a block of code that reads something like:

The secret question

Obviously, the secret question should be something a spammer couldn’t immediately answer. For a programming blog like this one, it makes sense to make the secret question a programming question. For example, questions like these should weed out 99% of the spammers:

What is (5 << 2)?

How many nibbles are there in a 32-bit integer?

Etc.

It’s best if these questions do not have an answer in the first hit when entered into Google (though it is probably unlikely a spammer would ever go as far as searching for the answer to a custom security question).

Lastly, for this blog I opted for a question that helps weed out a bit more than just spammers from registering, to hopefully help raise the bar of any comments posted. You may or may not want to consider that as an option.Similar Posts:

]]>5christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=1032011-01-22T03:57:31Z2010-12-31T05:31:43ZIt’s been quite a while since I posted on the blog (a) at all, and (b) about a topic remotely related to the name of my domain and subsequently my book. Thanks to a gentle nudge from my friend and colleague Pål-Kristian Engstad I’ll try to rectify the situation with this post about how one could go about optimizing a sphere-triangle intersection test, suitable for a SIMD-implementation (such as on the PS3 SPUs).

This article isn’t so much about producing useful code, but more about the steps that you should be able to identify and perform when optimizing vector-heavy code. I also briefly discuss how to deal with separating axis tests when one of the objects is a sphere (which doesn’t have any obvious features).

Testing sphere vs. triangle

There are several different methods we can use to determine the intersection between a sphere and a triangle.

One is to “inflate” or “grow” the triangle by the sphere (forming the Minkowski sum of them) while simultaneously shrinking the sphere to a point. The test then becomes that of testing if the sphere center (the point) lies inside the spherically inflated triangle. In practical terms, this resolves into testing containment of the sphere center in one of 3 spheres (at the triangle vertices), 3 cylinders (aligned to the triangle edges), or a triangular prism (centered around the triangle itself).

Another option is to use the method of testing for a separating axis. Since this method is usually applied to (convex) polygons and polytopes only, and not for spheres, I thought it is a more interesting solution to elaborate on here, since I get to touch on two things at once.

Before continuing, let’s briefly review the separating axis test, to see where it comes from and how it works.

Justifying separating-axis testing

If two convex objects, C1 and C2, are not intersecting there must exist a pair of points P1 and P2, one from each object, such that no other pair of points are closer than these points. Given such a pair, we can insert a separating plane between P1 and P2, with normal P2 - P1. We call P2 - P1 a separating axis.

Since there is an infinite number of points on either object, which is not practical for testing, we classify points into a finite number sets we call features. We do this in such a way that all points of a feature share the same test axis for separation. This way, it is sufficient to form candidate axes for all pairs of features from each object, and see if we can find object separation on any of those axes.

If, after examining all candidate axes, we cannot find separation, we must conclude that C1 and C2 are intersecting.

For convex polyhedra (aka polytopes) features are the vertices, edges, and faces of the polytopes.

Separating axis testing for a sphere

From the above we conclude that a triangle has three kinds of features that are involved in testing: vertices (3), edges (3), and a face (1). But what about a sphere? Well, if you followed the justification of the test, it should be clear a sphere has only one feature, but it varies from test to test: the point on the sphere surface closest to each given triangle feature!

If we define the problem as testing the intersection between a triangle T, defined by the vertices A, B, and C, and a sphere S, given by its center point P and a radius r, the axes we need to test are therefore the following:

normal to the triangle plane

perpendicular to AB through P

perpendicular to BC through P

perpendicular to CA through P

through A and P

through B and P

through C and P

We can now proceed with the actual testing, below.

Testing if sphere lies outside the triangle plane

The sphere S cannot intersect the triangle T if the sphere center P lies further away from the plane of T than r units. This can be expressed as follows:

Since both d and r are positive, we can square both sides of the test; this allows us to remove the abs() too. N is only used once, so we can substitute the expression in the calculation of d, and move out the constant sqrt() expression from within the dot product of A and N:

(Here we assume that A is the feature that separates T and S. As such, if B or C are closer, in the projection, then A cannot possibly be the separating feature. B or C might be, but we will find that out when testing for B and C as the potential separating feature, so we do not need to test that case here. The idea is to not do any early outs in this code.)

Testing if sphere lies outside a triangle edge

To determine if there is a separating plane through the triangle edge AB with a normal parallel to the axis through the sphere center P and perpendicular to AB, we first need to compute the point Q on the line AB to which P projects. This Q is really just the projection of P onto the plane and must, by construction, fall onto the line AB (which is why we project P onto AB). We compute Q as follows:

AB = B - A
t = dot(P - A, AB) / dot(AB, AB)
Q = A + t * AB

(For a full justification of why Q is computed like this, see Section 5.1.2 of RTCD.)

To test separation we now need to see if Q is further than r from P and if C lies on the opposite side of the plane through AB with normal PQ.

We can get rid of the sqrt() by squaring both sides of the first inequality (as both sides are positive) and we can prepare to get rid of the division by multiplying both sides of the inequalities by the positive number e^2:

Yet again we translate there problem so the sphere is at the origin (P = 0), which, after some shuffling to remove unary minuses and making all comparisons greater-than, turns the pseudocode into the final version:

It should be noted that throughout I've been deliberately sloppy with the separation criteria (i.e. greater-than vs. greater-equal, etc) to allow for the final version of the code to perform the same comparison for several tests in parallel. (Using SIMD instructions, the sixteen scalar greater-than comparisons can be packed into four SIMD comparisons.) Also, if implemented as derived, the resulting code is not the greatest example of floating-point robustness since we have cross-multiplied and squared terms to get rid of divisions and square roots in our quest for faster code. Finally, like Knuth, I have only "proved" the pseudocode to be correct, I haven't actually tested it, so beware bugs. Caveat emptor, in other words!

Aside: there is no "separating-axis theorem"

As a side note, I feel compelled to point out that there is no such thing as a "separating-axis theorem" despite people talking about it in academic papers and even writing Wikipedia articles about it! Why? Because it is not a theorem and no one has ever proven it in print, nor would anyone attempt to, because it is a trivial consequence of the separating hyperplane theorem, which is a real proven and fundamental theorem in convex analysis! The correct vernacular is "separating-axis test." Get it right.Similar Posts:

]]>8christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=1022009-12-18T04:20:10Z2009-12-18T04:20:10ZThe previous episode of the ACM saga had a powerful organization bully a young impressionable PhD student into deleting his fully legal web pages under an implied threat of legal action if he did not comply.

This weeks episode has ACM fighting against a US government initiative for open access to research papers supported by government funding! This is a highly important initiative. ACM is trying to kill it so they, and other greedy scientific publishers, can continue to make money on those papers that you paid for with your tax money.

]]>1christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=1012009-11-24T04:01:52Z2009-11-21T20:32:06ZOK, WTF, this got me so annoyed that I had to get out of blog posting dormancy. I just went to Ke-Sen Huang’s brilliant page of conference papers on the web. Except, this time, all ACM pages (such as SIGGRAPH 2009, I3D 2009, etc) have been taken down, with the comment “This page has been removed at the request of the ACM Publications Board.”

What the fuck!?

ACM has no rights to request require(*) someone to remove links to pages on the net, and it’s unfortunate that their request was complied with.

According to this page the ACM Publications Board is run by the following nasty little censoring asses:

I strongly urge you to email them, with a cc to the ACM president Wendy Hall (wh@ecs.soton.ac.uk), to tell them what you really feel about ACM practicing censorship on Ke-Sen Huang’s pages (or anywhere)!

And if you have anything to do with ACM and SIGGRAPH, as people in the games industry tend to do, then I implore you to immediately stop your involvement and furthermore that you boycott their conferences (SIGGRAPH in particular) until they straighten their shit out.

Do not let their censoring of free information stand!

(*) Changed the wording here, because some dip-shit on Reddit can’t understand the message otherwise.

As you are aware, the computer graphics community has expressed dismay and concern about the removal of your web pages. ACM wants to make it possible for you to continue this service that the community clearly values very highly. By this message ACM grants permission for you to repost the pages, with the addition of links to the authoritative versions of the papers in the ACM Digital Library. The author's home page links may also be included, but should not be links directly to the author's version of the paper. Please post on the site that the information is being provided with the permission of the ACM. This is the solution you proposed earlier, and it is clear from the community's comments that it is the right thing to do.

As you know, the concern about your pages was ACM copyright policy with regard to links. As a result of the community discussion, ACM will institute a formal review of this portion of its copyright policy.

Please contact us with any concerns or questions.

Sincerely,

Patricia Ryan
ACM Chief Operating Officer

They are still implying Ke-Sen’s pages were infringing on ACM copyright, which is still a legally suspect claim as (1) Ke-Sen’s pages are first and foremost factual listings which are not subjected to copyright infringements, (2) as Ke-Sen’s pages were sufficiently different from ACM’s so as not to be a derivative copy, and (3) even if they were outright copies of ACM’s table of contents, “fair use” of TOCs have apparently not been tested in a court of law, so ACM has no legal leg to stand on in this issue (and in fact, a ruling against all libraries in the US seems logistically implausible):

It will be interesting to see how this truly plays out over the next several weeks, but it seems a battle has been won, though the war is likely to continue for quite some time.

Thanks to everyone who read my post and voiced your concern to the ACM Publication Board. An organization is its members, and there is no stronger means of controlling an organization than through the vote of your voice and your purse!Similar Posts:

]]>10christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=952009-08-31T19:52:38Z2009-08-31T19:52:38ZArtists get a lot of mileage out of animating the alpha reference value for the alpha test. Lets call the alpha reference value t. Then, for example, by having alpha come from a 0..1 alpha “contour” or “depth” map, artists can make things gradually appear or disappear by animating t.

What the alpha tests implements is effectively the Heaviside step function, except centered at t instead of at 0. You also find this implemented e.g. in the step() function of the Renderman shading language:

float step(float t, float x) {
return (float)(x >= t);
}

The alpha test is great for cutout alpha, but if you have a shader system that does layering within a single shader, having a “reference alpha” feature for the blending of each layer in the shader also makes a lot of sense. We can easily implement the step function in a shader as per above, but it is easy enough to support a small palette of alpha filtering functions that an artist can apply to the alpha values read from an alpha channel (or similar).

The picture below shows a few interesting functions to map an input alpha, x, into an output alpha, y, with control parameters t and w:

The last function above is the traditional step function. (The functions in blue can be ignored; they are only there to help show the function derivations.)

It is worth noting that the square pulse() function can also be implemented in terms of subtracting two step() functions:

We can use the same technique to come up with expressions for most of these functions. For example, the triangle pulse can be expressed as:

In addition to these simple functions that can be implemented in around 1-3 shader “instructions”, we can also provide smooth filtering functions. I’m not covering the smooth functions here, because, well, I don’t have a nice way of plotting them accurately!

]]>0christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=942009-08-29T22:13:40Z2009-08-29T22:13:40ZGDC — as you (should) know — is the premiere conference for game developers in the world. That said, the conference is not without flaws. In fact, you can criticize GDC for a lot of things, but one thing they’ve been reasonably good at is posting slides from the talks (as long as the speakers have bothered to submit them, that is). You can find the GDC proceedings archives here.

Another interesting games conference, is CEDEC, the Japanese equivalent to GDC. In years past, companies like Capcom have held really interesting presentations at CEDEC, and I and others have blogged about what little was released about the presentations (see links below). I say “little”, because CEDEC was never very good at posting slides. But this appears to have changed! I recently noticed that almost all of the CEDEC 2008 presentations are available for download here:

Of course, you pretty much need to speak Japanese to get much from the presentations (except from Steve’s, which had every other slide in English), but there’s always the google translator which does a good enough job that you can usually figure out what’s described.

CEDEC 2009 is imminent, and there is already a link to the 2009 archives, but nothing is yet posted there. Here’s to hoping that CEDEC will post all presentations for 2009 as well!

As a final note, some interesting CEDEC presentations from earlier years can be found on Pyramid’s technical reports page. Well worth a look.

]]>0christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=932010-02-02T04:56:31Z2009-06-08T08:51:02ZMy previous post contained some of the links I’ve gathered in the last 6 months. Here’s another post to try to clear out the backlog. This time covering gameplay and graphics.

Gameplay

I have talked before about how imperative it is to do extensive play testing (NOT focus testing, they are different concepts). For another story on the importance of doing thorough play testing and how “the customer is always right”, see the Schizoid Post Mortem (and this post too).

The Mystery Man on Film blogger posted a link to a 125-page PDF-file transcript of the original 1978 story conference between Steven Spielberg, George Lucas, and Lawrence Kasdan for Raiders of the Lost Ark. Some people will geek out over the transscript for sure. More interestingly, I think, is the Mystery Man sharing 10 valuable screenwriting lessons that he extracted from the transcript.

For cameras, one of the better systems out there is the camera system we have in the God of War games. Phil, who did all the work, spilled the beans on how our system work in his GDC 2008 talk Designing and Implementing a Dynamic Camera System. Another good camera read is The Full Spectrum Warrior Camera System. Gavin James, formerly of Naughty Dog, had a really good GDC talk several years back on the camera system used at ND. Sadly neither Google nor the piss-poor joke that is the GDC website was helpful in locating Gavin’s slides, but if you can find them they are a good read.

On the AI side, games still have really stupid looking characters that keep running after they’re stopped against a wall and other shit like that. Many of the “looks stupid” problems are due to not having top-level manager code that puts a stop to the silly stuff. Some problems are down to lack of planning and some are due to poor pathfinding.

On the pathfinding side, Paul Tozour has a nice article on pathfinding (though his pro-navigation mesh and very anti-waypoints article fails to discuss how to do nav meshes to deal with transforming terrain).

This article discusses the use of potential fields for planning and navigation in games. I think using potential fields as a basis for planning is viable. However, it is trivially obvious that potential fields alone can never serve as a basis for navigation (as that equates to hill-climbing, which is a local and not global search method). Using potential fields to bias a (non-admissible) A* search to reduce search effort is fine though.

Uncharted 2 is soon out, and looking amazing I might add, but Uncharted was pretty darn good too. Michael Abbott wrote a good piece on part of what made Uncharted good. Michael also linked to this article about the music of Uncharted.

Trophies/achievements are a big deal in games these days. Trent Polack has a good article on the topic.

Graphics

The Gran Turismo website has an article which talks about how the team hooked up four PS3’s working together to display GT4 at 3840×2160 resolution and GT5 Prologue at 240fps. Very cool indeed.

Inside the Digitial Foundry is an interesting blog that analyzes video captures of games, sometimes with neat observations. For example, in WipEout HD’s 1080p Sleight of Hand they note that WipEout HD is “operating with a dynamic framebuffer. Resolution can alter on a frame-by-frame basis”, using the hardware horizontal scaler, to control framerate and avoid tearing.

It really does seem like no link summary is complete without some shadow links. This one is no exception. First, Ignacio has a good post about Gaussian filtering of shadow maps, though his observation is (as with almost everything) previously known. This pair of forum post by Jonathan “LoneSock” Dummer discuss variants of VSM. Brian Richardson offers up some screen shots of different shadow methods in Quick Probabilistic Shadow Map Comparisons. Finally, there are so ridiculuously many shadow presentations coming out of NVidia alone, that they had to create a section just for their shadow papers.

Maciej Sinilo wrote a good post on software occlusion culling. I know of several games (from different companies) that have used software-rasterized occlusion culling methods similar to what is described.

This was an interesting post about motion compensation using image data from the previous frame.

Naty gives us a thorough schooling of the difference between deferred shading and deferred lighting, and also points out that “light pre-pass” is an ad hoc and broken version of deferred lighting, and probably not worth pursuing. Dean Calver’s old article on deferred lighting is also worth (re-)reading. And on the topic of deferred lighting, Adrian Bentley talks about the (non-)use of stenciling to accelerate same. Lastly, Adrian Stone makes an argument for deferred shading and against deferred lighting.

And for a final tool, if you don’t have the attention span to read these two very long articles (which would be tragic) try the summarize tool at Tools4Noobs. Here’s Keith’s two articles again: on marketing and on prices.Similar Posts:

]]>5christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=922009-05-24T09:33:14Z2009-05-24T09:32:39ZAs many have probably noted, I haven’t had much time or energy for updating this blog in quite a while. To rectify this I thought I’d make an effort to at least share the many interesting links that I’ve gathered since I last posted. In fact, there are so many links that I probably have to do this in parts. Let’s start with those relating to tools, process, and software.

Level editing

Some game teams develop their own level editors; definitely companies selling game engines, they really don’t have much choice. We also see (PC) developers who want to ship a level editor with their game to help build a user community. Others too make their own level editors, for various reasons. However, many games teams (including ours at Sony Santa Monica) rely on using commercial art packages like Maya or 3D Studio MAX as their level editor, to avoid reinventing the wheel.

However, we don’t necessarily need full-blown art packages or custom-designed level editors. We can find novel uses of other pieces of software for level editing. For example, there’s been occasional talk about using Google SketchUp as a level editor. It seems this is beginning to happen with e.g. the SketchUp to Hammer export plugin and with the SketchUp plugin PlayUp that allows exporting to SandBox 2 (Hammer and SandBox 2 being the level editors for Valve’s Source engine and the CryEngine 2, respectively). Some sources suggest the $495 “Pro” version of SketchUp is needed for exporting into a reasonable format (.obj), but this article points out that the .kmz files output from SketchUp are really nothing but renamed .zip files containing Collada .dae files.

Process

Joe Duffy offers a good article on being a software architect (or a programmer manager). Lots of food for thought, whether you are running a team or not.

Parallel computing is here to stay. With it, it has brought a whole set of problems that we didn’t use to have to deal with. Joe Duffy (again) has links to several articles talking about this paradigm shift.

Software

On the software side of things, Cedric Collomb compares six free image viewers. Vince Scheib points out that Input Director is an improved synergy (both being programs to share mouse and keyboard between two computers, across the network).

A tool I’ve found useful and end up using on and off is ToDoList. I’m not sure if it’s useful, but the free collaborative whiteboard at Twiddla is nevertheless pretty cool.

Symbolic (Maple, Mathematica) and numerical (MATLAB) math programs are really useful pieces of software but they cost way too much for the occasional tasks I need them for. Fortunately there are free alternatives. Instead of MATLAB, try Scilab or Octave. Instead of Maple and Mathematica, try Maxima (a derivative of the CAS granddaddy Macsyma). Wikipedia has a nice overview of other free and commercial computer algebra systems.

To finish things off, for some awesome out of the box thinking read this bank robber news story.Similar Posts:

]]>7christerhttp://realtimecollisiondetection.net/blog/http://realtimecollisiondetection.net/blog/?p=912009-02-07T21:10:42Z2009-01-02T07:30:30ZThere are many things that can kill the frame rate in a modern game, and particles are up near the top of the list of causes. A key contributing factor is that particles are subject to a lot of overdraw that is not present in your opaque geometry.

The reason for the increase in overdraw is that for particles we tend to have lots of individual primitives (usually quads) that are overlapped, perhaps to mimic effects like fire or smoke. Normally each particle primitive is translucent (alpha-blended) so the z-buffer is not updated as pixels are written and we end up rendering to pixels multiple times. (In contrast, for opaque geometry we do write to the z-buffer, so between a possible z-prepass, sorting objects front-to-back, hierarchical z-culling on the GPU, and normal depth testing, the result is that we have very little overdraw.)

Overdraw, in turn, leads to increased uses of both fillrate (how many pixels the hardware can render to per second) and bandwidth (how much data we can transfer to/from the GPU per second), both of which can be scarce resources.

Of course, overdraw is not the only reason particles can slow your frame rate to a crawl. We can also get bitten by other problems, like setting too much state for each particle or particle system.

What to do?

OK, let’s say we all agree that particles can cause a lot of problems. What to do? Fortunately there are lots of things that can be done to optimize the rendering side of a particle system. For whatever reason, few of these are discussed in books or articles, so I thought I’d list out a few things we can do. Feel free to add more suggestions as comments.

Use opaque particles. For example, make smoke effects really thick so (some or all of) the particle billboards can be opaque, with cutout alpha. For some particles, like shrapnel, rocks, or similar, use lightweight geometry particles instead of sprites with alpha borders.

Use richer particles. Put more oomph in a single particle sprite so we need fewer of them. Use flipbook textures for creating billowing in e.g. fire and smoke, rather than stacking sprites.

Reduce dead space around cutout-alpha particles. Use texkill to not process the transparent regions of the sprite. Alternatively, trim away the transparent areas around the particle, using an n-gon fan instead of just a quad sprite. (but beware lowered quad (2×2 pixel block) utilization when increasing the triangle count, or becoming vertex bound in the distance, so LOD from fan to a quad sprite in the distance).

Cap total amount of particles. Use hardware counters on the graphics card to count how many particle pixels have been rendered and stop emitting or drawing particles when passing a certain limit (which can be set dynamically).

Use frequency divider to reduce data duplication. We can reduce bandwidth and memory requirements by sharing data across particle vertices using the frequency divider, instead of through data duplication across vertices. (Arseny Kapoulkine described this well in Particle rendering revisited.)

Reduce state changes. Share shaders between particles. We can make this happen by e.g. dropping features for distant particles (such as dropping the normal map as soon as possible).

Reduce the need for sorting. Rely on additively or subtractively blended particles where possible. E.g. additive particles can be drawn in any order, so we can sort them to e.g. reduce state changes instead of sorting on depth (as is likely needed for normal alpha-blended particles).

Draw particles after AA-resolve. Most games today use multisampled antialiasing (MSAA), drawing to a 2x or 4x MSAA buffer. These buffers must be resolved (with an AA-resolve pass) into a non-MSAA buffer before display. Due to the way MSAA works, we still run the pixel shader equally many times whether we draw particles before or after the AA-resolve, but by drawing particles after the AA-resolve we drastically reduce frame buffer reads and writes, ROP costs, etc.

Draw particles into a smaller-resolution buffer. We can also draw particles into a separate, smaller-resolution buffer (smaller than the frame buffer or the AA-resolved buffer). The exact details vary depending on e.g. whether you use RGBA or FP16 frame buffers, but the basic idea is the following. First we draw the opaque geometry into our standard frame buffer. We then shrink the resulting corresponding z-buffer down to 1/4 or 1/16 size, then draw particles to 1/4 or 1/16 size frame buffer using the smaller z-buffer. After we’re done, we scale the smaller frame buffer back up and composite it onto the original frame buffer. (Some interesting details I’ve left out are how exactly to perform the z-buffer shrinking and the composite steps.)

Use MSAA trick to run pixel shader less. On consoles (and on PC hardware if drivers allowed it) you can tell the GPU to treat, say, an 800×600 frame buffer as if it were a 400×300 (ordered) 4xMSAA buffer. Due to the way MSAA works, this has the effect of running the pixel shader only once per 2×2 pixels of the original buffer, at the cost of blurring your particles equivalently much. (Though you still get the benefit of antialiasing at the edges of the particles.)

Generate particles “on chip.” On newer (PC) hardware we can use geometry shaders to generate particles on the GPU instead of sending the vertex data from the CPU. This saves memory and bandwidth.

We can also attempt some more esoteric stuff, like:

Compose particles front-to-back premultiplied-alpha style. Using premultiplied alpha (which is associative) we can blend particles front-to-back instead of the normal back-to-front ordering. The idea here is to use the front-to-back drawing to fill in depth or stencil buffer when alpha has become (near) solid and ultimately stop drawing particles all together (when they no longer contribute much to the visual scene, off in the distance).

Group particles together into one particle entity. Instead of drawing two overlapping particles individually, we can form a single (larger) particle that encompasses the two particles and performs the blending of the two particles directly in the shader. This tends to reduce the amount of frame buffer reads we do (as we now only have to blend one particle) but it can also increase it (if the single particle covers much more area than the union of the two original particles).

My original intent was to categorize all these items in terms of what they were saving (overdraw, fillrate, ROP, pixelshader ALU, etc.) but it was a little bit more effort than I had time for to create the 2D matrix of feature vs. savings this would create. Hopefully it’s still clear what each bulletpoint-ed task would achieve.

All in all, the above’s a long list, but I’m sure I left something out, so please comment. Also, what’s your favorite “trick?”Similar Posts: