Save/Load

Do you need World Editor help? Ask here!
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)

Save/Load

New postby PurePwnage on Mon Jul 20, 2009 10:39 pm

Does anyone know how to program in save + load strings?
I have triggers and such down fine and am trying to add this to my knowledge for later use...
PurePwnage
 
Posts: 3
Joined: Mon Jul 20, 2009 10:34 pm
Location: Canada
Realm: US East
Account: Pure.Pwnage.

Re: Save/Load

New postby 3ICE on Mon Jul 20, 2009 10:58 pm

Regular users are not supposed to understand how to encode numbers into strings and prevent cheating with (a) checksum(s). That's why there are save load systems available. You don't have to know how they work, all you have to do is import a few triggers into your map and you are done. (It would take days to make your own save load system.)
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Save/Load

New postby PurePwnage on Mon Jul 20, 2009 11:53 pm

So; from what I gather - I use a player types "whatever" event - and then use triggers to give them a code specific to their unit
And then when they type this code into a game - it decompresses this code into the unit that has been saved...
I'm going to look through a few unprotected maps I have to see if I can find exactly how some people did this...
PurePwnage
 
Posts: 3
Joined: Mon Jul 20, 2009 10:34 pm
Location: Canada
Realm: US East
Account: Pure.Pwnage.

Re: Save/Load

New postby 3ICE on Mon Jul 20, 2009 11:56 pm

Why not use a save load system?
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Save/Load

New postby PurePwnage on Tue Jul 21, 2009 12:11 am

I guess I phrased my last post wrong - you said what it was I was trying to say - that I'd figure out how to make a save/load system
Anyhow I figured out how to create a save/load system in the past 10 mintes or so
And now I'm going to sleep - It's 1:11 over here
PurePwnage
 
Posts: 3
Joined: Mon Jul 20, 2009 10:34 pm
Location: Canada
Realm: US East
Account: Pure.Pwnage.

Re: Save/Load

New postby manstie on Sun Aug 30, 2009 9:51 am

Along the lines of save/load systems... How the hell did the makers of The Black Road 2.0 make it that whenever you save, then save 1 second later, the code is totally different to the previous one...
Image
User avatar
manstie
 
Posts: 278
Joined: Wed Jun 17, 2009 9:27 am
Location: Perth, Australia
Account: manstie

Re: Save/Load

New postby 3ICE on Sun Aug 30, 2009 9:58 am

They have multiple encoding patterns.

Every time you save, a random encoding is used. The encodings have an id, which is also saved (unencoded). This makes it harder (but not impossible) to manipulate your savecode.

I believe hashing is a more clever way to prevent code manipulation.



EDIT: What I meant by hashing is adding a 2-4 characters long checksum (also called a hash sum) to the savecode. This way people can try to edit their codes all they want but it will not have any effect because they will have no chance of finding out what the new checksum is.

If I made an RPG, I would save a hero this way:

Hero type: Archer, Code: A
Hero level: 45, Code: 45

Player gold: 19455, Code: 19455

Player wood: 6, Code: 6

Item in Slot#1: Empty, Code: null
Item in Slot#2: Crown of Kings +5, Code: Crwn
Item in Slot#3: Boots of Speed, Code: Btos
Item in Slot#4: Empty, Code: null
Item in Slot#5: Empty, Code: null
Item in Slot#6: Potion of health, Code: Poht

Quest 1 status: Completed, Code: 3
Quest 2 status: Completed, Code: 3
Quest 3 status: Started, Code: 2
Quest 4 status: Discovered, Code: 1
Quest 5 status: Not discovered, Code: 0

Type and level: A45-
Gold and wood: 19455-6-
Items: nullCrwnBtosnullnullPoht-
Quests: 33210
Full savecode: A45-19455-6-nullCrwnBtosnullnullPoht-33210

Get a checksum: md5

We don't even have to encode (turn the code into something players don't understand) their savecode, the hash sum takes care of potential cheaters.

Savecode: A45-19455-6-nullCrwnBtosnullnullPoht-33210-md5

We can optimize the item code by replacing 4 char strings with 1-2 char numbers: A45-19455-6-0-16-27-0-0-2-33210-md5

The checksum changes with every minor modification of gold or other variable:
The hero kills a creep (levels up, gets gold) and saves again: A46-19500-6-0-16-27-0-0-2-33210-xav
The hero kills another creep (gets gold) and saves again: A46-19515-6-0-16-27-0-0-2-33210-upt
The hero kills another creep (gets gold) and saves again: A46-19535-6-0-16-27-0-0-2-33210-dmz
The hero kills another creep (gets gold) and saves again: A46-19610-6-0-16-27-0-0-2-33210-awg

And the chance of getting a 3 digit checksum right is:
Characters: abcdefghijklmnopqrstuvwxyz1234567890 (36)
Digits: 3
Exponentiation: 36^3 = 46656
Chance: 1:46656
Calculating percent: 0.00002%

As you can see, it is pretty low. :)
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Save/Load

New postby manstie on Sun Aug 30, 2009 10:02 am

Can you explain what the new "Hashtable" trigger function is? And how could I possibly use it?

Random off-topic stuff: Have you seen that BlizzCon thing about the Starcraft II Editor? ****ing amazing.
Image
User avatar
manstie
 
Posts: 278
Joined: Wed Jun 17, 2009 9:27 am
Location: Perth, Australia
Account: manstie

Re: Save/Load

New postby 3ICE on Sun Aug 30, 2009 10:03 am

No&No.

Don't post unrelated stuff to this topic... This is about save/Load, not hashtables!
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Save/Load

New postby manstie on Sun Aug 30, 2009 10:04 am

But... you said hasing, I thought the two were related :x
Image
User avatar
manstie
 
Posts: 278
Joined: Wed Jun 17, 2009 9:27 am
Location: Perth, Australia
Account: manstie

Next

Return to HELP



Who is online

Users browsing this forum: Google [Bot] and 24 guests