Removed Kite Demo Assets.
Using the Layout Designer to create a building Prefab.
Example Verison: 8.4 - Will update to the offical 4.8 when avaliable. Note that the files will work in 4.7 except for the blueprint node for Editor Apply Spline which was new to 4.8.
-City of Tristian’s Revival- Well for my first test in modular parts lead to the creation of the city or Tristian but before i could release it for those that wanted to play around with it my version of the 4.2 build corrupted the terrain vegitation causing the entire scene to no longer work. This make me sad a little but in the 4.8PV i was able to convert it and revive the entire map. So why not give it out with this release!
So about 3 mothns ago, I started looking more into modular/procedual creation. My final result being the CityPath Builder which adds builds on top of all my previous smart objects to help me make citys and towns faster for my game. Since I’m not an artist I can’t really think of any better way to create buildings outside of themed modular parts. With the use of an external application built in C# I can make prefabicated building layout designs and save them to a collection. From there I can use both the City Path Builder and the Building Generator to load this data and apply custom building themes to the instances in the map, spawn the building parts and make them to instanced meshs for optimization.
This is the smallest component of the Building Gen it’s purpose is to house the base components of a modular tile, all modular parts are displayed in this component. This compnent holds the Floor,Wall(External Walls),InternalMesh (Used for internal walls aka walls adjacent to external walls), Decoration Mesh (Wall Lamps, pictures etc), and Furnatur Mesh. The data for this tile is sent from the controlling parent into this component. Any generated content of this tile can be manually changed with dropdowns allowing you to change the wall alignment, the mesh used in this indivisual instance. Lastly the tile will also report its final mesh list to build a baked mesh list of all elements and send this back to the control parent for making into instance meshes.
This component is fairly simple. The level spawns child BuildingModTiles using manual entry, if used alone or by templete prefab data sent from the parent constrolling class. The Level class controls a set of rules for dealing with the templete data. The data normally does not have floor information so the level will determine if a BuildingModTile will need the generic floor or a slanted floor or no floor at all, based on the incomming wall and internal wall data coming from the templete data.
Manual use of the MuildingModLevel and BuildingModTile:
This component is responsible for load prefab data,creating level children, baking children data to instance mesh, adding smart objects to certain items(Interactable Doors, cabinets, tearsure chect etc), Theme creation/mesh collection. First the Prefab loading of building layouts made in the RPG Toolkti Application, by default the BuildingModGen will load all building templetes located in teh Content\Data folder. If for reasons you want to load only a certain types of building layouts the field PrefabFilterPrefix can be set with a Name prefix that will append to the file scan and only bring in files leading with that given naming convention. After the data is loaded the file list are listed in the Building Data section of the details panel from here you can manually set the desired building to generate by setting the DesiredPrefab option to the index of the desired building. From here a building will be generated from teh prefab data.
Next the Baking process. Once you generate and or modify the tiles as desired you can select the Bake option bool to start the baking process. This will start the baking process for the meshes in the child objects. In addition to the process if you have any meshes linked to smart objects these can be spawned during the baking process. Currently the only smart objects used areMainDoor, InsideDoor or SlidingDoor. These can be expanded as desired. The Smart objects addapt the same rotation and offset as the mesh that they are paired to.
Finally Themes… Themes are just a instance of the BuildingModBen that has the meshes list setup for a certain building type. Themes are used by the CityPathBuilder to set the data for the buildings on a path. To understand this more, if I make two instances of the BuildingModGen one named Victorian and one named Medieval. The mesh list in each will define the meshes to use for the given style of the modular parts. The dementions of one type could be different from the other. 400x400x400 vs 500x500x1000 modular size. This gives you the ability to make many differnt types of buildings and use them without manually configuring per instance. As a note the theme option in the path building should probably accept an array of building themes to change up the styles of building used in a path but I decided to leave that as a single them to keep it simple…
This component generated proxy buildings along a spline, generates BuildingModGen buildings that can be modified after creation, and also triggers the bake process for all buildings. There is also the ability to add a road mesh to the center RootPath, and to apply the spline to the terrain simular to the terrain options for the spline objects. (PLEASE NOTE THAT EPIC NOTED THAT THESE TERRAIN MODIFICATIONS CAN NOT BE UNDOED TO UNDO THIS YOU MUST RELOAD THE TERRAIN DATA THAT WILL RESET ANY TERRAIN MODIFICATION) Because of the before mentioned issue you can opt to not use this feature but you will need to manuall adject the terrain to the buildings underneath sections. This Component is a little hard to explain so i will try to break this into sections according to the configuration sections:
- proxyMesh - This component spawns “Render Friendly” Proxy meshes alone the splines. These proxys are scaled to the area size of a loaded list of Prefab data. This should give you a good visual of the building that will be occupied when the building is generated.
- ModularSize - Used as a multiplier for the Prefab Data loaded for the proxy cubes. NOTE: This data should probably come from the Theme Building but for now it uses this manual option).
- BuildingTheme - BuildingTheme is a drop down for selecting premade BuildingModGen data that will be used for the random buildings generated on this city path.
- PrefabFilterPrefix - PrefabFilterPrefix works the same as before in the BuildingGenMod object to filter the building data loaded.
- LoadBuildingSettings - Bool used to execute the loading process.
- BuildingSpacing - Sets the spacing between buildings
- StreetWidth - Sets the offset that the Left and Right Blocks are away from the center RootPath
- L_BlockActive - Enables or Disables the Left block from being generated
- R_BlockActive - Enables or Disables the Right block from being generated
- CurrentBuildState - Used to move back and forward through the building process: Proxy/Generate/Tweaking/Bake/Dormate
- ShowProxy - Used to enable or disable the proxy generation.
BuildingData only displays the data collected from proxy state. This data is used in the Generate state.
- RoadMesh - The mesh to use for the road tool.
- RoadScale - The scale to use for the scale of the road. (Only used X and Y Scale)
- RoadUpDir - Modifier for the Up direction (Defaults to ZUp) (Note that the forward vector for the road is X default)
- NumberOfRoads - The number of roads to stretch accross the length to the spline.
- TerrTarget - The terrain that will be the target for the terrain modifification.
- RoadTerrWidth - Terrain Flatten settings
- RoadTerrFalloff - Terrain Flatten settings
- BuildingTerrWidth - Terrain Flatten settings
- BuildingTerrFalloff - Terrain Flatten settings
- UpdateTerrain - Applys the terrain to the splines. (Only works in blueprint and only in 4.8+)
The workflow for the tool. Does not show the smart objects in this version there are also a few defects with the road calculations fixed now:
The example is 2GB extracted.
The RPG Toolkit source for the Building Generator module is in the Content\Data folder. It was created using VS2013 C# Forms. If you do not have this compiler there is a EXE already built in the folder:
Content\Data\RPG Toolkit Data Manager\RPG Toolkit Data Manager\bin\Debug\RPG Toolkit Data Manager.exe
As for the modular parts they are all made for 400x400x400 space. Things like walls are made to be applied on the mid of the edge of the cutoff plane so that the walls could fit at perpendicular angle to each other. This is another reason the edges of the wall have a 45% angle to them to create a stylistic edgle to the corners of the walls.
3DS Max 2014: Building Modular Parts
In the example I only used the main meshes needed for the mase building, though all test meshes for the interrior decoration and furnature are in the build. Here is a list of the meshes as they should appear in the mesh list:
Run through of level (Shows off the smart objects for the buildings door:
I will try to make a video over how to use the RPG Toolkit Data Manager for the Building Generator.
Don’t make a crazy long path as generating the BuildingModGen can eat some memory.
As always I hope this helps some people with tool creation and/or help some of you indie people create enviorments faster and efficently.
***Editor Memory clean up from deletion process issues, when generating building parts even though I call the destruction of all child components I think these things are being stored in the editors memory, maybe for undo purposes? Either way it causes a memory eat to happen so after baking something you like if memory get high for you make leave the CityPathBuilder in the Dormate state after bake and restart the editor. ***