ledeir / srrreboot

SNES Shadowrun Reboot
2 stars 0 forks source link

unclosed gm tag. #2

Open i30817 opened 4 years ago

i30817 commented 4 years ago

https://github.com/ledeir/srrreboot/blob/64800c1b7b5161078878aafd4f45d73a7531ef1c/SNES%20Tenth%20Street%20Demo/data/convos/5bf8865b663136100f000e43.convo.txt#L41

DaveOfDeath commented 4 years ago

Seems like a simple fix...

On Tue, Jun 9, 2020, 3:36 PM i30817 notifications@github.com wrote:

https://github.com/ledeir/srrreboot/blob/64800c1b7b5161078878aafd4f45d73a7531ef1c/SNES%20Tenth%20Street%20Demo/data/convos/5bf8865b663136100f000e43.convo.txt#L41

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNJEDKG2IYUVUYCF2UTRV22NLANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

I'm playing the ugc in hong kong (with the help of a adaptive ugc, so ofc the orc/troll armor is broken) and i'm surprised at how long the random spawns take to load, is this another incompatibility of the triggers used or is it normal?

The warnings tab shows a lot of 'this trigger is deprecated: Evaluate Turn Mode in Dimension"' so i suppose it's a HK incompatibility, but just asking if there is a easy fix. Maybe if i edit that trigger on all the maps?

DaveOfDeath commented 4 years ago

You're playing SNES in HK? The triggers are degraded... You have to replace them with the HK equivalent to clear that error.

Disguises won't work either... And may cause hard crashes. Spawners take forever because they're using models and then dressing them.

On Tue, Jun 9, 2020, 4:08 PM i30817 notifications@github.com wrote:

I'm playing the ugc in hong kong (with the help of a adaptive ugc, so ofc the orc/troll armor is broken) and i'm surprised at how long the random spawns take to load, is this another incompatibility of the triggers used or is it normal?

The warnings tab shows a lot of 'this trigger is deprecated: Evaluate Turn Mode in Dimension"' so i suppose it's a HK incompatibility, but just asking if there is a easy fix.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-641626907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNPRGJHKFIRTOH4XW6LRV26H5ANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

Spawners take forever because they're using models and then dressing them.

Yes, this is my experience. Was the mechanism/performance the same in dragonfall? I'm interested in seeing if it's possible to hack this performance regression (as in the dll, by editing the IL with ILSpy).

DaveOfDeath commented 4 years ago

Dunno. The HK models are significantly more complex than DFDC ones.

Switching to prefabs would help significantly... But HK has longer spawn times regardless.

On Tue, Jun 9, 2020, 7:44 PM i30817 notifications@github.com wrote:

Spawners take forever because they're using models and then dressing them.

Yes, this is my experience. Was the mechanism the same in dragonfall? I'm interested in seeing if it's possible to hack this performance regression (as in the dll, by editing the IL with ILSpy).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-641686324, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNKZIQFCVCC45NQSRPTRV3XSNANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

this happens when entering the building on the 'shady part of downtown' which is the gang headquarters, and if i recall correctly the original game, not necessary to end the game:

NullReferenceException: Object reference not set to an instance of an object
  at SkinnedMeshCombiner.Initiate (UnityEngine.GameObject core, UnityEngine.GameObject root, Boolean destroyImmediate) [0x00000] in <filename unknown>:0 
  at ParentGeartoBody.Combine (.PlayerBody body, Boolean combineMesh, Boolean fillList) [0x00000] in <filename unknown>:0 
  at OutfitManager+<OnBundlesReady>c__Iterator6F.MoveNext () [0x00000] in <filename unknown>:0 

It hangs the game there. Quite possible it's a missing object in Hong Kong which is being referenced in one of the enemies prefabs though i haven't seen a warning for it.

DaveOfDeath commented 4 years ago

Bet that's a disguise rather than an outfit.

On Tue, Jun 9, 2020, 9:09 PM i30817 notifications@github.com wrote:

this happens when entering the building on the 'shady part of downtown' which is the gang headquarters, and if i recall correctly the original game, not necessary to end the game:

NullReferenceException: Object reference not set to an instance of an object at SkinnedMeshCombiner.Initiate (UnityEngine.GameObject core, UnityEngine.GameObject root, Boolean destroyImmediate) [0x00000] in :0 at ParentGeartoBody.Combine (.PlayerBody body, Boolean combineMesh, Boolean fillList) [0x00000] in :0 at OutfitManager+c__Iterator6F.MoveNext () [0x00000] in :0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-641708132, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNOV52R246NENVFNTZ3RV4BQRANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

Ah, i see. It's 'mesh completely missing' not 'broken' for disguises.

DaveOfDeath commented 4 years ago

So you'd need to decide them with a HK specific disguise.

On Wed, Jun 10, 2020, 12:15 AM i30817 notifications@github.com wrote:

Ah, i see. It's 'mesh completely missing' not 'broken' for outfits.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-641782357, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNJSUG7IZFXB24VPFOLRV4XKDANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

Ok is there a file difference between disguise files in Dragonfall and Hong Kong? Because i'm suspecting this is a case of the code being different.

I did a side by side diff of the method (SkinnedMeshCombiner.Initiate) that fails with null pointer in the HongKong version vs Dragonfall version of the dll, and they're very similar (after filtering out all the false positive changes caused by different whitespace).

In fact the only thing different is that Hong Kong adds this if to the else (that was the only part inside the loop in Dragonfall):

    foreach (SkinnedMeshRenderer skinnedMeshRenderer in array)
    {
        if ((Object)skinnedMeshRenderer == (Object)null || (Object)skinnedMeshRenderer.sharedMesh == (Object)null)
        {
            Transform transform = core.transform;
            while ((Object)transform.parent != (Object)null)
            {
                transform = transform.parent;
            }
            string name = transform.name;
            Debug.LogError("Missing SkinnedMeshRenderer from root object: " + name + ", skipping");
        }
        else
        {
            skinnedMeshRenderer.transform.localPosition = new Vector3(0f, 0f, 0f);
            skinnedMeshRenderer.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f);
            num += skinnedMeshRenderer.sharedMesh.subMeshCount;
        }
    }

This suggests, if the data is not different, that the only thing that is throwing a null pointer exception is fetching the 'tranform.name' for a debug log (core is already dereferenced in code before both in HK and in Dragonfall); even if the disguise wouldn't show ofc (because 'Missing SkinnedMeshRenderer from root object').

If you investigated this, can you tell me if the disguise files are actually different between hong kong and dragonfall before it try to nuke this debug log?

Of course if this what it's causing the exception it wouldn't fix things (probably would end up with a naked npc) but it's interesting to see if this is the cause or a different file.

edit: i should probably try it.

i30817 commented 4 years ago

Nope, it's the file itself. Replacing that if branch by nop's didn't fix it, so the code is effectively the same between the versions in this situation, since the error occurs in code that's the same.

edit: i haven't tracked down exactly where in the function it NPE's yet but it's not either the arguments or the code before that section or in that section.

i30817 commented 4 years ago

I was curious where it crashed, so i'll show the larger function (most of the 'debug number' were added by me to see it).


// SkinnedMeshCombiner
using System.Collections.Generic;
using UnityEngine;

public static CachedMesh Initiate(GameObject core, GameObject root, bool destroyImmediate = false)
{
    Debug.LogError("0");
    Vector3 position = root.transform.parent.transform.position;
    Quaternion rotation = root.transform.parent.transform.rotation;
    root.transform.parent.transform.position = new Vector3(0f, 0f, 0f);
    root.transform.parent.transform.rotation = new Quaternion(0f, 0f, 0f, 0f);
    root.transform.localPosition = new Vector3(0f, 0f, 0f);
    root.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f);
    SkinnedMeshRenderer[] componentsInChildren = core.GetComponentsInChildren<SkinnedMeshRenderer>();
    List<Transform> list = new List<Transform>();
    List<BoneWeight> list2 = new List<BoneWeight>();
    List<CombineInstance> list3 = new List<CombineInstance>();
    List<Texture2D> list4 = new List<Texture2D>();
    int num = 0;
    Debug.LogError("1");
    SkinnedMeshRenderer[] array = componentsInChildren;
    foreach (SkinnedMeshRenderer skinnedMeshRenderer in array)
    {
        if ((Object)skinnedMeshRenderer == (Object)null || (Object)skinnedMeshRenderer.sharedMesh == (Object)null)
        {
            Transform transform = core.transform;
            while ((Object)transform.parent != (Object)null)
            {
                transform = transform.parent;
            }
            string name = transform.name;
            Debug.LogError("Missing SkinnedMeshRenderer from root object: " + name + ", skipping");
        }
        else
        {
            skinnedMeshRenderer.transform.localPosition = new Vector3(0f, 0f, 0f);
            skinnedMeshRenderer.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f);
            num += skinnedMeshRenderer.sharedMesh.subMeshCount;
        }
    }
    int[] array2 = new int[num];
    int num2 = 0;
    for (int j = 0; j < componentsInChildren.Length; j++)
    {
        SkinnedMeshRenderer skinnedMeshRenderer2 = componentsInChildren[j];
        if (!((Object)skinnedMeshRenderer2 == (Object)null) && !((Object)skinnedMeshRenderer2.sharedMesh == (Object)null) && j < array2.Length)
        {
            BoneWeight[] boneWeights = skinnedMeshRenderer2.sharedMesh.boneWeights;
            BoneWeight[] array3 = boneWeights;
            foreach (BoneWeight boneWeight in array3)
            {
                BoneWeight item = boneWeight;
                item.boneIndex0 += num2;
                item.boneIndex1 += num2;
                item.boneIndex2 += num2;
                item.boneIndex3 += num2;
                list2.Add(item);
            }
            num2 += skinnedMeshRenderer2.bones.Length;
            Transform[] bones = skinnedMeshRenderer2.bones;
            Transform[] array4 = bones;
            foreach (Transform item2 in array4)
            {
                list.Add(item2);
            }
            if ((Object)skinnedMeshRenderer2.sharedMaterial.mainTexture != (Object)null)
            {
                list4.Add(skinnedMeshRenderer2.renderer.sharedMaterial.mainTexture as Texture2D);
            }
            CombineInstance item3 = default(CombineInstance);
            item3.mesh = skinnedMeshRenderer2.sharedMesh;
            array2[j] = item3.mesh.vertexCount;
            item3.transform = skinnedMeshRenderer2.transform.localToWorldMatrix;
            list3.Add(item3);
            if (!destroyImmediate)
            {
                Object.Destroy(skinnedMeshRenderer2.gameObject);
            }
            else
            {
                Object.DestroyImmediate(skinnedMeshRenderer2.gameObject);
            }
        }
    }
    Debug.LogError("2");
    List<string> list5 = new List<string>();
    foreach (Transform item4 in list)
    {
        list5.Add(item4.name);
    }
    List<Matrix4x4> list6 = new List<Matrix4x4>();
    Debug.LogError("2.1");
    for (int m = 0; m < list.Count; m++)
    {
        list6.Add(list[m].worldToLocalMatrix * root.transform.worldToLocalMatrix);
    }
    SkinnedMeshRenderer skinnedMeshRenderer3 = core.gameObject.GetComponent<SkinnedMeshRenderer>();
    Debug.LogError("2.2");
    if ((Object)skinnedMeshRenderer3 == (Object)null)
    {
        skinnedMeshRenderer3 = core.gameObject.AddComponent<SkinnedMeshRenderer>();
    }
    SkinnedMeshRenderer skinnedMeshRenderer4 = skinnedMeshRenderer3;
    Debug.LogError("2.3");
    skinnedMeshRenderer4.sharedMesh = new Mesh();
    Debug.LogError("3");
    skinnedMeshRenderer3.sharedMesh.CombineMeshes(list3.ToArray(), true, true);
    Texture2D texture2D = null;
    RuntimePlatform platform = Application.platform;
    texture2D = ((platform != RuntimePlatform.Android && platform != RuntimePlatform.IPhonePlayer) ? new Texture2D(0, 0, TextureFormat.RGBA32, false) : new Texture2D(0, 0, TextureFormat.RGBA4444, false));
    Rect[] array5 = texture2D.PackTextures(list4.ToArray(), 0, 2048, true);
    texture2D.name = "SKINNED MESH ATLAS";
    Vector2[] uv = skinnedMeshRenderer3.sharedMesh.uv;
    Vector2[] array6 = new Vector2[uv.Length];
    int num3 = 0;
    int num4 = 0;
    if (array5.Length > 0)
    {
        for (int n = 0; n < array6.Length; n++)
        {
            array6[n].x = Mathf.Lerp(array5[num3].xMin, array5[num3].xMax, uv[n].x);
            array6[n].y = Mathf.Lerp(array5[num3].yMin, array5[num3].yMax, uv[n].y);
            if (n >= array2[num3] + num4 - 1)
            {
                num4 += array2[num3];
                num3++;
            }
            if (num3 >= array5.Length)
            {
                num3 = array5.Length - 1;
            }
        }
    }
    Material material = new Material(Shader.Find("HBS/Transparent/Cutout/Diffuse"));
    material.mainTexture = texture2D;
    skinnedMeshRenderer3.sharedMesh.uv = array6;
    skinnedMeshRenderer3.sharedMaterial = material;
    skinnedMeshRenderer3.bones = list.ToArray();
    skinnedMeshRenderer3.sharedMesh.boneWeights = list2.ToArray();
    skinnedMeshRenderer3.sharedMesh.bindposes = list6.ToArray();
    skinnedMeshRenderer3.sharedMesh.RecalculateBounds();
    root.transform.parent.transform.localPosition = position;
    root.transform.parent.transform.localRotation = rotation;
    Debug.LogError("4");
    CachedMesh cachedMesh = new CachedMesh();
    cachedMesh.mesh = skinnedMeshRenderer3.sharedMesh;
    cachedMesh.tex = texture2D;
    cachedMesh.boneNames = list5;
    for (int num5 = 0; num5 < list4.Count; num5++)
    {
        if (list4[num5].name.ToLower().Contains("clone"))
        {
            if (destroyImmediate)
            {
                Object.DestroyImmediate(list4[num5]);
            }
            else
            {
                Object.Destroy(list4[num5]);
            }
        }
    }
    return cachedMesh;
}

From the extra debug logs it crashes between 2 and 2.1, which means that either list or list5 are null (which is impossible since they're initialized), or at least some of the item4 are null during the loop.

item4 comes from list which is populated in the previous loop with the bones which come from componentsInChildren which come from 'core' argument. I think the core is the npc mesh and the 'componentsInChildren' are the attachments, like hair, horns etc.

I'm not sure how the disguises would break with HongKong style attachments, considering that this npc is a Seattle:Core/OrkFemale mesh (so not the new meshes which are in hongkong and named OrkFemale2 iirc) and using the CG Ork Street Samurai character sheet in addition to the (crashing) additional equipment armor Outfit_SINless.

I think it might be the randomizer spitting out something with a attachment that the old mesh doesn't like, but how that translates to a null bone i don't know. Another hypothesis i have is that CG Ork Street Samurai character sheet is using the Hong Kong version, which has extra attachments and some are null or something but that sounds wrong.

Maybe someone more in-tune with mesh systems and C# can figure it out.

DaveOfDeath commented 4 years ago

I'd imagine it's related to the rigging of the models. (Shrug)

The animations and outfits from HK are more complex than the DFDC or SR era ones...

That's just a guess, but since they're returns era disguises that case the failures... The logic seems solid at least in my head.

On Wed, Jun 10, 2020, 7:44 PM i30817 notifications@github.com wrote:

I was curious where it crashed, so i'll show the larger function (most of the 'debug number0 were added by me to see it).

// SkinnedMeshCombiner using System.Collections.Generic; using UnityEngine;

public static CachedMesh Initiate(GameObject core, GameObject root, bool destroyImmediate = false) { Debug.LogError("0"); Vector3 position = root.transform.parent.transform.position; Quaternion rotation = root.transform.parent.transform.rotation; root.transform.parent.transform.position = new Vector3(0f, 0f, 0f); root.transform.parent.transform.rotation = new Quaternion(0f, 0f, 0f, 0f); root.transform.localPosition = new Vector3(0f, 0f, 0f); root.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f); SkinnedMeshRenderer[] componentsInChildren = core.GetComponentsInChildren(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); int num = 0; Debug.LogError("1"); SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer skinnedMeshRenderer in array) { if ((Object)skinnedMeshRenderer == (Object)null || (Object)skinnedMeshRenderer.sharedMesh == (Object)null) { Transform transform = core.transform; while ((Object)transform.parent != (Object)null) { transform = transform.parent; } string name = transform.name; Debug.LogError("Missing SkinnedMeshRenderer from root object: " + name + ", skipping"); } else { skinnedMeshRenderer.transform.localPosition = new Vector3(0f, 0f, 0f); skinnedMeshRenderer.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f); num += skinnedMeshRenderer.sharedMesh.subMeshCount; } } int[] array2 = new int[num]; int num2 = 0; for (int j = 0; j < componentsInChildren.Length; j++) { SkinnedMeshRenderer skinnedMeshRenderer2 = componentsInChildren[j]; if (!((Object)skinnedMeshRenderer2 == (Object)null) && !((Object)skinnedMeshRenderer2.sharedMesh == (Object)null) && j < array2.Length) { BoneWeight[] boneWeights = skinnedMeshRenderer2.sharedMesh.boneWeights; BoneWeight[] array3 = boneWeights; foreach (BoneWeight boneWeight in array3) { BoneWeight item = boneWeight; item.boneIndex0 += num2; item.boneIndex1 += num2; item.boneIndex2 += num2; item.boneIndex3 += num2; list2.Add(item); } num2 += skinnedMeshRenderer2.bones.Length; Transform[] bones = skinnedMeshRenderer2.bones; Transform[] array4 = bones; foreach (Transform item2 in array4) { list.Add(item2); } if ((Object)skinnedMeshRenderer2.sharedMaterial.mainTexture != (Object)null) { list4.Add(skinnedMeshRenderer2.renderer.sharedMaterial.mainTexture as Texture2D); } CombineInstance item3 = default(CombineInstance); item3.mesh = skinnedMeshRenderer2.sharedMesh; array2[j] = item3.mesh.vertexCount; item3.transform = skinnedMeshRenderer2.transform.localToWorldMatrix; list3.Add(item3); if (!destroyImmediate) { Object.Destroy(skinnedMeshRenderer2.gameObject); } else { Object.DestroyImmediate(skinnedMeshRenderer2.gameObject); } } } Debug.LogError("2"); List list5 = new List(); foreach (Transform item4 in list) { list5.Add(item4.name); } List list6 = new List(); Debug.LogError("2.1"); for (int m = 0; m < list.Count; m++) { list6.Add(list[m].worldToLocalMatrix * root.transform.worldToLocalMatrix); } SkinnedMeshRenderer skinnedMeshRenderer3 = core.gameObject.GetComponent(); Debug.LogError("2.2"); if ((Object)skinnedMeshRenderer3 == (Object)null) { skinnedMeshRenderer3 = core.gameObject.AddComponent(); } SkinnedMeshRenderer skinnedMeshRenderer4 = skinnedMeshRenderer3; Debug.LogError("2.3"); skinnedMeshRenderer4.sharedMesh = new Mesh(); Debug.LogError("3"); skinnedMeshRenderer3.sharedMesh.CombineMeshes(list3.ToArray(), true, true); Texture2D texture2D = null; RuntimePlatform platform = Application.platform; texture2D = ((platform != RuntimePlatform.Android && platform != RuntimePlatform.IPhonePlayer) ? new Texture2D(0, 0, TextureFormat.RGBA32, false) : new Texture2D(0, 0, TextureFormat.RGBA4444, false)); Rect[] array5 = texture2D.PackTextures(list4.ToArray(), 0, 2048, true); texture2D.name = "SKINNED MESH ATLAS"; Vector2[] uv = skinnedMeshRenderer3.sharedMesh.uv; Vector2[] array6 = new Vector2[uv.Length]; int num3 = 0; int num4 = 0; if (array5.Length > 0) { for (int n = 0; n < array6.Length; n++) { array6[n].x = Mathf.Lerp(array5[num3].xMin, array5[num3].xMax, uv[n].x); array6[n].y = Mathf.Lerp(array5[num3].yMin, array5[num3].yMax, uv[n].y); if (n >= array2[num3] + num4 - 1) { num4 += array2[num3]; num3++; } if (num3 >= array5.Length) { num3 = array5.Length - 1; } } } Material material = new Material(Shader.Find("HBS/Transparent/Cutout/Diffuse")); material.mainTexture = texture2D; skinnedMeshRenderer3.sharedMesh.uv = array6; skinnedMeshRenderer3.sharedMaterial = material; skinnedMeshRenderer3.bones = list.ToArray(); skinnedMeshRenderer3.sharedMesh.boneWeights = list2.ToArray(); skinnedMeshRenderer3.sharedMesh.bindposes = list6.ToArray(); skinnedMeshRenderer3.sharedMesh.RecalculateBounds(); root.transform.parent.transform.localPosition = position; root.transform.parent.transform.localRotation = rotation; Debug.LogError("4"); CachedMesh cachedMesh = new CachedMesh(); cachedMesh.mesh = skinnedMeshRenderer3.sharedMesh; cachedMesh.tex = texture2D; cachedMesh.boneNames = list5; for (int num5 = 0; num5 < list4.Count; num5++) { if (list4[num5].name.ToLower().Contains("clone")) { if (destroyImmediate) { Object.DestroyImmediate(list4[num5]); } else { Object.Destroy(list4[num5]); } } } return cachedMesh; }

From the extra debug logs it crashes between 2 and 2.1, which means that either list is null (which is impossible since it's initialized), or at least some of the item4 are null during the loop.

item4 comes from list which is populated in the previous loop with the bones which come from componentsInChildren which come from 'core' argument. I'm not sure how the disguises are 'special' to cause this crash yet (and maybe never) but if someone more intelligent than me figures out what's needed, please post.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-642371946, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNOF7WI25PUDUZHUJ3LRWBAJHANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

I was hoping to narrow it down further for someone who actually knows how to use blender and unity4 in anger to have a clear path to a fix.

And this always sounded weird to me too, why would the game crash using the old meshes with the old outfits (which is the case here). Unless the seattle rigging was changed, which is possible now that i think about it, but it's suspect that the game is crashing with a OrkFemale and not the other orks males in the same map, because the orkfemale is the one which was replaced in HK, and it makes little sense that this code which didn't really change, using the old mesh, to merge in a old disguise mesh to crash.

My best hypothesis right now is 'Randomized npcs in HK can 'gain' bones for random attachments which the old meshes from seattle don't support and that crashes later here when trying to merge the mesh with null bones resulting from those phantom attachments with the disguise'.

But that doesn't explain why it apparently only happens with disguises and not other kinds of armor (from what i've read). From what i've seen, this function is not only called for disguises.

DaveOfDeath commented 4 years ago

Good luck.

On Wed, Jun 10, 2020, 8:13 PM i30817 notifications@github.com wrote:

I was hoping to narrow it down further for someone who actually knows how to use blender and unity4 in anger to have a clear path to a fix.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-642379636, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNLIXQBYRS4FPSUBXFTRWBDWRANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

I was wrong btw. Even with Seattle:Core/xxxxx meshes, it's using the new version not the old (you can tell because the old orc female is doughy and the new one is kind of slender). Apparently the HK version of the seattle prefabs has the new meshes.

So this explains things better. The disguise merge with the other attachments leads to the disguises trying to access the name of a null rigging bone. Why only disguises and not other armors, not sure.

DaveOfDeath commented 4 years ago

Couldn't tell you...

Just seen a whole ton of those hard crashes using SR & DFDC era disguises in HK.

On Thu, Jun 11, 2020, 2:08 AM i30817 notifications@github.com wrote:

I was wrong btw. Even with Seattle:Core/xxxxx meshes, it's using the new version not the old (you can tell because the old orc female is doughy and the new one is kind of slender).

So this explains things better. The disguise merge with the other attachments leads to the disguises trying to access the name of a null rigging bone. Why only disguises and not only armors, not sure.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-642518171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNPLQVLA6TURU427CZDRWCNKVANCNFSM4NZ2PCHQ .

i30817 commented 4 years ago

I actually replaced the disguise (as a test if that would be a good approach to port) for for a version in a another prefab group (it was in 'Deprecated Outfits>Outfit_SINless' and i replaced by 'Disguises>SINless'.

I suppose these two are Deadman's Switch and Dragonfall, not Hong Kong? It crashes the same so i was just assuming that, although it doesn't make sense to me since Dragonfall is backwards compatible.

It almost appears as if that 'Disguises' group was a HongKong incomplete port - since some work fine, and others don't - and 'SINless' was left there broken.

I'm tempted to try to start hacking that function above to filter out the broken bones (in fact, i already tried with the first error, but apparently it has a error further down) just to eliminate this annoyance, even if it's the 'wrong' way to go about it (considering all the broken 'normal' armors which don't crash but look ugly).

i30817 commented 4 years ago

I got it not to crash by simply skipping the null bones, by doing this in the middle of that big function. Not sure of side effects but the npcs loading with disguises don't crash the game anymore:

            foreach (Transform item2 in array4)
            {
                if ( item2 != null) //added
                    list.Add(item2);
            }

The armors as still as broken as always though, you may be able to see the broken bone in the npcs that crashed, in that crashing ork female, pants are missing, i think (may just be distorted and offset).

Not sure if i should add this hack to the dll hack i distribute....

Maybe with a warning log that this would crash on the original dll and the armor is broken. I wonder what's the difference between HK disguises and older disguises if only the disguises break like this and only on some npcs.

DaveOfDeath commented 4 years ago

(shrug)

On Thu, Jun 11, 2020, 6:31 PM i30817 notifications@github.com wrote:

I got it not to crash by simply skipping the null bones, by doing this in the middle of that big function:

      foreach (Transform item2 in array4)
      {
          if ( item2 != null) //added
              list.Add(item2);
      }

The armors as still as broken as always though, you may be able to see the broken bone in the npcs that crashed, in that crashing ork female, pants are missing, i think (may just be distorted and offset).

Not sure if i should add this hack to the dll hack i distribute....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ledeir/srrreboot/issues/2#issuecomment-643015186, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBGYNOJNQAYLE5FT2AFJ3LRWGAO3ANCNFSM4NZ2PCHQ .