OpenMW-cs does not save deleted subrecords?

Involved development of the OpenMW construction set.
ezze
Posts: 513
Joined: 21 Nov 2013, 13:20

OpenMW-cs does not save deleted subrecords?

Post by ezze »

I am playing around with the editor and I notice a strange behavior. Basically, the editor does not save the deleted subrecords, the net effect is that those records are then shown in game even if they should not be. I am using a git version compiled few days ago.

Here is an example, the first code block is a cell from the original mod as shown by tes3cmd dump, the second the same cell just after saving in the editor.

Code: Select all

Record: CELL "mzahnch ruin (8, -10)" Flags:0x0000 ()
  NAME: Name:Mzahnch Ruin
  DATA: (Exterior) Coordinates: (8, -10)  Flags:0x0042 (Has_Water)
  RGNN: Region:Azura's Coast Region
  NAM5: Color:6333898
  NAM0: Reference_Count:4
 *FRMR: ObjIdx:118134  MastIdx:1
  NAME: Name:Flora_tree_AC_04
  DELE: Deleted:4729956
 *FRMR: ObjIdx:118135  MastIdx:1
  NAME: Name:flora_emp_parasol_02
  DELE: Deleted:4729956
 *FRMR: ObjIdx:118136  MastIdx:1
  NAME: Name:Flora_emp_parasol_03
  DELE: Deleted:4729956
 *FRMR: ObjIdx:1953  MastIdx:0
  NAME: Name:flora_tree_jw_ayse_722
  DATA: X:66156.000  Y:-81180.000  Z:1344.000  X_Angle:0.0000  Y_Angle:0.0000  Z_Angle:0.0000
As you can see the author added a tree and removed the two emperor parasols and the Flora_tree_AC_04 thingy.

Code: Select all

Record: CELL "mzahnch ruin (8, -10)" Flags:0x0000 ()
  NAME: Name:Mzahnch Ruin
  DATA: (Exterior) Coordinates: (8, -10)  Flags:0x0042 (Has_Water)
  RGNN: Region:Azura's Coast Region
  NAM5: Color:6333898
  NAM0: Reference_Count:4
 *FRMR: ObjIdx:1953  MastIdx:0
  NAME: Name:flora_tree_jw_ayse_722
  DATA: X:66156.000  Y:-81180.000  Z:1344.000  X_Angle:0.0000  Y_Angle:0.0000  Z_Angle:0.0000
After saving, there is only the new tree.

Am I missing something? Or it is really a bug?
ezze
Posts: 513
Joined: 21 Nov 2013, 13:20

Re: OpenMW-cs does not save deleted subrecords?

Post by ezze »

I guess it is this bug that is on the tracker since 7 years... It is really unfortunate for this bug is a showstopper for me :(
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: OpenMW-cs does not save deleted subrecords?

Post by psi29a »

ezze wrote: 21 Sep 2020, 03:21 I guess it is this bug that is on the tracker since 7 years... It is really unfortunate for this bug is a showstopper for me :(
Technically it is an unimplemented feature/task to be done and not a bug. We do accept patches/merge requests/pull requests :D
ezze
Posts: 513
Joined: 21 Nov 2013, 13:20

Re: OpenMW-cs does not save deleted subrecords?

Post by ezze »

Since I never saw the Openmw-cs code I am afraid it is a bit hard. It is not just to pass-through the subrecord, but also to change the GUI so it shows, and allow to change, if a subrecord is deleted or not.

Maybe you can share some pointers?
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: OpenMW-cs does not save deleted subrecords?

Post by psi29a »

Perhaps it is best to have our CS Editor-in-chief unelsson give his view of things.
unelsson
Posts: 227
Joined: 17 Mar 2018, 14:57

Re: OpenMW-cs does not save deleted subrecords?

Post by unelsson »

I unfortunately can't work on this right now, but I might be able to help by pointing a finger.. I'd very much like to have a more defined explanation what needs to be done, and what isn't currently working. It's then easier to start diagnostics, homing on the issue.

I haven't been able to investigate this, but just shooting blind: I'd first check the component-level saving, as well as from the openmw-cs side's commands (Qt Undostack), see what's implemented and what's not. I believe you can mark records deleted, but it fails somewhere after that..
ezze
Posts: 513
Joined: 21 Nov 2013, 13:20

Re: OpenMW-cs does not save deleted subrecords?

Post by ezze »

I attached to this message a tiny example, maybe it will help you to understand what it needs to be done.
The forum does not accept .esp files, but the archive contains:

Code: Select all

no_ghostgate_tree_btes.esp
no_ghostgate_tree_openmwcs.esp
I just created the first file (no_ghostgate_tree_btes.esp) with the bethesda editor* and did exactly one thing: delete one of the dead trees you find on the east of Ghostgate.
I then open the file with OpenMW-CS and just saved it, that's it. The result is the second file: no_ghostgate_tree_openmwcs.esp.

Here is the dump from tes3cmd of both files:

Code: Select all

$ tes3cmd dump no_ghostgate_tree_btes.esp 

Record: TES3 "()" Flags:0x0000 ()
  HEDR:   Version:1.3  Is_Master:False  Author:""
  Description:""
  N_Records:1
 *MAST: Master:Morrowind.esm
  DATA: Length:79837557

Record: CELL "ghostgate (2, 4)" Flags:0x0000 ()
  NAME: Name:Ghostgate
  DATA: (Exterior) Coordinates: (2, 4)  Flags:0x0046 (Has_Water, Illegal_To_Sleep_Here)
  RGNN: Region:Ashlands Region
  NAM5: Color:6333898
  NAM0: Reference_Count:1
 *FRMR: ObjIdx:223671  MastIdx:1
  NAME: Name:flora_ashtree_06
  XSCL: Scale:2.00
  DELE: Deleted:4729956

Code: Select all

$ tes3cmd dump no_ghostgate_tree_openmwcs.esp 

Record: TES3 "()" Flags:0x0000 ()
  HEDR:   Version:1.3  Is_Master:False  Author:""
  Description:""
  N_Records:1
 *MAST: Master:Morrowind.esm
  DATA: Length:79837557

Record: CELL "ghostgate (2, 4)" Flags:0x0000 ()
  NAME: Name:Ghostgate
  DATA: (Exterior) Coordinates: (2, 4)  Flags:0x0046 (Has_Water, Illegal_To_Sleep_Here)
  RGNN: Region:Ashlands Region
  NAM5: Color:6333898
  NAM0: Reference_Count:1
As you can see the tree is not deleted anymore. So, playing with no_ghostgate_tree_openmwcs.esp one still sees the trunk.


* technically, created empty with MWEdit, edit with the bethesda editor, and then cleaned with tes3cmd.
Attachments
no_ghostgate_tree.7z
The two esp files
(388 Bytes) Downloaded 305 times
unelsson
Posts: 227
Joined: 17 Mar 2018, 14:57

Re: OpenMW-cs does not save deleted subrecords?

Post by unelsson »

This was fixed to master. Hey, thanks for the excellent bug documentation. It provided to be very useful in hunting.
ezze
Posts: 513
Joined: 21 Nov 2013, 13:20

Re: OpenMW-cs does not save deleted subrecords?

Post by ezze »

(commit 0eaac, of Wed Oct 28th)

While the bug is less severe I am afraid it is still there.

I do not have a minimal example for I do not know exactly when it happens, but you can replicate doing this:
  • Download and set up Forested Morrowind as usual (unpack in a directory, edit openmw.cfg to add the dir and the esp file.)
  • Start the game in the Urshilaku Camp, look around and notice there is no tar pit (--no-sound --skip-menu --start 'urshilaku camp' ).
  • Open the esp file with openmwcs and just save it.
  • Change the openmw.cfg file so it uses the newly created .omwaddon file.
  • Start the game again in the Urshilaku Camp, the tar pit is back; not deleted anymore.
unelsson
Posts: 227
Joined: 17 Mar 2018, 14:57

Re: OpenMW-cs does not save deleted subrecords?

Post by unelsson »

ezze wrote: 02 Nov 2020, 10:37 (commit 0eaac, of Wed Oct 28th)

While the bug is less severe I am afraid it is still there.

I do not have a minimal example for I do not know exactly when it happens, but you can replicate doing this:
  • Download and set up Forested Morrowind as usual (unpack in a directory, edit openmw.cfg to add the dir and the esp file.)
  • Start the game in the Urshilaku Camp, look around and notice there is no tar pit (--no-sound --skip-menu --start 'urshilaku camp' ).
  • Open the esp file with openmwcs and just save it.
  • Change the openmw.cfg file so it uses the newly created .omwaddon file.
  • Start the game again in the Urshilaku Camp, the tar pit is back; not deleted anymore.
The bug happens because the master index is zeroed in OpenMW-CS. In order to find out what needs to be done: Instead of zeroing the record, what should it do (when opening a mod, it should likely save it like the original plugin, but how about handling new plugins)? Is there something different in OpenMW-way from vanilla? It's not only about changing existing mods, but rather about how plugins work in general,
Post Reply