Jump to content
  • Advertisement
Sign in to follow this  
NYAndrew24

C# Mud and persistence to DB vs serialization

This topic is 4607 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So after searching online for some C# Mud libs out there, I was quite disappointed with the few that I ran across and that they were not that great at all. I set out to write my own (I have quite a bit of time on my hands for a few weeks) - obviously multithreaded, will allow for a web app to connect to it, etc. I kinda ran across an issue - saving, or rather, persisting players, items, objects in the world. I'm not sure what's better - to use some object persistence tool such as say Hibernate (or even simpler - just write my own, simple one) to persist objects into a database (MySql) or use the serializer that .NET provides. What would you guys suggest?

Share this post


Link to post
Share on other sites
Advertisement
If you will want to query information out of your game state, such as player stats for your website, then it would be easier to persist to some sort of normalized database.

If all you are concerned about is saving and loading gamestate, then I would use the serialization services provided by .NET. I don't know much about .NET's serialization implementation, but I suppose that there's a chance that if you change the structure of the serialized object it may no longer be compatible with state you had serialized from previous versions of the object. It may even change in later versions of the .NET framework. With python's pickle this is a concern, as it doesn't guarantee that future versions of python will remain back-compatibile with old pickles.

A hybrid approach might be a good solution as well. In the database, keep fields representing the data you are interested in performing queries on, such as character level, gold pieces, hit points, etc. Also include a binary field that is reserved for the serialized data. This would be more work than the serialized approach, and somewhat less work than not serializing at all.

I don't know about the hybernate software, so I can't comment on that.

Share this post


Link to post
Share on other sites
Thanks for the suggestion. I think I'll stick to the hybrid approach. Hibernate is an industrial tool for object persistence to a DB. Its very good for big (or small) web apps, though I'm thinking that its too much unecessary overhead for a MUD OS.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!