My first: Item - Scenery

From Divinity Engine Wiki
Jump to: navigation, search

Scenery items are the most simple visual items we use.
These usually exist of a 3D mesh and one or more physics meshes.
Sometimes animation and cloth is added depending on the type of visual you want to create.
This guide will explain how we export these assets from 3DS Max and import them in the editor.


This article is part of a collection of guides, with a page for every type of item.

General
Scenery (Rocks, plants, trees, shelves, etc.)
Lootable items (Shells, plates, food, gems, etc.)
Interactable animated items (Levers, doors, etc.)
Interactable socket items (Chairs, beds, etc.)
Weapons (The sharp stuff)


Setup

Layer

The name of your layer will be the name of your visual, so pick something logical.
Inside this layer you could/should only have the following:

  • Your mesh(es)
    Named <LayerName> or with multiple meshes <layername_(any addition that seems fit)>
  • Your physics mesh (if needed)
    Named <LayerName>_phys or if you are using multiple physic meshes <LayerName_phys_01, _02, _03> etc.
  • A root dummy (if needed)
    Named Dummy_<LayerName>

Always try to follow the Larian naming conventions.


Physics

Whenever one of your visuals needs to be walked on, block sight, block movement or needs to interacted with you will need to create a physics mesh.
Any mesh can be used to make physics by:

  1. Selecting your mesh
  2. Going to the Utilities tab
  3. Scrolling down until you find LarianPhysics
  4. Pressing MakeRigidBody.


You can pick from several types of physics:

  • Kinematic
    When you are creating physics for any player movable objects, you will have to create a kinematic physics mesh.
    This mesh must be convex and singular or performance loss could happen.
  • Dynamic
    Currently unused in our 3DS max pipeline.
  • Static
    Used for both animated and static physics.
    Even though concave meshes are allowed here, try to avoid these if you can.
    Instead you could use multiple physics meshes for one visual.


All of these physics meshes can be either convex or concave, but what does this mean?

  • Convex
    Any mesh that has no inward angles.
    This could be but is not excluded to: a box, a cylinder, a sphere or editable poly with no inward angles.
  • Concave
    Any mesh that has inward angles.
    This could be but is not excluded to: a torus, a tube or editable poly with inward angles.


Exporting

  1. Make sure your mesh and physics mesh are in the same layer.
  2. When using multiple meshes in a single visual make sure they are linked to a dummy.

You do not have to export anything other then the visuals and physics. Unless you want to add animations and/or cloth.


Importing

Importing your visuals

  1. Open the Content browser.
  2. Select the proper package you want to add your visual to.
  3. Add the resource by pressing the Add Resource button.
  4. Choose to add your model or physics.

Once you added your files you can find them in your content browser either by selecting the proper package and finding it or using the search bar at the top.


Adding resources

After importing all you resources it is time to add all of them together:

  1. Open the Content browser.
  2. Find your visual, double click it and a new window will open.
  3. You will start on the Materials tab, here you will see each of your meshes inside the exported visual.
  4. Select the mesh you want to add the texture to, now find and select your texture in the Content browser.
  5. Add your texture by clicking the <- button.


Creating a root template

With all your resources imported and setup properly we can now add it all to a root template.
The template is the combination of all your resources and is what you will actually place in-game.
To make things easy whenever you want to create your template find something similar in the Root Template browser, right click it and select create new from selected.
This will prevent any extra work in the form of scripting, naming or checking any of the important features.

  1. Press right-click > create new from selected a new window will open called Create object wizard.
  2. Add the new Physics Resource ID and Visual Resource ID.
    Select the resource in your Content Browser, now select the resource slot in the Create object wizard. A ... button should appear on the right.
    Press the arrow button for the appropriate field in the Create object wizard and you are done.

You might have noticed the naming of the template changed automatically to the name of the visual resource. You are allowed to change this if you want.


See also

General
Scenery (Rocks, plants, trees, shelves, etc.)
Lootable items (Shells, plates, food, gems, etc.)
Interactable animated items (Levers, doors, etc.)
Interactable socket items (Chairs, beds, etc.)
Weapons (The sharp stuff)