Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Database for games  (Read 2482 times)
0 Members and 1 Guest are viewing this topic.
Offline siu

Junior Newbie




Java games rock!


« Posted 2004-05-28 03:53:48 »

Hi, I'm creating a card game very similar to Magic "The Gathering" and Yu-Gi-Oh! Card game. I was wondering, what type of database do game programmers use? I think it shouldn't use database managers like mysql and sql server since they are for more complex data dealing applications, I need to know what database to use such that a computer that only has the java virtual machine installed can run my card game and don't have problems accessing the databse. I really have 0 experience on gameprogramming, I'm learning and really need a lot of help out here, this is one of the many issues I will have for this project, later I'll have to deal with AI technique for these type of games, but for now I would appreciate any help about java connecting to database for games and if you have tutorials for working with java and a dabatase.
Offline DrBizzar0

Junior Member




Raj raj!


« Reply #1 - Posted 2004-05-28 04:38:50 »

I've used hsqldb in the past, it's small and fast. I noticed though that the current build isn't that small anylonger, ranking in at 553kb.

http://hsqldb.sourceforge.net/
Offline phazer

Junior Member




Come get some


« Reply #2 - Posted 2004-05-28 06:06:20 »

First I think you should consider if you need to use a database at all. If you don't need transaction handling, indexing, query language etc. storing objects in files might be a good solution. If you are creating a client/server application and your data objects fits in memory you should consider a solution like Prevayler (www.prevayler.org) which is very easy to use.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2004-05-28 08:42:33 »

Quote
First I think you should consider if you need to use a database at all. If you don't need transaction handling, indexing, query language etc. storing objects in files might be a good solution. If you are creating a client/server application and your data objects fits in memory you should consider a solution like Prevayler (www.prevayler.org) which is very easy to use.


This is the old debate: are databases for general storage and retrieval of data? (hint: in the end, those that said "yes" won the majority verdict by a huge margin).

I would suggest you never ever turn down a database if you could conceivably use one; you will benefit many times over in terms of how quickly you can write your code, how easy it is to maintain, etc.

OK, so the most *famous* DB's you hear of these days are:
- Oracle
- DB2
- MySQL
- Access

3 of which are a PITA to install and setup and sometiems hard to justify the hassle for 20 users, let alone for just a single non-networked app for one person. The fourth is pretty trivial - assuming you have windows and Office.

But...you should use databases wherever you can, really. They're like java.util.*, only much better Grin. Thankfully, Java has JDBC which lets you write your code independent of the actual database you use, and then you can try out several of the "local machine only" DB's. Someone mentioned one above, but there are many more available (have a look on sourceforge.net for a start for free ones?).

Sadly, though, most of the famous ones are only compatible with each other for the most common commands, and they each rename all the other commands to words they like better (stupid evil bastards) than the ones their competitors use for no good reason. So you have to limit yourself in some ways if you want trivial portability. Although if you're considering not using a database, your needs are probably straightforward enough that you can use the common subset for everything anyway (it will only become a problem when you start to say "Hey, this is cool...what else can I do with it?")

EDIT: I forgot to say my most important point: just because the "big four" require lots of setup, many megabyte downloads, etc doesn't matter - the many other DB's around are often just tens or hundres of Kb, and many do things like implement as lots of files in the local directory - perhaps even with no networking at all - but they give you all the benefits of a DB-style API to work to.

malloc will be first against the wall when the revolution comes...
Offline zparticle

Senior Member




Thick As A Brick


« Reply #4 - Posted 2004-05-28 11:42:25 »

If you need something basic just to Store/Modify/Read records you could use a library I recently wrote.

see http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Offtopic;action=display;num=1084466955 for more details.

It works and supports indexes, there is an NIO and a regualr IO version. On a crappy lap top it can read 100,000 records in only a few seconds.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #5 - Posted 2004-05-28 13:49:07 »

Hehe.. remember that a filesystem IS a database.  Then take a look at what Microsoft and Apple are planning to add to their filesystems in future OS releases.. (more metadata),  and you will realize how silly today's filesystems are.  The trend is to move to more full-featured databases for all general storage.

I'm with blah3.

Offline ribot

Junior Member




Ribot - mobile UI specialist


« Reply #6 - Posted 2004-05-28 13:59:06 »

I've always had a question with regard to database access:

How would I go about making sure that the password used to access the database is not discovered?  Someone could obtain a class decompiler, extract the password and delete all my data.

Couls I somehow hash the password, then the hashed password is checked against the real password on the server (a jsp file?) and then i somehow reroute the access?

http://ribot.co.uk - design agency focused on mobile
http://www.retrospecs.co.uk - online vintage eyewear store
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2004-05-28 14:30:14 »

Quote
I've always had a question with regard to database access:

How would I go about making sure that the password used to access the database is not discovered?  Someone could obtain a class decompiler, extract the password and delete all my data.

Couls I somehow hash the password, then the hashed password is checked against the real password on the server (a jsp file?) and then i somehow reroute the access?


If your game client has a password, then every hacker with a copy of your game has that password. There is no other scenario (assuming you have any significant number of people playing your game!).

The way that games typically work is to NOT access the server directly from the client. Instead, they access an intermediary - usually a "gameserver" written perhaps in java - which itself then performs DB access. There are many advantages to this, not least of which that you can also place a software cache inside your "gameserver" which is shared by all the clients accessing the game Smiley.

In the case mentioned by the OP, all that is going to happen is that someone could "hack" their local copy, and perhaps change the powers of the different cards etc. They could do this anyway, of course Smiley, and it's only them who is affected, so you probably don't care.

...except that it is perhaps easier now for someone to distribute a tiny client that lets people interactively modify the game rules on their local copy. But if someone does this, you'll probably be delighted - it shows people really like your game! And if you are charging money, you just include a "bonus" app (possibly for minimal) charge which is your own official editor in your next release.

(nb: it's not unknown for games companies to hire hackers in this way, in order to get the person and the editor, which they then convert into an "official" one at less than the cost of developing one from scratch. The first major hacker of Diablo got recruited by Blizzard in time for D2 IIRC...)

malloc will be first against the wall when the revolution comes...
Offline siu

Junior Newbie




Java games rock!


« Reply #8 - Posted 2004-05-30 17:20:32 »

Thanx for your responses, I just have a question, with te HSQLDB, when deploying my game, somebody installing my game in his computer doesn't need to install de HSQLDB in order to be able to play my game am I right?
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #9 - Posted 2004-05-30 17:43:37 »

That's right: HSQLDB in a deployment consists of a number of data files (the database data) and a Jar library (the database application code).  As long as you distribute this library with your application, end-users will not even need to know you're using HSQLDB.

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline siu

Junior Newbie




Java games rock!


« Reply #10 - Posted 2004-05-31 03:28:32 »

What do you think about Pointbase Server?
Offline ribot

Junior Member




Ribot - mobile UI specialist


« Reply #11 - Posted 2004-06-01 09:37:22 »

thanks for the explanation blah^3!  So, I'm thinking that I'd need to use servlets (which my host does not allow me to do), is there any other way using standard server-side scripting such as PHP, ASP or Coldfusion?

http://ribot.co.uk - design agency focused on mobile
http://www.retrospecs.co.uk - online vintage eyewear store
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #12 - Posted 2004-06-02 01:20:31 »

Quote
What do you think about Pointbase Server?

I"ve never really used it before myself, but I think it's as lightweight as you can get.

Enjoy.
Regards,
     - D.t.O
Offline shawnkendall

Senior Member





« Reply #13 - Posted 2004-06-02 18:08:15 »

Any comments from someone who has used (or choose not to use) Java Data Objects?
http://access1.sun.com/jdo/
Thanks!

Shawn Kendall
Cosmic Interactive, LLC
http://www.facebook.com/BermudaDash
Offline rreyelts

Junior Member




There is nothing Nu under the sun


« Reply #14 - Posted 2004-06-02 19:18:55 »

Quote
Any comments from someone who has used (or choose not to use) Java Data Objects?
http://access1.sun.com/jdo/
Thanks!

I haven't used JDO for games, but I am using it in production code. JDO has saved us buttloads of development time. We're quite happy with the results.

If you're going to evaluate JDO, the best thing you can do is to make sure you try out a good implementation. Some of the open-source stuff out there is total crap. (There may be some better free implementations out there since I lasted checked - it's been a while).

We're using JDOGenie and we've been very happy with them. I've also evaluated Kodo, and Solarmetric seem to be a competent vendor.

God bless,
-Toby Reyelts

About me: http://jroller.com/page/rreyelts
Jace - Easier JNI: http://jace.reyelts.com/jace
Retroweaver - Compile on JDK1.5, and deploy on 1.4: http://retroweaver.sf.net.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (21 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (66 views)
2014-09-10 06:39:09

Tekkerue (33 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (36 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!