Save/Load System Question

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
If I wanted a Save Load System. That would save 3000 bools(true or false.
or 1000 ints (each int value would be (1-5))

How would i go about doing that.

Is that too much info to save?
How long would the code end up being?


*Edit
I will start to list possible methods, and see if you can improve on them.

Method 1
3000 bools
Assuming war craft can take 50 chars in a string.

type in every bool(0 or 1) in sets of 50. In other words type 60 strings with 50 chars long.

Method 2
Assuming war craft can take 50 chars in a string.

type in every int in sets of 50. In other words type 20 strings with 50 chars long.

Method 3
Assuming warcraft can take 50 chars in a string.
Assuming there are at least 25 differnt chars you can input

Note(char 'a' for example would mean int 1 is 0 and int 2 is 0, where 'b' would mean int 1 is 1 and int is 0)

type in a char that represents 2 int values. In other words type 10 strings with 50 chars long.

Method 4
Hmm....
 
Reaction score
341
Depends on how you would want to generate the code. If you used the base10 system then it would be pretty long, probably too long of a string that warcraft could even handle.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Well we will just have to be inovative and find a way to solve it :)

Prehaps If i use A system that includes all every possible lower and uppercase letter numbers and all possible input....
And then find a way to be able to read on char as servel variables. I don't know yet but i just thinking out loud. i sure this is possible. :)

My Goal would be 20-50 chars for the hole thing. H mm i will think on this...
 
Reaction score
341
Base10>Base64 1000 integers of a value of 1-5 would still be at least 1000 characters long, unless you added all of them up and somehow knew how to subtract them down, then it would be around 6-8 characters long (off the top of my head).

I don't know how to use hash's or anything so maybe you could lookup that or really any integer compacting formulas.

I have only dealt with save systems a few times (the actual coding), so this is what i know.

Note that i am not an expert and certainly and really bad at math :p
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
My method 1 requires 3000 char inputs
My method 2 requires 1000 char inputs
My method 3 requires only 500 char inputs.

How many keys are there on the key bored? that can be used? can war craft tell the difference between lowercase and upper case?
 
Reaction score
341
Base10>Base# works like this, say your base output is 26 (26 characters in your alphabet , A-Z)

Now say you wanted to save a number of 26.

The output would be the 26'th letter of the alphabet which is Z.

Now what if you wanted to save a number higher than the number of characters in the alphabet, what you would do is basically break the number down by the base.

So if you wanted to save a number of 28, it would be 26 + the remainder which is 2.

So ZB would be your result.

Z = 26'th letter
B = 2'nd letter.

I'm not very good on base conversions though, hopefully someone else can come by and explain better.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Maybe some sorta patten grouping.

Like, if theres 20 values of 1 in arow. it could do 20 or a char that = 20. and then 1 so (w)(1).

But the code could still be long....
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Here is in idea.
The values that need saved would look something like this.
13245123152435142153412514253143541254125431534125413154
It would be 500 long, but this is in example.
Does (1, 3) have a pattern? Yes, (1, 3) now = A
So Update (A2451231524351421534125142531435412541254315341254A154)
Does (1, 3) have a pattern? No
Does (2, 4) have a pattern? Yes, (2, 4) now = B
(AB512315B351421534125142531435412541254315341254A154)
Does (5, 1) have a pattern? Yes, (5, 1) now = C
(ABC2315B3C42153412C42531435412541254315341254A154)
Does (2, 3) have a pattern? No
Does (1, 5) have a pattern? Yes, (5, 1) now = D
(ABC23DB3C42D3412C425314354125412543D341254AD4)
Does (D, B) have a pattern? No
Does (B, 3) have a pattern? No
Does (3, C) have a pattern? No
Does (C, 4) have a pattern? Yes, (C, 4) = E
(ABC23DB3E2D3412E25314354125412543D341254AD4)
Does (E, 2) have a pattern? Yes, (E, 2) = F
(ABC23DB3FD3412F5314354125412543D341254AD4)
Does (F, 5) have a pattern? No
Ect. Ect.


Anyway then in the end you have some definitions, that you might be able to conduce some. And you can run throw it a few times, doing the same thing. I think it should not in every case but in most lower the code by quite some bit.

Also If I have stuff like 2(3) that means 2 3 times. Instead of 2,2,2.

The save code would need the key of the patterns though. But I think if this were set up right…perhaps the code could get down to 25-50 at the smallest.. but in general it would be closer to 50+… Thus its still too long….
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> save 3000 booleans

An integer can hold, at best, 32 of them.
10 digits per integer... the usual base 36 conversion cuts that down by about 35%.
Roughly 300 characters result...
Even just half of that is still way too many.

What are you trying to store there? And, are you sure you need it all?
 

Akolyt0r

New Member
Reaction score
33
> save 3000 booleans

An integer can hold, at best, 32 of them.
10 digits per integer... the usual base 36 conversion cuts that down by about 35%.
Roughly 300 characters result...
Even just half of that is still way too many.

What are you trying to store there? And, are you sure you need it all?

store them as hex or ..much better rawcode ..
 

Strilanc

Veteran Scripter
Reaction score
42
Suppose you want 30 characters to store your 3000 bits of information. Call the number of possible characters X. [eg x = 4 could be {a, b, c, d}]
2^3000 = x^30
(2^3000)^(1/30) = x
x = 2^(3000/30)
x = 2^100
x = 1267650600228229401496703205376

:D
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
A Roller Coaster with 500 tracks,is plenty. I would be fine if the code could only hold 500 instead of 1000. But 250 is hardly enoufe. (250 is better then 0 though :) )
You might would think it is enough, but i dont think it is.
You can try it out for your self to tell me if you think other wise. Link To Forum with Map

What are you trying to store there? And, are you sure you need it all?

Question
1)What are you trying to store there?

Answer
I am trying to store all the input values for my roller coaster game.
For every track they set, they can press one of 5 values. Rotate left, Rotate Right, Rotate up , Rotate down, or set(same as last piece value).

Question
And, are you sure you need it all?

Answer
Well no i am not sure. Because if they were to continue pressing left all 1000 times. and some how finished there coaster. i could have value (Left)(1000)
and then that would be there hole code. But i need all 1000 values in some way.

What i have thought of at this point
There are 3 things i have thought of thus far
1.Condense the code by not using base 10. by also using letters i can have a bigger base. (I would use this for part 2 or 3 or 4)
2.Any of them that go twice or more, i could add a value saying (Left)(2)
3.Create a ridged Pattern Key (A = Left Left) or something.
4.Create a custom pattern key to fit each code, because there has to at least have some patterns if there code is 500 long, and they only have 5 values to work with. (example my last post on this thread)
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Bump (Its been 24 hours i think)

If It cant hold this amount of information. How much could we have it hold while keeping the code from 20-30 charters or so.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Less than 200 bits...

2^5 = 32, 2^6 = 64
So, base 36 (A-Z0-9) holds about 5+ bits per character.
And base 62 (A-Za-z0-9) about 5.8.

Let's pretend it's 6.
6 * 30 = 180.


1.
Base 36 has one major advantage over higher bases, the code can be case insensitive.
Which makes writing down, and, more importantly, typing it back, that much easier.
Also, as seen above, the "win" in size is only 0.2 bits... pointless really.

2.
While "twice or more" has a chance to cut down on size, you also need the "just once"s...
Given there's no way to prevent that, the code will probably be longer.

3.
Same here.
If there is no such handy pattern, it will be longer than without any pattern system.

4.
Arithmetic encoding in JASS? Good luck with that.
If the dictionary is generated per code, you need to encode that too... which already is longer than the actual code.
And if the dictionary is fixed, we're back to 3.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
2.While "twice or more" has a chance to cut down on size, you also need the "just once"s...
Given there's no way to prevent that, the code will probably be longer.

Cant you just Say something Like...
First Char = To A,B,C,D,E Then once. There is no 2ed char to check. As they mean only one time.
But if First Char = F,G,H,I,J Then Check 2ed Char (2ed char = amount)

Example

Sample Code

ABCDEFBBC

That code means. 1 once, 2 once, 3 once, 4 once, 5 once, 1 Twice, 2 once, 3 once.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top