My Message close
GAME JOBS
Latest Blogs
spacer View All     Post     RSS spacer
 
May 23, 2013
 
Xbox One: a flawed plan, well executed
 
Letting the Player Find the Fun
 
Using Small Studios As Stepping Stones In Your Career [3]
 
Maturity, Challenge, Art and Games
 
Combat Analysis: Guacamelee [1]
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
May 23, 2013
 
2K Games
Tools Programmer - 2K Games
 
2K Games
Graphics Programmer - 2K Games
 
2K Games
Engine Programmer - 2K Games
 
GREE International
Senior Product Manager, Growth and Revenue
 
GREE International
Business Intelligence Data Analyst
 
Synergy Blue
3D Artist / Animator
spacer
Latest Press Releases
spacer View All     RSS spacer
 
May 23, 2013
 
Ragnarök 2 : Legend
of the Second dé...
 
Chillingo launches Dead
Ahead and Zombie Fish
Tank...
 
DONKEY KONG COUNTRY
RETURNS IS BACK
 
SILICON STUDIO ANNOUNCES
YEBIS 2 MIDDLEWARE FOR...
 
ASL-News, Mac:
Brainjogging for Kids is
shipping
spacer
About
spacer Editor-In-Chief:
Kris Graft
Blog Director:
Christian Nutt
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Mike Rose, Kris Ligman
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
Education:
Gillian Crowley
 
Contact Gamasutra
 
Report a Problem
 
Submit News
 
Comment Guidelines
Sponsor

 
Using loads of particle effects without fragmenting your memory
Using loads of particle effects without fragmenting your memory Exclusive
 

October 23, 2012   |   By Staff

Comments Post A Comment

More: Console/PC, Programming, Exclusive





If you're making a game that uses a lot of short-lived particle effects, you run the risk of fragmenting your available memory. Shooters and action games often run into this problem, and developers need to be careful not to let these small visual effects hinder their game's performance.

As Radical Entertainment's senior rendering coder Keith O'Conor puts it, "Fragmentation happens when many small pieces of memory are allocated and freed in essentially random order, leading to a 'Swiss cheese' effect that limits the amount of contiguous free memory."

Radical's Prototype 2 was especially susceptible to this problem, as the open world action game often needed to have numerous explosions, sparks, and blood effects going off at any one time. Thus, O'Conor and the rest of the team had to come up with some strategies to make sure the game could support those effects and regulate its precious memory.

"Whenever possible, we use static segmented memory pools (allocated at start-up) to avoid both fragmentation and the cost of dynamic allocations," O'Conor said in the latest Gamasutra feature. "The segments are sized to match the structures most commonly used during particle system allocations. Only once these pools are full is it necessary to perform dynamic allocations, which can happen during particularly heavy combat moments or other situations where many particle effects are being played at once.

"Our effects system makes multiple memory allocations when a single particle system is being created. If any of these fail (because of fragmentation, or because the heap is just full), it means the effect cannot be created. Instead of half-creating the effect and trying to free any allocations already made (possibly fragmenting the heap further), we perform a single large allocation out of the effects heap.

"If this succeeds, we go ahead and use that memory for all the allocations. If it fails, we don't even attempt to initialize the effect, and it simply doesn't get played. This is obviously undesirable from the player's point of view, since an exploding car looks really strange when no explosion effect is played, so this is a last resort. Instead, we try to ensure that the heap never gets full or excessively fragmented in the first place."

To avoid that fragmentation, the team partitioned its various effects into "stores" based on their various types. The team had stores for explosions, ambient effects, bullet effects, and more. By dividing effects into categories, the team could more easily control how many of each effect type could go off at once.

With these and other rendering techniques, the team was able to streamline Prototype 2's memory allocation and ensure that the game could pull off its explosive, action-heavy visuals. To learn more about how Radical refined its effects technology for Prototype 2, be sure to check out O'Conor's full feature, which is now live on Gamasutra.
 
 
Top Stories

image
A Guacamelee! combat design analysis
image
Blog: I took my Ouya game to retail, and here's what happened
image
'This model of game making is so fundamentally broken.'
image
Opinion: Xbox One is a desperate prayer to stop time


   
 
Comments


none
 
Comment:
 




 
UBM Tech