Author Topic: SQL Database  (Read 7426 times)

ExtremoPenguin

  • Newcomer
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • Entropy Interactive
SQL Database
« on: March 17, 2013, 04:45:36 AM »
I'm thinking about using an SQL database (SQLite specifically) as the back end to store data for my rogue-like. Does anyone have any experience with using SQL for game programming and would like to share any tips or suggestions?

scombinator

  • Newcomer
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: SQL Database
« Reply #1 on: March 17, 2013, 10:33:16 AM »
SQLite is certainly a nice database to use, and would solve the problem of parsing save files and so on. I'd suggest you avoid using it to store current state, like the current map or anything like that.

Valmond

  • Newcomer
  • Posts: 23
  • Karma: +0/-0
    • View Profile
    • Email
Re: SQL Database
« Reply #2 on: March 21, 2013, 06:43:23 PM »
scombinator is certainly right, SQLite is really nice.

Databases are made (mostly) for variable sized data that needs to be searched so put players and stats (and why not savegame data?) in there but things like maps would probably fit better in a 'binary' format like a file.

I have used MySQL and SQLite and a database is really handy to have, you can just make a new table and stuff mails, logdata or whatever in there.

BTW. I'd recommend MySQL is for server side (multiplayer / connected games) or SQLite for embedding in your game (singleplayer).

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: SQL Database
« Reply #3 on: March 29, 2013, 03:02:48 PM »
Games are just Databases with a UI.


I'd recommend looking into Entity Systems or component-based systems. They're designed to translate easily into tables- works quite naturally with lua and sql and are incredibly extensible.

Not a great resource, but find some links to articles/papers on the subject. They're pretty eye-opening.
http://entity-systems.wikidot.com/