Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am building a game in jMonkey (Java) and I have so far only used default quest text. But now I need to start populating a lot of quests with text. My design requires A LOT of quests texts.

What is the best way to build a database of quest texts in jMonkey? I don't have a lot of real experience with databases. Is there a database that integrates well with jMonkey?

Here are the ideal properties I want in my database, in order of priority:

  1. Reasonably light learning curve
  2. Easy portability (in Java) to Windows, Linux, and Mac OSX
  3. Good interface with Java
  4. Good interface with jMonkey
  5. The ability to add properties to the quests: ID, level, gender, quest chain ID, etc.

Or am I wrong in thinking I need to use some giant monster like SQL? I haven't been able to find much information on this, so are people using some non-database methods for storing things like quest text in jMonkey?

share|improve this question
1  
I'm not sure about jMonkey, but I think it's generally better to use some file format like XML or JSON for texts like dialogues and quest text. –  Mentoliptus May 2 '12 at 10:45
    
Assuming that by "quest texts" you mean lines of text you can directly reference by say, an ID number... What do you mean by "A LOT"? 100? 1,000? 100,000? –  Tim Holt May 2 '12 at 14:06
    
@Mentoliptus So you would store thousands of quests in 1 giant XML or thousands of little ones? –  theJollySin May 2 '12 at 15:37
    
@Tim Holt Sorry, my design currently has in the neighborhood of a couple thousand quests. And each quest will need several identifying properties: ID, level, gender, faction, quest chain, etc. –  theJollySin May 2 '12 at 15:37
1  
One big file is slower to parse, uses more memory and it's harder to maintain, but a lot of small ones is slower to access. The strategy depends on your game and the way you use the quests in your game. It's a "chatty or chunky" approach decision. –  Mentoliptus May 2 '12 at 16:19
show 1 more comment

2 Answers 2

up vote 3 down vote accepted

If you want an SQL database, i would recommend you the H2 database engine. It is pretty lightweight, written in pure Java and you can use it in embedded and server mode. It doesn't have so many features as "bigger" db engines do, but I think it will be enough in your case.

Also, consider Object databases. There are several options out there, but I would recommend you db4o. In my opinion, object databases are more intuitive to learn than SQL ones if you are akin to object-oriented design.

Hope this helps, and good luck with your game.

P.S. also, if you intend to sell your game, watch out for licensing

share|improve this answer
    
So SQL/Object database are the way to go for gaming? Mentoliptus above suggested just storing quest text in JSON/XML format. And my current goal would be to license under BSD. –  theJollySin May 2 '12 at 15:42
    
If you don't have much quests, xml is the way to go. But if you have thousands of entries and you need to retrieve them based on different criteria - some kind of database is the way to go. This can be a SQL or a NOSQL one, depending on your preferences. –  loodakrawa May 3 '12 at 6:39
add comment

Why not try Json or XML if you want to hold large amounts of data. In my own jMonkey project I use XML currently to store all of my relevant information; though I plan to switch to JSON. Both are simple to use and parse and quest information can be edited by hand. You could maybe save a file for each quest and then place all of the quests in an archive to be loaded by reference ID when needed. I wouldn't really use SQL for this but thats just my opinion.

You could try using DOM, SAX or JAXB for XML or Kyro, Moxy or Jettison for JSON

HopeThisHelps

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.