Sign in to follow this  
Baltar

Database for 1st Commercial Game (Access, SQL, SQLite?) Help?

Recommended Posts

Baltar    122
I have a problem. I have a fairly data-centric game that it intended for Commercial Publication. With that in mind I can't use open-source and such so I was looking for some database options and am confused about some things. SQLite looked good, but I need to use C# and it seems that any easy way to use SQLite involved getting a wrapper that is not available for commercial use. So thats out unless there is something I am missing or dont know about. I am extremely SQL Server knowledgeable to the point of even being certified, so I looked at SQL Server Express Edition. Turns out its free even to redistribute BUT after going through the install and looking at it I just cannot comprehend deploying this as part of my game. Its simply way way too much no? Do any other games out there put SQL Server Express on your PC?? It is the replacement for MSDE but still. So I ruled that out. Should I reconsider? I thought perhaps MS Access, but I know zero about it. Never had to use it. So I had some questions about it. 1. If I have an Access database and use C# ADO.NET type access does the end-user need a copy of Access installed on their machine (I'm assuming so)? 2. If so can I redistribute some type of Access database viewer/reader etc. or how is this done for MS Access based applications (Sorry for the stupidity). What should I be using? I like the idea of data binding and such also.. Many Thanks.

Share this post


Link to post
Share on other sites
Instruo    373
1) Nope, they don't have to have Access installed for you to use a .mdb file, and they're very easy to connect to with .Net
2) As far as redistribution goes, its been a few years since I looked at it, but at the time it simply required owning a copy of one of the higher-end versions of Office (which was about $1000 at the time). Once you owned it, you could redistribute in an unlimited fashion.

Share this post


Link to post
Share on other sites
Baltar    122
What isn't making sense to me is how come I can obtain a full fledged MS SQL Server for free and redistribute it for free, yet in order to redistribute a much "simpler" access database I have to pay $745 apparantly for what is now called "Microsoft Visual Studio 2005 Tools for the Microsoft Office System".

It looks like it does install some sort of access runtime module.

I'm reading an older MS article though

http://msdn2.microsoft.com/en-us/library/aa167800(office.11).aspx

It seems like I could just save $745 and just use SQL Server Express. What am I missing? (Though as I said above I can't imagine SQL is what other Game Developers are actually using).

Share this post


Link to post
Share on other sites
Alpha_ProgDes    6921
I, too, am wondering if one can just write to a database file and not have to download SQL Server or even have the user need Access installed. The initial response seems like one can use a plain .mdb and not have to have the user download SQL Server or have Access installed. If so, yea!

Share this post


Link to post
Share on other sites
hplus0603    11348
Different businesses make different decisions. Microsoft is a very large corporation, with lots of departments that don't always talk to each other.

If you think your game can include MS SQL Server Express, then you can include that. However, I would recommend against it -- users don't like having arbitrary services (with known vulnerabilities) installed on their machines!

I would recommend going with SQLite. If all you need is to run SQL text, and get an array of array of strings back, the API is really simple to wrap.

Or, perhaps even better, develop the data in SQL, but flatten it out to a big binary file that you load into RAM. Then run your queries in RAM the old-fashioned way (linear scanning) -- it'll probably be faster than a SQL database, unless you're talking hundreds of megabytes of game data.

Share this post


Link to post
Share on other sites
Baltar    122
Quote:
Original post by hplus0603
Different businesses make different decisions. Microsoft is a very large corporation, with lots of departments that don't always talk to each other.

If you think your game can include MS SQL Server Express, then you can include that. However, I would recommend against it -- users don't like having arbitrary services (with known vulnerabilities) installed on their machines!

I would recommend going with SQLite. If all you need is to run SQL text, and get an array of array of strings back, the API is really simple to wrap.

Or, perhaps even better, develop the data in SQL, but flatten it out to a big binary file that you load into RAM. Then run your queries in RAM the old-fashioned way (linear scanning) -- it'll probably be faster than a SQL database, unless you're talking hundreds of megabytes of game data.


I need ADO.NET and .NET 2.0 Data Binding support.

Share this post


Link to post
Share on other sites
Flimflam    665
I would advise a word of caution using Access, as I have run into issues from machine to machine, depending on the libraries they have or even the versions of Access they have (if they have it).

I would also advise against installing SQL Server and/or MySQL on the end user's machines, especially for a game. No one appreciates having to require such large services on their machines for a game.

Share this post


Link to post
Share on other sites
Alpha_ProgDes    6921
Quote:
Original post by Flimflam
I would advise a word of caution using Access, as I have run into issues from machine to machine, depending on the libraries they have or even the versions of Access they have (if they have it).

I would also advise against installing SQL Server and/or MySQL on the end user's machines, especially for a game. No one appreciates having to require such large services on their machines for a game.

Since you effectively annilihated all the options [smile], what do you suggest?

Share this post


Link to post
Share on other sites
Flimflam    665
Quote:
Original post by Alpha_ProgDes
Quote:
Original post by Flimflam
I would advise a word of caution using Access, as I have run into issues from machine to machine, depending on the libraries they have or even the versions of Access they have (if they have it).

I would also advise against installing SQL Server and/or MySQL on the end user's machines, especially for a game. No one appreciates having to require such large services on their machines for a game.

Since you effectively annilihated all the options [smile], what do you suggest?


Ah, true =) I'm at work and in a rather big hurry to get my rounds done online. The Paranoia of SCEA is somewhat scary sometimes, especially with the PS3 release coming.

Personally, I haven't done much data storage in C# or any .NET language really. I wrote a simple inventory management system for someone to help manage their eBay store inventory, and I used Access there. Decided I'd never do that again when it came to using the program on machines other than mine.

I honestly don't know much more on what to use. I'd probably look into a free wrapper for SQLite, or write his own wrapper. The library is pretty nice.

Share this post


Link to post
Share on other sites
Baltar    122
Quote:
Original post by Flimflam
I would advise a word of caution using Access, as I have run into issues from machine to machine, depending on the libraries they have or even the versions of Access they have (if they have it).


According to Microsoft that problem is solved if you use their packager that comes with the redistributable Access Toolkit. It also apparantly contains the source code so you could probably decipher how to solve the problem on your own. So if thats the only reason not to use access it seems like MS has long since solved it.

Share this post


Link to post
Share on other sites
Arild Fines    968
You could try SQL Server Compact Edition (formerly SQL Server Everywhere). It's an embedded database (just like SQLite) so the only thing you need to deploy are the runtime DLLs (just like SQLite), but it gives you access to a large subset of the functionality of the real SQL Server. See here for an introduction to using it.

Share this post


Link to post
Share on other sites
Jack9    102
MySQL is a bad choice.

You do have to pay for licensing per copy for DISTRIBUTING copies of MySQL with your game. If your game is online and is only used to store data (the client you distribute commercially has no actual MySQL binaries in it) online, then it's free to use. That's why websites which use MySQL dont need a commercial license. A client accessing backend data is also under that.

A game that installs MySQL and uses it to store data on someone's machine requires a commercial license.

Share this post


Link to post
Share on other sites
Quote:
Original post by Arild Fines
You could try SQL Server Compact Edition (formerly SQL Server Everywhere). It's an embedded database (just like SQLite) so the only thing you need to deploy are the runtime DLLs (just like SQLite), but it gives you access to a large subset of the functionality of the real SQL Server. See here for an introduction to using it.


SQLite.NET really looks good, but unfortunately it does not specify what the code license is. Obviously it's an open source one, but which one? zlib? gpl? bsd? Without such information (which can surely be obtained from the author), I would advise to not use it.

Of course, the best thing to do is probably to contact the author and to get the answer (and the formal authorization to use it in your product if possible). This should not take long, and would probably save you some headaches.

Share this post


Link to post
Share on other sites
Damon Shamkite    139
As your primary constraints are "fairly data-centric", "distribute", and "need to use C#", I wonder why you don't consider Berkeley DB for .NET (found on Sourceforge).

From what I understood, you only looked into SQL because you happen to know SQL quite good, but you don't necessarily need it.

Berkeley DB is not SQL, but it's a database, and it is quite good for "fairly data centric" applications.
The "Berkeley for .NET" package is BSD licensed, so there should be no objections to use it in a commercial application. In any case, it has only around 5% of the bloat that you'll have to face with shipping a Microsoft SQL engine.

Share this post


Link to post
Share on other sites
First of all I'm not sure that a data-centric game necessarily requires SQL-style functionality. One of the few cases where transactions are important enough would be MMO-style games, but in those cases I'd worry a little more about the database itself and a little less about the .NET interface. If there is some specific database functionality you are looking for then this will obviously also help eliminating options. What exactly is it that you need, and why do you need ADO.NET and .NET 2.0 Data Binding?

It's quite possible to use a database during development without actually having to integrate it or some lightweight alternative in the game itself. This could be both easier and faster in the long run.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Quote:
Original post by Erik S. Andersson
. What exactly is it that you need, and why do you need ADO.NET and .NET 2.0 Data Binding?


Nobody NEEDS ADO.NET or .NET 2.0 Data Binding. For that matter nobody really NEEDS C# itself either. You can do things the "hard way" or the "old way" if you want to call it that.

Specifically the requirement for Data Binding revolves around creating the game editor which allows you to basically alter every aspect of the game. It is a lot easier to write and update this interface using data binding.

Share this post


Link to post
Share on other sites
ID Merlin    119
SQL has quite a few advantages for doing complex data retrieval operations, but whether it is needed or not would, I suppose, depend on how much work you want the DB engine to do. If your queries are all like "SELECT * FROM sometable WHERE sometable_id = 6" then you don't need SQL at all. If, on the other hand, you are going to write complex queries, with joins and aggregate functions, then SQL is a lot betterr than having to code your own operations.

Does the Berkeley DB have a SQL engine or some equivalent available, also? If so, then that would be a great choice.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster

Nobody NEEDS ADO.NET or .NET 2.0 Data Binding. For that matter nobody really NEEDS C# itself either. You can do things the "hard way" or the "old way" if you want to call it that.

Specifically the requirement for Data Binding revolves around creating the game editor which allows you to basically alter every aspect of the game. It is a lot easier to write and update this interface using data binding.


Of course you don't need anything in that sense, but the question was more if the requirement came from someone else or if it was a personal preference. Although I have no personal experience with ADO.NET/Data Binding I'd still say that it is highly unlikely that anything else is to be considered hard and antiquated. As far as I can tell you want to use your previous experience in SQL on the game which might be a good idea, but it might also make things more complicated than necessary. I'm genuinely curious, what about data bindings makes everything else look old and hard?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
How about Postgres?.. (www.PostgreSQL.org)
It's very good, and have BSD license.. Meaning that you can use it for a commercial non-OpenSource proyect.

Share this post


Link to post
Share on other sites
Baltar    122
Quote:
Original post by Erik S. Andersson
Quote:
Original post by Anonymous Poster

Nobody NEEDS ADO.NET or .NET 2.0 Data Binding. For that matter nobody really NEEDS C# itself either. You can do things the "hard way" or the "old way" if you want to call it that.

Specifically the requirement for Data Binding revolves around creating the game editor which allows you to basically alter every aspect of the game. It is a lot easier to write and update this interface using data binding.


Of course you don't need anything in that sense, but the question was more if the requirement came from someone else or if it was a personal preference. Although I have no personal experience with ADO.NET/Data Binding I'd still say that it is highly unlikely that anything else is to be considered hard and antiquated. As far as I can tell you want to use your previous experience in SQL on the game which might be a good idea, but it might also make things more complicated than necessary. I'm genuinely curious, what about data bindings makes everything else look old and hard?


"Data Binding" is the association of object properties with control properties facilitated by a data binding engine. Essentially when you have something like a textbox you need to maintain synchronicity between the values displayed and whats stored in the db/file etc. The "old way" would be for you to write lots of repetative code for this yourself and deal with other factors such as what else might indirectly modify things. The new way all the code is written for you and you essentially just get a permanent logical data binding. The benefits are probably best articulated elsewhere but it does make for far faster, less error-prone, coding.

Beyond the above there is no specific requirement that I use it. Perhaps a MS Case Study would be nice. They did that with the first few games to be entirely C#.

Share this post


Link to post
Share on other sites
Damon Shamkite    139
Quote:
Original post by ID Merlin
SQL has quite a few advantages for doing complex data retrieval operations [..]
SQL's advantages are its disadvantages at the same time. SQL is great if you need to be able to (re)formulate queries in a comprehensible way, and if you need complex things done. I love SQL from that point of view. It is a very sophisticated language to work with data in every imaginable way, and you don't need to care about anything (well, almost).
However, this comes at a high cost. Your SQL query is parsed, optimised, your input data is converted to a native format (after you converted it to a textual representation in the first place), and the result is converted to textual representation, only to be re-converted into native format by you again. You can work around some of this overhead by using stored queries et al., but the principle stays the same.
Using Berkeley, you can simply feed a struct into the database, and it will take it just as it is. Your abilitites to run complex queries are somewhat limited, but most of the time, you'll only want to execute something like "give me the data for player with ID no. 23423" anyway. In that case, you call a simple API function and get back a structure that you can use right away, without needing to parse or convert anything.

Sure enough, entire websites run content management systems written in PHP/MySQL, and they work reliably with little or no maintenance for years, so one could say "SQL is not that slow". However, if your web server is under some heavy load, creating a page can as well take 3-4 seconds (look at gamedev.net for an example). For a website, that might be a little annoying, but it does not really matter. For most games, 3-4 seconds are a killer.

Transactions are not a property of SQL. Although some SQL engines have transaction support, this is not what makes SQL (or, SQL does not make transactions).
For example, Berkeley has transactions, although it is not SQL.
MySQL has transactions since two years or so (might be incorrect, could actually be 3 years), but it did not have them for a almost a decade before, even though it is "SQL".

Quote:
Does the Berkeley DB have a SQL engine or some equivalent available, also? If so, then that would be a great choice.
No, unless you count using MySQL with Berkeley backend. It's not what you would want to do, anyway. The reason why one uses Berkeley is because it is *not* SQL (i.e. it operates on native data and does not do any SQL parsing).

Share this post


Link to post
Share on other sites
evolutional    1393
Quote:
Original post by hplus0603
If you think your game can include MS SQL Server Express, then you can include that. However, I would recommend against it -- users don't like having arbitrary services (with known vulnerabilities) installed on their machines!



Default installs of SQL Server Express don't allow remote connections, only local ones. The only vulnerabilities to be exploited would by something already on the box.

Share this post


Link to post
Share on other sites
Mr Grinch    318
Look at Firebird. It is free and open-source, but it has a commercial-friendly license. The project is a spin off of Borland's Interbase. It also can be deployed along side your EXE as a single DLL. From what I can gather it gives you a lot of the features of an enterprise level database (ACID, stored procedures, triggers, etc.) with the convenience of an embedded DLL. It seems like a good choice if you don't want to distribute and install a full database server, but want a little more standard SQL than SQLLite.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this