using database to store strings

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Mr Man.

using database to store strings

Post by Mr Man. »

Hallo,
many games i have looked at use database files to store all their text strings, which makes it pretty simple to change them when u need to fix them, or add and delete them. What do you guys think about this idea.... each piece of text would have its own unique id, and i could use id's again to get similar messages when i needed, like for OK buttons, i could just use GetTextFromDB("STR_OK") etc...etc....
could also make it easier to add languages and etc....


anyways, just wondering what u thought on the subject
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

This is similar to the resource files that windows apps use.

Could do something like -

MyStrings.h -

Code: Select all

#ifndef __MYSTRINGS_H__
#define __MYSTRINGS_H__

#define STRING001 "First String"
#define STRING002 "Second String"

#endif
Image
Mr Man.

Post by Mr Man. »

k ,ive seen this type of file used in a few games so i thought it was at least worth some thought on my part. anyone know how to get info from excel spreadsheets? :P
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

export it to CSV ( comma delimited )

then parse it
Image
Guest

Post by Guest »

If you like databases and you know SQL, why not try SQLite: http://www.sqlite.org/

It's file based, so it can move anywhere without having to install MySql, PostgreSql, etc...
deprecated
Posts: 62
Joined: Fri Jan 07, 2005 4:37 pm
Location: California

Post by deprecated »

SQLite is clutch!... thanks!

but... does SQLite run on windows?

humm.. looking deeper into website... :shock:

yep. it does.

I recommend others look into this as well.. It looks like a simple solution that doesnt require much resources to provide a lot of functionality...

Couldnt ya make a new "database.file" for save games and such?... that seems easy to do. make it relational, by storing item ids and status id's, coords, other info in the save database and item / status info and pretty much anything else in game database.

I know sql, and for me, this would save a bit of time compaired to xml format, and hopefully would provide good performance.
Mr Man.

Post by Mr Man. »

yes, this looks like a great choice. thanks for the linkage, Guest. deprecated, you read my mind 8) now, where to get started.....
PC-XT

Post by PC-XT »

A DATABASE-Driven Approach is very very COOL

Almost nothing about any object in AGE of EMPIRE is hard coded
into the program.

Huge TABLES of information describe every characteristic of every
objects that appears in the game.

The game designers used a system of over 40 PARADOX DATABASE
TABLES to control the shape, the game, etc...

As a result, they were able to constanly update and tweak the game
and then test their changes without having to involve a programmer.
Mr Man.

Post by Mr Man. »

:D

im thinking i'd like to use excel spreadsheets..just to try...anyone know how to get info from them, with multiple pages in them too?
deprecated
Posts: 62
Joined: Fri Jan 07, 2005 4:37 pm
Location: California

Post by deprecated »

Mr. Man,
It seems a lot harder of a task to create something to interact with excel files or excel.
I am in the process of putting together a sample class that uses SQLite, and I'll post it when I finish... (by monday.. maybe??)

It is way easier to query a DB for info than write a file read/write class for excel format.

Then, when the DB is setup, you can use excel, access or a text editor to update the game info in the db file manually....

However, You could use ODBC to connect to an access DB... for a win32 solution.

Excel doesnt seem like the right tool to me, but I am sure it could be done...
RLG not logged

Post by RLG not logged »

yeah, u'd prolly have a lot more success with regular ol' DB formats.

looking forward to your class, dep.
Post Reply