Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
boris
Posts: 736
Joined: Tue Jul 15, 2003 3:37 pm

Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Post by boris »

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 all

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 all

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 41 times
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by Cherno »

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
boris
Posts: 736
Joined: Tue Jul 15, 2003 3:37 pm

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by boris »

Well,

Code: Select all

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.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by Marisa the Magician »

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)
boris
Posts: 736
Joined: Tue Jul 15, 2003 3:37 pm

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by boris »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by Graf Zahl »

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
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by Major Cooke »

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
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

Post by Marisa the Magician »

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

The fact that it works despite being incorrect, however... that's another story.
Post Reply

Return to “Closed Bugs [GZDoom]”