Browser Game Caching and Design

C

Chu

Hello All-

I'm writing a game using asp.net (c#). The game is a browser-based Role
Playing Game. I'm trying to determine the best way to design the game
with scalability in mind.

The Player class will hold info about the player, such as hit points,
weapons and armor that are equipped, and other stats specific to the
player. Each page on the site will require some or all of the info
stored in the player object.

I'm assuming that there would be lots of overhead with re-creating the
player object each time the page is refreshed. Is there some type of
caching mechanism I can use to cache the player object?

A few things to keep in mind:

Player 1 could be logged in and choose to attack another player who
could be logged in or not. If the player being attacked is not logged
in, the info about that player would obviously come from the database
and not the cache. On the other hand, if the player is logged in, it
should come from the cache.

If there are 50 players logged in at the same time, would this type of
caching system become way too much of an overhead in terms of ram
storage? Where's the best tradeoff, I could either get lots of CPU and
DB overhead by recreating the player object on every page load or I
could get the overhead in RAM storage by keeping a cache.

Would any of the session state methods work (such as using a database
session state to save each player object?) Or perhaps a simple static
hashtable that stores a player object?

I appreciate any thoughts or tips that can be provided here.

Thanks

R.S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top