Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (674)
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 1118 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 Wizard

Medals: 90

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

basil_ (40 views)
2015-09-30 17:04:40

shadowstryker (20 views)
2015-09-29 15:55:06

TheSpaceHedgehog (26 views)
2015-09-29 01:58:48

GamerC4 (50 views)
2015-09-24 21:10:38

GamerC4 (69 views)
2015-09-24 21:09:48

htuy (24 views)
2015-09-24 04:57:24

htuy (34 views)
2015-09-24 04:56:35

htuy (25 views)
2015-09-24 04:56:09

htuy (25 views)
2015-09-24 04:47:33

Roquen (62 views)
2015-09-21 12:54:28
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!