using database to store strings
-
Mr Man.
using database to store strings
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
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
This is similar to the resource files that windows apps use.
Could do something like -
MyStrings.h -
Could do something like -
MyStrings.h -
Code: Select all
#ifndef __MYSTRINGS_H__
#define __MYSTRINGS_H__
#define STRING001 "First String"
#define STRING002 "Second String"
#endif

-
Mr Man.
-
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...
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
SQLite is clutch!... thanks!
but... does SQLite run on windows?
humm.. looking deeper into website...
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.
but... does SQLite run on windows?
humm.. looking deeper into website...
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.
-
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.
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.
-
deprecated
- Posts: 62
- Joined: Fri Jan 07, 2005 4:37 pm
- Location: California
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...
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