GAME JOBS
Latest Blogs
spacer View All     Post     RSS spacer
 
June 7, 2013
 
Postmortem: Game Oven's Bam fu [1]
 
Tenets of Videodreams, Part 3: Musicality
 
Post Mortem: Minecraft Oakland
 
Free to Play: A Call for Games Lacking Challenge [3]
 
Cracking the Touchscreen Code [4]
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
June 7, 2013
 
YAGER Development
Senior Game Systems Designer (f/m)
 
RealTime Immersive, Inc.
Animation Software Engineer
 
Havok
Havok- 3D Software Engineers (Relocate to Europe)
 
Social Point
Senior Game Developer
 
Treyarch / Activision
Senior Environment Artist
 
Sony Computer Entertainment America - Santa Monica
Senior Staff Programmer
spacer
Latest Press Releases
spacer View All     RSS spacer
 
June 7, 2013
 
Bootcamp
 
Indie Royale Presents The
Arclight Bundle
 
A space hero among us
 
Make Family History! 7
Grand Steps: What
Ancients...
 
Who is Harkyn?
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
 
Blogging 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
How Kinect's brute force strategy could make Xbox One a success
image
Microsoft's official stance on used games for Xbox One
image
Gearbox's Randy Pitchford on games and gun violence
image
Why you can't trade items in MMOs anymore


   
 
Comments


none
 
Comment:
 




 
UBM Tech