• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Sigh Once again Load/Save

Status
Not open for further replies.
Level 7
Joined
May 21, 2009
Messages
289
Ok that's it, I'm tired of my half GUI half JASS load/save system. It can't keep big numbers saved for stats on heroes and it constantly creates some random items or doesn't give you all your items.

Will some one, please, some one refer me to a save/load system to save hero stats, items, gold, lumber, AND hero ABILITIES. I really need the abilities to save. I need both Hero and non-Hero abilities to save at the level they are at.

Thx for any help
I + rep of course

EDIT:
I don't care if it is GUI or JASS, just as long as it works. . .
 
Level 7
Joined
May 21, 2009
Messages
289
Codegen v0.05 was my last save/load system with the problems. Does this version save abilities and high level stats? The last version loaded high level stats with 1 for the stat and added the rest to one of the other abilities, items sometimes randomly generated in front of the hero I loaded, and it made you redistribute all the ability points - which makes it difficult to save unit ability levels.

NOTE: My ORPG, (which I have unlocked for the public), is attached if you can point out my own errors, otherwise I blame it on the load/save system itself.

This is why I don't really feel like using Codegen v0.06 unless these bugs are fixed.
 

Attachments

  • (v1.35) Abyss ORPG BETA.w3x
    2 MB · Views: 46
Last edited:
:Bump:
Any other suggestions on save/load?

use CodeGen... anyway, you need to figure out yourself how to save the abilities and all other things that needs to be saved coz its your job as the user of the system...

CodeGen's/any other save-load system's purpose is simply to give you a save code based on what data you feed into it...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Why do people seem to have problems with making their own save load systems...
1. Convert what you want to save to a set of finite integers of a pre determined range (from which it can be reloaded).
2. Generate a checksum integer (the sum of string hashes of all component integers is good enough with the addition of the hash of the lower case player name for name locking). Wrap this hash to a pre determined range (range determines chance of cracking code)
3. Base convert all integers from decimal to a custom character base (often with characerts in illogical order for better protection) with more than 10 characters (smaller code length).
4. Combine all the converted string and display to user.
5. Optional - scramble and mix code around to make it appear more random. You can even randomly mix the code as long as you store the outcome for the demixing of it to the code unmixed.

It is that simple and should not take more than an hour or so.

Loading is the inverse.
1. If you mixed the code, demix it with inverse algerthim.
2. Break code appart into separate data.
3. Base convert data back into decimal.
4. Regenerate hash using save algerthim, restrict to same range and check against the one stored to the code (if they are not equal, the code has been tampered with so stop loading).
5. Use the set of integers to generate a state in your game (like a hero).

They are not rocket science, magic or the work of the devil... They are simple encoding / decoding algerthims.
 
CodeGen crashes for numbers higher than (length of alphabet)*10 (judging from a quick look at the code). It fails for numbers higher than length of alphabet, it becomes very inefficient. I think I saw a tutorial on how to save numbers so that you use every bit, making the shortest save strings possible.


ahh... maybe that's also why AceHart's system stopped working when the integers I tried to save reach a certain point... ^_^
 
Level 7
Joined
May 21, 2009
Messages
289
Why do people seem to have problems with making their own save load systems...
1. Convert what you want to save to a set of finite integers of a pre determined range (from which it can be reloaded).
2. Generate a checksum integer (the sum of string hashes of all component integers is good enough with the addition of the hash of the lower case player name for name locking). Wrap this hash to a pre determined range (range determines chance of cracking code)
3. Base convert all integers from decimal to a custom character base (often with characerts in illogical order for better protection) with more than 10 characters (smaller code length).
4. Combine all the converted string and display to user.
5. Optional - scramble and mix code around to make it appear more random. You can even randomly mix the code as long as you store the outcome for the demixing of it to the code unmixed.

It is that simple and should not take more than an hour or so.

Loading is the inverse.
1. If you mixed the code, demix it with inverse algerthim.
2. Break code appart into separate data.
3. Base convert data back into decimal.
4. Regenerate hash using save algerthim, restrict to same range and check against the one stored to the code (if they are not equal, the code has been tampered with so stop loading).
5. Use the set of integers to generate a state in your game (like a hero).

They are not rocket science, magic or the work of the devil... They are simple encoding / decoding algerthims.

Why is it so difficult? Because most people don't know half of what you just said. I understand what your saying but I couldn't ever do it JASS or GUI. It IS rocket science for the average person. Programming in general is considered one of those "nerd" subjects anyway.

Thanks for the help guys, and now I know why big numbers do not work :/. I will probably take Dr. Super Good's advice eventually, but until I feel inclined to create my own save/load system I will stick to just using other peoples. It is much quicker, easier and more lazy. Especially when you get the urge to do a project, the last thing you want to do is creating save/load systems, entering all that data into the object editor. . .zzz. . . ect.


EDIT:
Yeah. . . About those abilities, how would you get those to save?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Abilities are just more numbers you get your save system to store.

Levels would simply be a number in the range of 0-max level.
Ability types (if applicable and if so then increase the above range to not include 0) would need a table to map them from ability type id to a reduced integer in range of 0 to number of abilities.
Repeate the sotorage and load for however many abilities you have.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Since abilities, items, unit types, etc. (any object editor data) are numbers, you could save them directly, IF you ensure they all share same number range (it is also possible, though not easy, to edit object ID manually, with mpq editor). I did that for my map (altouhg I had to use the manual ID change :sad:)
Especially when you get the urge to do a project, the last thing you want to do is creating save/load systems, entering all that data into the object editor. . .zzz. . . ect.
This is not true. I mean, inventing an efficient compression algorithm and safe encryption, that is one of the most enjoyable part of map creation (ofc aside from vector algebra, NOTHING can top that) :grin:
No, seriously, I get that it can be difficult and boring, but imho it actually is much more fun than creating dialogs with hundred buttons and images.
 
Level 7
Joined
May 21, 2009
Messages
289
This is not true. I mean, inventing an efficient compression algorithm and safe encryption, that is one of the most enjoyable part of map creation (ofc aside from vector algebra, NOTHING can top that)
No, seriously, I get that it can be difficult and boring, but imho it actually is much more fun than creating dialogs with hundred buttons and images.

Hehe, that was more of an opinion, thanks guys. +rep if you haven't received any yet.
 
Status
Not open for further replies.
Top