jalagar / animated-art-engine

A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file
MIT License
167 stars 62 forks source link

Multiple errors/issues with the "Make Regenerate" process #148

Closed EvilDegenStudios closed 2 years ago

EvilDegenStudios commented 2 years ago

First off, amazing system btw! Can't thank you enough for taking the time to provide web3 with this amazing tool! We donated for sure!

SYSTEM: MacOS Big Sur iMac (Retina 5K, 27-inch, Mid 2015) 3.3 GHz Quad-Core Intel Core i5 32 GB 1600 MHz DDR3 AMD Radeon R9 M290 2 GB

Latest version of python3, npm, node, gifski, make, etc


I've encountered a few issues when trying to use the "make regenerate" function. I can't confirm if the errors/issues are due to the system or our project's structure and spelling inconsistencies.

I will first list suggestions that might help identify the problems.

ISSUE: I've noticed that the system will throw “TypeError: Cannot read properties of undefined (reading 'path’)” when the metadata is looking for a specific trait and cannot find it in the layer structure due to the trait folder missing or having spelling issues.

POSSIBLE SOLUTION: Before starting step 1, scan the json files/_metadata.json and check to make sure all traits are present before moving forward. If there is a discrepancy, log the conflicts and present them to the user to fix.

ISSUE: There might be an issue regening from json files that dont start at "0". If i set the startIndex to any number other than "0" I get "TypeError: Cannot read property 'layersOrder' of undefined". For instance, I want to regenerate a static pfp #7998. I add the json file #7998 to the build/json folder. I try and regen and the layersOrder error is thrown.

ISSUE: receiving "/Users/xxxxxxxxxx/Desktop/animated-art-engine-main/step2_spritesheet_to_generative_sheet/src/main.js:372 const dna = _dna.split(DNA_DELIMITER); ^ TypeError: _dna.split is not a function

Not sure what this error is, but it looks like the gif still gets generated.

ISSUE: I receive this error "Error: ENOENT: no such file or directory, open '/Users/xxxxxxxx/Desktop/animated-art-engine-main/step2_spritesheet_to_generative_sheet/../build/_dna.json'"

This happens if i try to gen any json files that dont start with "0". for instance, I copied json files 8000 - 8020.


I will list more details as i continue to debug and isolate the problems.

Thanks Again!!!

jalagar commented 2 years ago

Hi @EvilDegenStudios sorry for the issues and appreciate you documenting all these issues. As you can tell regenerating and turning static to animated is still in beta and not thoroughly tested (which means collections that do it first have a lot of novelty ;)).

Here's what I got for ya: Issue #1: “TypeError: Cannot read properties of undefined (reading 'path’)” Solution: Your solution would work as a solution, however that'd be a pretty big build work. As a temporary solution, I added logging whenever you have a mistyped or missing attribute. It will say something like: “Error: 0.5:Orange#20.png DNA is missing for trait: Background, is something misnamed?”

Issue #3: "receiving "/Users/xxxxxxxxxx/Desktop/animated-art-engine-main/step2_spritesheet_to_generative_sheet/src/main.js:372 const dna = _dna.split(DNA_DELIMITER);" Not sure about this either, do the GIFs look weird?

Issue #2 & #4: Both are two sides of the same coin, essentially you need all the JSON and DNA.json for the code to work. Solution: Given that JSON files are very small, I recommend populate all the JSON and DNA files, and if you only want to regenerate one, go to regenerate.py and edit START_EDITION and END_EDITION. So if you only want to regenerate 7998, START_EDITION = 7998, END_EDITION = 7999

EvilDegenStudios commented 2 years ago

Awesome! thanks so much for your prompt reply. I tried your suggestion regarding the issues #2 & #4. Unfortunalely im still getting...

/Users/xxxxxxxx/Desktop/animated-art-engine-updated/step2_spritesheet_to_generative_sheet/utils/createFromDNA.js:65 const layers = layersSetup(layerConfigurations[layerConfigIndex].layersOrder); ^

TypeError: Cannot read property 'layersOrder' of undefined

I added all json files to the json folder as well. I adjusted my regenerate.py file...

START_EDITION = start_index END_EDITION = 100

Thanks!!

EvilDegenStudios commented 2 years ago

fyi. Setting SKIP_STEP_ONE = True doesnt seem to respect the bol. Looks like step 1 still processes?

jalagar commented 2 years ago

Hmm we'll take this offline to help debug. Also SKIP_STEP_ONE is a little misnamed, but only meant for if you want to generate the entire spritesheet. It's a pretty niche use case so it can be ignored

jalagar commented 2 years ago

We figured this out offline, closing this issue!