8 Replies - 843 Views - Last Post: 28 March 2016 - 12:58 PM Rate Topic: -----

#1 zedpython  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 16-March 16

Database for beginner

Posted 16 March 2016 - 08:18 AM

Hey I'm a game programmer and interested in making my game multiplayer with a server.
What language should i learn and what programs will i need to run a server etc please help me out :)
Is This A Good Question/Topic? 0
  • +

Replies To: Database for beginner

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13552
  • View blog
  • Posts: 54,079
  • Joined: 12-June 08

Re: Database for beginner

Posted 16 March 2016 - 08:20 AM

What have you looked into or researched?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 593
  • View blog
  • Posts: 3,823
  • Joined: 12-January 10

Re: Database for beginner

Posted 16 March 2016 - 08:22 AM

this is very vague-- however you're not really a game programmer without making a game?

lots of games store the info in sql servers or oracle however oracle blows so stay clear

game language? it all depends on the engine i am assuming
Was This Post Helpful? 0
  • +
  • -

#4 zedpython  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 16-March 16

Re: Database for beginner

Posted 16 March 2016 - 08:23 AM

Well i have been looking how to make a server bu they say i need webserver + dedi + sql server.
the problem is i don't know how any of these work. I don't know anything about servers
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13552
  • View blog
  • Posts: 54,079
  • Joined: 12-June 08

Re: Database for beginner

Posted 16 March 2016 - 08:25 AM

"dedi "?

Multiplayer game servers vary due to the type of game being played.. so.. work out those specs first.
Was This Post Helpful? 0
  • +
  • -

#6 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 792
  • View blog
  • Posts: 1,886
  • Joined: 24-April 12

Re: Database for beginner

Posted 17 March 2016 - 02:34 AM

View PostDarenR, on 16 March 2016 - 09:22 AM, said:

lots of games store the info in sql servers or oracle however oracle blows so stay clear


Oracle blows so stay clear? I'm probably not Oracle's chief advocate, but you're saying that possibly the top selling corporate database "blows"? Is there a specific reason you believe this to be the case? Professionally, Oracle is considered the top database system in the world. Oracle DBA's tend to make about $20,000 a year more than SQL Server DBAs. Personally, I think SQL Server is a bit under-rated. But Oracle "blows"? But is there a specific reason you believe this?
Was This Post Helpful? 0
  • +
  • -

#7 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 792
  • View blog
  • Posts: 1,886
  • Joined: 24-April 12

Re: Database for beginner

Posted 17 March 2016 - 03:26 AM

I've never put together a multi-player game. I did, however, write a chat server for role playing games once. It was basically like IRC with dice rolling and some other features built in. I wrote it in C++ with TCP/IP.

So, you don't necessarily need a database to have a multi-player game, depending on what you're doing. A lot of games are UDP/IP rather than TCP/IP with peer-to-peer networks rather than client-server networks.

So, it kind of depends on the platform you are writing the game with and what your needs are.

If you're dealing with a million players then a professional database system probably makes a lot more sense. Just handling things like credit card processing justifies it pretty much alone. If you're writing a game for 5 people to join each other on their own private server, it's probably less justified.

I would start by looking into what the game platform you are writing with wants. For example, if I were using Unity, I would look into how people are doing networking with Unity. With XNA for example, I believe Microsoft had a networking service ("Live" I think they called it) that they expected you to go through; something like that may handle much of the networking tasks for you.

And to write a server, you may not even need a game platform. Off the top of my head, if I wanted to write a game that was server based multi-player, I might use DirectX 11 with C++ for the game clients and C# with nothing game related for the server. The server mostly needs to crunch numbers and track them and facilitate communications between clients. So, the server most likely does not even have to be game related. I also might use a database like SQL Server, but I don't know that a commercial database would be my first choice. Commercial databases are designed to sort through extremely large amounts of data and answer questions. They are not designed to play games. Without the large amounts of data it becomes somewhat questionable. They are also not bi-directional, which is maybe the biggest problem. They don't "send out" data. They return data when requested. It's all about returning the data requested. There's no way to send out data that wasn't requested, which is your typical scenario for a game.

Maybe that's the biggest problem. So, if I were going to use SQL Server, for example, I would probably write a server that calls SQL Server when needed. So, there would basically be middle-ware. Otherwise, I don't see how it could be done in many cases.

For example, text chat is pretty standard for network games so that players can talk to one another. In an MMORPG, for example, it usually allows players to chat via text in game. If I type into the game client on my machine a message for everyone in the zone, my request goes to the server and then the server must broadcast that message to everyone in the zone. So, it has to determine who is in the zone and who is not in the zone. Then it has to broadcast out to every player in the zone the message so that appears in their client. So, it needs to at least temporarily record the message. And it has to send the message back out based on a decision it made to select players. And the clients need to display the message.

SQL Server does not have the ability to send such unrequested data to clients. The clients don't even know that the event happened and so they don't know to request the data and they are never going to get unrequested data from a commercial database such as SQL Server or Oracle. What you could do however, is write a server as middle-ware. So, the game server could store the message on SQL Server, determine who to broadcast it to, read the message from SQL Server, and then send it out to the clients that need it. This is probably over-kill for this example.

If you're already writing a server, then it becomes very questionable why you need a commercial database. The server can probably store and retrieve a moderate amount of data on its own. Most of the data is probably short lived.

Maybe a scenario where it might be more justified is with an MMORPG. I don't have actual experience with this, and so I'm mostly guessing and theorizing here. But if you have 100 zones and you have say a million game assets in each zone with 200,000 simultaneously active players, then maybe it makes sense to sort through all these simultaneous data requests using a commercial database. You could have tables of data for each zone with hundreds of millions of game assets. With 200,000 near simultaneous requests for large amounts of data you probably need commercial database servers. Although, you probably want to optimize things as much as possible to run client side. All your graphics assets, such as models and textures should be 100% client side. You may want to have a server to store those assets so that clients can download them at startup. Players request any updates they have not received yet which could be a gigabyte of game assets.

I might implement that with a version number. So, that the request at startup is "I am on version 2.07. Send me updates if needed". The server sees that the highest version is 2.09 and so it sends all the assets for version 2.08 plus those for 2.09 all at once. The client records that it is now on version 2.09 as soon as all assets are received successfully. For managing this data server side, it makes pretty good sense to use a commercial database. That way, when the game developers build a new version, they can put all the data files out on a file server and record those files in a commercial database along with their version number. So, the commercial database is really just storing file paths and version numbers. If you have 500,000 users requesting what new files they need and that the files be sent to them, it makes a whole lot of sense to have a commercial database handle these requests. First of all, they are not bi-directional but requests for data. Second, all 500,000 clients may be on different versions and if you have 300 different versions of the game where you have to send only the versions that each player does not yet have this makes a lot of sense. Plus, you may add a new version every week. And a commercial server makes it easier to update and especially maintain this large amount of data. Although, this one situation alone may not warrent a commercial database. Commercial databases are built to store a lot of different types of data. This is actually not that much data in this example because the game files are stored on a separate file server instead of inside the database.

Anyway, I'm rambling on at this point. But commercial databases are designed to store not just large quantities of data, but large quantities of many different types of data. Game asset files is just one type of data. In an MMORPG you might want a lot of different types of related data to be stored server side such as Players, Monsters, Spells, Treasure, Weapons, etc. A commercial database may make it easier to store and maintain very large amounts of this type of data especially in a situation where you are needing to update this data fairly regularly. Maybe you need to balance out the game world economy as you watch players interact with the game and so you want to be editing this data pretty regularly while at the same time having 200,000 players simultaneously request different parts of this data. For example, player 2,446 is in zone 22 and needs to know the data for Monster 52 in that zone. Well, the game company may need to edit all monster 52's in zone 22 in the next maintenance down time because they are believed to be over powered. Maybe they want to change the weapon type of Monster 52 in zone 22 to a less powerful weapon. So, perhaps they have table of "MonstersInZone" of monsters that can spawn in that zone. And that points to a table of "Monsters" where the generic data of Monster 52 can be looked up to find how many hit points it has and such. And maybe there is a table of "Weapons" where you go to the "MonstersInZone" table and for the record on Monster 52 in zone 22 you can change the weapon type to 17. The server may need to touch data from all these tables when the player fights the monster. So, when you have 10's of thousands or 100's of thousands of pieces of data (not just game asset files but numeric and other types of data) that you need to be maintaining a commercial database becomes a very solid answer. One reason is that no programmer is going to know off the top of their head how to edit your game data in your own custom binary data files. It will take time to train people for this and you probably are not optimized to sort through gigabytes or terrabytes of data for 200,000 simultaneous requests for different pieces of data. The commercial database is designed to go looking for needles in the haystack. And anyone trained with that commercial database will know how to go in and change the weapon type of Monster 52 in zone 22 to weapon type 17 without even any custom software to make the change. The more pieces of data you have to deal with the more sense a commercial database makes.

A race car game where 5 friends share a server that they setup probably doesn't need such an elaborate setup. The position of each car probably needs to be tracked along with some other data that needs to be sent out to every client regularly. But it's a relatively small amount of data being tracked and it does not need to be stored long term. The server may not need to store anything more than long enough to send the data back out. Maybe position in the game world is all it needs to track and broadcast. All the logic and so forth may be client side.

This post has been edited by BBeck: 17 March 2016 - 03:45 AM

Was This Post Helpful? 0
  • +
  • -

#8 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 593
  • View blog
  • Posts: 3,823
  • Joined: 12-January 10

Re: Database for beginner

Posted 28 March 2016 - 11:00 AM

View PostBBeck, on 17 March 2016 - 04:34 AM, said:

View PostDarenR, on 16 March 2016 - 09:22 AM, said:

lots of games store the info in sql servers or oracle however oracle blows so stay clear


Oracle blows so stay clear? I'm probably not Oracle's chief advocate, but you're saying that possibly the top selling corporate database "blows"? Is there a specific reason you believe this to be the case? Professionally, Oracle is considered the top database system in the world. Oracle DBA's tend to make about $20,000 a year more than SQL Server DBAs. Personally, I think SQL Server is a bit under-rated. But Oracle "blows"? But is there a specific reason you believe this?


sorry for the late reply:

yes i deal with it all the time at work and to do simple things, it is just to complicated. It may be #1 in the world and i bet the reason those oracle db's make so much money is because ORACLE is a pain to use. There is nothing simple about it. I know a lot of companies that i deal with are going away from oracle just for the fact their dba's dont want to deal with it any more. Oh and have you ever visited their forums and asked a question-- most of the time they answer with snarky remarks that elude to their mastery of oracle and how every other coder is inferior. Their forums are not for the feign at heart nor do they really give direct answers to questions.
Was This Post Helpful? 0
  • +
  • -

#9 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2340
  • View blog
  • Posts: 9,388
  • Joined: 03-December 12

Re: Database for beginner

Posted 28 March 2016 - 12:58 PM

We had this discussion last week. Farming data from MySQL (and changing SP's from MySQL) to integrate with our SQL Server. That spurred a discussion on RDBMS's. SQL Server 2008 is missing A LOT of functionality that was normal in MySQL (2012 made significant progress in addressing those). 2 of out DBA's said that they preferred Oracle, most of the devs likes MySQL, or PostGres.

From the dev standpoint. As long as it stores the data and gives me what I want, I don't care how it is stored. BUT, dealing with it is a whole other matter. I like Postgres and MySQL. I thought I likes SQL Server, until I realized things like pagination where not possible without hacks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1