1) The library is best for players who save a lot of information, especially for maps with a lot of players. For just 10 values you won't have any real advantage of the compression.
2) Banks are always modifyable manually because they're stored on the players' computers. Starcode doesn't change this. But Starcode's encoding/encrypting turns all values into a cryptic string which you CAN change, but you have no idea what the outcome is (and Starcode would most likely detect the modification and you can punish the player).
3) Yea, sure.
4) The compression only affects the saved string code. It doesn't compress your map or so. So nothing will give you back the space that the library requires.
5) About 550 lines. Without readme and change log about 350.
Apparently I'm doing something incredibly wrong. I'm trying to basically create an Achievement system where it tracks total number of kills, wins, losses and a few other specific Achievements and then assigns you a rank based off of those Achievements. When I run through a single game, the game runs perfectly. It levels me up when I complete Avhievements and tracks my total number of kills. However, once I load the game the second time, it sets my ranks to 21, my wins to around 3,000, my losses to around 7,000, and my total kills to 0.
I do have a dialog box that tracks the Total Kills and it shows the correct number at the end of the game. It just changes after I load a new game. Note that most of the Achievements are supposed to be set to either 0 or 1 to see if they're complete. Only rank, wins, losses, and kills go higher than that.
Here's my code I'm using. The first trigger is what I use at the Map Init phase.
I don't know what I said that made you think that we could use more than the 95 printable ascii character, but I'm interested! Hows that coming along?
I wouldn't know how you could get the extended ascii alphabet into galaxy editor. It wouldn't let me paste them in as a string and I don't know of a way to caste them to a string, other than perhaps having to load them from a preset bank, if thats even possible.
Alright I conducted some testing now, and according to this results the additional ascii chars do take up additional space.
So it looks like we have to stay at 90 characters. That's unfortunate.
Also it seems you can't even properly retrieve the characters anymore.
Oh well the 5 characters that I'm talking about are Html encoded. & ' " < and >
I can save 849 html encoded characters and load them back up.
What I meant was that no matter if the character is saved as "a" or "'" in the xml file, they both only count as 1 toward the 849 character limit in this example.
Tested by the below bank named "a.SC2Bank".
The name of the bank has to be 1 character long in order for this bank to load.
350 lines of code doesnt sound bad at all and I like the check sum modification check. I think Ill make use of this just need some time to figure it out I guess. Thanks for the answers.
I too am interested in this checksum. It is definitely a part of starcode thats highly valuable even if you don't intend to use the integer encoding.
With it you could save compressed data without encryption and still have a good level of security.
I use base 92 integers and currently sum the entire save string with 3 characters at the front, but its actually easier to break than a random hash sampling.
Now I'm thinking...
Max base size times the max character's store-able minus 3 characters for checksum. (95 * 846 = 80370)
3 characters in base 64. (64^3 = 262144)
So if you summed the entire save string, serialized it in base 64 as a bool, you could apply 64 bitwise encryption to just the sum.
I had a 64bit xor encryption lib that I deleted because it increased the size of the save string by 17%~ , but 80370 has to be stored with 3 characters regardless of base 44 or base 284. Sacrificing 3 characters for 64bit encryption doesn't seem like too bad an idea.
Now, where'd i put that library...
I ran the same test, with & and it still killed my game with the same amount of characters. I made a bank that was barely able to load, then turned most characters into & and the map crashed.
I also tried with the \x0XX encoding but that one's totally fubar.
and what about \xHH encoding? (Hexadecimal)
(Haven't tested it, but in string comparisons (\x31 == 1) (\x31 = char 049)
Rollback Post to RevisionRollBack
Meow meoow meeow. I'm ze evil SC2MapsterKitten.
UI Tutorials listing
UI support for other projects
Helrals Random Dungeon Map (progressing very slowly)
monitoring wiki and UI development forum
Is there any possibilty to get any information out of the playername text?
It is simply stupid that we can't convert to string, compare it, get the length or anything else. The library, compression and encryption is nice, but when player can simply copy paste the bank file from another player, there is no point in having huge encryption. :(
What about asking them secrets, hoping they say the truth and so won't tell others the "password"? :D
No way of getting anything out of the player name.
There are basically two ways of protection we can use right now:
1) Letting the player enter a password to save. That will make others unable to load the bank without the password, but if you think about it it's pretty darn useless. Since you only store your own bank locally you'd have to pass it on yourself so others could use it. You'd probably do that with the intention of others playing with your bank so of course you'd give them the password too.
2) When you save the bank the first time you create a random integer number and store this number.
Then, in the beginning, you get all these random ID numbers and compare them. If two of them are the same you can be pretty sure that someone passed his bank to another player in this game beforehand.
Drawbacks is, of course, that you can only prevent the "cheaters" from playing with each other, but not from playing their own games seperately.
Also, this is the very very small chance that two players could randomly get the same random ID and would get punished wrongly.
If you have 50,000 people actively playing your map then the chance would be 1 to 42949 that you'd have two players with the same ID (provided you generate the ID from a number of 1...2,147,483,647 which is the max for an integer). And that doesn't even include the small probability that these two players play with each other.
Another advantage is that you could use the bank to ban certain IDs that have been identified as cheaters. But that system is rather instable since you have to spread the info by playing with a lot of other players.
A related question. Since the introduction of new patch, it's been reported that character limit for bank files has been increased to 30000, from 400 previously. So does this means that the previous total bank file size limit 4kB of all players' files is also increased by a factor of roughly 70?
Hmm. This is interesting...I saved so many encrypted strings, that the test bank size went to 817kB, and it's still loadable without causing crash! I can't tell what's the bank size limit yet, but for now it seems to be at least 817kB.
Haven't test with multiplayer environment, so bear in mind this is for a single user bank file loading.
Quick question. Whats the possibilites of me dynamically generating the Encryption Seed Based off The Players name. Lets say I convert the players name to hex value and use that as the key?
Im basically looking to make it unique to the player and encoded as to discourage people trying to modify anything saved from my game.
On detecting a bad save. As in the decryption fails to pass I would not do anything but reset the data to be level 1 settings. such as score, kills, basic information I intend to save from game to game for players.
I wouldnt bother trying to "punish" people.
The reason would be IMO that the name difference would be unique enough to discourage most. Secondly it creates a kinda of barrier from people sharing the key.