NokiMo
TrixelCreative
TrixelCreative

patreon


Restitched: Dev Diary | Asset Import #1

Welcome back to another Developer Diary! In this post, we'll be discussing our internal process for importing assets into Restitched. Those of you who enjoy the backend/technical side of development may find this to be an interesting process!

This was originally going to be one long post, but after tackling it and realizing there was so much to write about, we've decided to split this post into two! You can look forward to 'Asset Import #2' at a later date! In this post, we'll be looking at importing Stamps, Props, and Materials!

What are assets in Restitched? An asset is anything that adds content to the game, often in a visual form. Props, Materials, Stamps, Craftbook colors, cosmetic pieces, backgrounds, etc. - these are all prime examples of the type of assets we regularly import into the game!

Importing certain assets can be a tedious process, so we've created different ways to streamline it for both our veteran team members and new developers alike. Though we do have internal documentation with tutorials, we appreciate having a few user-friendly tools that can do the dirty work for us!

Importing Stamps

We have hundreds of Stamps already imported in-game! With this ever-expanding library of graphics, it was important that we streamlined the process for importing. Who wants to manually add Stamps through lines of code? Not us!

Formerly, the method to import Stamps was a bit more technically complex. We relied on a '.JSON' file with a code-like structure. This file listed and labeled each one of our Stamps. The method of adding stamps through lines of code quickly became tedious and confusing, especially for our artists and non-programmers. 

We tried to ease this process by building a script program that would mass-import new Stamps for us. However, because this was still not very user-friendly and again relied on a .JSON file, importing Stamps continued to feel like a chore.

We realized that as the game continues to grow we'll be leaning more toward the artists' world, as these are the folks responsible for one day building the story levels that act as the facade of Restitched.

For the artists to do their best work when designing levels, we would need a tool to accommodate their need for on-the-fly Stamp editing... thus, the Stamp Import Tool was born!

The Stamp Import Tool is a custom-coded pop-up window in the game engine that easily allows us to add, replace, name, and label Stamps at our convenience. This tool was designed so that anyone with basic Unity experience can use it, and it helps to bridge the gap between the programmers' and artists' worlds.

Importing Props

Props are one of the trickier assets to import, as they come in many different shapes, sizes, and dimensions. The layer system in Restitched is a tricky one to work with, as the layers are technically recognized by the engine as being 2D, but are presented in a way that works as a 3D space. 

This can be confusing when adding 3D models into the mix because we must define how deep they are in the layers, how heavy they are, what physical aspects they inherit, their settings by default, and their hitbox (the collision shape that prevents the player and other Props from going through them).

While we're still refining the system for Prop importing, we've added some settings to make life just a bit easier. We don't have a special tool for Props at the moment (like we do with Stamps) just because of the sheer complexity. We are working on new ways to more effortlessly work with Props, however.

To import a 3D model as a Prop, we often need to make adjustments to the model itself in a 3D editing program such as Blender. When we have the Prop ready to be imported (all one mesh, rotated correctly, etc.), we then create a new 'Prop' settings element in the engine. This new element will create a panel with settings for the prop, assign it a number ID to be recognized by the game, and ultimately lay the foundation for the process going forward.

Every Prop needs a material assigned to it, so the next step is to create a new material element in the engine and assign that material to the Prop element we made earlier.

Once the Prop's settings and material elements exist, we can start filling in the details like the name that will appear in the Craftbook, how heavy it will be when added to the level, and which physics properties it holds (slippery, rough, normal, etc.)!

Now that we've got everything in place, there are a few other tweaks to make and boxes to tick. This process usually takes a while for each prop as we fine-tune the model including its alignment and size in-game. 

Once everything is right and ready, we click an 'Import Props' button in the engine's toolbar, and voila! If all is well, the prop should now be functional in gameplay!

Importing Materials

Materials are textured brushes of geometry that make up the playable platforms in Restitched. Because each level might have a different style, we heavily rely on Materials and their textures to give a scene its unique look and feel. Materials have many configurable properties, ranging from weight to bevel style and texture.

Unlike Props, importing Materials is thankfully a fairly simple process! It works similarly to the way we import props, but a bit easier as we're not working with those tricky 3D models. 

We start by creating a 'Material' element in the engine. From this element (much like with Props), we can assign settings like bevel type, weight, physics properties, texture, name, etc.

Once a Material is all set up, we can then import the materials into the game and Craftbook by clicking an 'Import Materials' option in the engine's toolbar. If done successfully, the engine will run through all materials in the database and create a new entry at the ID you assigned it to.

The way we generate Material icons for the Craftbook is a bit different from how other assets use icons. For example, Prop icons have to be made manually (for now). While Stamp icons are simply just a smaller version of the Stamp graphic itself, for things like Materials and Cosmetics we have to generate our icons with some neat coding wizardry!

To accomplish this task, we have a custom-scripted scene called 'MaterialsPhotography'. This scene contains a sphere with its own UV scale, lighting, and positioning. When you click the 'Take photos' button, this sphere will quickly cycle through all of the material IDs in the game and take a photo of each one to be used as an icon. 

Fortunately for us, this system does all of the hard work by taking photos, cropping them, assigning them to the correct ID in the material database, and so on!

...and that's all the time we have for now! Importing assets plays a huge part in the game's development pipeline, so there is certainly more ground to cover. For those of you who've made it this far, thank you for tuning in!

Restitched: Dev Diary | Asset Import #1

Comments

Not if we do it first

Trixel Creative

i want to eat the material spheres

cutegirlclover


Related Creators