Click here to Skip to main content
15,886,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make a text based MMORPG in C# and ASP .NET. The game will involve constant, continuous updates for example the character/skill experience a player has. My question is, how would I store/update those skill experience variables?

Would I update the SQL Server database every single time a change is made to the "experience points" variables or would I only update the database at certain time intervals? What state management would be best to store such data that is continously updating and is private to each user? How might the requirements/techniques need to be changed if the website/web application becomes extremely popular with heavy traffic?

Thanks for any input!
Posted
Comments
I.explore.code 8-Oct-12 17:30pm    
I know its probably not the best parallel, but I am thinking the way chat applications work say on facebook. Basically, its a server socket program that's sat listening at a specific port, clients (aka gamers) connect to that server address and start sending messages i.e. playing game.

The server socket creates a tunnel directly with each client and also keeps a track of which clients are still in the game. Thinking of Texas Poker on Facebook. Once you have a sessioned tunnel created, you can use customised commands sent over TCP/IP to cause a certain action to happen. I would really love to see what others have to say on this.
FourCrate 11-Oct-12 17:47pm    
Thanks for your reply :)

1 solution

Depends on the hardware you have available, and the number of users you are going to have.

You *could* have a layer sitting in-between your app and db which stores certain things inproc and updates the db on a timely basis, but personally I would always update the DB when a change occurs, storing in RAM is dangerous as if your application crashes uncommitted changes wouldn't be there.

For high turnover applications I usually INSERT UPDATE or DELETE exactly when it is meant to happen, and then CACHE the READ's, to minimise the reads from the database.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900