Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

krez

c++ database

This topic is 6156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i''m working on my RPG engine (like everyone else who isn''t doing a 3D engine or an RTS) and i have come to a point where i no longer want to load stuff from individual files. when i used to play with VB i used a ms-access database for this type of thing, so I could build classes and fill them in with SQL and recordsets and whatnot. so, does anyone know of any database-things i could use for this in c++? i don''t want to use ms-access, and i don''t want to pay [much if anything] for it; i just want the ability to create tables, link them (or use SQL for this), and get data to put in my classes. i was considering writing my own format, but that would take time away from the game itself (plus why the hell would i want to program an SQL parser in c++ when i can possibly use someone elses stuff?). any suggestions? --- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
Advertisement
Try mySQL. It is a great little SQL database that is also free. Plus they provide APIs for many languages to get direct access to the database. You can also do it with indirect access by using command line options and text files.

---
Make it work.
Make it fast.

Share this post


Link to post
Share on other sites
Just a thought, you could use ADO, that way you can easily modify which database you are using via ODBC i.e.access, SQL server....

I know MySQL is free on Unix/Linux platform, maybe the same for Windows platform ?

Reg''ds,
sTeVe

Share this post


Link to post
Share on other sites
wow that was fast!
i will check out mySQL now... feel free to recommend anything else though, just in case

EDIT:
well, i can't download this at work, so i'll have to wait until tonight. but, i have a question for you.
from the screenshots it appears as if you have to run a database server (i've used similar things before, interbase with java for example) to get access to the database files. what i want is more of a "file structure" + "API to interact with it" than a "set up server, run server, call server to get data from a file". i mean, i will if i have to, but i'd rather not
maybe i misperceived mySQL (i did only see the screenshots, and i didn't download yet), hopefully i did in fact
but, if not, is there anything else similar to what i described? (for example, with VB and MS-Access, you can just include the "MS DAO Library", and use their database, recordset, whatever objects)

--- krez (krezisback@aol.com)

Edited by - krez on January 3, 2002 4:28:39 PM

Share this post


Link to post
Share on other sites
quote:
Original post by krez
i''m working on my RPG engine (like everyone else who isn''t doing a 3D engine or an RTS

hah, the truth is painful indeed




-eldee
;another space monkey;

Share this post


Link to post
Share on other sites
quote:
me: i''m working on my RPG engine (like everyone else who isn''t doing a 3D engine or an RTS)
eldee: hah, the truth is painful indeed

even more painful: mine is going to be better than all those other ones, just like everyone else''s

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
Do not use MySQL.

Use Jet (Access) or PostgreSQL or sapDB or MS SQL Server or DB2 or Oracle or ANYTHING.

But not MySQL.

It... is... crap . Its lack of subselects, for instance, makes all manner of what should be simple things very fiddly to do.

ADO and DAO are database agnostic; however, if you want a file database (which stores its data in a single easily transportable self-contained file), your best bet is probably Access/Jet.


Share this post


Link to post
Share on other sites
Is it a server-based multi-player game ? If yes, go ahead with a database. However, for a game, I suggest to create your own file format. Even if you don''t mind the performance hit of a huge database system, can you imagine a game in the store with this in the specs: "require MySQL installed on the system to run"...

Share this post


Link to post
Share on other sites
Do a search on google for "xbase library". xbase is a very simple file-based database format. It uses the ISAM approach (Indexed Sequential Access Method), rather than SQL.. meaning that you iterate over records yourself, rather than writing a SQL query. If you use indexes correctly, then the iterating is "more" effecient (than if you iterate without indexes). There should be several libraries out there that will do it all for you. There is also database "management" software out there for xbase databases .. like dBase and FoxPro.

Once you look over the xbase file format though, you''ll want to create your own file format. the format is so simple (and so limiting in some ways).


-Brannon

Share this post


Link to post
Share on other sites
yah, that's the thing... i just want a way to save and load a few characters information from a huge file that holds the information for all the characters in the game. my old way was to dynamically piece together an SQL:

Public Sub LoadCharacter(CharUID As String)
SQLString = "SELECT * FROM tblCharacters WHERE charUID='" + CharUID + "'"
'use the SQL to get a recordset from ms-access, and use that data
End Sub

i mean, i want to use it for loading the other data too (maps, whatever), but that is the basic functionality i want: save/load stuff with a bit of indexing and whatnot.
i definitely do not want to have to install anything (or run anything) extra, just a format and maybe a DLL for the API.
it is a single-player game, so all that is not necessary.
i was considering writing my own thing, and i'm pretty sure i could pull it off (at least for my limited goal), but that'd be a whole other project dropped right in the middle of my game project...

--- krez (krezisback@aol.com)

Edited by - krez on January 3, 2002 6:40:36 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!