Save/Load Code, Yet Another

Arkan

Nobody rides for free
Reaction score
92
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.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
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
 

Arkan

Nobody rides for free
Reaction score
92
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.
 

Arkan

Nobody rides for free
Reaction score
92
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 :/
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> 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
 

Arkan

Nobody rides for free
Reaction score
92
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.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> 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.
 

Nestharus

o-o
Reaction score
84
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
 
C

cliffhan61

Guest
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.
 
B

basil

Guest
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
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
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.
 
B

basil

Guest
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
 
B

basil

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

esb

Because none of us are as cruel as all of us.
Reaction score
329
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"?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
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...
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
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.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> 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.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
Oh ok, thank you very much :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top