Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Since the core application might be abstracted from the presentation layers, most core game objects would have to be serializable to and from a stream. This implies marking an object with SerializableAttribute at the least, so that the member data can be properly serialized. However, this default serialization would mark each piece of data as its variable name, and the variable name could be less than desirable at times. Of course, I could always rename the variable name, but there are times where I probably cannot use my preferred name.

I then search around in the framework to see if there's any serialization attribute where I can actually specify the name I want the variable to be serialized as. Surprisely I found none, except for xml serialization. Those attributes can't be carried over to soap nor binary serialization, so I had to forgo those.

Not finding such an attribute, I decided to create my own, as well as helpers to serialize all marked variables in a class. Now, I would have to inherit from ISerializable, and implement both the constructor and GetObjectData methods to make a class serializable.

I'll explain the reasoning for custom names in my next post...
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!