I'm a self teaching beginner, and I know absolutely nothing about the technical specs of computers/programming in general. I am using a C# book to learn it, and I mainly just want to learn everything that relates to game development, if something has no part in game development/no use in it. I won't bother learning it for the time being. All I currently need to know is, does SQL have use when it comes to game programming?
views:
190answers:
5It depends on how you plan on persisting data after the user closes the program. There are a lot of options, so SQL may be a good way to handle it, and it may not. This is, of course, assuming that you want to save data between game play sessions. There are so many options out there that you may never use SQL.
(That's an understatement).
Outside of game programming, if you're a developer you will likely need to know SQL. I'd recommend learning it. Even if you don't use it in your game design, knowing the concepts will help you.
Perhaps SQLite where the overheads are minimal, but unless you need the indexing (fast access) and lots of storage it would be better for roll your own as SQL Server itself is overkill and heavy on system resources, not something you'd want running alongside your game.
In summary, I would say no, SQL does not normally have a place in game design (client side stuff anyway).
99% of the time, no.
SQL is used for storing and retrieving large amounts of data quickly and efficiently. Think of a database as a filing cabinet (or usually a room full of filing cabinets) and SQL as an ultra efficient filing clerk!
If your game needs to store and retrieve lots of data (maybe a highly complex strategy game for example) then the answer may swap to yes, but on the list of things to study I would put it waaaay down.
If you do need to store settings etc. from your game you're better off
- storing it in the system registry, if the amount of data is tiny
- storing it in the application settings file of your app
- storing it in a text/binary file next to your game executable
Most games have high performance requirements, where loading times are predictible and it is possible to have fine grained controlled over when and how data is loaded. Unfortunately that is not what a general storage engine like sql database offers, so most games use their own storage in binary files.
Any ways, if you want to learn programming focusing on one thing at a time is probably best in the beginning so my suggestion is to keep focused on C# and when you feel you can do at least basic things there, you can broaden your perspective.
Online games almost always use SQL on the back end for the persistent world, player accounts, etc. (Though there are exceptions.)
Single player games or games with no persistent world almost universally do nothing with relational databases at all (although again, there are exceptions, often involving SQLite.)
.NET is sort of an irrelevant issue because only hardly any commercial games are written using .NET, and if you're asking about hobbyist games then it's impossible really to say what people have done at home.