Some Noob Q's - Mostly about gui's & data logging

Hi guys,



Some noob questions that i couldn't find a simple answer to by searching.



As a bit of background, I am more a scientist than a programmer & for my psychology phd I am writing a game that will allow me to test how children form new categories or learn rules. In the first 'grab' phase they have to navigate round an environment capturing various "aliens" and then in a 'sort' phase they have to sort them into appropriate categories based on their appearance. I actually started off using CrystalSpace but jME is much easier and more appropriate for what i am doing. And thanks to the examples, tutorials, wiki and forums (and Eclipse!) I have been able to get started very quickly. But now i've hit a few problems that are less to do with the game and more about the fact that this is an experiment where I need to capture data.



So I havet two main questions.


  1. What is the best way to read/write game data to a file? I will need to include various types of data

  • information entered about the individual players entered at the start (through some GUI.. see Q.2 )

  • info about the initial set up of the game.. what objects are we using as the aliens, where are they initially located, etc.

  • relatively detailed telemetry data - ability to track where the user went and what order they grabbed the aliens, where did they click when they were sorting, etc

  • this should ideally include fairly accurate timing information


  • Creating some kind XML document seems the most obvious way to proceed but i would be very grateful for any pointers to example code or any of your thoughts on how best i should proceed.

    2. I need a simple GUI to enter info about each player and to select the type of task I want them to complete. However I have had trouble with both FengGUI and JMEDesktop

    I could not get FengGUI to work. Using the sourceforge jar file,  I get java.lang.UnsupportedClassVersionError which i told is a probably a java language compatibility problem  (OSX 10.5 PPC with Java JRE 1.5.0). I tried getting FengGUI from SVN but that wasn't a straight-forward process either so i switched to JMEDesktop.

    However, the JMEDesktop example runs very slowly on my machine and I've seen a few comments on here about JMEDesktop not playing nicely with OSX. my GUI doesn't need to be fast so I will probably persevere with JMEDesktop but I'm a little worried about the reliability.

    Again all input gratefully recieved.

    Ta, 1mnky

    Well, you might write your own data class.  That way you could use LinkedList (etc) to traverse the data as it was needed, but easily use a custom writer/reader object to write/read XML (or any format you want)



    As far as the GUI, what about just using a swing or AWT GUI and adding graphics to an AWT panel?  You would of course have to be careful about any use of swing since its all using lightweight objects and AWT is all heavyweights.  (I am pretty sure this can be done, I used to do it with JOGL all the time)

    FengGUI is currently being developed very actively, and right now the svn version is rather unstable / incomplete, so you have to use an older stable jar file.

    I also had problems with JMEDesktop on MacOS, the only thing you could try is BUI/GBUI, but i never used it yet.

    GUI libraries for jME

    You can try downloading fenggui source release (not the CVS/SVN version). Then you might be able to compile it with 1.5 in eclipse. It's unlikely they are using too many 1.6 specific features (if any at all): maybe once or twice in the whole fenggui project. Then you can locally replace 1.6 specific code with code that works in 1.5. Eclipse will tell you where the problem is, so it should be fairly easy to find 1.6 specific code.



    About data: it seems you will have a lot of data (user input with timing can add up to hundreds of megabytes or several gigabytes). Also it looks like you require to run many data queries. So you should consider using a database. Have a look at Java Derby (aka Java DB). And also have a look at java persistence api (you can use hibernate as the persistence driver). With this approach you can easily store/manipulate gigabytes of data easily and efficiently. The only downside is you need to have the basic understanding of databases and SQL, which is faster to learn rather than develop your own data storage format and querying mechanism.

    Yeah, a DB would probably be a good idea.





    Is Java DB comparable to SQL??

    hmm, I hadn't thought of a database… It is a possibilty and from our point of view it is always better to log as much as possible at the outset and decide which data are of interest after the fact.  I've did a fair bit of SQL database coding in a previous life so I will certainly have a look at Java Derby