Model displays correctly in my map editor, but not in-game.

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Model displays correctly in my map editor, but not in-game.

Post by RazurBlazur »

So I have a tree model that I'm intending to use to detail my map, it shows up fine in Ultimate Doom Builder but the model is invisible once I load into the game. Here's how the area looks between the editor and the game.
Spoiler:

I've been trying to figure out what's wrong with this for a while now but it's just not clicking with me, I've tested it in both Zandronum (this map is for a MP mod that I'm making for Zandro) and GZDoom and gotten the same result. The actor spawns but the model isn't present, and if I turn models off the actor's sprite will show up clear as day. I've combed through a good number of posts regarding model issues but just haven't been able to find one with a fix for this exact problem, if anybody can somehow help me out it'd be much appreciated.

For reference here's my DECORATE for the actor:

Code: Select all

Actor JungleTree 4000
{
	+NOGRAVITY
	+SOLID
	+SHOOTABLE
	+NOBLOOD
	Mass 9999
	Radius 138
	Height 482
	States
	{
	Spawn:
	TNT1 A 0
	POSS A 35
	Loop
	}
}
And here's my MODELDEF for it:

Code: Select all

Model "JungleTree"
{ 
   Path "models"
   MODEL 0 "jungtree1.md3"
   Scale 25 25 25
   ZOffset 32
   FrameIndex POSS A 0 0
}
I haven't included any sort of texture pointers here because the model uses multiple textures and I already set those paths up via material names in Blender, they seem to work if the editor display is anything to judge by.
You do not have the required permissions to view the files attached to this post.
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: Model displays correctly in my map editor, but not in-ga

Post by WARCHILD_89 »

Model "JungleTree"

delete the quotation marks. They are obsolete and my be the reason. While Doombuilder just ignores them, GZDOOM might not. Tell me if it works.
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Re: Model displays correctly in my map editor, but not in-ga

Post by RazurBlazur »

Just gave it a try, still got the same results in both sourceports. I'm partially thinking it could be a problem with the model itself but I'm not sure what exactly that could be.
User avatar
Enjay
 
 
Posts: 26498
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Model displays correctly in my map editor, but not in-ga

Post by Enjay »

Why do you have that TNT1 A frame in your decorate? It seems to serve no purpose and could even be the problem. Also, the duration for the POSS frame could be set to -1 and the word loop changed to stop. I'm not sure if that would have any real impact, but it would mean that the actor wasn't looping its frames every 35 tics.

If it's not the TNT1 frame, then maybe the lack of material info is a problem after all?
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: Model displays correctly in my map editor, but not in-ga

Post by WARCHILD_89 »

RazurBlazur wrote:Just gave it a try, still got the same results in both sourceports. I'm partially thinking it could be a problem with the model itself but I'm not sure what exactly that could be.
Actually I had a similiar problem once but I reconverted the model again and then it worked. Or Sometimes it´s just a code segment conflicting with another segment and you don´t get an error message necessarily.

okay there are several ways to chek what´s up with the model:

doombuilder:
- doombuilder shows errors and warnings that could be useful.
- doombuilder has a function to reload resources. Try reloading modeldef only instead and see if you get any warnings or errors. Some errors and warnings are only shown when selecting "reload model definitions".

Noesis model viewer:

- in case you don´t work with that, I highly recommend it. Open the md3 and as it shows the preview, it might be untextured. Drag and drop the texture into noesis, it will ask if you wish to load into a new scene, you select "no". The texture is then put onto the model and shows it textured. If this works, it´s a good sign that the model itself is not the source of the problem.



you could also use blender but from there on it gets too complicated to explain. MAybe you can share the model and I could try and find out what´s wrong. Working with models is a key part of my mod so I have my ways to fix things related to models.
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Re: Model displays correctly in my map editor, but not in-ga

Post by RazurBlazur »

Why do you have that TNT1 A frame in your decorate?
Initially I did have the Decorate set up like you said, but when that wasn't working I changed it to its current state just to see if by some back-assward stroke of luck that would fix it. Fruitless, but still an attempt. I'll switch it back when I take another crack at it.
If it's not the TNT1 frame, then maybe the lack of material info is a problem after all?
I was thinking that could be the case but I'm also not sure how I'd set up the material info for this, the way I have it set up in Blender is all just one object but I could reimport the model from scratch to get it back into a multi-object state if that'd be necessary or less of a headache.
Actually I had a similiar problem once but I reconverted the model again and then it worked.
I've tried reconverting this thing in Noesis plenty of times from both obj and fbx but still no change in result. Might try again and take a good look at the export info just to see if anything goes wrong there, it didn't seem like it was so I didn't pay it any mind but it was also 5 AM so my judgement there probably wasn't to be trusted.
Some errors and warnings are only shown when selecting "reload model definitions".
Didn't know about this, will check next time I have the chance.
User avatar
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Model displays correctly in my map editor, but not in-ga

Post by Logan MTM »

Can you post the model?
Kzer-Za
Posts: 509
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Model displays correctly in my map editor, but not in-ga

Post by Kzer-Za »

Maybe, try decreasing the scale? I seem to remember that I once set the scale way too high and couldn't see the model at all. Probably the whole scene was inside of the model. I'm not 100% sure it's not a false memory, but it's worth a try.
User avatar
Enjay
 
 
Posts: 26498
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Model displays correctly in my map editor, but not in-ga

Post by Enjay »

Just thinking about this again - if the model has several skin files then rather than set them in Blender, you might need to define them in an MD£ surface skin file and use the SurfaceSkin property in MODELDEF.
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Re: Model displays correctly in my map editor, but not in-ga

Post by RazurBlazur »

Drag and drop the texture into noesis, it will ask if you wish to load into a new scene, you select "no". The texture is then put onto the model and shows it textured. If this works, it´s a good sign that the model itself is not the source of the problem.
Well I gave that a try, the textures load onto the model fine. They look a little funny since it's applying a single texture to the whole model but everything the textures are supposed to apply to look alright.
Maybe, try decreasing the scale?
Messing with the scale hasn't seemed to help, was worth a try though.
Just thinking about this again - if the model has several skin files then rather than set them in Blender, you might need to define them in an MD£ surface skin file and use the SurfaceSkin property in MODELDEF.
Haven't heard of that before, how would I do that?
Can you post the model?
Sure, there's a pk3 in here with all the files related to the model, and the fbx file I converted in the sources folder.
jungle_tree.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
 
 
Posts: 26498
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Model displays correctly in my map editor, but not in-ga

Post by Enjay »

Sorry, I think that I may have mis-spoke about the QC file and surface skin. I think that QC files might be something that GZDoom can read, but I have never done it myself. I generated one for your model (using MilkShpae), but I could not get it to work with MODELDEF.

SurfaceSkin is also a feature. However, I'm now not sure that it is related to the QC file but, either way, I can't figure out a syntax that works with your model.

I'm almost 100% certain that what you want to do can be done these days but when I started using MD3 models with GZDoom, I think that multiple skin files had to be consolidated into a single image and then the UV of the model mapped accordingly. So I still tend to do that.


[Edit] oh, one thing I did notice was that you put your skin images in a textures folder. It is normal to put them in the same folder as the model unless you specify a different path for the skins in MODELDEF. I moved them in my test and this didn't fix the invisible model, but it's something to be aware of.

Anyway, my PC is now shut down for the night but I'll probably have another go at this after work tomorrow if no one else solves it. I'd like to know the answer myself. [/edit]
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Re: Model displays correctly in my map editor, but not in-ga

Post by RazurBlazur »

So I tried converting all of the model's faces from tris into quads per my partner's advice, it did get it to load into the game at the cost of.. this.
Spoiler:
It causes it to end up really squashed for some reason, but by god it definitely loads.
You do not have the required permissions to view the files attached to this post.
User avatar
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Model displays correctly in my map editor, but not in-ga

Post by Logan MTM »

There is:
Spoiler:
PartialFixed-Tree.pk3
Don't ask me why, but the big problem was the high Radius and Height properties!
I needed to split the model into 4 models because you did use 4 different skins. I strongly suggest always using one image just for the whole model.
You do not have the required permissions to view the files attached to this post.
User avatar
RazurBlazur
Posts: 7
Joined: Sun Nov 28, 2021 9:14 pm

Re: Model displays correctly in my map editor, but not in-ga

Post by RazurBlazur »

I needed to split the model into 4 models because you did use 4 different skins.
Dang, I was hoping it wouldn't have to come down to that, whole reason I had opted for my initial material method. Thanks a lot for the help though! Hopefully that'll keep me sorted for other models going forward.
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: Model displays correctly in my map editor, but not in-ga

Post by WARCHILD_89 »

RazurBlazur wrote:
I needed to split the model into 4 models because you did use 4 different skins.
Dang, I was hoping it wouldn't have to come down to that, whole reason I had opted for my initial material method. Thanks a lot for the help though! Hopefully that'll keep me sorted for other models going forward.

okay that´s the complicated way to do it.

If a model has more than one skin:

instead of "skin 0 "example.jpg" you need to use "surfaceskin 0" "surfaceskin 1" e.t.c


This way you apply a specific texture to a specific model part without having to split the model apart into pieces.

one Single model can have a ton of Textures applied. Best case is, the model finds the textures automatically if the texture path is identical with the path saved in the model itself. Worst case would be to have a model with 10 Textures and modeldef having 10 lines of "surfaceskin" definitions. But hey it works.


I NEED TO DO A TUTORIAL VIDEO

Return to “Assets (and other stuff)”