Hi. I'm currently working on banks that save players' info by using Starcode. Everything works fine w/o just one problem. When player leaves, the game saves his info, and ALL PLAYER'S GAME IS STOPPED FOR A WHILE. Nobody can't interact with game before the saving procedure is complete. Does anyone got clue about this?? Thanks.
p.s. Currently my game saves about 2 million integers(maybe). Was the size problem?
Smallized my bank to save just 360000 integers. Lag is reduced but not much I wanted. Can't it be threaded? Although I made a threaded action for save and put in on player leave trigger, result was same. All players stopped.
Do you mind posting your map in here? It's hard to imagine this problem with no real reference. Otherwise you need to describe your whole system a little more and how/when the lag occurs.
Main map uses above 100mb mod file, and it takes too long for upload, so I separate the bank triggers. There can be 2 players, and you can see the freezing when your opponent player leaves.
The areas where you save the "Player Item Allowed" variable and the "Hero Pick Frequency" are definitely too much for StarCode to handle. The problem is not how big those variables are, but rather how often you repeat the "Store Integer" action. Try merging all those variables into a String and compress it using the StarCode Function "Compress String", then save that string into your bank. Might be a little faster, but I cant gurantee you that.
Try merging all those variables into a String and compress it using the StarCode Function "Compress String", then save that string into your bank.
I didn't understand that, isn't there already compress that variables? Or did you mean create 'another' threaded macros that stores another Starcode string containing those variables, and put it in player leave trigger?
I separated Load macro into 4 threaded macros(Player Statistics, Item, Achievement, Hero Pick Frequency). Lag reduced, but some of Starcodes didn't saved.
As you can see in this picture, HPF(Hero Pick Frequency) and ACH(Achievement) didn't saved. watwatwat...
My bad, it has been some time since I last worked with it. Yes, saving all the variables in one bigger String as I suggested would be redundant, since StarCode does this anyway on its own. Therefore the only thing I can think of now is saving all variables in packs, meaning that you spread out the variables into multiple Strings that you save independently, sorting them by how frequently these values are changed and need to be saved. If thats no option for you then you either need to reduce your amount of variables somehow or if nothing of this works, send a message to the player informing them that the game is currently saving.
This might come from the fact that all your save actions create Threads and might interfere with each other. I can't say for sure though, since I still don't fully understand your system.
Well, Even though I unchecked 'Create thread' options for all save macros, ACH and HPF comes for nothing. And I thought that Galaxy Editor supports controlling the critical section(someday I experimented)... so there might not have race conditions.
This is the hardest problem I've experienced in mapping... Why Blizzard's bank signatures can be cracked.. LOL
That is only 1172 variables needed NOT 1.8 million!
It sounds like you are being very inneficient with how you are storing your data.
If you wanted to be even more efficient with how you store data you could drastically cut down on that number even further. If you stored only the achievements and items that the player DID have, say that each player typically has half the items and achievements available then that is only about 500 variables needed for the average player.
If you combined all those boolean states for whether a player has an item or achievement into a string you could probably reduce it so that each player only needed 7 variables.
From what you describe I don't see why you need more than 7 variables so I don't know how you manage to have 1.8 million lol.
Hmm. I've just modified the saving time and it works nearly fine. My game has two fade-out situations, so I can save all players' info in that time. Thanks for advicing me :)
I treated Starcode like a Limited Dynamic Array, that is retain its own area even though it doesn't use its space. Thanks for correcting me, but I can't find a way to reduce the amount of saving variables... Everything is needed in a right place.
ps. If my game just saves 1172 variables instead of 1.8M, then why Starcode freezes when I change the maximum Credits from 99999 to 999999? By your opinion, latter's amount is same with former. Of course, I changed the saving/loading bank name.
Hi. I'm currently working on banks that save players' info by using Starcode. Everything works fine w/o just one problem. When player leaves, the game saves his info, and ALL PLAYER'S GAME IS STOPPED FOR A WHILE. Nobody can't interact with game before the saving procedure is complete. Does anyone got clue about this?? Thanks.
p.s. Currently my game saves about 2 million integers(maybe). Was the size problem?
Definitely an issue with the amount of integers. Do you really require so many? What are you saving with them?
@TheUltragon: Go
3000 for Minimum amount of Exp, 60000 for Maximum amount of Exp, 50 for Maximum level
+ 999999 for Maximum Credits, 99999 for Maximum Play Count, 50000 for Maximum Amount of Player Win
+ 28(Maximum amount of heroes) * 30000 for Play Count for each Heroes, 840 for Items available, 300 for Achievemets available.
-> 3000 + 60000 + 50 + 999999 + 99999 + 50000 + 28*30000 + 840 + 300 = about 1.8 million LOL
How should I reduce? Should I remove Playcount for each heroes? but it's still about 1 million though OMG
Smallized my bank to save just 360000 integers. Lag is reduced but not much I wanted. Can't it be threaded? Although I made a threaded action for save and put in on player leave trigger, result was same. All players stopped.
Do you mind posting your map in here? It's hard to imagine this problem with no real reference. Otherwise you need to describe your whole system a little more and how/when the lag occurs.
Main map uses above 100mb mod file, and it takes too long for upload, so I separate the bank triggers. There can be 2 players, and you can see the freezing when your opponent player leaves.
The areas where you save the "Player Item Allowed" variable and the "Hero Pick Frequency" are definitely too much for StarCode to handle. The problem is not how big those variables are, but rather how often you repeat the "Store Integer" action. Try merging all those variables into a String and compress it using the StarCode Function "Compress String", then save that string into your bank. Might be a little faster, but I cant gurantee you that.
Thanks for your kind reply, but I have one question.
I didn't understand that, isn't there already compress that variables? Or did you mean create 'another' threaded macros that stores another Starcode string containing those variables, and put it in player leave trigger?
dafuq.
I separated Load macro into 4 threaded macros(Player Statistics, Item, Achievement, Hero Pick Frequency). Lag reduced, but some of Starcodes didn't saved.
As you can see in this picture, HPF(Hero Pick Frequency) and ACH(Achievement) didn't saved. watwatwat...
Here is the source :
My bad, it has been some time since I last worked with it. Yes, saving all the variables in one bigger String as I suggested would be redundant, since StarCode does this anyway on its own. Therefore the only thing I can think of now is saving all variables in packs, meaning that you spread out the variables into multiple Strings that you save independently, sorting them by how frequently these values are changed and need to be saved. If thats no option for you then you either need to reduce your amount of variables somehow or if nothing of this works, send a message to the player informing them that the game is currently saving.
Edit: Will take a look into your new map...
@killduk: Go
This might come from the fact that all your save actions create Threads and might interfere with each other. I can't say for sure though, since I still don't fully understand your system.
@TheUltragon: Go
Well, Even though I unchecked 'Create thread' options for all save macros, ACH and HPF comes for nothing. And I thought that Galaxy Editor supports controlling the critical section(someday I experimented)... so there might not have race conditions.
This is the hardest problem I've experienced in mapping... Why Blizzard's bank signatures can be cracked.. LOL
@TheUltragon: Go
How can I describe my systems? Do you mean my bank system? Or is it a whole game mechanism?
In its current state this is just a Bank System since it doesnt handle much more than saving all the values of your game into your bank.
That is NOT 1.8 million integers being saved!
amount of Exp = 1 integer variable
credits = 1 integer variable
play count = 1 integer variable
win count = 1 integer variable
amount of heroes = 28
play count for each hero = 1 integer variable
items gained = 840 boolean variables
achievements earned = 300 boolean variables
ACTUALLY the maths is
1 + 1 + 1 + 1 + 28*1 + 840 + 300 = 1172
That is only 1172 variables needed NOT 1.8 million!
It sounds like you are being very inneficient with how you are storing your data.
If you wanted to be even more efficient with how you store data you could drastically cut down on that number even further. If you stored only the achievements and items that the player DID have, say that each player typically has half the items and achievements available then that is only about 500 variables needed for the average player.
If you combined all those boolean states for whether a player has an item or achievement into a string you could probably reduce it so that each player only needed 7 variables.
From what you describe I don't see why you need more than 7 variables so I don't know how you manage to have 1.8 million lol.
@TheUltragon: Go
Hmm. I've just modified the saving time and it works nearly fine. My game has two fade-out situations, so I can save all players' info in that time. Thanks for advicing me :)
@finiteturtles: Go
I treated Starcode like a Limited Dynamic Array, that is retain its own area even though it doesn't use its space. Thanks for correcting me, but I can't find a way to reduce the amount of saving variables... Everything is needed in a right place.
ps. If my game just saves 1172 variables instead of 1.8M, then why Starcode freezes when I change the maximum Credits from 99999 to 999999? By your opinion, latter's amount is same with former. Of course, I changed the saving/loading bank name.