   SQL Server + TCP = Good Game Server?
  Hi :D. Basically I was thinking of using an SQL Server as a Game Server with VB.NET TCP connections being made by my VB.NET Game Server to various gamers PC's in order to update and their (and the Servers) data.Is this a good idea?Thanks :)Q   
  From your post I have trouble understanding exactly what you are trying to do -- please clarify.In any case, if I've understood correctly you will be using a Visual Basic.NET game server that serves clients over TCP/IP, and keeps the entire game state on the SQL server? That would probably be terribly slow, I'm afraid; querying the (possibly remote) database for information every time you receive a request is much, much, much slower than simply fetching the data from RAM. Instead of a thin game server that merely relays data to and from the SQL server, I recommend writing a complete game server that has all necessary simulation data available (as in, in RAM) and saves data that needs to be persistent at regular intervals, and upon server shutdown.  Constantly querying the database for information works fine for most web applications (forums, for example -- little or no state persists between invocations of the scripts). However, in applications with real-time requirements, such as online games, the delay between query and response will affect performance notably. It is also unlikely to scale beyond a few simultaneous users.   ;  I don't think it's a good idea. The primary reason being that you want the server itself to validate all actions being requested by the clients. That would be very hard to do with straight SQL code and SQL Server. Without the server validating every action, you are entrusting the user to never attempt to cheat by modifying your software or by creating their own software to connect and exploit the system.As far as speed concerns, those are entirely dependent on your game. This model would work well for a fantasy football type game, but not so well for a kinetic game like World of Warcraft. Games that follow the request/response model would work well. Games that are designed around a shared, synchronized simulation probably wouldn't.   ;  How would you recommend I go about accomplishing my goal using VB.NET?   ;  Clarification: I was intending to save all necessary data in SQL Server. Then each player would extract all the necessary data from the server. Then any changes they make or any other players make to the persistant world (e.g. moving to a new position in game) would be sent back through a socket connection and the game server would update the SQL server as well as send send then ecessary updates to all the other players.   ;  So I should keep the game state in-code e.g. arrays and all that, then update the server at intervals but update the players aswell.Thank you for your kind help.   ;  Have you read through the Forum FAQ?   ;Quote:Original post by quddusaliquddusSo I should keep the game state in-code e.g. arrays and all that, then update the server at intervals but update the players aswell. Im unsure (as i am not too familiar with servers) but ar you saying wht i wrote in my last post?Thank you for your kind help.As smr mentioned, the speed concerns are really only relevant to games with heavy physical interactions, such as most MMORPGs. I simply assumed that such a game is your goal -- forgive me if I were wrong. And yes, you appear to have understood what I meant. Transactions to and from the SQL server should only be made when it can be justified, in my opinion. Reasonable times to save data include server shutdown, completion of a critical operation (such as a trade) and at a recurring interval (for backup purposes, if your server crashes). If your game world is dynamic, you may also want to load the world state (position of all persistent objects, such as items) from the database on server startup. My point is that implementing your game logic in the game server gives you advantages both in terms of speed and and of input validation, which is critical for any online game.P.S: This entire post assumes an MMO:ish game; if you're working on a fantasy football game as suggested by smr, what I've said is not necessarily true.EDIT: In my opinion, using VB.NET is not a very good idea. It's not very widely used, and very few games are written in it. If you want to stick with the familiar .NET platform, look into C#. Otherwise, the most obvious choice for this type of game would be C++. With that said, it is entirely possible to write an online game in VB.NET, but you will have a hard time finding people who can help you.   ;  I hadnt read through it but i had browsed it and searched for the term "sql server" but couldnt find any matches. Why do u ask? I think i will read it since you have suggested it.Thank you soo much for your input. if its not too much trouble I would like as you whether a simple tcp connection would do the trick - maybe game world chnages would be returned as XML string (which should be easy to query)?   ;  I have been thinking about learning c# since that seems to be the way things are heading at the moment. XNA seems tempting.   