Mid-Week Wednesday #5: Getting Ready For Next VPT Release

Its been along week, and sadly am not getting a lot done. I probably did need the break though because sitting at your computer for 10 hours everyday for the last year is definitely not very good for you. If you've been following along with Screenshot Sunday and the other news you may know that my parents dropped Little Rain off here so they could go on vacation for 10 days, well its 5 days in and I have to say I would not get anything done if I had to take care of her all the time. Its been nice though, I really needed the exercise cause I haven't been getting out at all this fall.

So today I only worked for about an hour, I managed to finish one of the last Substances, with it being bathroom signs so it really didn't take long at all. The only thing I have left to do now is the Metal Glass Doors, and add some dirt and dust to the bathroom stalls.

The past week I did however get to add some new features and fix some bugs, I haven't released an update yet, cause I still want to work on it a little more, get it? A Little More?.... Anyways, A new release will be out very soon though, just a few more things before its ready.

Here, I'll tell you what I actually did, but first I gotta tell you a little bit about one of the tools. So in VPT, there is quite a few tools, one being A Little Variation. It can be used to manage prefab's, or to be more specific, you only have one prefab, which manages variations of the assets objects. So the main scripts you have are the LittleObject, LittlePartList, LittlePart, LittlePartVariant. The LittleObject holds LittlePartList's, or one LittlePart that is in "Object Material Mode," but I won't get into that today. So the LittlePartList holds, of course, the LittlePart, which holds the LittlePartVariant, but only if you need too.

Now lets say you have a door, it has 3 types of knobs, and 3 windows, each knob would be a part, as well as the windows. Now the LittlePartList would be a type of parts, so in this case one for knobs and one for windows. Now maybe each of those knobs have a variation to it, a version with a lock and one without, and maybe the window has regular glass, and the other has glass with a wire mesh inside. This would be handled by the LittlePartVariant. I do actually plan on creating a sub-variant because I have been finding many cases where It could be handy, this is one of the things I am doing before the next update. So in this tool ALittleVariation, we have a list of those LittleObjects, well actually we have a list of ObjectLists, which are lists that you make that hold these objects to search from, maybe you made a list called Bathroom, so we will select the Bathroom list in ALittleVariation, or we can just select All, which grabs every object from all the lists. So now that a List is Selected, we can choose the type, lets say we chose Door, or again, you could select All. In the future you will be able to select multiple lists at once, but not yet. So now we have all the Doors from the Bathroom list, we can now select which knob we want it to have, and which window. So you want this door to have a lock, so we choose the Locked Variant, and we want the window to have a mesh inside so we choose that. So now for the example we actually have a door system that has properties for when it has a lock or not, so when that Part Variant is selected, it can actually tell your door script that this one has a lock, or that the window isn't breakable. Another use for these variants is for switching objects to their damaged state. And you can set it so that no matter if you have the window with the regular glass or wired glass, it will break into the proper one. Or maybe its just a change in the material/substance, or even just a property or texture, well this will handle that as well.

Now I think you know enough for me to explain what I have been working on. So if you have 2 objects that use the same material/substance, and you want one of theirs material to be different from the other. For each Part, if you want to make changes that don't affect the global material we will have to instance it once, now before last week, every PartVariant when modifying the materials it would instance the material again, its not too big of a deal, especially if it isn't actually active, but some substances can be huge, like over 100MB, and if you are instancing this material 5 times, for 5 variants, for 5 different objects it can start taking up quite a bit of RAM. So what I did was made it so when you add what I'm calling Material Modifiers, it will search the other Variants to see if it has instanced materials that it can share. So now every time you switch variants, it will still use the same Material, but change all the properties to what the variant had set. Before it would just swap the materials out. Now there is some cases where you need to leave it instanced, at least if its a big substance and that's if you were to be swapping from an undamaged version to a damaged one. So basically where you need instant runtime swaps, and can't wait for the substance to regenerate. 

There is also presets you can select in the object, so maybe one preset will have a certain knob and window, which you create and can choose from each preset. The "Object Material Mod" is basically an object wide Part/Variant that only affects materials, too much to go over today.

It may seem like a simple thing but I had to rework a bunch of code to do it. I had it on my list and knew if I didn't do this know I would have to redo the example scene later. These tools are supposed to be there to help you to add variation easily while keeping performance/RAM down, and I think it does quite a good job at that. Now another thing I added was an save/auto-save feature, you can set how ever many minutes you want it to save, and also revert to a state before in-case you don't like the changes you've made. For the mean time you can only go back once but I will add the option to revert further back later, with the option to set how many saves you can revert back too, as well as if the saves will delete after switched to another variant or object.

Now these tools scale, so you don't have to be using them for just a door with its knobs. Each LittleObject could be a building, where each LittlePart is a room, or you could even use each LittleObject as a village, with each LittlePart being a building. I can tell you that some of the objects I've made have hundreds, if not thousands of potential variants, so you can imagine what it would be like if you had to hand pick these every time, or even just save all those prefabs into your scene. It would create a mess.

Now there is really too much to go over, and Its really best done in a wiki like format, or a per-feature video series. Once I release next update that's what I plan to start doing, cause this does not do it justice. This is just a taste of one of the tools in a pack , and the other tools can be used inconjunction together, where A Little Brushy can select these ALittleVariation objects and Paint them to your mesh or terrain.

Well that's all for today, I will see you Friday to give out another freebie!