Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO
My Message close
Latest News
spacer View All spacer
 
February 10, 2012
 
DICE 2012: Activision's Hirshberg believes creative people should lead companies
 
DICE 2012: EA's Galda says television's episodic model is the future of game narrative
 
GDC 2012 reveals Super Mario 3D Land, Resident Evil Revelations postmortems
spacer
Latest Features
spacer View All spacer
 
February 10, 2012
 
arrow Virtual Goods - An Excerpt from Social Game Design: Monetization Methods and Mechanics [1]
 
arrow Principles of an Indie Game Bottom Feeder [21]
 
arrow Postmortem: CyberConnect 2's Solatorobo: Red the Hunter [1]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
February 10, 2012
 
The Parable of Feudal Japan [1]
 
Audio Passes: Success Through Layering
 
What the current RPG can learn from Diablo 1
 
Double Fine's Kickstarter Windfall: Will Patronage Supplant Traditional Game Publishing? [10]
 
The Principles of Game Monetization
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
February 10, 2012
 
Retro Studios
RETRO CONTRACT - Environmental Artist
 
Retro Studios
RETRO - CONTRACT AI Engineer
 
Adhesive Games
UI Technical Artist
 
Adhesive Games
Technical Artist
 
Adhesive Games
Senior Network Engineer
 
Adhesive Games
Senior Engine Programmer
spacer
Latest Press Releases
spacer View All     RSS spacer
 
February 10, 2012
 
Eufloria HD App for iPad
Arrives on the App Store
 
PARAMOUNT PICTURES AND
NAMCO BANDAI TEAM UP
FOR...
 
EA AND 38 STUDIOS SHIP
ONE OF THE MOST HIGHLY...
 
Indie Royale's
Valentine's Bundle is
live
 
SUPPORT YOUR FAVORITE
NARUTO NINJA TEAM IN
NARUTO...
spacer
About
spacer Editor-In-Chief/News Director:
Kris Graft
Features Director:
Christian Nutt
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Frank Cifaldi, Tom Curtis, Mike Rose, Eric Caoili, Kris Graft
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
 
Feature Submissions
 
Comment Guidelines
Sponsor
News

  Feature: 'A Templated C++ Attribute Library for Object Persistence and Export' Exclusive
by Eric Caoili [PC, Exclusive]
Post A Comment
Share on Twitter
Share on Facebook RSS
 
 
June 4, 2008
 
Feature: 'A Templated C++ Attribute Library for Object Persistence and Export'

In this in-depth technical piece, coding veteran McNickle explains how experience on the Deer Hunter series led him to create a library for managing and exporting important variables.

During Deer Hunter 2003's development, McNickle found himself having to explain a reoccurring bug and the process needed to correct it whenever a new programmer would come across it:

"Essentially, any time a new variable was added to the base actor class or one of its derived classes, the programmer had to manually add support in the archiving routines to persist this data.

The problem was further complicated because it was not desirable to serialize all variables during a saved game, and the logic determining which variables should be serialized when was poorly understood.

Questions such as 'Should the variable be saved during a saved game?', 'Should it be serialized to the network stream?' and 'Is the variable state managed by the server, or is it client authoritative?' had to be answered. They were typically understood at the time the variable was added, but when being reviewed by another programmer, the answers to these questions had to be re-discovered."


Frustrated with having to repeatedly fix the problem and seeking to develop an elegant, automated, and less error-prone solution, McNickle envisioned a system fulfilling a list of specific requirements:
  1. It must have minimal impact on the existing code.
  2. It must be simple to expand without changing the code of the management system. In other words, it has to be generic, and it has to support complex types.
  3. It must have a small memory footprint. (Thankfully, we were only developing for the PC, so there was some wiggle room.)
  4. It must provide a simple, easily discernable means for the programmer who implemented the variable to state how the system and the user should interact with it, if at all. Ideally, this means could be adjusted dynamically.
  5. It must provide a way to query an object for all of its attributes that are to be exposed or serialized and, if possible, how and when it should be serialized.
  6. It must provide a way to automate the serialization.
  7. It must support altering the values of these known variables.
  8. And finally, it must not require that the value of the variable be changed through any particular mechanism, or be notified of any such change, while always being aware of the exact value of a known attribute at any time.

You can now read the full feature including source code on McNickle's solution for " A Templated C++ Attribute Library for Object Persistence and Export." (no registration required, please feel free to link to this feature from other websites).

 
   
 
Comments


none
 
Comment:
 




 
UBM Techweb
Game Network
Game Developers Conference | GDC Europe | GDC Online | GDC China | Gamasutra | Game Developer Magazine | Game Advertising Online
Game Career Guide | Independent Games Festival | Indie Royale | IndieGames

Other UBM TechWeb Networks
Business Technology | Business Technology Events | Telecommunications & Communications Providers

Privacy Policy | Terms of Service | Contact Us | Copyright © UBM TechWeb, All Rights Reserved.