• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Saved Code stored locally & Sync Speed

Status
Not open for further replies.
Level 16
Joined
Aug 7, 2009
Messages
1,406
So I've got a pretty wild map idea a few days ago and I've been working on it ever since. I've been checking the spells/JASS section every now and then so I knew that it's still possible to use the preloader exploit to store data locally. However, I read in the "Codeless Save/Load" thread that syncing might take 2-5 minutes, which is a LOT.

I've seen the preloader being used to STORE things (TKoK), and it was roughly instantaneous, but I've never seen it used for loading stuff, so I don't know if it's the encryption, the syncronization or simply reading the data is what slows this process down.

My question is: has anyone ever experimented with this? Does anyone know how fast reading & syncing a "regular" (the ones you usually see displayed in ORPG's - except this would be 2-3x longer) save code would be? If I can't pull this local account idea off I'm better off just abandoning the project straight up, I'm already dancing on the edge of a knife with this.

P.s: I want to read the entire save code, sync it, and decrypt it afterwards, for everyone.
 
You can sync more than one thing at once (not quite "at once", but I mean that you don't have to wait the latency per sync.. so if you sync two things with a latency of 300 ms, it'll take about 300 ms to sync both [increases with more syncing], not 600 ms), so it shouldn't be too bad.

If it is just one string that you need to sync between players, I really don't think it'll be much. Keep in mind that Nes' codeless/save load was made to handle really severe cases, beyond what any practical map would save. The 2-5 minute estimate is likely from a stress-test. I haven't tested how fast syncing strings are, but I imagine it really isn't that much if you have such little data (the data saved in an "average" ORPG falls under that category).
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
Well, my plan was to sync it while it's one huge string and go from there (decrypt, etc, everyone can do that locally). Is it really that slow? I mean, we're talking about 200-300 characters at max here. What's that? That's a few kilobytes at max even with Unicode.

The player limit is 6 at the moment, BTW, and it only needs to be done once. With something like 15-30 seconds I think I could live.

Well, it's a shame if it's really that slow.
 
Well, my plan was to sync it while it's one huge string and go from there (decrypt, etc, everyone can do that locally). Is it really that slow? I mean, we're talking about 200-300 characters at max here. What's that? That's a few kilobytes at max even with Unicode.

it's ~2 minutes for 256 bits in a 12-player game

1 character = ~6 bits

300*6 = 1800 bits

1800/256*2 = ~14 minutes

this means that it is guaranteed that 300 characters will take at least 14 minutes to synchronize in a 12 player game

it maybe be 5 minutes in a 6 player game


you definitely want to do local decryption and validation so that you aren't sending the extra bits over the network. AES does a minimum of 128 bits and MD5 adds another 128 bits.
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
Yea, kinda thought it was the synchronization, because 1) when I run alone it's instantaneous, and 2) yes, there might be still a few more weeks left before I dive into the world of networking, but I've already dealt with file IO, and I know that reading a few hundred characters does not take minutes, LOL.

Well, hmm, IDK. I'll see if I can get away with 1 or 2 player inputs. It's a shame though, it totally kills the idea of local accounts :S

Every damn day I spend with WC3 makes me want to do something from scratch even more.

Thanks for the answers.

[EDIT]

Well, screw it. There's no way even 250 characters are enough. FPS issues, painful loading, etc etc. I'll rather spend my next half year practicing OpenGL and computer graphics/networking than working on a painful map for a game hardly anyone uses.
 
Last edited:
Level 15
Joined
Aug 7, 2013
Messages
1,338
it's ~2 minutes for 256 bits in a 12-player game

1 character = ~6 bits

300*6 = 1800 bits

1800/256*2 = ~14 minutes

this means that it is guaranteed that 300 characters will take at least 14 minutes to synchronize in a 12 player game

it maybe be 5 minutes in a 6 player game


you definitely want to do local decryption and validation so that you aren't sending the extra bits over the network. AES does a minimum of 128 bits and MD5 adds another 128 bits.

Ah so you finally pull out the figures for how long it takes given how much information. Been waiting for these.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The restoration time is based entirely on the complexity of the data being restored. I remember overhearing people saying that it literally goes in bytes per second which is very slow in this day and age. However this is often enough as even a few bytes can be used to represent most text based save/load codes.

The key is to fragment your data such that you only ever transfer what is needed. If you have a complex state make sure that only the required subset from it is loaded (do not sync all characters, just the character the guy wants to load).
 
Status
Not open for further replies.
Top