This is a fork of Hashlip's art engine. It is currently a Work in Progress as more features are planned to be added.
🛠️🛠️ Please note that the README is barebones atm as I'm still working on feature implementation, but if you have any questions, please feel free to ask me in the various channels I can be reached.
- Work in Progress
This fork gives the option to use a simpler weight system by using common rarity names (Common, Uncommon, Rare, Epic, Legenedary, and Mythic) instead of numbers. Weight will be calculated based on named value.
This repository is set up to use named weights by default. The layers are already using named weights
You can switch back to using numbered weights by setting namedWeight
to false in config.js.
// Set this to true if you want to use named rarity instead of numbers.
const namedWeight = true;
This fork gives the option to use define exact counts of traits rather than using weight to randomly determine counts of traits.
To use exact weight system, set exactWeight to true in config.js. PLEASE NOTE: exactWeight and namedWeight can not be used together at this time!
const exactWeight = true;
Use this option to assign a 'variation' to multiple layers. The most common use-case for this option would be ensuring certain traits are the same color or skin pattern. For any trait that has variations, put a placeholder in the normal layer's folder with the desired weight, then put each of it's variations into the layer's '-variant' folder named with the variant name instead of a weight. Define your variations in the layerVariations const in config.js. NOTE: If a layer has variations, it must contain all the variants. For example, the base images in this fork have 4 variants defined (Blue, Green, Purple, and Red), so any layer using layerVariations must include a variant for each of those colors.
In this fork, there are currently two layers with variations (Arms and Head). If you look at the file structure, you will see each have '-variant' folders with each trait duplicated the number of colors edfined in layerVariations. Define layerVariations:
const layerVariations = [
{
variationCount: 1,
name: 'Color',
variations: [
'Blue',
'Green',
'Purple',
'Red',
],
Weight: [
35,
25,
25,
15,
],
},
];
Determine which layers need variants:
{ name: "Arms", options: {layerVariations: 'Color'} },
Base folder for the trait (Arms) as well as it's variant folder (Arms-variant):
Base trait folder contents. These files should be named the same way any other trait would be (trait#weight):
Variant folder contents. These files should be named with the traits name (exactly matching that in the base trait folder) followed by a space and the variant's name (the four colors in this case):
This fork gives the ability to start generation at any number. This can sometimes be useful, but in 99% of cases generation should be done all at once. These options simply provide tools for the other 1%. Utilizing a previous generations dna will help to prevent duplicates from being generated. Please be sure to utilize the oldDna Util.
resumeNum
can be set independantly to simply start edition at a higher number, but if you want to use old dna, your resumeNum
must be set and it must equal the number of items in _oldDna.json
const resumeNum = 0;
const importOldDna = false;
Adjusting every growEditionSizeTo
anytime you want to test something out on a smaller scale can be frustrating. This system allows you to set your collectionSize
once, then your growEditionSizeTo
definitions are replaced with scaleSize. Ensure the numbers fed to that function add up to your collectionSize
, and you can change toCreateNow
on the fly to whatever scale you want to test. All rarity is scaled where applicable, so no need to make weight adjustments!
By default, this repository is working with a collection of 1000. You can test this feature quickly by simply setting toCreatNow
to a smaller number.
NOTE: This feature can be bypassed by setting growEditionSizeTo
to numbers vs using scaleSize
. If you do use this feature, collectionSize
and toCreateNow
must match to create the full collection!
TIP: To avoid potential scaling issues, you can set your final layersOrder to equal collectionSize
.
const collectionSize = 1000;
const toCreateNow = 1000;
const scaleSize = (num) => {
if (collectionSize === toCreateNow) return num;
return Math.ceil((num / collectionSize) * toCreateNow);
};
If you want duplicates in your collection, you can set the allowDuplicates flag to true.
const allowDuplicates = true;
This utility gives the option to remove some commonly requested items. Set any to true to remove them from generated metadata. Original metadata is preserved, and clean metadata is saved to build_new/json
let removeDna = true;
let removeEdition = false;
let removeDate = true;
let removeCompiler = false;
This utility give the ability to remove any attribute either by trait_type, or value. Commonly used to remove 'None', but can be set to remove any attribute.
let removeValue = "None" //Enter a value you want to remove here. (ie: "None")
let removeTraitType = "" //Enter a Trait you want to remove here. (ie: "Head")
This utility generates a dnaList for import from a previous generation's metadata. As mentioned several times, the better options is typically to regenerate everything; however, this gives the ability to prevent duplicates from being generated based on old information.
You must place your previously generated _metadata.json file in the build_old folder.
This utility recreates all individual metadata files as well as _metadata.json and orders them numerically. This can be useful if _metadata.json was accidentally deleted from the build folder or if you need each item in _metadata.json to be ordered numerically.
No edits necessary to use this util.
🛠️🛠️ Note again that the engine and especially documentation are a work in progress. Both will be improved upon further.
Mark layers incompatible with others to prevent generation
Mark layers for variation, allowing things like ensuring all traits are the same color
Mark specific items to be moved the first n of the collection for sequential minting.