• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Zubadar

Where should I store data?

8 posts in this topic

Hey everyone.

First year university student here studying games programming.

I'm designing a very primitive system to simulate realistic AI and virtual relationships (not uni stuff). There is going to be a LOT of data, so I'll need a database of some sort.

Here's an example of 2 snippets of tables I might have to store:
[img]http://filebeam.com/6e6670f6d916f7fae9ea7ce9e3bb3de0.jpg[/img]

Obviously it's very relational.

I've looked into databases for games, and I'm not really sure how I should go about tackling this. Apparently SQL is a bad choice and mostly used for online games and such. How would something like Skyrim store data? Flat file databases?

I want to be able to manipulate some sort of database using Visual C# 2010.
0

Share this post


Link to post
Share on other sites
[quote name='Zubadar' timestamp='1340332531' post='4951585']
Apparently SQL is a bad choice and mostly used for online games and such.[/quote]
Why is SQL a bad choice? What are your requirements? How much data do you expect to store? Keep in mind that the SQL language is very expressive; you can do more with fewer lines of code than you can otherwise, SQL is very adapt to database changes, and SQL has already been invented; there's no need for you to reinvent it!

[quote]
How would something like Skyrim store data? Flat file databases?
[/quote]
Skyrim most likely uses some sort of SQL server. Flat file databases have (or may have) been phased out when memory/disk space requirements were tight (i.e., the DOS era).

[quote]
I want to be able to manipulate some sort of database using Visual C# 2010.
[/quote]

You're in luck. You can get [url=http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx]SQL Server Express[/url] for free, and .NET library [url=http://msdn.microsoft.com/en-us/library/system.data.sqlclient.aspx]interfaces amazingly well[/url] with databases. It's basically a service that runs on the client machine and acts as a professional SQL Server. This is a plus, since your application interfacing with the database won't need to care about where the data is stored. You can also get [url=http://www.microsoft.com/en-us/download/details.aspx?id=8961]SQL Server Management Studio Express[/url] for free and use it to interact with your SQL Server on your local machine.

If you're not sure of what you want, then install SQL Server Express and try it out for yourself. Edited by fastcall22
0

Share this post


Link to post
Share on other sites
Also, another option available to you is to use various free libraries such as [url=http://www.codeproject.com/Articles/9258/A-Fast-CSV-Reader]LumenWorks.Framework.IO.Csv[/url] and [url=http://dotnetzip.codeplex.com/]Ionic.Zip[/url] to create your own sort of "flat-file database" and use the C# [url=http://msdn.microsoft.com/en-us/library/bb397933.aspx]LINQ[/url] to do SQL-like queries on [url=http://msdn.microsoft.com/en-us/library/system.data.dataset]System.Data.Dataset[/url]s. The only disadvantage to this approach that I can think of is that the entire database will need to be read into memory, and any changes to a table will require rewriting the entire file the table is in... Edited by fastcall22
0

Share this post


Link to post
Share on other sites
Thanks for the reply. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

What if I were to build the program and send it to somebody? Wouldn't they need to have an SQL service running on their PC for it to work properly? I just want to make sure it can be portable.

EDIT: With your second response, I think storing the whole database into the memory would be quite a disadvantage, because I can see this database getting very large. Edited by Zubadar
0

Share this post


Link to post
Share on other sites
I haven't done it myself, but [url=http://stackoverflow.com/questions/2442635/can-i-deploy-sql-server-express-with-my-desktop-application-just-like-builtin-da]this[/url] looks promising.
0

Share this post


Link to post
Share on other sites
I don't really want an SQL server to be running in the background for this to work, unfortunately. It seems messy and bloated to me, and I've never heard of games running servers in the background to keep single-player data.

Here's what I need for this database:[list]
[*]Relational capability
[*]Portability
[*]Preferably doesn't have to load the entire database to memory to do things as that would be incredibly slow
[*]Manipulable via Visual C# 2010
[/list]
Any ideas? Edited by Zubadar
0

Share this post


Link to post
Share on other sites
You could look into SQLite.

SQLite is written in C but there are a few ways to use it from C#:

[url="http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki"]http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki[/url] provides .NET bindings to SQLite.
[url="http://code.google.com/p/csharp-sqlite/"]http://code.google.com/p/csharp-sqlite/[/url] is a C# re-implementation (or more like a translation) of SQLite.

SQLite is absurdly portable and well-tested, and it's designed for embedding into applications (there is no separate server process.)
0

Share this post


Link to post
Share on other sites
[url="http://www.sqlite.org/"]SQLite3[/url]? Contrary to what you may believe, you don't have to use a separate process, service, or even thread to use SQL. SQLite creates a database file which you can access through your code, where you can create queries and execute them.

[edit]

ninja'd

[edit edit]

[url="http://www.codeproject.com/Articles/236918/Using-SQLite-embedded-database-with-entity-framewo"]You may be interested in this article on using SQLite and LINQ in C#[/url]. Edited by Cornstalks
0

Share this post


Link to post
Share on other sites
Thanks everyone for the responses.

I'll definitely be using SQLite as it suits my needs perfectly.
0

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  
Followers 0