HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

compress/decompress string

11-16-2006, 05:06 AM#1
Zandose
Hi. I'm looking for a way to compress/decompress a lot of letters and numbers into a string.

Storing the location of all the doodad's in a map you would have it's Z-point, X-point, Z-point, It's Raw Data name and maybe some other stuff like it's size.

Example (but like 400-1000 times)
Raw = LFtg
X = -1200
Y = 1400
Z = 200
Size = 2

Any idea's? Anything I can think of off the top of my head it not very good.
11-16-2006, 05:13 AM#2
Av3n
Dunno, only things i can think of is to use JASS Helper. All I can think of to do this as they reduce cause JASS Helper can reduce these things pretty good.
11-16-2006, 05:55 AM#3
PipeDream
Single player or multiplayer map? What format is the data currently in? Only .doo?
11-16-2006, 10:39 AM#4
RaveEye
You can use a string array variable to store it.
set string[x] = "xxxx-yyyy-zzzz"
ie.
set string[1] = "0001-0001-0000"
set string[2] = "0002-0002-0000"
set string[3] = "0003-0003-0000"
11-16-2006, 02:48 PM#5
Zandose
-RaveEye
I don't quite understand what you mean but I don't want to use variables.

-PipeDream
The map will be multiplayer but for the process of making the map I need to do it in single player.

What I'm doing it making a map ingame by giving a unit dummy abilities and making it make doodads. Next I put all the doodad data into game cache and save the map. Then I use a program called Cache Converter made by PitzerMike to extract the doodad data so now when a game starts with a flat and empty map I can load anything I want onto it (doodads, terrain types, terrain deformations, units, etc).

All this data is going to be alot so I want to compress it somehow and store it all as one string.
11-16-2006, 08:17 PM#6
wyrmlord
In some cases, using variables can be more convenient and getting a value from a variable is also faster than using a gamecache and you should be able to notice the difference if you are trying to get a large amount of data at once. Seeing as how you want everything as one string, a string or string array would possibly be a better choice. As for compressing the strings, you could probably compress each x/y/z coordinate into about 2-3 letters depending on how large your map size is. As for how to go about compressing, I can't really help you there.
11-16-2006, 10:55 PM#7
[VDM]Amn
Quote:
Originally Posted by Zandose
-RaveEye
I don't quite understand what you mean but I don't want to use variables.

-PipeDream
The map will be multiplayer but for the process of making the map I need to do it in single player.

What I'm doing it making a map ingame by giving a unit dummy abilities and making it make doodads. Next I put all the doodad data into game cache and save the map. Then I use a program called Cache Converter made by PitzerMike to extract the doodad data so now when a game starts with a flat and empty map I can load anything I want onto it (doodads, terrain types, terrain deformations, units, etc).

All this data is going to be alot so I want to compress it somehow and store it all as one string.
Nice, that's a good idea, it's like a trigger that saves everything in order to be loaded in another map.
Sounds good for testing purposes.
11-16-2006, 11:15 PM#8
Vexorian
You basically want a save code then? It is just encoding of the positions I guess your issue is that the code gets big? When I was making the codemaker I looked for compression schemes, but the fact is that for small amount of information compressing doesn't work or actually does the opposite.
11-16-2006, 11:43 PM#9
Zandose
@Vexorian
What method did you end up using?

Also is there a max length for strings?