TFTools Tutorial: Prop Instancing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi so this tutorial briefly covers the tools and processes for using properly instanced props in time formats uh or from timefall maps in unity uh I won't go over any of the details for how to actually rip the maps themselves I'm just going to assume you already know all that stuff by watching this um but first off I should explain what is an instances and what is an instance and why is it important uh so an instance is basically just a duplicate of an object or a mesh so blender actually when you import the props blender into blender it's already like this so see this like tree here is just a duplicate of uh an original mesh none of these are the actual meshes they're just collections uh but whenever you export to Unity none of this data gets carried over and they all get exported as their own unique meshes so this tree that tree whatever all this grass they're all different meshes in unity well basically being completely identical and that has really obvious performance in file size ramifications that realistically should not be an issue uh had they been properly exported uh a prime example of this is actually My Angel City Port I did a while back uh it looks really pretty but none of this stuff is properly instanced uh and what I had done to sort of get around the file size part of that was to combine all the uh different methods that were identical and that honestly caused more issues because then that meant that the occlusion calling was god-awful on the map and this port does have a lot of its own issues uh it has like two separate texture folders and whatever it's it's no good but this issue does apply to I think every map Port I've seen on vrchat no one really has properly instance uh props and even if you aren't going after the performance benefits of instancing uh just doing so will actually improve your uh performance in editor quite a bit so it's honestly just something you should do no matter what it's you it's a good thing you know um so what what do you do uh you're just Homestead which is what I'll be using as an example I've recently uh updated my tool set my VR chat tools for Unity to include a new thing that can basically take I just close it actually I can take a CSV or a data file as an input and a folder path that contains all the prop models individually uh and with those two inputs it can import all of the props so here you see I've got all the props of Homestead and unity but if I were to click on them they're all models which derive from just a folder of models so while there is like let's see it's a couple thousand yeah well there's 16 000 prop instances there are only oh I shouldn't have done control a oh no whatever they're only like 300 prop models that it uses so it's very uh very good for performance and file size and all that fun stuff so yeah I'll quickly show you how to work this into your existing map porting workflow as I said I'm gonna assume you already know how to do all this uh up into the instancing point so yeah you're going to want to rip the map as you normally would uh and get the mprt and all the cast meshes and all that fun stuff so you've got all that in this models folder and here's my nprg um but before you import it into blender like you normally would you're going to want to use a template that I provide in this non-unity folder on the GitHub page if you go here there's a blend file for the data export or whatever download that and then you uh import your map into that blend file or you can just steal the script from it and put that into your own project so I'm gonna just quickly open up the template and this is what it should look like it's just a regular project file but you've got all this fun shizas on the right so I'm actually going to quickly import all the homestead perups into this sort of project I uh I don't know if there's many other options out there but I use the Apex map importer add-on for getting my per opportunity or into blender uh this tool probably won't work if you use a different method so just keep that in mind you might want to swap to this if you are on a different tool or whatever okay so now that all my props are finished importing I'm actually going to quickly show you on the right there are two collections that came with them one called map and one called assets the map collection actually just contains all the instances so these are all just duplicates as you see they're empty they don't contain anything in them that's because they reference this other collection which is hidden by default called assets and this just contains the original models which then get duplicated everywhere which is why they're all like at the origin overlapping each other you're looking ugly let's actually first go and Export the prop data so that's where this template actually comes in handy you may notice at the top this is the export path and this is highlighted by default because you might want to change it by default I have it set to my D drive because uh the C drive has some like permission issues if you try to export it there it might require admin or whatever uh and you can rename it or change it to something else so if you wanted to go on to a G drive or whatever Drive you just edit this up here but I'll keep it at D you can also rename it so by default it has it named as instance data in all caps but you can change that just make sure not to rename the CSV extension at the end that's important for the unity tool to work properly but yeah the second thing you have to do to export you have to do two things is in this map collection with all the instances select all the things you want to export you don't actually have to export the entire map at once if you don't want to so if you just wanna get the stuff from right there you can do that but I'm just gonna get everything and make sure you only have the instances selected I don't know yeah and then at the top here there will be a little arrow button next to the name here and then X press that and it'll run the script if everything went nicely and you don't see any errors down in this console uh look in your file explorer for where you put it and you should have this beautiful instant status CSV which is exactly what we need now let's get the models themselves like I said before they're in the assets collection so let's just quickly show that but in order to export them all as individual models we're going to need a separate add-on I use this one that's called super batch export or whatever uh it's actually worked really well in the time I've used it so I'm gonna link it in the description and just show you how to set it up uh make sure only the props you want are shown select all the collections then up here at the help button click on this Arrow because we're going to configure it first the top text box just set it to where you want to export to you're going to want to set the format to fbx and the mode to collections and limited to only selected visible would probably honestly work but whatever and everything else should be set up right so you can just press that button and they'll all export as individual fbx files cool so now that we have our instance data and all of our prop models let's go back to Unity and quickly import both of those I already have my in my instances here so I'm not gonna rip those again but you know I'm just gonna hide the old ones but yeah here's my instant data file at least that's new make sure all your instances are in a folder that only these instances are in right uh you're probably going to want to do that anyway for organization reasons but uh the tool kind of expects that so don't break open up the tool we probably already did that under Maps prop instancer uh so select the instance data file you just imported and press this handy dandy button and it'll set the path for you Now find that models folder with all the instances select it just the folder and do that same thing again now this bottom text box actually is pretty important this is the suffix so the file extension and anything any words that would show up at the end of the model names so mine actually do have a suffix all of mine have lod0 at the end underscore lod0 so let me quickly add that uh you can also use this like I said you can change the extension to be like obj or even like prefab so you can have all of your props as prefab so you'd have to set up yourself if you hate life you know but uh just fbx since that's what we set it up as uh and this text or check box uh this enables the fast exporter so what happens whenever you export by default is they all come packed as their proper models like if I were to drag an instance into the scene it's going to be like this blue model thing and so if you make any edits to the model here it'll automatically affect all the instances which is really handy for development but that also slows down the import time a little bit so if you're in a rush if it's taking forever if you're just quickly testing stuff you might want to swap to fast importer which does the same thing as the slow importer I guess but uh it just shoves everything into the scene as their raw meshes already unpacked uh which kind of sucks but whatever so yeah I'm gonna have it as fast importer just so I don't go brain dead while recording this so yeah fun little progress bar it shows all the objects and current object its own you can cancel it if you want but don't do that unless it's like frozen I don't know yeah you can see fast importer doesn't take long at all even though this is literally the entire map of Homestead which is mostly just mesh grass Gotta Love mesh grass right so now that it's done you'll quickly notice one major thing it's put them all under one transform so they're not just dumped into your project and it's actually organized but uh I do have it scaled to 0.025 which is my scaling model if you use a different value for your ports you're going to want to change that here and that'll just scale it properly you know but another thing this message at the bottom will tell you extra detail about how the import process went skips is basically it couldn't find the model or encountered an error so I've actually got five skips here which is no good uh if you click on the message it'll give you a list of everything that went wrong so yeah it couldn't find four models it told me the name of the models they couldn't find and this last one I'm pretty sure this is just an error with my tool actually the it'll always have incomplete data at the end of the file that's just don't worry about it it's fine there was no prop that was actually there and in this list of everything here you can see it's all unpacked right uh so it's all trash garbage but everything is instance correctly and cool and laced and awesome yay uh what was I saying so if you actually look through this list if you have a bunch of Skips it'll actually still add that object just as an empty so you can actually see where specifically in the process it came across that Skip and you can also just quickly scroll through and see how much of your stuff was lost uh which I don't know it's kind of Handy and it gives you the specific object data ID whatever which probably means literally nothing to you but if you're crazy yeah but yeah now you have instance perhaps your game will run a little faster your editor will run a little faster your map Port will be a little low in file size everyone's happy yay bye
Info
Channel: Swagguy47 VR
Views: 104
Rating: undefined out of 5
Keywords: Titanfall, VRChat, Unity, Tools, Blender, Porting, Port, Instancing, GPU Instancing
Id: V-4rb4wx498
Channel Id: undefined
Length: 15min 56sec (956 seconds)
Published: Fri Mar 22 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.