• 🏆 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!

[JASS] The Saver 1.0

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
Brand new conversion system that doesn't initially convert bases or merge numbers at all!

It uses an algorithm to change the number into a series of 1 digit numbers. a 10 digit number turns into twelve 1 digit numbers. After this it merges them together 2 at a time to make it a 6 digit code (40% compression, decent), and from there, it uses an encryption key (not quite a base key) to lower the numbers. It can continue to do this until you have a *1-2* DIGIT CODE! A 50 digit number would probably be a 3 digit code!

I just have to continue testing it.. RIght now, I can easily make a 10 digit number into a 4 digit number (better compression than any other save/load system out there!)
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
Regular Base Conversion: 40% Compression
Pipedream's Save/Load Engine Compression: 51.4% (Considered the best)

Step 1 Conversion: Remove All Empty Data (0 gold, 0 lumber, level 1, default stats, etc) (Increases Compression, is not included in the calculations for the percentages below.)

Compression Method 1: 60-80% compression
Example:
10 digit number converted to base 6 is 6 characters
With this method, a 10 digit number converted to base 6 is 2-4 characters (Generally 2)

Compression Method 2: 60% Compression

Compression Method 3: 70% Compression

Compression Method 4: 55-66% compression

When doing this, the first thing I realized is that some methods are better than others for certain numbers. Based on the number, you might have an actual increase in size with one of the methods above or, from what you see above right now, an 80% decrease in size (a 10 digit number into 2 characters). You can't just use 1 method to compress this data with wc3... unless we really start getting complicated ^_^. You need multiple methods.

Imagine a regular 24 character code changing into a 4 character code. Would that not shock you? The best compression I've ever seen online was 51.4% (31-16 ratio).

Oh well ^_^. What I learned from all of this is simple base conversion just doesn't cut it anymore. Most engines online just use base conversion. The real part that developers were working on before was keeping the information separated out so that it could easily be decrypted. You could use digit lengths, separation values (sometimes - marks), or constants (give enough characters to hold the maximum value). Depending on the number once again, some of these were better than others. This was where I first really started getting into this. When you had a code with lots of large numbers in it (700,000 gold etc), I'd use the constants method, and when you had a number with all small values (1 gold), I'd use the digit length method (better than separation because you can keep all of the numbers merged into one number).

Some save/load engines tried to separate values by keeping them separate in the encrypting process (just encrypt 100, then encrypt the next, etc, etc, etc). This is just... not good, lol.

So, to keep values merged, you have a number of options and the option's effectiveness is fully based off of the number. It's the same way with all of my compression systems up above.

Here's a quick example with one of the methods above. It's not the greatest, but it gives you an idea. This stays in Base 10.

3231312324
15169072

In fact, you can stack methods on top of each other and go for higher compression. The above uses Method 1. That's a 20% Compression while staying in base 10. I'm going to convert each of them to Base 36 to show you the significance of this.

3231312324 -----------> 1hfu8jo
15169072 -------------> 914j4

50% Compression, not the greatest. As you can see, Method 1 probably wasn't the best method for this number. Pipedream's 51.4% Compression was achieved using a 62 base. I imagine if I use a 62 base key here, it'd probably jump up to 60%.

Here's another method:

3958298573 -----> 4264326122

Both are 10 digit numbers, but notice that it was converted to base 6 (There will "Never" Be any 0s)

42-64-32-61-22 (instant 50% compression). But we can do more with this number =), and we can go up to a base 80 Encryption, so why do this.

Here's an example of what I meant by more-
4264326122
55025513

Now let's look at what we've done so far
Original Number:
3231312324 -----------> 1hfu8jo
55025513 -------------> z2z9

A Sudden 60% Compression and we're still not done, lol.

Oh well, enough about compression =).

On to color code securities. If we color code the first character and the last character to a specific color, we can use these to decide what compression methods we took and ask the players what color they were when they load up. It's also a sort of security feature =).

Colors are easy to remember

Oh well, that's how we know what compression methods we took. It'll allow 100 different possibilities or so.
 
Last edited:
Status
Not open for further replies.
Top