Skip to main content
GameDev.net gamedev.net
🔒 Locked

RLE Loading Problems

Started by Laroche Dec 6, 2002 at 7:47 PM 5 replies 200+ views
Original Post
Laroche
Laroche
Im working on a level editor, and the maps are stroed as text files, and I use RLE (runetime-length encoding) to compress them. This works fine, but im having a lot of trouble trying to think up how to make the loading algorithm work. The problem in my mind is that once i find the repetions of the tiles and run through another for loop to set the tiles ID, X, Y, and Z positions, im not sure how this would affect my regular loop, and how I would calculate the Y and Z positions, given the Hight Width and Depth of the map. If anyone has example code or the algo in pseudo-code I would be grateful!
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content
Laroche
Laroche
Im afraid i dont understand what you mean. In my mind, the program would loop through the structure and save it using RLE, and then whenever i want to load the map i decompress it using the decompression algo. Im not sure i grasp what you mean about temporary structures?
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content
Laroche
Laroche
Whats the advantage of decompressing the whole thing to a string then filling in the CMap class as opposed to doing it directly from the file to the temp vars which i use to fill in the class? Should i show some code to show what exactly I mean?
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content
Laroche
Laroche
GOt it Working!! Finally! I did your suggestion and noticed that while i splitted the algo in 2 i made a mistake with both the saving and loading code. Everything works perfectly now, thanks!
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.