Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Chopkinsca

Problems when .wad is opened in XWE and DB

Recommended Posts

I'm not sure what can be done about this, if anything, but I've run into problems a few times in the past because of it. If you have a .wad loaded into XWE, forget about it, then load the .wad in doombuilder, it will corrupt everything in the .wad file. Even after knowing what happens when this is done, I've done it every now and then by mistake. I'm not sure if it happens just by opening it in Doombuilder, or only when you save it in DB.

Just wanted to bring this up, in case something could be done about it. It could very well be on Doombuilder's side, but that currently isn't in development. It could also just be a "make sure you close the file in xwe before loading it in DB", but mistakes happen. At least there are backups made.

Other than that, XWE is great and I have no other problems.

Share this post


Link to post

It would help if we could nail down where the corruption actually occurs.

When you open a WAD in XWE, it reads everything in, and closes the file. If you keep browsing or even make modifications in lumps but don't save them, the file is never touched. So there shouldn't be any corruption in this case.

Let's say you keep XWE open, and open the WAD in anything else, and it gets modified. If you make changes in XWE, that will probably corrupt everything. (The reason is simple: XWE keeps the information about the lumps in the WAD in the memory, and that information is now outdated.) Is this what you are doing?

I guess one way to fix this would be to check the last modified date of the WAD file every time XWE gets focus (or, every time before XWE commits any change). If the date of the file is different from what it was when XWE read the file, it would tell you to close and reopen the file. I'll see if I can add this.

Share this post


Link to post

I added a small change and I need help testing it.

XWE now tries to detect if the currently open WAD file was modified by an external program (like DoomBuilder), and if it was, it gives you a message. Grab the beta and see if it works - and more importantly, if this helps you guys avoid the corruption chopkinsca was talking about.

This change will need a lot of work - right now, even if you modify the file with XWE (e.g. move an entry up/down), you'll already get this message. So for sure this is really a beta version, just use it for testing, you've been warned. I just need to know if it solves the above issue.

Share this post


Link to post

Alright, I downloaded it and I'll try it out later on when I have time. I'd give more information oon what I did to have the corruption occur, but it only happened when I wasn't paying attention to begin with.I'll try out a few things to try and get it to happen again with this new beta. Hopefully it's cleared up.

Share this post


Link to post

With the latest beta dated 26th May 06 whenever I edit a text lump within XWE I always get this message on save ...

The currently opened file was modified by an external program. To avoid corruption, please close and re-run the file.

The message, while benign, is slightly annoying.

Share this post


Link to post

If you had read Csabo's post...

right now, even if you modify the file with XWE (e.g. move an entry up/down), you'll already get this message. So for sure this is really a beta version, just use it for testing, you've been warned.

Share this post


Link to post

Get the very latest, I just updated it. It should be much better now, most operations update the internal timestamp of the file. If you still get the message just by editing stuff in XWE, then let me know...

As it is, it's still imperfect. You get the message if you click the lump list, but if you were to go to XWE right after modifying the file in DB, and make a change, it would make the change first and then give this message. So I guess I'll have to add a check before any operation that modifies the file, and if the timestamp is changed, prevent the user from making that change.

Share this post


Link to post
Csabo said:

If you still get the message just by editing stuff in XWE, then let me know...


Forgetting about DoomBuilder - If just using XWE beta and after modifications and going File - Close , I get the message. But if I do File - Clean up , all is well.

Share this post


Link to post

Okay, I've been able to reproduce the corruption.
I created a new map in doombuilder (zdoom: doom in hexen format), drew enough lines to be able to build nodes and did so. Closed it after that. I then added a decorate lump, then closed it. Re-opened it, went to the decorate lump, made a change and saved it. Without doing anything else (leaving the decorate lump open) I opened the map in doombuilder. I built the nodes, saved and quit. I also closed xwe without doing anything.

I tried it out in the beta, and it still does it. If before closing it in the final step, I clicked on another lump, it would give me the 'wad has been changed' message and wouldn't corrupt the file. Perhaps closing it does something that doesn't check if the wad was changed. Regardless, I hope this helps, as it used to be a 'how the hell did that happen' kind of thing, and only just realized how to do it anytime just now.

Share this post


Link to post

Right, it's the autocleanup then. When you close XWE, if autocleanup is turned on (which it is by default), that rewrites the whole file. But by that time the file is changed. It's fixable, I'll work on it (and avoidable right now, if you turn off autocleanup from Options).

Share this post


Link to post

Grab the latest beta and check things out again. I think the whole issue is about 60% done. Things fixed:

- If the user moves around in the lump list (ie. no action), and an external change is detected, there's just a warning.

- If the user tries to commit something (like saving a lump, etc), and the file is modified, there's a question. Ok lets you save the item (and probably ruin the file), cancel cancels it.

- When exiting, the autocleanup will not kick in if the file was externally modified.

Todo: some more actions that save into the file will not yet give the question. Let me know how it goes otherwise.

Share this post


Link to post

The beta seems to have fixed the closing-cleanup corruption. I went through the steps to corrupt a map again, and it stayed in it's non-corrupt form.

I'll be sure to let you know if I find anything else out that causes corruption.

Share this post


Link to post

With the latest beta 06-22-06 I still get the Warning external program. This occurs if I just open any doom pwad, and then select Close. i.e. no modification or change of any sort.

Share this post


Link to post

Hmm, it doesn't happen to me. Grab the latest beta, and run it from the command line with -debug parameter: xwe -debug

Then open and close the wad. This will create a small textfile (c:\xwedebug.txt), either email it to me or dump it here. Also, let me know what's the first lump in the wad.

Share this post


Link to post

Using latest beta which still produces the close issue with Doom, Heretic and Hexen IWAD. Opened/Closed IWAD from Heretic v1.3. First lump is named 'Extended', size is 18 byte, contains text "Extended Version".

xwedebug.txt:

Session Start 25.06.2006 21:15:06
Load "E:\Doomsday\Data\jHeretic\Heretic.wad"
LastModDate "22.03.1996 01:30:00"
WarnFileExtModified
Session End 25.06.2006 21:15:35

Share this post


Link to post

I still can't reproduce this... I tried setting those WADs to read-only, etc. but it works fine. I have a suspicion on why it may happen though, maybe XWE is getting confused about which file's date it needs to check. I added some additional debugging information, please try the above again and dump the result file here.

Share this post


Link to post

And i'm sorry to report that i still can reproduce it with XWE beta from 27-06-2006:

Open/Close DOOM.WAD (Ultimate Edition), 12.408.202 Byte, 1st Lump 'GENMIDI', 11.908 Byte.

Session Start 28.06.2006 02:33:19
Load "E:\Doomsday\Data\jDoom\Doom.wad"
LastModDate "25.05.1995 02:09:00"
LastModDate of "" is "", different from "25.05.1995 02:09:00"
WarnFileExtModified
Session End 28.06.2006 02:33:34

Share this post


Link to post

Argh, I just wasn't paying attention. You did say Close, but I just closed XWE with the X in the corner. I rarely use the Close item in the file menu, but that's where the bug was. The last dump you posted finally gave me the clue. Sorry about that. Fixed in the latest beta.

Let me know if there any more problems.

Share this post


Link to post
Csabo said:

Argh, I just wasn't paying attention. You did say Close, but I just closed XWE with the X in the corner.

LOL

Csabo said:

I rarely use the Close item in the file menu, but that's where the bug was. The last dump you posted finally gave me the clue. Sorry about that. Fixed in the latest beta.

Confirmed. Nasty bug squashed. :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×