Torchmodders

Mod Projects => Lord Nyriox's Playground => Topic started by: Lord Nyriox on March 08, 2017, 11:10:34 pm


Title: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 08, 2017, 11:10:34 pm
SOLVED:

Disable "hardware skinning" in the options to enable these pets to work. 


Original Post:

Next time I need to be a little more thorough in my testing prior to posting… 

Primarily I want to know how to make the Ordrak ("bosses\ordrak\ordrak") model from TL1 and the Vyrax ("bosses\boss_dragonlive\tower_dragon") model from TL2 both load as TL1 pets. 

I am getting a "crash to desktop" at the main menu whenever I try to load either of those as pets. 
Title: Re: [TL1] Converting boss models for pets
Post by: Anarch16sync on March 09, 2017, 03:57:13 pm
There may be some difference in the ogre mesh version, like TL2 using an updated version of ogre than TL1... I haven't checked, but since you can't make it work that may be the issue. If you want to check you can convert the models to .xml and open them in a text editor to see the version difference.
Title: Re: [TL1] Converting boss models for pets
Post by: Anarch16sync on March 10, 2017, 04:06:10 pm
For 3, just remove the collision mesh line in the unit data. Pets shouldn't have collision meshes since it bugs (crash to desktop) skills with collision detection.
If that doesn't work then 1 may be an issue, the game has a soft limit to vertex count, if you use models with a  high poly count the games bugs in weird ways. TL2 should have a higher vertex limit, since most models have more poligons than the TL1 models.
Title: Re: [TL1] Converting boss models for pets
Post by: Kva3imoda on March 10, 2017, 05:22:39 pm
but whenever I try to make a pet use any vanilla mesh from the "Bosses" directory—even if I move the model to the generic monster model directory—the game crashes the instant it tries to render the pet.
You mean these models?

(http://i.imgur.com/U89caUe.png)

This all works fine as pets. I think the problem is in the *.material files.
It should look like this:
Alric.material
Code: [Select]
material Alric
{
technique
{
pass
{
ambient 0.588 0.588 0.588
diffuse 0.588 0.588 0.588
specular 0 0 0 0
emissive 0.4 0.4 0.4
scene_blend alpha_blend
alpha_rejection greater 5
texture_unit
{
texture alric.dds
}
}
}
}

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 11, 2017, 06:36:15 am
Hey Nyriox. I also can't seem to get Vyrax to work as a pet! Tho I got him to work as a monster - so it can't be the model files...  Will keep digging...

Spoiler (hover to show)
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 11, 2017, 11:10:39 am
Hi Phanjam! 

It's really awesome you are helping out, because I am having no luck with either Ordrak or Vyrax (they both crash the same way, so I have been testing them side by side with the same methods). 

There are a few commonalities I would like to note between them, regarding their model data: 


There are a few other commonalities, like the fact that they're both bosses (I was entertaining a theory for a while that boss models might be flagged in some way and forbidden from being used for pets), and they're both dragons (lore-wise, dragons are an endangered species). 

As for testing, could you forward me your spawnclass for the Vyrax model?  I would like to see if spawning Vyrax in the "Upper Wilds" area of Emberfiend crashes the game (if so, number 6 is the cause; the "Upper Wilds" area uses above-ground lighting, like the town and main menu). 

EDIT 2:  Also, I see that you're using my "Dragonkin Overlord" pet in the screenshot.  What do you think of him so far? 

Thanks again,
- Lord Nyriox




Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 11, 2017, 09:50:20 pm
To avoid duplicating test results, I'll provide a summary of my proposed tests on the potential model issues listed above.   

Spoiler (hover to show)

For numbers 2, 3, and 5, I can confirm that removing excess animations and/or meshes from the model directory does not solve the problem.  The crash occurs same as always. 

For numbers 1 and 4, I have neither the tools nor the experience to test with any confidence.  Someone with more experience working with mesh/skeleton data should handle that. 

For number 6, testing should be easy.  Simply spawn either Ordrak or Vyrax in an outdoor area.  As I mentioned above, the "Upper Wilds" area from Emberfiend could be used as a testing ground. 

For number 7, I will downscale the Ordrak and Vyrax textures to 256x256 tomorrow for testing. 

Thanks again,
– Lord Nyriox,
Necromancer of Torchlight

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 12, 2017, 04:32:35 am
...could you forward me your spawnclass for the Vyrax model?  I would like to see if spawning Vyrax in the "Upper Wilds" area of Emberfiend crashes the game (if so, number 6 is the cause; the "Upper Wilds" area uses above-ground lighting, like the town and main menu).
Here you go...
https://drive.google.com/open?id=0B2aVtkeuHrtcVE5La3FwUndaN2c

"Vyrax as replacement for the dog" is in there too, just disabled; I was trying to test him (unsuccessfully so far) as a pet...

About the commonalities...
Spoiler (hover to show)
If these are what is causing the crashes, then they should do so whether you are spawning them as pets or as enemy monsters.  The fact that they can spawn as monsters but not as pets leads me to believe these are not the cause.

I see that you're using my "Dragonkin Overlord" pet in the screenshot.  What do you think of him so far? 
LOL! He is so OP :D Zipping around killing anything that moves, and I just casually walk over to pick up whatever loot is lying around 8)
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 12, 2017, 09:47:17 am
If these are what is causing the crashes, then they should do so whether you are spawning them as pets or as enemy monsters.  The fact that they can spawn as monsters but not as pets leads me to believe these are not the cause.

That depends on whether te game loads models for different types of units differently.  I have no idea if that's the case, but it is a possibility. 

Also, have you tried to load Vyrax or Ordrak in town (or at least in an area with sky exposure)?  Until you have, #6 is a possibility. 

LOL! He is so OP :D Zipping around killing anything that moves, and I just casually walk over to pick up whatever loot is lying around 8)

Yeah, that part does annoy me a little bit.  It's turned into a competition between my Vindicator character and my Dragonkin Overlord pet to see who kills enemies the fastest.  My Vindicator usually wins, but only because monster/pet AI sucks, meaning I notice enemies faster.  (I've been considering adding advanced AI to monsters based on the discussion in https://forums.runicgames.com/viewtopic.php?f=6&t=6187#p145189 (https://forums.runicgames.com/viewtopic.php?f=6&t=6187#p145189), because I find monster lemmings so boring.) 

Thanks again,
~ Lord Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 13, 2017, 07:40:55 am
Huh. This is interesting.

I don't know how exactly you managed to summon "vyraxtest", but I tried to use the console to do it (I don't really know any other method).

I typed in
Code: [Select]
vyraxtest into the console in the mines, and—BAM—the exact same crash-out I get loading Ordrak and Vyrax at the menu.

Just a reminder, the console command I typed would have placed the dragon right where I was standing.

Which makes me wonder: perhaps pets somehow start out rendering with their coordinates at the exact same place as the player. 

If so, then we just need to figure out why these models in particular crash the instant it happens, even though no other models do. 

Just a thought,
– Lord Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 13, 2017, 09:33:26 am
Hmmm, yes I spawned him the same way (typed in "vyraxtest" in the console), but I got him into the game  ???

About the spawn-point; could the collision.mesh file have something to do with the crashing? If the unit is spawning in the exact same location as you and the collision mesh is saying "noooooooooo!!!!!" Just a thought (I need some sleep right now :P see you in a bit!)
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 13, 2017, 01:43:21 pm
could the collision.mesh file have something to do with the crashing?

See my prior comment:
Spoiler (hover to show)

Removing the "collision.mesh" file was one of my earliest tests, as was removing excess animations.  Neither solved the problem for me. 

But actually, what I was thinking was that the models themselves might have been designed with external collision in mind. 

Given that they are both unique models designed exclusively for use as bosses, all sorts of shortcuts could have been taken with regards to their design.

Then again, it might be just the fact that I tried to type it at level 1, right after entering the mines for the first time.  ;} 

– Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Matthew Lefferts on March 16, 2017, 12:37:10 pm
Hey hey folks!

I'm Matt Lefferts, lead animator over at Runic. 
Obviously it's been a while since I've worked first hand on TL1 or TL2, but the animation count, or the complexity like having fingers animated, shouldn't be an issue.

When your game runs, it should generate an "Ogre Log" file in the same general location as your save folder, or where screen shots are stored.  (see the attached image).

Run the game and get it to crash in the same way, then check the Ogre log file, all the way at the very bottom.  Post up that information so we can see what it says.  This is one way that I debugged a lot of stuff when working on the game.
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 16, 2017, 04:31:11 pm
@Matthew Lefferts:   

Steps to reproduce: 

Note that the problem does not occur when using these models for a normal monster.  The crash only affects pets that use them. 

Entire content of the Ogre.log file afterwards: 

Spoiler (hover to show)

That is the entire content of the file.  I have no idea if that is helpful or not. 

Thank you for your support,
- Lord Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Matthew Lefferts on March 16, 2017, 04:43:41 pm
Dang.  Nothing shows up in the Ogre Log that suggests where the problem occurred.

We've been thinking about it on our end and the first thing I would try is stripping out Ordrak's skills, one by one.  In theory he may have a skill that specifically tries to target the player or summon things it can't find, and that's what's causing the issue.

It's also highly likely that characters like Ordrak exceed the bone count for hardware skinning, so if you have any flags in there for that it would cause it to crash.
Title: Re: [TL1] Converting boss models for pets
Post by: Anarch16sync on March 16, 2017, 05:27:36 pm
Totally off topic... But the lead animator from runic is here, in our humble forum  ??? I'm sooo exited. You honour us @Matthew Lefferts, from all of the Torchmodders a big welcome.
Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 17, 2017, 05:13:27 am
o   m   g

I am stunned. I am giddy.  "Welcome @Matthew Lefferts " is all I can think of atm. You really do honor us with your signing-up and posting here!

@Lord Nyriox if we need to reduce the polygons on the models there's a simple way to do that in Blender. I'll give it a shot this weekend and share the models with you.
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 18, 2017, 11:00:24 am
It's also highly likely that characters like Ordrak exceed the bone count for hardware skinning, so if you have any flags in there for that it would cause it to crash.

@Matthew Lefferts, @Phanjam

Well I'll be danged.  Disabling "hardware skinning" DID solve the problem.  Just goes to show you that hardware acceleration doesn't always work…

I'll post a screenshot shortly. 

EDIT:  How do I take a screenshot in-game?  I removed the built-in Windows tools for it… 
Title: Re: [TL1] Converting boss models for pets
Post by: Anarch16sync on March 18, 2017, 11:15:47 am
EDIT:  How do I take a screenshot in-game?  I removed the built-in Windows tools for it… 

Shift + F9 then search for them in the appdata folder for Torchlight files.
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 18, 2017, 11:26:43 am
Thanks @Matthew Lefferts

Disabling "hardware skinning" worked! 

Screenshots enclosed.   

~ Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 19, 2017, 01:39:09 am
Haha! There u go ;) hope he doesnt get stuck in some of the narrower passes! :D
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 19, 2017, 07:05:27 am
@Phanjam

Ha!  As if.

During my early testing for the Dragonkin Overlord, I increased his scaling value to 10 (no joke).  He had a beautiful Godzilla effect (with a lot of clipping through buildings in town), but he walked the narrow spaces just fine.

Also, pets that get stuck eventually skip across the map to where you are.

Now, does anyone have any advice for backporting his skills? 

EDIT:  For now I'm going to experiment with mapping Ordrak / Zealot skills to the Vyrax animations.  Likely I'll also start experimenting with AI support soon. 

Thanks again,
– Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 19, 2017, 06:52:36 pm
...does anyone have any advice for backporting his skills? 
Normally just copying over all the contents of his skill folders will do. But you'll want to look into any .LAYOUT files his skills use, to see what they point to (the sounds and particles mainly) and that those are present / copied over as well for the skill to use. Within the particles, do check that all their components are present/copied over as well. ;)
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 19, 2017, 09:11:30 pm
But you'll want to look into any .LAYOUT files his skills use, to see what they point to (the sounds and particles mainly) and that those are present / copied over as well for the skill to use.

Ah. So all those "Resource" references I found (and didn't recognize) in the .LAYOUT files pointed to particles.  That certainly answers my question.

Within the particles, do check that all their components are present/copied over as well. ;)

Well, then.  I'd best get on it. ;}

– Nyriox

Title: Re: [TL1] Converting boss models for pets
Post by: Phanjam on March 19, 2017, 09:53:25 pm
So all those "Resource" references I found (and didn't recognize) in the .LAYOUT files pointed to particles.  That certainly answers my question.

What will alert you to look into further are all those lines that have <STRING>DESCRIPTOR:. These are things the .LAYOUT will need to execute properly.  Descriptors can be...

<STRING>DESCRIPTOR:Camera Shake
<STRING>DESCRIPTOR:Damage Shape
<STRING>DESCRIPTOR:Layout Link Particle
<STRING>DESCRIPTOR:Timeline
<STRING>DESCRIPTOR:Sound
<STRING>DESCRIPTOR:Unit Spawner
(I think that's it, but there may be others)

The Particles should be easy to find since they are referenced explicitly by their .layout filename with a full path to boot.

Sounds are a little tricky because they are referenced by their GUID. You will have to find that GUID in one of the several .DAT files in the MEDIA\SOUNDS folder (player.dat, skills.dat, etc.) to find out which actual sound files are being used.

I forgot to mention in addition to the Particles and Sounds, the Unit Spawner is important too because it spawns any units (duh) that the skill wants to call.

Within a <STRING>DESCRIPTOR:Unit Spawner "block", the unit referenced is the one in the line <STRING>Resource:.
Title: Re: [TL1] Converting boss models for pets
Post by: Matthew Lefferts on March 21, 2017, 11:04:43 am
Hellooooo!  Looks like the issue was with the hardware skinning bone count!  I remember dealing with that too.  Glad we could figure it out together.  Reach out to us like that when you get really stuck.  Brian Ward on our community relations team saw the issue sent to us and reached out to me for help.  Messages usually do reach us.

I always wanted to be able to talk to people directly before I worked in games, and it's awesome to follow through on that, on the other side.
Title: Re: [TL1] Converting boss models for pets
Post by: Lord Nyriox on March 21, 2017, 11:46:24 am
@Matthew Lefferts
Hellooooo!  Looks like the issue was with the hardware skinning bone count!  I remember dealing with that too.  Glad we could figure it out together. 

Yeah, I had no idea such a limit even existed.  I would have thought the vertices would affect skinning more than the bones.

Reach out to us like that when you get really stuck.  Brian Ward on our community relations team saw the issue sent to us and reached out to me for help.  Messages usually do reach us.

That was pretty much what I was thinking when I sent the support ticket.  We might have figured the issue out eventually, but it would probably take months before any of us tried fiddling with the game options. 

Since we were all stuck running around in circles (and I'm not afraid to ask for help), I felt that someone who helped develop the game might have a better understanding of the issue we were facing. 

I always wanted to be able to talk to people directly before I worked in games, and it's awesome to follow through on that, on the other side.

It's awesome for us all too!  Thanks again for helping out! 

If you're interested, I should have a new version of the pet mod I am working on released in the next couple of weeks (backporting  Skills is a new challenge).  ;} 

See you around,
~ Lord Nyriox,
Necromancer of Torchlight