Most likely how RS does - which (I believe, but may be wrong) is either in an XML document or something of the sort and then unpacking the data with a java class.
|
|
I am making a multiplayer 2D game and I'm wondering, what would be the best way to store items and all their data?
Thanks.
Most likely how RS does - which (I believe, but may be wrong) is either in an XML document or something of the sort and then unpacking the data with a java class.

Compression shouldn't matter for something like this, nor how it's stored beforehand, and assuming it's only loaded once at startup - just do whatever suits your needs and is easiest for YOU to work with.
Edit:
Meh.......
Code:private void loadSomeItemsPlz() { try { StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new FileReader(new File("items.txt")))); while (tokenizer.nextToken() != StreamTokenizer.TT_EOF) { int id = (int) tokenizer.nval; tokenizer.nextToken(); tokenizer.nextToken(); int price = (int) tokenizer.nval; tokenizer.nextToken(); tokenizer.nextToken(); System.out.println("loaded item #" + id + " and the price equals=" + price); // do what you gotta do yo } // print total amount of items loaded or something or how long it took, who cares } catch (Exception e) { // you done goofed } }
I'm personally a fan of MySQL databases to store data. But I believe you should only use MySQL if you're actually ready to release. Otherwise, I'd use some easy way to store data like .xml or .txt etc for just testing purposes because it's easier to manually edit.

| « Web browser made in fx | Programming Challenge #1 [Nov 7-14] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |