Click here to Skip to main content
13,199,318 members (66,927 online)
Rate this:
Please Sign up or sign in to vote.
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 8-Oct-12 10:30am
gladiatron 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100