Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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  
  Saving game data with performance in mind  (Read 668 times)
0 Members and 1 Guest are viewing this topic.
Online Mac70
« Posted 2013-10-11 15:56:45 »

I am working on small MMO project where data loading and saving speed is very important. What is the best choice between:
  • performance (most important, no more than 0,2 s for 10 mb of data)
  • compatibility (possibility to add/remove fields without compatibility loss)

Currently I am using KryoNet for both networking and saving server state, but I am wondering if there is even better solution.

Check out my Devblog! Smiley
Offline Roquen
« Reply #1 - Posted 2013-10-11 16:04:15 »

Depends on how much effort you willing to put into it...specifically handling multiple formats.
Offline xsvenson
« Reply #2 - Posted 2013-10-11 17:12:22 »

Asynchronous saving and/or splitting up the saving into smaller parts.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Roquen
« Reply #3 - Posted 2013-10-11 17:34:11 »

compression
Online Mac70
« Reply #4 - Posted 2013-10-11 18:01:52 »

compression

I think that compression would make opossite effect - making data loading longer. Smiley

I will check asynchronous saving/loading, it seems like a good idea.

Check out my Devblog! Smiley
Offline Savant

Junior Newbie





« Reply #5 - Posted 2013-10-11 18:07:48 »

Can you give any more details? How frequently do you need to save state, are you able to save the state in pieces or do you need to save everything at the same time? Are you saving across a network or is all of the work happening on one machine? What sort of structures do you have to save?
Online Mac70
« Reply #6 - Posted 2013-10-11 18:19:13 »

I am saving and loading map fragments (together with all objects and items in this area). The whole map is too big to be stored in RAM, so I must save and load 500X500 fragments when player come close to them and trigger loading. The whole saving and loading happens on server.

Client is receiving 100X100 map fragments when he is close to the edge of visible area. Game is not too dynamic, so players usually spend most time near the same place unless they want to go exploring, hunting or switch layer (for example, going from surface to interior).

Check out my Devblog! Smiley
Offline cylab

JGO Ninja


Medals: 43



« Reply #7 - Posted 2013-10-11 19:04:51 »

for the ease of it,  I would try to load/save json through xstream. also try out roquens advice to use compression by wrapping the input and output streams with inflater or gzip streams.  chances are that network/filesystem bandwidth is more limiting than cpu

Mathias - I Know What [you] Did Last Summer!
Offline Savant

Junior Newbie





« Reply #8 - Posted 2013-10-11 19:21:12 »

A few more questions, sorry.

How much system ram does your server have? What sorts of objects are you saving, and how are they stored?
Offline Roquen
« Reply #9 - Posted 2013-10-11 19:22:16 »

Yeah that's why I mentioned compression...without thinking it through it seems like it would slow things down but often it's actually faster.

Multithreading: lower priority thread for preloading of static data for instance.
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.

atombrot (20 views)
2014-08-19 09:29:53

Tekkerue (21 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (55 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (27 views)
2014-08-08 02:01:56

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (64 views)
2014-08-03 02:57:17
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!