Armature causing silent crash.

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Armature causing silent crash.

Post by DaggorathMaster »

I have an armature that's causing a silent crash in the game.
No error on screen or in the log file.
All constraints are baked and removed, though I think those would just make it animate incorrectly.

It has 117 bones (more until I delete ones unneeded in the game).
Is there a limited number? It's not a simple monster, so it won't work with 40, but it could lose some if the limit is 100 for example.

If I delete most of the bones (but leave the animation channels and the mesh), it doesn't crash but doesn't animate very well. So it's most likely the armature not the mesh or the animation, although I suppose having the full armature could cause a problem with the mesh or the animation that then causes the crash.

Trying to get this and one other boss into the mod then it's nearing* done.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Armature causing silent crash.

Post by Isaac »

IIRC, a vertex cannot have more than four bones affecting it.

Best might be to host the .blend, or a modified .blend that still shows the error.
It was minmay who worked on Bitcopy's Blender 2.73 export script, to make it compatible with recent Blender versions.
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Re: Armature causing silent crash.

Post by DaggorathMaster »

I already limited the weights to 4.
But yeah I'm pretty sure I remember it being one of those get-ready-for-export tasks.
So a list of those to refresh my "brain" might help.
I'm using Blender 2.90.1, and the Importer/Exporter is 1.5.0.

I'll put together a spoiler-free version to post.
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Re: Armature causing silent crash.

Post by DaggorathMaster »

Okay here's a blend. Looks like garbage to hide spoilers.
There's also a monster def, but there's nothing in that to be the issue (it's copied and renamed from a vanilla monster, with all actions using the same animation for testing).

https://drive.google.com/drive/folders/ ... share_link

Blender 2.90.1, Importer/Exporter 1.5.0. Would another version be better?
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Re: Armature causing silent crash.

Post by DaggorathMaster »

On further testing, exporting with no material works.
The mesh is invisible, but the shadow animates.
Adding a material (even a known good vanilla one) crashes.
And having the monster catch on fire with an invisible material also crashes.

I hope that raises a "That could be <known issue>" red flag or two...

The mesh does have <=4 vertex groups for each vertex, valid UVs, no crazy vertex group/bone names, and test meshes have simple low poly topology.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Armature causing silent crash.

Post by minmay »

If the number of bones turns out to be the problem (I don't know whether it is or not, sorry), I believe a workaround would be to split the model into two meshes and two armatures. This is what the dark acolyte model file (101 bones) does.

Up to 64 bones per armature should definitely work, but I have no idea about higher numbers.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Re: Armature causing silent crash.

Post by DaggorathMaster »

OK cool. I'd need to decide where to split it to not look disjointed.

I'm also working on a version of the same monster with the same number of end-result bones as Lindworm to be safe.
The animations are not disappointing like I thought they would be. But I have not tested that version in game yet.

But if splitting the mesh and the armature works, it should be less work than doing monsters the way I want, then deleting them bit by bit until it stops crashing. And it allows going over-the-top on moving parts for dramatic effect.

In good news, I got firearms to do +20% damage per skill point with not much of a hack.
User avatar
DaggorathMaster
Posts: 37
Joined: Thu Sep 08, 2022 7:29 pm

Re: Armature causing silent crash.

Post by DaggorathMaster »

There is a limit, of somewhere around 60 bones.
Could be 64. Or possibly 500 or 512 animation channels.

I haven't tested it enough to find the exact number, but the boss that started all this works and looks decent with 58.

Now time to fit him dramatically into the mod!
Post Reply