Save/Load Code, Yet Another

Yeah I thought the code would have to be alot longer before difficulties would appear.

Anyway, I'm not very good at compression and stuff, can you further elaborate what you mean with:

Code:
value5 * 10000 + value4 * 1ooo [COLOR="Red"](surely you mean 0's (zeroes)??)[/COLOR]+ value3 * 100 + value2 * 10 + value1

and how I would split it up into 5 different values again after loading?

let's say value1= 1
value2= 3
value3= 0
value4= 4
value5= 2

then (2*10000) + (4*1000) + (0*100) + (3*10) + 1 = 24031

save compressed integer 24031 (would save 2 letters right?)

load value1= ?
value2= ?
value3= ?
value4= ?
value5= ?

Your help is much appreciated.
 
Set TempInteger = 12345
Set Value4 = TempInteger / 10 // 1234
Set Value5 = TempInteger - 10 * Value4 // 5
Set Value3 = Value4 / 10 // 123
Set Value4 = Value4 - 10 * Value3 // 4
Set Value2 = Value3 / 10 // 12
Set Value 3 = Value3 - 10 * Value2 // 3
Set Value1 = Value2 / 10 // 1
Set Value2 = Value2 - 10 * Value1 // 2
 
Thanks.
Now I'm gotta compress the shit out my integers and then we'll see if I can squeesh the code length below critical length.
 
Gah, I thought I understood this, it worked for the 5 integers with values between 0 and 4, but how would I do it with 5 integers with values between 0 and 500?

It didn't work using the previous method.

Also, what you said:

Code:
> 2 integers (values between 0 and 300)

Same here.
value[COLOR="Red"]2[/COLOR] * 1000 + value1

That doesn't make any sense to me, I guess it's * 1000 instead of * 10 cause the value can hold 3 digits instead of 1, I suck at math :/
 
> I guess it's * 1000 instead of * 10 cause the value can hold 3 digits

Good guess.

The "split" works just the same though, only with lots more 1000s than 10s.


Set TempInteger = 123456
Set Value2 = TempInteger / 1000 // 123
Set Value1 = TempInteger - 1000 * Value2 // 456


> 5 integers with values between 0 and 500?

That doesn't fit into just one integer... two will do though.

Set Value1 = 789 // example values to store
Set Value2 = 456
Set Value3 = 123

Set TempInteger = Value3 * 1000000 + Value2 * 1000 + Value1 // 123456789 (this will be saved)

Set Value2 = TempInteger / 1000 // 123456
Set Value1 = TempInteger - 1000 * Value2 // 789
Set Value3 = Value2 / 1000 // 123
Set Value2 = Value2 - 1000 * Value3 // 456
 
Alright, but it seems to me addition would save no space in this case:

Code:
Set TempInteger = Value3 * 1000000 + Value2 * 1000 + Value1 // 123456789 (this will be saved)
Wouldn't 123456789 take up 6 letters? (with base of 36, 36^6) So it would be pointless, or am I wrong here?

Also compressing 2 integer values (0-500) would result in a number around the 100000 digits, thus requiring 4 letters anyway (36*4).

The reason for not adding more than 3 (0-500) integers is because the wc3 engine can't handle that big numbers?

If I include lowercase letters, would the base increase to 62? Cause in that case the compression would work here as I can see it.
 
> Wouldn't 123456789 take up 6 letters?

Asuming it does, it would easily beat 3 * 6.

Though, the code isn't generated number by number.
The entire Save array is being considered as one huge number in base 11 and converted to base 36.

With the exception of the first couple "digits" and the last, it's impossible to know what values ends up in what character position of the final code.


Example for easier "getting it": saving the values 123, 456 and 789.
The code is not 'encode("123") + encode("456") + encode("789")'.
Instead, the code is 'encode("123-456-789")', all in one go.
 
Acehart, just one question on like security.

So, what if someone were able to crack the code with the name checker and so forth. I've seen people do it, heh, with a name checker and many security variables because the code never changed for their tests ^)^

I'm just trying to prevent these "serious intense" cheaters from figuring it out, heh ^_^

So, when looking at the security features in that sense, would it be more secure to make it impossible to test out adding gold, removing gold, leveling and so forth? : )

Plus I added in another variable that will add the gold, lumber, level, and ability account of the player and divide it all by 10,000 then add the remainder. It'll save this value into the code under a savecount. When you load it up, it adds up all your stuff and gets the value of the load code you entered, then it checks it against the variable, so in the case that you did change something, meaning you are purposefully cheating, it'll corrupt your save code so that when you try to load it up later, it'll just kick you out.

So, I'm just trying to say

254,016 combinations for the exact same thing will make it impossible to do tests for those insane cheaters out there

A security variable for anti-cheats in case they manage to change a value like their level, their stats, and so forth will make it impossible for them to load up their code. It won't tell them they can't load it up until the second load, sort of a stealth anti-cheat system. Usually, people will delete their older codes, so in this way, they lose all of their information. It'll also tell the host that they are cheaters and will suggest to the host to add them to a banlist.

So, tell me your side of why it doesn't really add any more security. I've seen those intense cheaters that always have 1 mil gold and 1 mil lumber, maxed level, and so forth every time they load. They've been able to crack some crazy codes.

It only adds 4 extra characters, 1 for the sequence so that even if the encryption changes, they won't know what's what, 1 for the encryption for more confusion, and 1 for the anti cheat variable.

The sequencing is probably one of the most secure things you can do as they'll never figure out what characters represent the gold, what represents the lumber, and so forth, heh.

Give me your feed-back k, I just like to know why. When you just say, well, it doesn't really do much, it's already secure enuf with the name check, I mean, heh. I know it's secure with name check and so on, but according to how I've been looking at it, it'll be impossible for cheaters to crack secure.

Also, remember, I'm also working on a system to maximimze the encryption pool (array size) with all the different possibilities that way you don't have to type them all out. It'll do it for sequencing too.

But yea, just give me your feedback kk
 
How to solve this prob

eerm i copied over the triggers and create the cariables myself. However they JASS code has some errors that occurred with almost every trigger. IT says eg. Line 162: Expected a name. How do you solve this? and i am bad with JASS. Thanks in advance.
 
hmmm

:banghead: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
keeps popping up every time i try to enable the save load codes
i edited them a little used my own custom spells and units and put all the things into varibles but when i try to enable them a message pops up saying this....

expected a name
and a couple more pop up like non arrays index i dont know what to do mabye you could help me.......:D
 
How to import:

Menu: File / Preferences,
check "auto-create unknown variables".

Open the save/load map, open the trigger editor:
Right-click the trigger category you want (the yellow titles), select "copy".

Open your own map (menu: file / open):
open the trigger editor if you aren't there already, and click the "paste" button (toolbar at the top).

Switch back to the save/load map (menu: Window):
Click the map's name at the very top of the trigger list.
See all of that weird text there?

Select it all, use "copy".

Switch maps one more time, and paste it in the same place on your map.

Done.
 
i copied all that....

:confused: was there any varibles that were soposed to be arrays????

i added my own custom heros and abilities and items and it keeps bringing up this error


expected a name line 461: set r = r * 64 + udg_SaveLoad_Compress
and some other ones...

was i not sopposed to make the varribles myself? i think that messed up some things....

thanks for helping earlier it got me less problems to deal with:D
 
I started over

I used your map made it the epic size because I messed up on some of the varibles on my map I will give credit for code. I deleted all the units and made it into a new map with your trigger thanks. Even though i will have to start over I will still benifit with a save code, and this time im gana make it better.
:D
It will now be known as the denied:resurection
and instead of having the hero arena type of chosing heros i have made a tavern. So thanks.
 
One question... so i added the lowercase alphabet

Code:
Set SaveLoad_Alphabet = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

but i noticed in warcraft the capital i and lowercase L look alike, and also that you color coded the numbers from the letters. Is there a way to color code the capitals and lowercase too?

I don't know any jass (well i can kind of know what's going on).

I think it has to do with this part

Code:
        set i = i - 1
        set c = SubString(s,i,i + 1)
        if c == "0" or c == "1" or c == "2" or c == "3" or c == "4" or c == "5" or c == "6" or c == "7" or c == "8" or c == "9" then
            set r = "|cffffcc00" + c + "|r" + r
        elseif c == "-" then
            set r = "|cffdddddd-|r" + r
        else
            set r = c + r
        endif
        exitwhen i <= 0
    endloop
    return r
endfunction
(since it has color codes) but i don't know what to edit...

Also, one more question. Do you know what causes "code wipes"?
 
If you added lower-case letters, you also remembered to set the "case sensitive" flag to true?
If you didn't, it won't decode correctly.

Actually, do you really need that?
IIRC, you "only" want to save a single value...


For the color coding, replace
JASS:
else
    set r = c + r
endif

with
JASS:
elseif StringCase(c,false) == c then
    set r = &quot;|cffffdead&quot; + c + &quot;|r&quot; + r
else
    set r = c + r
endif



> Do you know what causes "code wipes"?

Perhaps.
Though I'd first have to know what a code wipe is...
 
Yeah i did set the case sensitive to true.

And a code wipe is when people can't use codes from a previous map version.
 
> can't use codes from a previous map version

The simplest way to get that is to change the alphabet.
If "map 1" used "abc", have "map 2" use "bca" or so.
The decoder will fail...


If you wondered why a code wouldn't work from one version to the next... well, the IDs of units or items have probably changed.
 
Oh ok, thank you very much :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    A probate is usually done with a will, yes? If so I am sorry for your loss
    +1
  • The Helper The Helper:
    Yeah Tom, me too sorry for your loss buddy my mom told me she finds out her olds friend died from Google searching them. She had not talked to one of her old friends in a year and found out she died from Google. Also another one in the same session. RIP all of them my sincere condolences Tom
    +1
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
  • The Helper The Helper:
    It will only be on internal network

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top