iHaveNet.com
Video Games: Game Optimization for Modern Hardware
Online Breaking News Headlines Single Source to Headlines Breaking News Current Events Top Stories. Find out what is happening in News & the World. Check out iHaveNet.com for the latest news & current events articles plus Movie Reviews, Wolfgang Puck Recipes, NFL Previews Analysis and Politics. Your Single Source to News Articles, Current Events & Reviews.
  • HOME
  • WORLD
    • Africa
    • Asia Pacific
    • Balkans
    • Caucasas
    • Central Asia
    • Eastern Europe
    • Europe
    • Indian Subcontinent
    • Latin America
    • Middle East
    • North Africa
    • Scandinavia
    • Southeast Asia
    • United Kingdom
    • United States
    • Argentina
    • Australia
    • Austria
    • Benelux
    • Brazil
    • Canada
    • China
    • France
    • Germany
    • Greece
    • Hungary
    • India
    • Indonesia
    • Ireland
    • Israel
    • Italy
    • Japan
    • Korea
    • Mexico
    • New Zealand
    • Pakistan
    • Philippines
    • Poland
    • Russia
    • South Africa
    • Spain
    • Taiwan
    • Turkey
    • United States
  • USA
    • ECONOMICS
    • EDUCATION
    • ENVIRONMENT
    • FOREIGN POLICY
    • POLITICS
    • OPINION
    • TRADE
    • Atlanta
    • Baltimore
    • Bay Area
    • Boston
    • Chicago
    • Cleveland
    • DC Area
    • Dallas
    • Denver
    • Detroit
    • Houston
    • Los Angeles
    • Miami
    • New York
    • Philadelphia
    • Phoenix
    • Pittsburgh
    • Portland
    • San Diego
    • Seattle
    • Silicon Valley
    • Saint Louis
    • Tampa
    • Twin Cities
  • BUSINESS
    • FEATURES
    • eBUSINESS
    • HUMAN RESOURCES
    • MANAGEMENT
    • MARKETING
    • ENTREPRENEUR
    • SMALL BUSINESS
    • STOCK MARKETS
    • Agriculture
    • Airline
    • Auto
    • Beverage
    • Biotech
    • Book
    • Broadcast
    • Cable
    • Chemical
    • Clothing
    • Construction
    • Defense
    • Durable
    • Engineering
    • Electronics
    • Firearms
    • Food
    • Gaming
    • Healthcare
    • Hospitality
    • Leisure
    • Logistics
    • Metals
    • Mining
    • Movie
    • Music
    • Newspaper
    • Nondurable
    • Oil & Gas
    • Packaging
    • Pharmaceutic
    • Plastics
    • Real Estate
    • Retail
    • Shipping
    • Sports
    • Steelmaking
    • Textiles
    • Tobacco
    • Transportation
    • Travel
    • Utilities
  • WEALTH
    • CAREERS
    • INVESTING
    • PERSONAL FINANCE
    • REAL ESTATE
    • MARKETS
    • BUSINESS
  • STOCKS
    • ECONOMY
    • EMERGING MARKETS
    • STOCKS
    • FED WATCH
    • TECH STOCKS
    • BIOTECHS
    • COMMODITIES
    • MUTUAL FUNDS / ETFs
    • MERGERS / ACQUISITIONS
    • IPOs
    • 3M (MMM)
    • AT&T (T)
    • AIG (AIG)
    • Alcoa (AA)
    • Altria (MO)
    • American Express (AXP)
    • Apple (AAPL)
    • Bank of America (BAC)
    • Boeing (BA)
    • Caterpillar (CAT)
    • Chevron (CVX)
    • Cisco (CSCO)
    • Citigroup (C)
    • Coca Cola (KO)
    • Dell (DELL)
    • DuPont (DD)
    • Eastman Kodak (EK)
    • ExxonMobil (XOM)
    • FedEx (FDX)
    • General Electric (GE)
    • General Motors (GM)
    • Google (GOOG)
    • Hewlett-Packard (HPQ)
    • Home Depot (HD)
    • Honeywell (HON)
    • IBM (IBM)
    • Intel (INTC)
    • Int'l Paper (IP)
    • JP Morgan Chase (JPM)
    • J & J (JNJ)
    • McDonalds (MCD)
    • Merck (MRK)
    • Microsoft (MSFT)
    • P & G (PG)
    • United Tech (UTX)
    • Wal-Mart (WMT)
    • Walt Disney (DIS)
  • TECH
    • ADVANCED
    • FEATURES
    • INTERNET
    • INTERNET FEATURES
    • CYBERCULTURE
    • eCOMMERCE
    • mp3
    • SECURITY
    • GAMES
    • HANDHELD
    • SOFTWARE
    • PERSONAL
    • WIRELESS
  • HEALTH
    • AGING
    • ALTERNATIVE
    • AILMENTS
    • DRUGS
    • FITNESS
    • GENETICS
    • CHILDREN'S
    • MEN'S
    • WOMEN'S
  • LIFESTYLE
    • AUTOS
    • HOBBIES
    • EDUCATION
    • FAMILY
    • FASHION
    • FOOD
    • HOME DECOR
    • RELATIONSHIPS
    • PARENTING
    • PETS
    • TRAVEL
    • WOMEN
  • ENTERTAINMENT
    • BOOKS
    • TELEVISION
    • MUSIC
    • THE ARTS
    • MOVIES
    • CULTURE
  • SPORTS
    • BASEBALL
    • BASKETBALL
    • COLLEGES
    • FOOTBALL
    • GOLF
    • HOCKEY
    • OLYMPICS
    • SOCCER
    • TENNIS
  • Subscribe to RSS Feeds EMAIL ALERT Subscriptions from iHaveNet.com RSS
    • RSS | Politics
    • RSS | Recipes
    • RSS | NFL Football
    • RSS | Movie Reviews

Game Optimization for Modern Hardware
Mark Randel

HOME > VIDEO GAME REVIEWS

 

SocialTwist Tell-a-Friend

Although we seem to have hit a ~3 GHz limit in processor speed, Moore's law may still be holding as more and more cores are added to a processor at this speed. As processors have gotten faster, memory latency has gotten longer over time. This means that understanding how the architecture you are working on accesses memory is critical to the execution speed of your program, and for the first time, may be even more important than the algorithms themselves.

Let me give you an example: For collision detection with actors that move in the world, every level in Ghostbusters: The Video Game (and the Infernal Engine) is partitioned with a BSP tree. Each node in the tree contains a linked list of actor pointers that are in that node. Note that actors may not be in the leaves of the tree, but may be pushed up until one node fully contains the actor.

Here is a simplified example of what our world and actors looked like in previous generations of code:

class CActor {

.

.

.

CVector wPos;

float wRadius;

.

.

.

CActor *nextActorInBSP;

.

.

.

};

struct SBSPNode {

float a,b,c,d;

SBSPNode *left,*right;

CActor *firstActorInBSP;

};

void raytraceActorsInNode(SBSPNode *node,CVector *wRayStart,CVector *wRayEnd) {

CActor *a = node->firstActorInBSP;

while (a != 0) {

checkCollision(&a->wPos,a->wRadius,wRayStart,wRayEnd);

a = a->nextActorInBsp;

}

}

So this is a very simple code example running through a linked list of actors and performing a simplified ray trace on them. The problem with this code, though, is execution speed. While this type of code worked well in previous years, it does not perform well on modern hardware due to the potential of cache misses running through a linked list. Certain hardware can have over a 500 clock tick penalty for an L2 cache miss and a 37 clock penalty for an L1 miss. Neither is acceptable if you want to run your code at 3 GHz. To ensure we run at maximum speed, we rearrange our structures as follows:

New BSP structure:

struct SActorPosRad {

CActor *actor;

CVector wPos;

float wRadius;

};

struct SBSPNode {

float a,b,c,d;

SBSPNode *left,*right;

Array actorList;

};

void raytraceActorsInNode(SBSPNode *node,CVector *wRayStart,CVector *wRayEnd) {

int i;

for (i =0; i wPos,a->wRadius,wRayStart,wRayEnd);

}

}

The array template is a very simple dynamic memory allocator. As long as actors don't move very far in one frame of a game, using a template array here mostly doesn't change from frame to frame. Insertion and deletion from the array is treated as a linear list, and the array is pre-allocated to a minimum size, so that allocation (and de-allocation) will almost never happen. This could even be a static-sized array, with actors overflowing this node pushed up in the tree.

This is a case where we will have to unlearn what has been taught in computer science classes for decades; the use of a linked list may not be the fastest way to store data in memory anymore. We're violating multiple rules we've been taught -- not using a linked list, and using a linear search for inserting and deleting actors in this list. Linear searches are slow, right?

Linear searches (if used properly) can be extremely fast due to the memory access pattern. The cache line on a modern system is anywhere from 64 bytes to 128 bytes in size. That means that, to read any memory location in that vicinity, the memory around that will also have to be read in. So you have free full-speed access to the data around you as well. If you are constantly hopping around in memory, like a linked list does, you will be stalled while the memory around your pointer is brought in as it is de-referenced.

So, while linear searches may not be applicable for all types of data, they can certainly be used for tight game code.

 

Mark Randel is the president and chief technology officer of Terminal Reality Inc., developer of Ghostbusters: The Video Game

 

Available at Amazon.com:

The Saboteur

Assassin's Creed II

Assassin's Creed: Brotherhood

Mario vs. Donkey Kong Mini-Land Mayhem!

Time Crisis: Razing Storm

ArcaniA: Gothic 4

 


Videogaming & Video Game Reviews

  • 'Homefront'
  • Game Optimization for Modern Hardware
  • 'PixelJunk Shooter 2: The Belly of the Beast'
  • Pixels and Sand
  • Sneak Peek at DC Universe Online With Chris Cao
  • Thought Leaders: Orion Granatir
  • Combat Duality in 'Dragon Age II'
  • 'Jikandia: The Timeless Land'
  • Exclusive Look at Homefront
  • GDC 2011: Sneak Peek of Battlefield 3
  • Talking Portal 2 With Valve Software's Erik Wolpaw
  • Nathan Camarillo of Crytek Talks Crysis 2 and CryEngine 3
  • 'Two Worlds II'
  • 'Dungeons'
  • Peter Molyneux Talks Fable III and Commitment to PC Gaming
  • There's an App for That Game
  • Talking Tech Tactics With Football Manager 2011
  • 'Kingdom Hearts Re:coded'
  • 'Dead Space 2'
  • 2K Sports Announces 'NHL 2K11' for Apple iPad
  • 'Dead Space' for iOS
  • Why are Video Games for Girls so Lame?
  • The Muddy Beauty of DiRT 2
  • The Reality of Indie Game Development
  • Using Artificial Intelligence in Game Development
  • Top 10 Most Anticipated Video Games of 2011
  • Need for Speed Drives Back to Roots
  • Developing and Optimizing Games for Netbooks
  • 'Bejeweled 3'
  • Rolling Thunder, Analytics and Performance Drive Need for Speed World
  • Who You Gonna Call? Ghostbusters Challenges
  • Dude! Who Killed My First-person Shooter?
  • Racing to the Finish Line: Chris Southall Talks Total War and Sonic
  • The Force Remains Strong with LEGO Star Wars III: The Clone Wars
  • Unreal Engine 3 Brings Chadam to Life on Web Video
  • 'Pac-Man Championship Edition DX'
  • 'Infinity Blade'
  • TRON: Evolution -- Game Developers Go Hollywood
  • EA Sports Moves Graphics-rich Gaming Online
  • Humble Opinions: From The Sims to Indie Games
  • Meet Mr. Industrial: Justin Lassen's Music Machine
  • 'Assassin's Creed: Brotherhood'
  • 'Mario Vs. Donkey Kong: Mini-Land Mayhem'
  • 'Time Crisis Razing Storm'
  • 'Arcania: Gothic 4'
  • 'Disney Epic Mickey'
  • 'Final Fantasy: The 4 Heroes of Light'
  • 'Ace Combat: Air Assault'
  • 'Game Dev. Story'
  • Epic Games Unveils 'Gears of War 3' Multiplayer Details
  • 'Castlevania: Lords of Shadow'
  • 'Sonic the Hedgehog 4: Episode 1'
  • 'Amnesia: The Dark Descent'
  • 'Enslaved: Odyssey to the West'
  • 'Valkyria Chronicles II'
  • 'Dead Rising 2'
  • 'Kingdom Hearts Birth by Sleep'
  • 'Halo: Reach'
  • 'Mafia II'
  • 'Scott Pilgrim' vs. Its Video Game References
  • 'Madden 11'
  • 'Metroid: Other M'
  • 'APB'
  • 'Scott Pilgrim vs. The Games'
  • Burn Zombie Burn
  • Scott Pilgrim Vs. The World: The Game
  • Starcraft 2
  • Dolby's Axon Software
  • What Video Games Could Teach
  • Valkyria Chronicles II
  • Metal Gear Solid: Peace Walker
  • Monkey Island 2: LeChuck's Revenge
  • Clash of the Titans
  • DeathSpank
  • Alien Spawn
  • Halo: Combat Evolved - Failure is an Option
  • Sin and Punishment: Star Successor
  • Medal of Honor
  • Singularity
  • ModNation Racers
  • Minecraft
  • 3D Dot Heroes
  • Eversion
  • Backbreaker
  • The Sims 3: Ambitions
  • Aquaria
  • Lost Planet 2
  • Star Trek Online
  • Coming of Age in Video Games
  • Putting Down Video Games And Picking Them Back Up Again
  • Government Should Stop Kids From Buying Violent Video Games
  • Video Games Don't Cause Children to be Violent
  • 'Monster Hunter Tri' (Wii)
  • 'Dead to Rights: Retribution' (Xbox 360)
  • Deus Ex Focuses on the Play
  • 'Sam & Max Season 3: The Penal Zone'
  • Sleep is Death
  • 'FarmVille': A Love Story
  • 'Blur'
  • 'Battlefield: Bad Company 2'
  • 'Assassin's Creed II: Bonfire of the Vanities'
  • Assassin's Creed II - Xbox 360
  • 'Avatar: The Game'
  • 'WWE SmackDown vs. Raw 2010' - Xbox 360
  • NCAA Basketball 10 - PS3
  • Disney Jonas - DS
  • 'God of War' Collection - PS3
  • How to Beat the Hydra in 'God of War' - PS3
  • 'Left 4 Dead 2' - Xbox 360

 

Video Games: Game Optimization for Modern Hardware

Copyright © 2011 Studio One Networks. All rights reserved.

 

Recommend

Brought to you by Visual Adrenaline

This editorial content is brought to you by webroot

Search Powered By Google

Google Search   

Your Favorite Comic Strips Online

Daily Comics & Your Favorite Comic Strips Online

Your favorite comics strips Animal Crackers, Annie, Bound & Gagged, Brenda Starr, Brewster Rockit: Space Guy, Broom-Hilda, Dick Tracy, Gasoline Alley, Gil Thorp, Housebroken, Loose Parts, The Middletons, Pink Panther, Raising Hector, Sylvia, 9 to 5, Bliss, Bottom Liners, Love Is..., Pluggers all online at ComicStripNation.com

ADVERTISEMENT

Advertisement

ADVERTISEMENT

Advertisement

Your Ad Here
Your Ad Here
  • HOME
  • WORLD
  • USA
  • BUSINESS
  • WEALTH
  • STOCKS
  • TECH
  • HEALTH
  • LIFESTYLE
  • ENTERTAINMENT
  • SPORTS

Video Games: 'The Saboteur' - Xbox 360

 

  • Services:
  • RSS Feeds
  • Shopping
  • Email Alerts
  • Site Map
  • Privacy