Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » JCS & Scripting

Corrupted level in JCS

Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 3, 2016, 09:38 AM
Whzkd is offline
Reply With Quote
Unhappy Corrupted level in JCS

Hello.

I have currently a problem with one of my levels.
The last time that i played one of my levels was some months ago where my level was working. Today i was trying to open my level in JCS to edit it after some months of not playing it but suddenly i get the message "The file "Black Storm.j2l" is corrupted, it cannot be loaded". Does somebody know what could be wrong?

The thing is that i tried to open a backup of my level and it says the exact same thing.

I tried to find a solution for this on the internet and searched everywhere for an answer but i didn't find one.

EDIT: Every other level that i currently have made are functioning normally.

EDIT: Here is the jazz2.log information:

Quote:
LOG: GRADE (Build 98-194W), Executable: G:\Jazz Jackrabbit 2 - The Secret Files [WERKT]\Jazz2.exe
LOG: Jazz Jackrabbit 2 version 1.24

WIN: Running Microsoft Windows NT Service Pack 2 version 6.0, Build 6002
CPU: Intel Pentium II processor found
CPU: Processor Vendor ID 'GenuineIntel', Family 6, Model 6, Stepping 1
CPU: Processor Features AFEBFBFF (FPU, MMX)
VID: Checking for available video modes
VID: DirectDraw v6.0.6000.16386 found
VID: Video memory 127472Kb (1Kb Free), AGP memory 65536Kb (65536Kb Free)
VID: Direct3D found
NET: WinSock v2.2 "WinSock 2.0", Status: Running, Host: PC_van_ENIGMA
SND: Galaxy Music System v5.0a
SND: Detected DirectSound driver
---- Starting execution: invoke MainProg()

4 macro files found in current directory
Reading animation library
custom level Black Storm
Warning! LoadLevel(Black Storm.j2l): CRC error, file corrupt
WIN: Application notified error: Could not load level file "Black Storm.j2l" because the level file or tileset has been damaged.

Make sure Jazz Jackrabbit 2 has been installed correctly and retry. If the problem persists, please reinstall Jazz Jackrabbit 2.
VID: Closing display (DIBSection)

---- Exiting program
SND: Closing sound system
NET: Closing network system
WIN: Writing registry
WIN: Closing window
If somebody can help me with this then you make me very happy
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 4, 2016, 10:50 PM
Whzkd is offline
Reply With Quote
Is there something that is missing? I tried to put as many information as i can find here.
If you need more information then i will place more.
I desperately want my most favorite level back and playable.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Oct 5, 2016, 01:51 AM
Violet CLM is offline
Reply With Quote
I don't think this is a problem that can be diagnosed without seeing the file.
__________________
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 5, 2016, 04:39 AM
Whzkd is offline
Reply With Quote
How do i post the file? I can't find a Attachment button.
Stijn Stijn's Avatar

Administrator

Joined: Mar 2001

Posts: 6,964

Stijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to behold

Oct 5, 2016, 04:54 AM
Stijn is offline
Reply With Quote
There isn't one, I'm afraid. You can use a service like ge.tt, though.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 5, 2016, 06:29 AM
Whzkd is offline
Reply With Quote
I have uploaded the file to [Removed]

Last edited by Whzkd; Oct 8, 2016 at 02:16 PM. Reason: Removed level
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Oct 5, 2016, 12:21 PM
Violet CLM is offline
Reply With Quote
I've looked at the file through a few tools, and it genuinely appears to have been partially corrupted. All the basic information--e.g. name, tileset name, layer sizes, help strings, animated tiles--is fine, and even all the events are fine, but I can't find any way to access any information about which tiles were placed where. Some of the bytes in the latter half of the file have been overwritten with other ones, and I don't know why but nor do I know any way to recover the original information.
__________________
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 5, 2016, 12:25 PM
Whzkd is offline
Reply With Quote
So there is no way to completely restore it?

So if i read it correctly the only thing that is actually corrupt is how the tiles are being placed in the level?

EDIT: I have also added the backup here from the level: [Removed]

I think that if you try to open this file that you will get the same result?

Last edited by Whzkd; Oct 7, 2016 at 05:21 AM. Reason: Removed backup level
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Oct 5, 2016, 01:22 PM
Seren is offline
Reply With Quote
The backup file is exactly identical, I'm afraid. Upon investigating the files, the corrupted content doesn't look much like a result of a software malfunction. Instead, it rather appears as if an entire part of the file were overwritten. Because the irregularities begin somewhere around the 4096-byte mark (typical cluster size on Windows), I'm suspecting it may be indicative of a more serious problem than one corrupted JJ2 level. For the sake of peace of mind, consider running CHKDSK to test integrity of the disk containing the J2L file.

Yes, the only damaged part of the file appears to be tile placement. If it's of any use to you, it would be possible to restore all other information, such as level and layer properties, as well as event placement.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 5, 2016, 10:44 PM
Whzkd is offline
Reply With Quote
Ah that's too bad that the backup file has the exact same problem.

You and Violet CLM are saying that some of the bytes are overwritten. How can you see that actually?
Do you compare it with a random level (not my level) to see which bytes were overwritten?

And about the Animations and Events, you say that they are intact. The level is completely empty but how about the Events that have animated tiles? Is that still visible or are only the Events visible?

Last edited by Whzkd; Oct 5, 2016 at 10:46 PM. Reason: Switched animations and Events around
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Oct 5, 2016, 11:47 PM
Violet CLM is offline
Reply With Quote
So, a level file is broken into five main sections. These are, in order: the header, the level properties, the event map, and then two separate sections that together tell JJ2 which tiles (static or animated) appear in which positions in which layers. Somewhere between the start and end of the fourth section--the first half of the tile layout data--the file begins to be corrupted. We don't know exactly where because all but the first section of the file is compressed, and while it might be possible to uncompress the part of the fourth section that isn't corrupted, it probably wouldn't do you much good without the fifth section. We know that bytes have been overwritten because the decompression code works on the second and third sections but fails on the fourth and fifth sections, and because bytes we'd expect to see in certain places aren't there; however, we know that it was overwriting specifically that happened because the file is exactly the size that the (not corrupted) header says it is.
__________________
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 6, 2016, 12:50 AM
Whzkd is offline
Reply With Quote
The decompression code data can not be changed unless it is decompressed?

When is it supposed to overwrite those codes normally that are currently being overwritten? Or is this unusual behavior?
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Oct 6, 2016, 03:52 AM
Seren is offline
Reply With Quote
To spell it out, JCS didn't overwrite this data. As it does not contain recognizable patterns, we do not know what the corrupted data represents. However, as far as we call tell, half of the file has been completely wiped out and replaced with data that is unrelated and not part of your JJ2 level. The original data is not in this file. The corrupted data is highly unlikely to have been caused by JCS. It's hard to tell for sure, because we do not have the source code of JCS, but the fact that the data goes incorrect in the middle of a compressed stream rather than for the entirety of it suggests this.

If not by JCS, it must have almost certainly been done by something that's part of your operating system. Files having part of their content overwritten is never normal behavior. Files are stored in data clusters, essentially small pieces of your hard drive, which nowadays are usually 4 KiB in size. Files bigger than 4 KiB must be stored in several clusters. Your file becomes corrupted after around 4 KiB, which may be a coincidence, but may also mean it's attempting to read a cluster that doesn't belong to it, or something happened to the cluster that was supposed to contain it. If this is really the case, there may be a bigger problem with your file system. Such problems may be caused by many factors, from unsafely removing USB storage to power cuts.

CHKDSK is a Microsoft utility that's available on every Windows operating system. It tests integrity of the file system, for example by checking if what the file system thinks about where files are located on the hard drive makes any sense. It's also capable of fixing some of the problems it encounters. I'm not saying it will fix your file, but I am saying nothing else will, so might as well run it. More importantly, it may detect problems with the file system that you didn't run into yet. The Internet will offer you instructions how to use it. If you use several drives, physical or virtual, remember to choose the one containing the file.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 6, 2016, 09:30 AM
Whzkd is offline
Reply With Quote
I was first thinking that JCS did change some bytes when opening a level. But that is now absolutely not the case.

You can only see the codes and compressed codes etc. because JCS refuses to open the level. How can i restore the most of this file if i can't open the level?

And i have looked around on all files on my computer and USB's but didn't find any corrupted files. The only thing that is corrupt is this level AFAIK.
I will try CHKDSK tomorrow and will place the results if it works.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 7, 2016, 05:16 AM
Whzkd is offline
Reply With Quote
So, i have tried to use CHKDSK but it said that everything was fine.
So that didn't work unfortunately.

To get back to my previous question,
You can only see the codes and compressed codes etc. because JCS refuses to open the level. How can i restore the most of this file if i can't open the level?

Does somebody know how to do this?

Last edited by Whzkd; Oct 7, 2016 at 05:41 AM.
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Oct 7, 2016, 07:43 AM
Seren is offline
Reply With Quote
I have sent you a link to a J2L file that contains the part of data of your level that was possible to restore.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 7, 2016, 08:17 AM
Whzkd is offline
Reply With Quote
Thank you for helping me with restoring most of my level.
Now i must find out how my level looked like and restore it myself...

I know that you and Violet CML said that the tile placement has been corrupted. Is there really nothing to save from? Just a question i was having.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Oct 7, 2016, 09:02 AM
Violet CLM is offline
Reply With Quote
There is really nothing.
__________________

Last edited by Violet CLM; Oct 7, 2016 at 09:35 AM.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 7, 2016, 09:52 AM
Whzkd is offline
Reply With Quote
Ah good to know. I am at least very happy that i have my level back in some way. I am currently rebuilding the level from my memory. It's hard to remember some things from the level but it will come back eventually.

I learned a lot from you guys. The internet is not so helpful...

Thank you everybody that helped me with this problem. Thank you very much.

Last edited by Whzkd; Oct 9, 2016 at 07:05 AM.
Whzkd

JCF Member

Joined: Oct 2016

Posts: 12

Whzkd is doing well so far

Oct 9, 2016, 07:07 AM
Whzkd is offline
Reply With Quote
Talking

I have restored all tiles! I am very happy that you guys helped me with this problem!
Again thank you everybody that helped me!
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 01:19 AM.