System The Shortest Save/Load Code Ever

SerraAvenger

Cuz I can
NOTE:
I think I read some time ago that your system doesn't use multiple integers, instead it tries to save as much info into one integer as possible in order to save space...
Just in case you really map n-dimensional arrays into integers (I did that), this might be intersting for you...

length = Log_base( integer + 1)
adding codes:
length = length1 + length2 = Log_base( integer1 + 1 ) + Log_base( integer2 + 1 ) = Log_base( integer1 * integer2 + integer1 + integer 2 + 1 )
mapping n-dimensional arrays:
length = Log_base( integer1_max * integer2 + integer1 +1 )
since integer1_max >= integer1,

integer1_max * integer2 >= ( integer1 + 1 ) * integer2 (in any reasonable case it's > )

hence it is actually stupid to compress everything into one integer, lots of space will be lost. In fact it should be clever to encode every number on its own and use + and - as a seperator. That way you can save _any_ JASS integer in upto x digits (with a reasonable base of 36, that would be log(2^31)/log(36)=31*log(2)/log(36)=5.99=> 6 ), which is absolutely fine. The smaller the integer, the shorter the code... That is the most clever "compression" I can actually think of.
(example code, in base 10)
+304-41423-425+3566
->
+304
-41423
-425
+3566
In base 36 the code would ofc get much shorter.


If you find any flaws, plz tell me....
 

Zwiebelchen

You can change this now in User CP.
I use KODE in Gaias Retaliation ORPG; however, I got a really strange problem:

When reaching a certain number of digits (I think at around 12 blocks a 4 digits or something), the system doesn't load anymore. There is no invalid code displaying and the "loading lag" occurs. However, nothing else happens. It works fine with shorter codes, though (for example saving with the progressive int being 0)

May it be possible that KODE can not save up to that many digits?

This is what we store:

- a progressive int (10,5) ... common values at around 1000-10000
- ordinary ints: 1000, 12x300, 12x2, 3x200, 51, 7, 20, 50x4


EDIT: testet it with the following edit of the KODE's source code:
JASS:

function load_code takes player p, integer security, string s returns boolean
    local integer num_chars
    call BJDebugMsg("KODE executed")
    call clear_bits()
    set num_chars = parse_code(s)
    call decrypt(p, get_num_bits_supported(num_chars))
    call BJDebugMsg("KODE did reach end")
    return is_valid(security)
endfunction

As expected, only the first message is displayed.

In fact, everything works fine until decrypt.
 

SerraAvenger

Cuz I can
Try to put a couple of waits into the decrypt loop, then see if it _still_ stops working with so many digits. Sounds like an OP problem to me. If it works then, but you don't want to have that pause, you'll need a system that doesn't encrypt/decrypt but uses hashsums... I could code you one, if you want.
 

Zwiebelchen

You can change this now in User CP.
Hmm, I set the encryption strength lower and it works ...

Seems like there is a need to split the decryption process into multiple threads to avoid operation limit.
Feel free to write an optimized system SerraAvenger, I think Korolen is fine with that too. ^^
 

SerraAvenger

Cuz I can
Hmm, I set the encryption strength lower and it works ...

Seems like there is a need to split the decryption process into multiple threads to avoid operation limit.
Feel free to write an optimized system SerraAvenger, I think Korolen is fine with that too. ^^
Glad you got it to work.

I won't copy this system just to make it avoid the op limit. I'm no fan of heavy decription / encription after all when it comes to save load codes... Doesn't make them harder to crack, but means a lot of hazzle. Mapping to a different alphabet would be more than enough, if you ask me.

wishes, Davey
 

Zwiebelchen

You can change this now in User CP.
Well, I encountered another problem with KODE, which is something I can not fix without a new security method.

The problem is, that KODE does not recognize in its validy checker, wether a letter is capital oder lowercase.

This means that if you load a code with the exact same letters, but without the right caps (if you used a 62 letter system), the code loads (and of course, returns weird results) ...
A checksum validy checker may be the better solution here, so I would gladly take your offer to improve KODE @SerraAvenger.
 

xXGauntletXx

New Member
After looking at kode, then gobbledygook (sp?) it seemed much easier to edit gobbledygook than kode.
To make kode MPI took much more work than to change 1 value in gobbledygook.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    The old shoutbox wasn't supported anymore. We updated xenForo, so it had to be replaced.
  • jonas jonas:
    let's see if everyone finds it... the nice thing about the shoutbox was I could check on it even while logged out, but the existence of this one is hidden when you're not logged in
  • Ghan Ghan:
    We can fix that.
  • Ghan Ghan:
    Chat should show on the sidebar when not logged in now.
  • Ghan Ghan:
    (You'll still need to log in to post messages)
  • Ghan Ghan:
    Test!
  • tom_mai78101 tom_mai78101:
    I must be in a test server.
  • tom_mai78101 tom_mai78101:
    Nice, Twitter tweets embedding now works
  • Wizard Wizard:
    Yup.
  • Ghan Ghan:
    Excellent.
  • Ghan Ghan:
    @tom_mai78101 Hello there.
  • Ghan Ghan:
    Tagging works in the chat too.
  • tom_mai78101 tom_mai78101:
    @Ghan Missed it.
  • Wizard Wizard:
    Still fixing things here and there. Added widgets to the portal, will make it match the ones here on the forum index tomorrow.
  • Ghan Ghan:
    The venerable World Editor Tutorials site has been converted to HTTPS at last.
  • jonas jonas:
    cool
  • jonas jonas:
    and I can even edit my messages, nice
  • seph ir oth seph ir oth:
    GENERAL CHIT CHAT, YOU ARE A BOLD ONE
  • Ghan Ghan:
    Hello there
  • The Helper The Helper:
    this new chatbox is great and the forum software update is great too
    +1
  • The Helper The Helper:
    upgrade has fixed forum registration spam problem
  • tom_mai78101 tom_mai78101:
    Something tells me we might be able to customize the chatbox a bit, considering that there's a gap under every message.
  • Wizard Wizard:
    Going to deploy a fix soon, just had to take some time for myself this weekend.
  • Varine Varine:
    Unbelievable. Time for yourself? How dare you!

    Staff online

    Members online

    Affiliates

    Hive Workshop
    Top