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

Save and load system

Status
Not open for further replies.
Level 23
Joined
Jan 1, 2009
Messages
1,615
Isnt this more like a trigger question than like a request?
The key is to think logical. If you disregard protection of the save-load code for a sec, you get the basic idea:
Save everything into a certain letter and load it also.
For example you got 3 heros, if some1 has the first one and saves his status, somewhere in the code appears an k, meaning he got the first hero, for every hero a different letter is at this position when saving.
If you load the code, you get to that position at some point and then create the hero for the player.

I think there are also some GUI savesystems here on hive, why dont u look into the triggers of them.
 
It's still a very good Save/Load system :)
The encryption and compression is great relative to the amount of data a code can store :)
Encoder's only good if you have a LOT of data you need to store.
If you just want to store the hero type, the level, and the position, you could easily
create your own save load system :)

It would be, as Frotty said, something like this:
Hero1 = "a"
Hero2 = "b"
Hero3 = "c"

Let's say a player has hero1 at level 12 and his coordinates are 89.2 and 124.4 and he has 100% hp and 98% mana.

The save code could be divided like this (unsecure):

Hero-Type....Level.....X-loc......Y-loc.....HP%.....MP%
....."a"........."012"...."00892"..."01244"..."100"...."098"..

The extra 0's are so that you can split the given load string to retrieve data.

The final product would be:
"a012008920124410098"
It's ok for a simple save/load system, but if you want to create VERY compact codes,
you should check out libraries like BigInt to compress very large numbers :)
 
Acehart's is by far not the best... and it is here http://www.thehelper.net/forums/showthread.php/49392-Save-Load-Code-Yet-Another

It will generate codes more than 2x longer than they need to be.

But if you don't care about massively long codes, then go for it =).

However, it is the best in regards to being easiest to use.

Here is a tutorial I wrote on how save/load works if you want to see for yourself the difs between the systems-
http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/saving-loading-192851/

And Pipedream's is a much better bet than Acehart's. It's quite easy to use and is right behind Encoder for save/load code sizes =).

edit
Keep in mind that Pipedream's save/load system leaks mass strings since it uses strings to do big number operations. BigInt, which is what Encoder uses, does not use strings at all.

Don't and no, it wont.

What's wrong with Encoder? >.>

There is a map that is using it. It went from 34 char code on one save/load system to a 9-24 char code on Encoder =).

Here is a code based on something like acehart's or CodeGen or w/e
-> 1666-666l-p648-4848 (16 chars)

and here is one that stores exact same data based on Pipedream's
-> c14R-OWXS-l (9 chars)

The above 2 examples were taken out of the tutorial (evolving a save/load code).


For Encoder, it's difficult to say... depending on the complexity of the code, it may have the same exact size, or a large range of sizes from a small size to same max size, or a large range of sizes from a small range to a medium size.

To give an idea, using a 9 character save/load code on Pipedream's, these could be possible code ranges in Encoder-
9 chars
2-9 chars
2-5 chars


----------------------
I think the results speak for themselves. Mag likes the compression in Encoder, but it won't blow your mind since there are systems like Pipedream's that use the exact same techniques. The thing that really sets Encoder apart from the others is the structure of its save/load codes. It has a tree based structure rather than a list based on, which leads to the wide variety of code sizes I showed above.

With a tree based structure, only relevant data is saved. For example, if you had an inventory size of 6 and you only had 2 items, then only 3 items would be saved (2 items + a blank) rather than 6 (2 items + 4 blanks).

It can also do things like save item charges properly, save hero specific abilities... and well, w/e you want really.

But keep in mind that Encoder is the most complex of all of the save/load systems... it's pretty much a save/load system for building a save/load system... lol... and because of that, it requires that users be pretty good with vjass =P

the philosophy behind it was that the best save/load system for a specific map is a save/load system built specifically for that map =). With that, you can have the best possible save/load codes for the map.
 
Last edited:
Status
Not open for further replies.
Top