The game I'm working on currently has a Client in Flash AS3, and a Server in C# (multithreaded).
Currently I use mySQL to handle logins (Raw access: no middleman for accessing the database) which seems to be extremely quick.
My question is would using a mySQL database be quick enough for a fairly simple real time game?
My game functions in a similar way to Diablo2, League of Legends, or even Starcraft:
- User logs in
- User is taken to lobby
- From lobby user may view active games
- User's group into 2-8 for games which exist on the server in it's own thread
Now, the game has been designed in such a way to minimize server calculations, while still providing zero trust to clients. Is it possible to use SQL in a way to store and manipulate all game data, for each game? ie:
- Users 1 through 8 all create 50 units
- Each user commands all of their units to move to a location on the map
- Units attack each other
- etc.
Is SQL fast enough to handle this kind of data traffic? Or would it be better to store it all in memory? Or is there some alternative (such as paging) I haven't considered?
Answer
What do you mean by "Raw access"? If it means what I think it means you have got a gaping security hole.
As for the performance question, it would be stupid to try using a database for such a job, for a ballpark figure I'd say an average database is 1000 times slower than memory. Just keep everything in application memory, I don't think you'll run out of memory before you hit some other bottleneck.
No comments:
Post a Comment