Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP .NET
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 11:30am
Comments
gladiatron at 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 at 11-Oct-12 17:47pm
   
Thanks for your reply :)

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 BillWoodruff 360
1 Mathew Soji 309
2 Maciej Los 270
3 DamithSL 225
4 Afzaal Ahmad Zeeshan 202
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2014
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