Essentials Series/Custom Models: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
(→‎Exporting as Other Formats: Correction about .dae model importing bug)
mNo edit summary
 
Line 44: Line 44:
When exporting level models from your model editor, it's important to note that there's a maximum amount of vertices/triangles that the model can have. After a certain amount, the game starts to lag, and after another one, it will crash when loading the stage. It's not known precisely what is the size, but the resulting MODL asset should not exceed 100 KB in size (you can check the size in the Archive Editor after importing). If your models are big, you can split them into smaller pieces in the 3D tool and import them as separate assets.
When exporting level models from your model editor, it's important to note that there's a maximum amount of vertices/triangles that the model can have. After a certain amount, the game starts to lag, and after another one, it will crash when loading the stage. It's not known precisely what is the size, but the resulting MODL asset should not exceed 100 KB in size (you can check the size in the Archive Editor after importing). If your models are big, you can split them into smaller pieces in the 3D tool and import them as separate assets.


Once the models are imported, you will need to make [[SIMP]] (Simple Model) assets and add them to the HIP so that the models will actually appear in the world. This can be done automatically in Import Models, but is also covered in the [[../SIMPs/]] page.
Once the models are imported, you will need to make [[SIMP]] (Simple Object) assets and add them to the HIP so that the models will actually appear in the world. This can be done automatically in Import Models, but is also covered in the [[../Simple Objects/]] page.


After importing the models, you will need to import their [[#Import Textures|textures]].
After importing the models, you will need to import their [[#Import Textures|textures]].

Latest revision as of 19:48, 1 June 2022

Essentials Series
  1. Introduction
  2. Industrial Park basics
  3. Editing Assets
  4. Templates
  5. Links
  6. Dispatchers
  7. Tikis and Enemies

This page is part of the Essential Series modding tutorials. It will cover how to use Industrial Park to import custom 3D models to the game. Models for levels, stage objects and characters can all be imported. We will also talk about how to import/replace textures and how to set rendering pipeline settings for models, needed for vertex colors and transparent textures.

Creating/Editing Your Model

There's not much I can say about this part, as teaching how to 3D model is out of the scope of this tutorial. I (igorseabra4) recommend Sketchup as a 3D tool for beginners, as it's simple to use and can export to formats supported by IP, but it lacks more advanced features, such as better texture mapping and vertex colors. Blender and 3ds Max are also commonly used tools. You can also get your model from another game or a site such as The Models Resource, but that'll usually require some kind of processing in a 3d tool, usually to scale the model to an approprite size, split into smaller parts (for the case of level models) and convert to a format accepted by IP.

Exporting as DFF

This method is the most traditional, and necessary if you want to import rigged models (with a skeleton, which also allows for animations). This allows you to create a custom character, for example, and even replace one of the player models (although the process of creating custom animations to replace each one would be lengthy). Another option would be to extract the player model and rig a different model to the same skeleton, which would avoid needing to make new animations. This is not supported for Scooby as the skeleton format for that version of the engine is unknown.

This method is quite simple: have your 3d model in 3ds Max or Blender, then use the DFF plugin for 3ds Max or DragonFF for Blender to export the model (in 3ds Max's case, you must have only the bones selected, then click on Export Selected, for the export to work properly).

Only the bones are selected, not the object.

These are the correct settings for the export (note: it is possible that other settings also work, depending on your model's needs):

rwio settings
Example of custom model imported from 3ds Max

Video guide on doing the steps above.

Exporting as Other Formats

This method works when exporting from any 3d editor. The most common formats are OBJ, FBX and DAE, all of which are supported by IP. Do not use OBJ for importing a model with vertex colors as the file format does not support it.

Note: There is a bug with AssimpNet, the library Industrial Park uses to import models, with DAE imports—the red channel for all vertices is overwritten by the alpha channel. Therefore it is recommended to use FBX for models with vertex colors.

Importing to the game

After exporting from the 3d tool, you can either use the Asset Data Editor of a MODL asset to import the data over it, or the Import Models dialog in Industrial Park to create a new MODL asset. You will also need to import the texture for the model.

Creating a New Level

When you have your own level model, usually you'll want to create a new level for it, and not import the model in an existing level, right? Right now, you have two options: creating a new HIP using Industrial Park or copying the blank HIP/HOP files from the EditorFiles.

New HIP

In Industrial Park, open a new Archive Editor and go to File -> New. With 'Add Default Assets' selected, click OK and save your new HIP file. You can add it to the game by replacing an existing level or creating a new one. Any combination of 4 characters will work as a level name. For example, the original game had JF01 up to JF04. You can name your file JF05, or JFAB, or even AXYZ (that would need to be in a folder called AX, you are also free to create new folders). With the file in place, you can set the boot level to that in the INI file, or you can create a portal from another level leading there to be able to access it ingame. The level will work immediately, but obviously has nothing in it.

You can work using only this HIP if you want to, as a HOP is not needed. If you want to use a HOP, open another Archive Editor and create one with File -> New, leaving 'Add Default Assets' unchecked.

Blank HIP/HOP

They are available in the IndustrialPark-EditorFiles (which we talked about here). You can copy and paste them into your game's files and give them a new name.

Adding the Models

With your new HIP or HIP/HOP pair open and working, create a new Model layer and use Import Models to add your level models to the stage.

When exporting level models from your model editor, it's important to note that there's a maximum amount of vertices/triangles that the model can have. After a certain amount, the game starts to lag, and after another one, it will crash when loading the stage. It's not known precisely what is the size, but the resulting MODL asset should not exceed 100 KB in size (you can check the size in the Archive Editor after importing). If your models are big, you can split them into smaller pieces in the 3D tool and import them as separate assets.

Once the models are imported, you will need to make SIMP (Simple Object) assets and add them to the HIP so that the models will actually appear in the world. This can be done automatically in Import Models, but is also covered in the Simple Objects page.

After importing the models, you will need to import their textures.

Import Models

This is available in the Archive Editor, under Edit. Make sure you have a Model layer selected before opening it!

Import Models dialog

Use the Import button to choose your model files. You can choose any of the available model formats (including DFFs, which were mentioned above, and more common formats like OBJ and FBX). The models will be imported with vertex positions, vertex normals, texture coordinates, vertex colors and faces if they have all of those things (and will not if they don't have vertex positions or faces, obviously). This is what each of the check boxes do:

  • Flip UVs: this will flip the UVs (texture coordinates) upside down when importing. This is useful if you note that they are imported upside down. You will certainly need to check this if you import from 3ds Max.
  • Ignore Mesh Colors: 3ds Max and other editors will sometimes add unwanted colors to the mesh (these are not vertex colors!) when exporting to FBX or DAE which make the model darker unnecessarily. Check this to ignore them.
  • Generate SIMPs: this will automatically generate SIMPs for each of the imported models and place them in a new Default layer. This is used for importing level models, as they need a SIMP to actually appear in the world.
  • Ledge Grab SIMPs: check this to enable the ledge grab flag on the generated SIMPs. Otherwise, the characters will not be able to ledge grab on the models.
  • Create PIPT: this is needed for models which vertex colors, for the vertex colors to show up. If your model has no vertex colors, leave this unchecked.
  • Overwrite: if this is checked, existing MODL assets with the same names will be overwritten.

After your model is imported, if you had Generate SIMPs checked, you'll already be able to see your model in the stage, but without textures. Otherwise, you'll need to add an Entity asset with a reference to your model to see it. If you think you should be seeing your model but are not, check the process you went through again and make sure all steps were correct. Check also if the scale of your model is not too big or too small for the game (SpongeBob is 1 unit tall).

Importing a BSP

Right now, using a BSP as a level model is experimental in Scooby and BFBB. You can use the method above to create a BSP as well, but in that case, make sure you have a BSP layer selected, and that you update the asset ID of the BSP in the Environment asset after importing.

Import Textures

This is available in the Archive Editor, under Edit. Make sure you have a Texture layer selected before opening it! Remember also that Texture layers must be the first layers in a HOP archive. You can use the arrows to reorder the layers and ensure this when adding a new layer. Edit -> Collapse Layers will also order this automatically.

Import Textures dialog

You can import textures of various formats with this, but PNG is recommended. Choose the textures you want and press OK to import. The textures should be visible on the models immediately. If they aren't, you can click on Refresh Textures and Models under Options to do this. This is what each of the check boxes do:

  • Append .RW3: this is necessary if you are importing textures meant to be used by models! (this can sound silly, but some textures are used by User Interfaces for example). All textures used by models must have .RW3 at the end of their names, and the Asset ID will be generated from that. Otherwise, the game will not be able to find the textures and will show the models blank instead.
  • Generate Mipmaps: choose whether mipmaps will be generated for the textures.
  • Compress: if checked, textures will be compressed. There will be a very minor loss in quality, but the size of the archive will be smaller. This must be turned off for textures with transparency, as transparency is lost on compression.
  • Flip Vertically: this will turn textures upside down when importing.
  • Overwrite: if this is checked, existing RWTX assets with the same names will be overwritten.

If you just need to import over a single texture, you can use the Asset Data Editor for RWTX assets instead of the Import Textures dialog.

Texture Dictionary

This is a function which Industrial Park has, mainly to allow you to edit or replace existing textures. From Edit -> TXD Archive in the Archive Editor, you can click on:

  • Export (RW3): this will export a TXD (texture dictionary archive) with all the textures that have RW3 on their names, which are the ones used by models as explained above. The RW3 will be removed from the names when exporting.
  • Import (RW3): this will import a TXD archive and add RW3 to the texture names when importing. This is meant to import the same TXD you exported with the above button! Existing textures with the same names will be overwritten.
  • Export (No RW3): this will export a TXD with the textures that don't have RW3 on their names, so the ones used by menus and particles and not models.
  • Import (No RW3): this will import a TXD without adding RW3 to the names. This is meant to import the same TXD you exported with the above button, existing textures with the same names will be overwritten.

TXD is a texture dictionary format, which can be edited by Magic.TXD. See the RWTX page for more information.

Pipe Info Table

The Pipe Info Table PIPT is an asset, usually present in the Default layer of the HOP. It contains information to be sent to the rendering pipeline about models. This is important to us because we must edit it if we want our models to have semitransparent textures or vertex colors, for example. Checking "Create PIPT" when importing the models will automatically set PIPT entries for vertex colors, but you must set them yourself if you want alpha blend on textures, for example.

To do this, open the PIPT Asset Data Editor and navigate to the PIPT entry of the model you want to set alpha blend to (or add one and set the MODL asset it in the entry, if it doesn't exist). You can choose one of the presets or even edit the flags yourself, if you know enough about the rendering pipeline to do that. These are the presets you can choose:

  • Default: this is the same as not having a PIPT entry. The model will have no vertex colors, default lighting and no transparency. Any transparent textures on the model will have rendering issues.
  • Vertex Colors: disables default lighting and enables vertex color display on the model.
  • Alpha Blend: enables blend on transparent textures.
  • Alpha Blend + Vertex Colors: combines the two above.
  • Additive Alpha: enables additive alpha on the model. This turns all "blacks" of the model into "transparents": the model becomes translucent and very bright.
  • Additive Alpha + Vertex Colors: combines Additive Alpha and Vertex Colors.

Material Effects

In the Asset Data Editor for MODL assets, you can click on the [...] button near the Materials field to open the Material Effect Editor.

Material Effects Editor

It allows you to create and edit not only texture names and material colors for individual materials in the model, but also create a Material Effects PLG RenderWare section with Bump Mapping, Environment Mapping and Dual Texture effects. None of these effects are previewed in Industrial Park. The Bump Mapping effect, although available, doesn't actually seem to work in BFBB.

User Data

Other parameters specified in the executable uses an effect added to an atomic when the name's scanned during the loading process. Documentation on how it's setup can be found here and the data names used in BFBB are HI_TAGS (stands for Heavy Iron Tags) and MORPHSTATE.