Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (223)
games submitted by our members
Games in WIP (813)
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 1885 times)
0 Members and 1 Guest are viewing this topic.
Offline 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.
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 »

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


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.
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?
Offline 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).
Offline cylab

JGO Kernel

Medals: 173

« 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.

cybrmynd (117 views)
2017-08-02 12:28:51

cybrmynd (139 views)
2017-08-02 12:19:43

cybrmynd (136 views)
2017-08-02 12:18:09

Sralse (152 views)
2017-07-25 17:13:48

Archive (620 views)
2017-04-27 17:45:51

buddyBro (730 views)
2017-04-05 03:38:00

CopyableCougar4 (1255 views)
2017-03-24 15:39:42

theagentd (1235 views)
2017-03-24 15:32:08

Rule (1213 views)
2017-03-19 12:43:22

Rule (1265 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!