[Closed] Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Postby boris » Mon Jun 10, 2019 4:50 am

So I'm in the process of adding OBJ support to GZDB-BF, and I noticed that OBJ models are handled in an weird (and as I understand incorrect way).

As a test case I used Spooktober, which has a table made ob OBJ models. The table is made from two OBJs, one for the legs, one for the top of the table. The MODELDEF looks like this:

Code: Select allExpand view
Model "SchoolTable"
{
   Path "models/flow"
   Model 0 "table1.obj"
   Model 1 "table2.obj"
   Skin 0 "FLOWTEX9"
   Skin 1 "FLOWTEXA"
   Scale 0.5 0.5 0.6
   FrameIndex TABL A 0 0
   FrameIndex TABL A 0 1
}


So, according to the FrameIndex lines it uses Frame 0 and 1 of model 0, which doesn't make sense. However, it works fine in-game. I played around a bit with FrameIndex, and it looks like it's completely irrelevant what you set as model and frame, it always displays all specified models. Even if try to use different models for different frames it will always display all models.

I made a bare-bones example (see attachment) that displays the whole table, even though the FrameIndex line doesn't make sense whatsoever:

Code: Select allExpand view
Model SchoolTable
{
   Model 0 "models/table1.obj"
   Model 1 "models/table2.obj"
   Skin 0 "FLOWTEX9"
   Skin 1 "FLOWTEXA"
   Scale 0.5 0.5 0.6
   FrameIndex STIM A 3 -894898
   //FrameIndex STIM A 0 12
}

So model 0 and 1 are defined, FrameIndex says to display frame -894898 of model 3... and it displays model 0 and 1 in-game.
Attachments
wonky.zip
(10.33 KiB) Downloaded 11 times
boris
I post less than Manc and Hobo
 
Joined: 15 Jul 2003

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby Cherno » Mon Jun 10, 2019 11:55 am

The wiki entry for MODELDEF sems to be incorrect regarding the option to "turn off" a model for certain actor frames if the model's frame is -1. I noticed that before and it makes things like guns that should only show a muzzleflash sub-model for one frame a hassle because you have to have two MODELDEF entries for that (one with all frames without the muzzleflash, one for the single frame with the muzzleflash).

[MD3] Using "-1" for model frame numbers to hide them
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby boris » Tue Jun 11, 2019 9:52 am

Well,

Code: Select allExpand view
Model SchoolTable
{
   Model 0 "models/table1.obj"
   Model 1 "models/table2.obj"
   Skin 0 "FLOWTEX9"
   Skin 1 "FLOWTEXA"
   Scale 0.5 0.5 0.6
   FrameIndex STIM A 0 -1
   FrameIndex STIM A 1 0
}


still renders both models for me.
boris
I post less than Manc and Hobo
 
Joined: 15 Jul 2003

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby Marisa Kirisame » Wed Jun 12, 2019 4:08 am

Ah, that was a typo from my part it seems. I was meant to set the model indices to 0 and 1 but instead I set the frames. (I'm surprised it worked anyway)
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby boris » Wed Jun 12, 2019 2:29 pm

Marisa Kirisame wrote:(I'm surprised it worked anyway)

Exactly! It just accepts anything you throw at it, it's not even printing out an warning.
boris
I post less than Manc and Hobo
 
Joined: 15 Jul 2003

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby Graf Zahl » Fri Aug 09, 2019 2:38 am

Marisa Kirisame wrote:Ah, that was a typo from my part it seems. I was meant to set the model indices to 0 and 1 but instead I set the frames. (I'm surprised it worked anyway)


So what about a fix?
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby Major Cooke » Fri Aug 09, 2019 9:24 am

He was referring to setting it wrong in Spooktober's MODELDEF file. Talon1024 is the one you want if something with OBJs is broken. He's the one I had to contact when I discovered that the triangle loader was backwards and he fixed it.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Postby Marisa Kirisame » Fri Aug 09, 2019 2:28 pm

Yeah, this is user (or modder, more like) error.

The fact that it works despite being incorrect, however... that's another story.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests