sanderfrenken / Universal-LPC-Spritesheet-Character-Generator

Character Generator based on Universal-LPC-Spritesheet
https://sanderfrenken.github.io/Universal-LPC-Spritesheet-Character-Generator/
GNU General Public License v3.0
396 stars 151 forks source link

Found some missing sheet folders, can I manually fix it ? #159

Closed fnaith closed 4 months ago

fnaith commented 4 months ago

I am running a simple python for parsing sheet_definitions folder, and find some sheet folder path in layer definitions are missing. Ex : side_swoop.json has "male": "hair/side_swoop/male/" field, but there is only hair/sideswoop/adult inside spritesheets folder.

I don't know why the generator wasn't broken.

Should I try to fix some folder paths and send a PR ?

Missing sheet folders

python 3 script

from os import walk
from os.path import join, exists
from json import loads

sheet_definition_dir = './sheet_definitions'
spritesheet_dir = './spritesheets'

sheet_definitions = []

# read all sheet definition json files
for dir_path, dir_names, file_names in walk(sheet_definition_dir):
  for file_name in file_names:
    if file_name.endswith('.json'):
      with open(join(sheet_definition_dir, file_name), 'r', encoding='utf-8') as f:
        sheet_definition = loads(f.read())
        sheet_definitions.append(sheet_definition)

missing_layer_dir = []

for sheet_definition in sheet_definitions:
  layer_dirs = []

  # check all layer fields
  for key1 in sheet_definition.keys():
    if key1.startswith('layer_'):
      layer = sheet_definition[key1]
      for key2 in layer.keys():
        if 'zPos' != key2 and 'is_mask' != key2 and 'custom_animation' != key2:
          layer_dirs.append(layer[key2])

  # check all variants
  variants = sheet_definition['variants']
  for layer_dir in layer_dirs:
    is_missing = True
    for variant in variants:
      spritesheet_path = spritesheet_dir + '/' + layer_dir + variant + '.png'
      if exists(spritesheet_path):
        is_missing = False # if any variant is found, we think the folder existed
    if is_missing:
      if layer_dir not in missing_layer_dir:
        missing_layer_dir.append(layer_dir)

# print missing folders
for layer_dir in missing_layer_dir:
  print(layer_dir)
jrconway3 commented 4 months ago

Apologies, some of those shouldn't be there. I added some unfinished entries that literally don't exist yet because I haven't actually made them yet.

These:

body/tail/fin/adult_front/
body/tail/fin/child_front/
body/tail/fin/adult_back/
body/tail/fin/child_back/
body/tail/dragon/adult_front/
body/tail/dragon/child_front/
body/tail/dragon/adult_back/
body/tail/dragon/child_back/
body/tail/feather/adult_front/
body/tail/feather/child_front/
body/tail/feather/adult_back/
body/tail/feather/child_back/

I am planning to make later, but they shouldn't exist yet. The sheet json files were placeholders but they should not have been pushed.

These:

feet/boots_fold/trim/universal/male/
feet/boots_fold/trim/universal/female/
feet/boots_rim/trim/universal/male/
feet/boots_rim/trim/universal/female/

I ended up cancelling making them because the boots are so small the trim styling just did not look good no matter what I did, so I dropped it.

This:

hair/curly/child/

Was replaced by: hair/wavy/child/

Because that "curly" hair is actually just a child version of "wavy" so I renamed the directory to fix the naming conventions. If its still pointing to curly that's wrong.

jrconway3 commented 4 months ago

These:

hair/extensions/braidr/universal/adult/
hair/extensions/braidr/universal/child/
hair/extensions/braidl/universal/adult/
hair/extensions/braidl/universal/child/

I'm working on updating the directory structure and applying all animations to these hairstyles, I'm just taking a long time to get through everything because there's a lot of assets that need to be mapped to all frames.

fnaith commented 4 months ago

Thanks you @jrconway3 ! I understand how those placeholders work. I am closing this issue, because most of those placeholders are intended.

jrconway3 commented 4 months ago

Lastly, these ones:

head/fins/fin_short/
hair/bob/male/
hair/bob/female/
torso/clothes/sleeveless/tanktop/pregnant/
torso/clothes/sleeveless/tanktop/female/
head/fins/fin/
hair/side_swoop/male/
hair/side_swoop/female/
shield/two_engrailed/trim/bg/

I'm not quite sure what the issue is here right now. That said, its possible I already renamed hair/bob/male and hair/bob/female to hair/bob/adult because I detected that these two were redundant; the male and female hairstyles were identical and there weren't alternate cutouts between the two of them. As such, if anything is pointing to male/ and /female it should point to adult. side_swoop I probably didn't get to yet, that's my own hairstyle and I haven't been prioritizing my own hairstyles yet all that much.

torso/clothes/sleeveless/tanktop/pregnant/
torso/clothes/sleeveless/tanktop/female/

This is probably a screwup on my part. I was adding subdirectories to have different styles of clothes in different subdirectories, mostly because ElizaWy has like 4 variants of two sets of shirts (Longsleeve and Shortsleeve/T-Shirt) but I haven't yet finished all the remaining animations there.

If the directories are wrong, feel free to fix the directories to the correct ones.

jrconway3 commented 4 months ago

Let's not close the issue, this helps me see where problem areas are. A lot of these were caused by me rushing through these updates as much as possible and this is a good way for me to know what still needs to be fixed.

jrconway3 commented 4 months ago

I can't reopen this so I'll just bookmark it. Thanks for pointing out these issues, though. If you see any more issues please let me know. Especially let me know if, after I push out some new updates to apply assets to all frames, if some frames have positions off. That's an important issue to resolve whenever it comes up.

jrconway3 commented 4 months ago

Heh, this file shouldn't exist anyway:

side_swoop.json

It was a duplicate of:

hair_sideswoop.json

Thanks for reopening! This will help me fix some issues.

jrconway3 commented 4 months ago

Yup, these:

hair/bob/male/
hair/bob/female/

Were condensed into:

hair/bob/adult

But I forgot to update hair_bob.json

And the "curly" hair for child should not have been moved to hair_wavy yet because the palettes are still using the old palettes.

jrconway3 commented 4 months ago

Here, I did some quick fixes right away: https://github.com/sanderfrenken/Universal-LPC-Spritesheet-Character-Generator/compare/master...jrconway3:issue-159-fix-missing-directory-mapping?expand=1

But I'm not opening the PR just yet. I think I'll just fix the child hairstyle right away and map both it and the wavy hair to all frames to quickly get it out of the way. I also clearly marked those new tails as placeholders rather than removing the json files.

fnaith commented 4 months ago

Thanks you @jrconway3 ! Can not wait the next update !!!

jrconway3 commented 4 months ago

Yeah I was hoping to have the directory restructure done for the clothing a while ago, but its taking me a long time to finish the clothing updates. So that's why those clothing directories got screwed up. I'll just do a quick cleanup to make sure no current assets are broken.

fnaith commented 4 months ago

I see the recent PR. Let me check more things, after I I go home.

jrconway3 commented 4 months ago

You can still load it up and see if I made any mistakes in that one similar to this card, though! If you do, point it out.

But yes, I wanted to get that issue out of the way first before tackling this one. This one is fairly small but I was in the middle of doing that one first.

fnaith commented 4 months ago

Oh, I do have another question.

In sheet_definitions\tool_smash.json, I find axe and pickaxe use layer 1 ~ layer 3 spritesheets. However, the hammer miss the layer 3 spritesheet.

Is it intended ?

jrconway3 commented 4 months ago

It depends on the asset. Its probably intended but I don't know for sure. I don't know what every single asset is doing.

jrconway3 commented 4 months ago

shield/two_engrailed/trim/bg/

I didn't see anything wrong here.

head/fins/fin/
head/fins/fin_short/

These two directories do exist, what's missing is that I moved all the colors into adult under this subdirectories so we can add "child" fins later. The PR corrects this issue.

The child curly hair I didn't fix yet because I'm just going to start adding a bunch of hairstyles to all frames next.

fnaith commented 4 months ago

@jrconway3 hey, my bad, head/fins assets seems fine.

But hair_curly.json''s hair/curly/child/ may be acutally missed. And shield_two_engrailed_trim.json's shield/two_engrailed/trim/bg/ may be shield/two_engrailed_trim/bg/

jrconway3 commented 4 months ago

Yeah I didn't fix the curly child hair yet. I'll do that soon, don't worry. I'm planning soon to just do a whole bunch of "easy" hairstyles to all frames and that includes completely redoing the "curly" hair into "child wavy".

hair_curly is actually just the child version of hair_wavy so I'm going to mesh them together and keep them consistent.

I'd like to convert a number of the main hairstyles to child as well so there's more child options.

jrconway3 commented 4 months ago

head/fins

The fins were messed up, however, head/fins did exist as a directory. The problem is that under head/fins/fin/ and head/fins/fin_short/ there was an extra "adult" directory added there, which I forgot to add to the json files. The "adult" directory was added so I can later add "child" fins as well.

jrconway3 commented 4 months ago

Anyway, if you see any new issues let me know. I know the "curly" hair is still messed up, I'll get to the hairstyles very soon. I'm planning to try and do all the "easy" base hairstyles shortly so we can have way more hair options.

I'm really hesitant to jump into longer hairstyles, though. These hairstyles may not look as good without animation and I really don't feel like animating all of them right now... I'm mostly looking at finishing up all the "short" hairstyles.