ME3Explorer / ME3Explorer

Modding Toolset for Mass Effect 1 - 3
http://me3explorer.github.io/
GNU General Public License v3.0
61 stars 19 forks source link

Strange behavior adding to HairComponents slider array in SFXMorphFaceFrontEnd_(Male/Female) of BioP_Char #462

Open ElysiumFic opened 7 years ago

ElysiumFic commented 7 years ago

Ottemis and I have both been working on mods that affect the sliders in the character creator. Specifically hair sliders. This issue might also affect the other sliders but so far we haven't discovered if it has. Ottemis has been able to duplicate the issue I'm having using a different method for cloning items and different versions of the tools.

It's difficult to be concise describing the problem, but what happens is that when you get to the point of the slider having XX number of items on it, one or more of the items will appear in the character creator as a duplicate of the item that comes before it on the slider.

Furthermore, when you use that problematic hair to create a character, in-game it will show up as the hair that came before it on the slider, and it will write the incorrect information to the savegame generated.

Since the array actually starts with item 0, things can get a bit messy when trying to describe where the problem occurs, so for my purposes, the shorthand I'll be using is as follows:

"A=XX" means that XX is the last item in the array. This means the hair slider in the character creator actually has XX+1 items on it. So A=27 would mean that the array has items 0-27 on it, which means the slider in the character creator would display a total of 28 items.

Similarly, when I say the issue occurs for item YY, YY is the number of the element in the array for that particular item. On the slider in the character creator, it would actually be YY+1.

a21 array 1

So this is what A=21 looks like for the female hair slider. The behavior is the same, and happens in the exact same places, regardless of whether we're working on SFXMorphFaceFrontEnd_Male or SFXMorphFaceFrontEnd_Male.

It doesn't seem to matter how many hairs have actually been added to the array, only that the array reaches a specific number of HairComponent elements. The "vanilla" male hair array is 0-15, but the vanilla female hair array is 0-12.. Thus, A=21 on the male side means that I've added 6 items, but on the female side it means I've added 9 items. Regardless, the bug happens on both sides when A=21, not when A="vanilla"+6, or whatever.

So, when A=21 (in other words, there are a total of 22 elements in HairComponents) then item 13 will display in the character creator as a duplicate of item 12, If I select Item 13 as the hair to use when I create the character, once I get in-game, hair 12 will be the one my character is wearing, and the information in the savegame will reflect that.

Here are screenshots (in the interest of saving time I haven't installed textures, since you can see the issue just fine only using the meshes. It happens regardless of whether or not textures are installed.)

Here is what 12 and 13 SHOULD look like (using A=19 or A=20 as an example):

a20 array

12 working

13 working

If I choose 13 to create a character, this is what I see in-game:

13 working ingame

And this is what the savegame will look like:

13 working savegame

This is what happens when A=21. Note that ALL I HAVE DONE is add one more item to the HairComponents array. I haven't changed anything else.

a21 array expanded 12 13

12 when a21

13 when a21

And when I select 13 for the character I create, this is what I see in-game:

13 bugged in-game

And this is what I see when I open the savegame:

13 bugged savegame

(everywhere it says "Mom" it should say "ABEf01")

The really thing is that sometimes this doesn't happen at all. And sometimes one hair that is bugged will be fine when you add another element to the array, but a different hair will be bugged instead. Thus far, I have added ~57 items to the HairComponents array on the female side (only 22 on the male). Here is what I've discovered:

A=21 Problem occurs for 13

A=22 Problem occurs for 7 and 14

A=28 Problem occurs for 15

A=36 Problem occurs for 3, 6, 12, and 24

NOTE THE "DOUBLING" PATTERN THERE. This crops up regularly, that the "problem" items are the number of the previous problem item, doubled. 7 and 14, or 3-6-12-24, etc.

A=37 Problem occurs for 27

(From this point on I have only tested the female slider, but the previous issues were identical on both male and female sliders)

A=40 Problem occurs for 1, 4, 8, 16, and 32

A=42 Problem occurs for 15 and 30

A=43 Problem occurs for 13 and 26

A=45 Problem occurs for 7, 14, and 28

A=46 Problem occurs for 1, 4, 8, 16, and 32

A=48 Problem occurs for 27

A=52 Problem occurs for 15 and 30

A=53 Problem occurs for 29

A=54 Problem occurs for 1, 4, 8, 16, and 32

A=55 Problem occurs for 31

A=57 Problem occurs for 15 and 30

A=58 Problem occurs for 31

A=60 Problem occurs for 1, 4, 8, 16, and 32

A=66 Problem occurs for 55

A=68 Problem occurs for 15, 30, 43, and 60

A=70 Problem occurs for 13, 26, 41, 52, and 63

So while some repetition and mathematical patterns can be discerned, so far I haven't uncovered enough of a pattern to pinpoint when the error might occur and what might be causing it.

I've been reluctant to make a bug report on this because I was afraid it was something I was causing but now that Ottemis has reproduced it using different methods and versions of the toolset, I can safely say it's not error on my part.

However, BioP_Char.pcc acts strangely in lots of little ways. For instance, the very first change I made when working on this project was simply to add two names to the name table. I didn't clone or change anything else. That's it. And just doing that caused the file to double in size. So maybe it's not a bug with the toolset so much as it is just something strange with BioP_Char?

Ottemis commented 7 years ago

I've seen the exact same happen. I've done testing on BioP_Char.pcc (array @ FXMorphFaceFrontEnd_Female) and as Elysium reported, when I test with 21 items in the array, # 12 and # 13 are identical where the mesh for # 12 is displayed in game for both slider positions.

With 22 items in the array, # 6 and # 7 are identical, and # 13 and # 14 are identical where the meshes for # 6 and # 13 are displayed in game for both slider positions respectively.

This corrects itself and breaks depending on the number of items in the array.

I've used 2.0.14 to clone in most of these entries using drag and drop, I've only used v3.0.1 for cloning of some of the latest entries using right-click clone tree. I think Elysium prodominently uses right click clone in v3. I wondered if that was a factor but seeing I can replicate exactly what Elysium has been experiencing, I doubt that is the case.

I don't know if this is an issue with the vanilla array itself or with the way the toolset edits it. I could potentially try adding functional iSteps to extend array size to # 21 or 22 for a texture or colour value slider for the CC to see if this same issue exists there, but this would take me some time. Let me know if that would be useful.

I've chatted to K about this and he had me specifically test whether the duplicate issue exists for a PCC that has only been edited in PackED, untouched by both Mehsplorer and Texplorer, and it does.

Kinkojiro commented 7 years ago

One thought - pure speculation on my part, but I somewhat doubt it is the toolset. Adding items to other arrays doesn't seem to result in this error. The most likely cause is an error in the character gui coding. We know that the gui team were understaffed during production and likely never tested whether the gui would properly handle very large arrays, or didn't bother to fix it if they did.

I would suggest trying to create a null entry (blank everything on the problematic entries) or a duplicate on #6 and #7 etc so hiding the error as far as the user sees it.

@Mgamerz is much better on shockwave gui elements than I am so he might understand how to test this theory.

ElysiumFic commented 7 years ago

Well, since there are certain array lengths where everything works fine, I figure what I'll do is shoot for one of those. For instance, for the male hairs, I have 22 mods, which leaves me with an array length of 38 (0 to 37.) This is one of the problematic array lengths (A=37, listed above) but if I add one more, everything will work. So I just need to create another male hair mod (or any number of male hair mods that will take me to a non-problematic array length) and I'll be golden.

Same for the female side, except that the longer the array gets, the more frequent and obtrusive the problem becomes. A=70 above, which is as far as I've gotten testing, still leaves me with another 103 mods I could add in. I'll keep adding them one by one to try to find where the non-problem spots are, and then decide if I want to port some more hairstyles to reach the next non-problematic array length, or pare back what I have.

So there are definitely ways to work around this, but they're a pain in the butt. Mostly, the fact that it exists in the first place and might someday become an issue for someone else I thought necessitated it being brought to everyone's attention.

Ottemis commented 7 years ago

@Kinkojiro I've had similar thoughts though if it's a problem with the original array, seems to me that would be a pretty kindergarten mistake ><

Mgamerz commented 7 years ago

I haven't worked on ME3 in a few months, but from what I've seen in unrealscript a lot of array items have a fixed maximum length. In multiplayer for example the map limit is capped at 30 even though there should be no limit.

In shockwave flash I don't remember seeing any cap on those GUI sliders. I had to spend quite a bit of time on that file hacking in cut and paste for controllers. You might consider looking at the unrealscript in sfxgame's file, there is a controller class for the character creator.

On Dec 28, 2016 7:27 PM, "Ottemis" notifications@github.com wrote:

@Kinkojiro https://github.com/Kinkojiro I've had similar thoughts though if it's a problem with the original array, seems to me that would be a pretty kindergarten mistake ><

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ME3Explorer/ME3Explorer/issues/462#issuecomment-269572771, or mute the thread https://github.com/notifications/unsubscribe-auth/ACnKlL7oL9KgNR0dW3vN4WV5vM2PcN94ks5rMxp1gaJpZM4LWp_e .

SirCxyrtyx commented 7 years ago

I'm betting this is just a bug in the game, that, since they never had that many hairs, they never even knew about.

ElysiumFic commented 7 years ago

@SirCxyrtyx I thought that might be the case, but I figured I ought to raise the issue in case it was something that could be fixed or corrected for, since at least two of us are working on CC mods and it will be an issue for anyone dealing with this slider in the future if they add more than 6 (male) or 9 (female) hairstyles.

I ended up following @Kinkojiro 's suggestion and adding "null" elements to the array at the end to achieve an array length where the bug wasn't a problem. But this means there are something like 7 copies of the vanilla shaved-head hairstyle at the end of the slider. I will likely end up trying to figure out how to port more hairstyles to fill those spaces just because having that there will eat at me. :)