Generating Randomized Characters - With Rarity & CSV Export FZRandomizer 2.1 (Blender 3.0 Addon)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's talk about how to generate some randomized characters i just want to kick this video off by giving a big thank you to anyone who has downloaded the fz randomizer and used it so far but i especially want to thank those who have donated to the creation of this plugin together everybody's support has made it possible for me to bring you two major updates to the add-on one a rarity system and two an option to export your variant data to a csv document the best way to comprehend how the rarity feature works is to think of the whole system as sort of a lottery the system will select one winner for each sub collection or each attribute whether that's a hat a shirt a pair of pants a hairstyle if we think of this in terms of a lottery the system will draw one ticket as the winner essentially each object within the sub collection is carrying one ticket so for example say we have two objects and each object has one ticket or one chance to win that is a 50 50 chance of being selected if you have three objects each object still has one chance to win but now it is a one third chance of being selected obviously you get how this works this is how the 2.0 version function what's new in this update is that you now have the option to hand out new tickets per each object to make objects more or less frequently selected so let's go back to the two-object scenario to see how this works we begin with each object having one ticket a 50-50 chance for each object if we decide to give the first object nine tickets rather than one a few things have happened we've increased the total number of tickets in the ticket pool to ten not only have the odds of object one changed to nine out of ten or a ninety percent chance of being selected but on the other end the odds of object two have in turn decreased to one out of ten or ten percent chance of being selected you can see how one object's tick account directly affects the others now this lottery is a closed system which means objects outside of the subcollection do not affect the rarity of the objects within that subcollection so you have multiple lotteries happening to create one overarching variant at the very end export to csv so for this update a lot of people asked for metadata with that being said i don't know how each individual person is going to need their data stored for their specific needs whether they need a json file or a text file or an excel document so i just included this option to export all the data as a csv document you can convert and manipulate the data as you see fit after it's in this file format if you have the feature turned on it will simply just generate the csv document in the root folder where your project is saved let's build a collection of random characters from the beginning so you can see how it's done one quick mention there was actually a bug in version 2.0 which threw an error code anytime you tried to uninstall the add-on no big deal just uncheck the marker and then hit remove at the bottom you will get the error code but it's okay you'll hit remove and then you'll close blender once you reopen blender you should have no sign of the initial plugin then you can just go through the typical steps of going to edit preferences add-ons and then installing version 2.1 yeah sorry about that but now you're good to go for this example i've already created all the attributes my characters will use such as the body objects the face objects the hat objects the hands other objects that you could use these are called our attributes or our sub collections these sub collections go within the host collection which i'm creating right now i've named my host collection ghost because for this example we're creating a collection of ghosts i'll begin by creating my first sub collection of attributes and this sub collection will contain all of the body items for my example i've only used one body and it's perfectly fine to have a sub collection with only one object in it i'll move that body object to the specified sub collection which in this case is body let's move on to the face items now the face is the first spot where i have multiple objects or what i would call variation within the collection you'll find an angry face a sad face an unfazed face and a vr headset let's put them all together and drop them back into their own specified sub collection called face again this sub collection goes inside of our host collection moving on to the caps i built a headband and a santa hat as we did before we'll make a new sub collection for these attributes we'll call it caps moving on to the hand objects i have one hand object in the down position one hand object in the up position as well as one hand object i just called kevin again we'll move all three of those hand objects into a new collection called hands and finally for the waste sub collection there's three objects one a fanny pack two an object called no waste so that way there's an option for nothing to be selected as a possibility as well as a sword with a belt and just like before we can move all three of these objects into a new sub collection inside of the host collection awesome now we finish the structure for our character randomizer now let's move on to material libraries or matlibs a matlib can act as a library for specified objects to pull random materials from hence the name at this stage using a matlab is not included in counting possibilities towards unique generations to have a specified material count towards a unique possibility you'll need to duplicate the object within the sub collection and manually add that material to that object doing it this way even allows you to access the rarity system for a specified material as well i'll go into more detail on rarity later in this video for this example we only need to use two but if you need to the randomizer allows you to use up to ten matlibs spots zero to nine setting up a material library is actually very easy add in any random object and by pressing f2 you can rename this object to a very specific term matlib in all caps m-a-t-l-i-b i then follow this with an underscore and i usually write anything after this that sort of defines what this material library is for me so i know if you look up in the outliner you'll then see your object is listed up there as an object in the scene for this to work properly make sure the material library is sitting in the root folder of the host collection rather than within a specific sub-collection going back to the viewport we can then tab into edit mode and delete all of the mesh data within this object now this object is just an empty container for mesh and we'll leave it that way your matlab is now properly set up and you can see it's still living here in the outliner if you move down to the material slots we can just begin adding in all the materials that need to live inside of this material library i'll start by working on the material library for the ghost skin to do this i'll select the body object as it's the only object that needs to access a random material from the ghostmatlib a group of objects that all access the same material library are referred to as a linkmat group with the body selected we will define our first link map group i'll scroll down to the advanced material options and set the link matt group to zero when i click set link matte our body is now placed into link matt group 0 as depicted by this prefix here the process isn't complete until we connect one of our matlibs to the linkmat group as well i select the matlab object and follow the same process make sure that the linkmat group is set to zero and then click set link mac group and finally for this to work you need to have a default material already on your subcollection objects if you remember from the last version it's still very important to make sure that the material slot is set to object link rather than datalink by default material slots are set to datalink so you will need to change that so the matlib knows where to apply the material to i'm going to set up the second material library now notice how this santa hat has multiple materials on it while link mount groups and material libraries only occupy the first material slot so that gives you options to randomize objects that need to use multiple materials where some need to stay the same for example here i only want to change the actual color of the santa hat leaving the white band and the white puff at the top of the hat i'll select both objects within the sub collection that need to access the material library and set them to link mat group 1. one well remember our last material library occupied linkman group zero so we need to be sure that we're actually occupying a different linkman group so that way we're not causing any overlap between the other material libraries move on to rarity now remember rarity should be treated like a lottery system in this example i want the vr headset to be the most rare item or the least likely to be picked which means it needs to have the least amount of tickets in the lottery system to do this we'll increase the amount of tickets for all the other objects within that sub collection by selecting all the other objects you can type into the tickets box the number of tickets you'd like to be assigned per each item i'll give the others 5 tickets in this case to set this tick account to all the objects hold alt and then hit enter this assigns that tick account to all selected objects rather than just the active object you'll see that as you select each object within the sub-collection the rarity panel will give you a readout of multiple pieces of data that includes the sub-collection the object's name the ticket count and the rarity listed in a fraction form as well as a percent form this rarity is calculated by the number of tickets this object has divided by the number of total tickets within the sub collection each object starts with one ticket by default but that number is just a default if you know you're going to be using rarity on multiple objects feel free to select all of your objects within the sub collection and just from the beginning set all of the tickets to a higher number like 10 or 100 or something this gives you maybe a better starting place to drop down from as you try to figure out the rarity of your sub collections i'm now just going through and setting the rarity for the rest of the objects within the sub collections based on what we've already seen objects like the vr headset weightlifting kevin hands and the belt sword will all be rare items meaning they'll have less tickets than the others and remember at any point in time you can just look down on the rarity panel for that object and it will tell you what the rarity currently is based on other objects within a sub-collection so we've set up the structure of our characters we've set up the material libraries the link mats as well as the rarity let's get ready to generate some of these characters the first step is actually make sure your host collection is typed out here properly this is case sensitive i'll run my calculate possibilities function here to find out i have exactly 108 unique possibilities that are possible this means you can't go over this number if you're trying to generate unique characters but logan i need more characters than that i need more variations than that okay then we gotta put in some more work we just need more attributes we need more things so right now i said we need more things so i'm going to make another set of hands i'm going to make some tiny hands and literally just in making one extra set of hands my possibility count jumped up to 144 and that's because this is an exponential process think about it if we add more attributes we're not just adding like two or three more attributes so there's two or three more possibilities no it's two or three times the possibilities of before so it's always very important to have lots of variation so you can bring that number of possibilities up i would always recommend to make sure that your possibility count is always at least double the amount of variance you're trying to calculate and if it's not it can even go as far as negatively impacting the accuracy of your rarity features so let's keep moving in this case i don't need to generate unique ones i'll also leave the instance box checked because i'm not going to be changing any of the shape keys so it's totally fine to instance this mesh data rather than having to recreate it we'll give it 60 variants our final step is to decide whether or not we want to write to a csv document and record all this data somewhere in a spreadsheet by default this saves in the root folder of where your project is saved so be sure to save your project before doing this at all and by default the csv document will be named variantunderscoredata.csv so feel free to change the name accordingly for your project and just make sure you leave the dot csv in the text box i'll now hit generate to run the actual variant generation process and there we have it 60 random variants now generated and in our variants folder i'll turn off my host collection so we can get a better cleaner look at all the spawns we have by going into our spawn tools we can click q for batch render to sort of clean up the scene and look at each one individually this function sets the scene frame length to the number of variants and sets each variant to a frame in the scene one small update from the 2.0 version is you can now use the arrow keys to parse through your variants in the viewport rather than having to wait till the render it makes it much easier to see what you're working with before you have to render everything and as you can see i'm just using the arrow keys to go through one by one and look at each variant i generated and as you can see we don't have many vr headsets except for maybe one right here come on let's get over let's get over our headset where are we at where are we at where are we at we're gonna get one they're rare they're really rare there we go there's a couple hours two in a row that's even more rare but you can see the rarity works and you can just parse through frame by frame and check them out let's go see where our data was saved so if i head over to the root folder we'll actually see now that i have that csv document we referenced earlier i named ghost data let's open that up i pulled it up in excel here and as you can see we just have each variant and it lists each attribute as well as the rarity of that attribute and the material assigned to that attribute all saved here in this one csv document which obviously will scale as big as you need it to be however many variants you generate and however many attributes you give it for each one it'll tell you the total number of tickets within that sub collection as well as the number of tickets for that actual attribute within the sub collection and i also gave you the rarity readout there as well but you know this is a csv document so all the data is just dumped into a csv document so you can manipulate it however you need to for your own projects make sure you always save and close out of your data document it'll throw an error at you if you have that csv document open somewhere so just when you're done looking at it make sure to close it out and the last thing i gave you here was this overwrite function by default it's turned on i don't really know why you would turn it off but um if you do turn it off and you happen to generate your document so we'll generate one right now with it turned off if we go back over to the csv document you'll see we actually just get another top line here right after the last one ended and it just sort of appends that data on to the previous document maybe you want to compare the last generation to this generation um if you're just running some testing or something again usually i would just keep this turned on for now i would just keep the override turned on but just something you have if you want to use it and there you have it a variant generation built with 2.1 now supports rarity for attributes as well as a csv export for your data so i just wanted to pop in here at the end and just mention a little something else about the rarity system we talked about the rarity working like a lottery system right well you know if it says it's a 17 chance of being selected that is a benchmark for how generally how often it's going to be selected this does not mean at the end of your variations you're going to have 17 of all of your variations we'll use that object why is that well you have to understand that this number is the chance that it will be selected this is not the percent that there will be at the end those are two very different numbers right so if you're generating 20 random objects but there's a rare item that only comes up one in 500 times you might not even see that rare item at all within your project so you know you have to just play with these numbers experiment a little bit and see how they play into a final list of generations so just keep that in mind is that those are two different numbers the chance it will come up and the actual amount of times it does exist right two different numbers anyway i'm gonna leave you guys with that thank you so much for watching i appreciate everyone who's made it this far in the video as well as everyone who has downloaded the plugin and especially those who have donated to the plugin you've made creating this plugin and other projects in my channel just so doable so i just want to give a huge shout out a huge thank you to everyone who's donated so far with that drop a comment leave a like and subscribe for more projects and videos in the future also be sure to check out my instagram i love seeing all the stuff that you guys are working on in the blender community as well as being able to share out new projects and updates to projects like this one here until next time take care [Music]
Info
Channel: FruitZeus
Views: 46,470
Rating: undefined out of 5
Keywords: Blender Character Randomizer, Blender Character Randomization, Character Randomization Addon, Blender Randomizer, Blender 3.0 Addon, Blender NFT Addon, Blender NFT Creation, Blender 3.0 NFT, Blender 2.9 NFT, Blender 3.0 Addon Tutorial, Blender NFT, FZRandomizer, FZ Randomizer
Id: e0vjuWopx5g
Channel Id: undefined
Length: 17min 43sec (1063 seconds)
Published: Sat Jan 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.