Difference between revisions of "3D Asset Workflow: Collisions"

From Frozenbyte Wiki
Jump to: navigation, search
(Created page with "* This site is a part of a series of 3D asset creating process related wiki sites 3D Asset Workflow * For using Modo you'll probably find a lot of useful general info on t...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
* This site is a part of a series of 3D asset creating process related wiki sites [[3D Asset Workflow]]
+
<div style="border-bottom:2px solid #99aac7; background:#d0def5; padding:0.4em 0.5em; font-size:130%; margin-bottom: 25px; text-align: center; float:top;">
* For using Modo you'll probably find a lot of useful general info on the [[Modo]] site
+
⬑  [[3D Asset Workflow]]</div>
 +
 
 +
<div style="padding-right: 10px; padding-left: 1000px; padding-top: 60px; padding-bottom: 80px;">
 +
{{#lst:3D Asset Workflow}} <!-- Link list transcluded from main 3D Asset Workflow page -->
 +
</div>
  
 
=Collisions=
 
=Collisions=
 
* Collisions are very simple and very low poly meshes that tell the game engine where the collideable edges of the model are
 
* Collisions are very simple and very low poly meshes that tell the game engine where the collideable edges of the model are
* Collisions can be divided into two categories; ''static'' and ''dynamic''
+
* Collisions can be divided into two categories; [[3D_Asset_Workflow:_Collisions_and_Breakable_objects#Static_Collisions|static]] and [[3D_Asset_Workflow:_Collisions_and_Breakable_objects#Dynamic_Collisions|dynamic]]
* When making collisions, be wary of sharp edges or holes, in which the characters can get stuc
+
** Static objects are stationary, dynamic objects are dynamic, and can be e.g. thrown or kicked around the level, or otherwise interacted with
* If you are unsure how to create and edit new types in the editor, ask designers about it
+
* When making collisions, be wary of sharp edges or holes, in which the characters can get stuck
  
==Static Collisions==
+
== Static Collisions ==
 
* Collisions for objects which can't be manipulated by the characters in the game
 
* Collisions for objects which can't be manipulated by the characters in the game
 
* For example just a static piece of environment in the game that doesn't move in any way
 
* For example just a static piece of environment in the game that doesn't move in any way
 
* Can be made in one layer with multiple objects colliding with each other
 
* Can be made in one layer with multiple objects colliding with each other
 
* The collision layer must be parented with the original object
 
* The collision layer must be parented with the original object
* '''Naming:''' xx_static_collision
+
'''Naming:''' xx_static_collision
  
 
'''Example of the hierarchy:'''
 
'''Example of the hierarchy:'''
* box
+
# box
** box_static_collision
+
## box_static_collision
  
 
==Dynamic Collisions==
 
==Dynamic Collisions==
* Collisions for objects which move and/or can be manipulated by the characters in the game, for example dropped or kicked.
+
* Collisions for objects which move and/or can be manipulated by the characters in the game, for example dropped or kicked
 
* The collision objects can't be concave, so in most cases the dynamic collision must be made with many objects
 
* The collision objects can't be concave, so in most cases the dynamic collision must be made with many objects
* These must be separated to different layers and can't collide with each other
+
* These must be separated to different layers, and can't collide with each other
 
* All the dynamic collision layers must be parented with the original object
 
* All the dynamic collision layers must be parented with the original object
* '''Naming:''' xx_dynamic_collision(_01)
+
'''Naming:''' xx_collision_dynamic(_01)
  
 
'''Example of the hierarchy:'''
 
'''Example of the hierarchy:'''
* box
+
# box
** box_dynamic_collision_01
+
## box_collision_dynamic_01
** box_dynamic_collision_02
+
## box_collision_dynamic_02
** box_dynamic_collision_03
+
## box_collision_dynamic_03
  
 +
<div class="toccolours mw-collapsible mw-collapsed" style="background-color: #f3e9f5; border-width:2px; border-radius:10px; margin: 5px;">
 +
Examples of Static and Dynamic Collisions via images
 +
<div class="mw-collapsible-content">
 
[[File:Static and dynamic collisions.jpg|1000px]]
 
[[File:Static and dynamic collisions.jpg|1000px]]
 +
</div>
 +
</div>
  
==Adding Collisions in Editor==
+
 
* Once the collisions for each object are done in Modo and the models are exported to the Editor, you need to add Model Components to the type to make the collisions work
+
== Adding Collisions in Editor ==
* Most of the time you can just copy and paste the needed components from some existing model that is similar to your new model
+
* Once the collisions for each object are done in Modo, and the models are exported to the Editor, you need to add Components to the type to make the collisions actually work
* It's good to copy the Model Components from objects that have similar material or size, but the shape doesn't matter because your object will use the collision model you made for it in Modo
+
* Most of the time you can just copy and paste the needed components from some existing model, that is similar to your new model
 +
* It's good to copy the Components from objects that have similar material or size, but the shape doesn't matter because your object will use the collision model you made for it in Modo
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="background-color: #f3e9f5; border-width:2px; border-radius:10px; margin: 5px;">
 +
Image Guide to Adding Collisions in Editor, with Explanatory Texts
 +
<div class="mw-collapsible-content">
 
[[File:Copy component.jpg|600px|collision tips]]
 
[[File:Copy component.jpg|600px|collision tips]]
  
Line 51: Line 65:
 
*** ConvexCompound (for dynamic collision)
 
*** ConvexCompound (for dynamic collision)
 
* Copy by selecting the object you want to copy from in Type Tree and right click "Copy Components", don't copy ModelComponent and TransformComponent, DO NOT COPY FROM DYNAMIC TO STATIC OBJECT OR FROM STATIC TO DYNAMIC!
 
* Copy by selecting the object you want to copy from in Type Tree and right click "Copy Components", don't copy ModelComponent and TransformComponent, DO NOT COPY FROM DYNAMIC TO STATIC OBJECT OR FROM STATIC TO DYNAMIC!
* If there aren't similar objects with collision in the game Add by selecting the object you want to add to in Type Tree and right click "Add Component Type", then search the needed components
+
* If there aren't similar objects with collision in the game, Add by selecting the object you want to add to in Type Tree and right click "Add Component Type", then search the needed components
 +
** In this case, you can either '''Add''' or '''Add and Inherit'''. By just Adding, the Components stay shared with the type you copied it from, with Add and Inherit you create a separate copy of the Component
 
[[File:Ohjeita editoriin ErilaistenModeliTyyppienKomponentit collisionit.jpg|1200px|Teemu's collision tips]]
 
[[File:Ohjeita editoriin ErilaistenModeliTyyppienKomponentit collisionit.jpg|1200px|Teemu's collision tips]]
 
+
</div>
=Breakable Objects=
+
</div>
* When in doubt, ask a designer
 
 
 
== Breakable Objects Setup in Modo ==
 
* To make the editor recognize what objects are breakable and what meshes are the broken parts of the model they need to be named correctly and have a correct hierarchy in the Modo file.
 
* The naming and hierarchy of the breakable objects in Modo. Please use the naming method your project uses (old/new)
 
[[File:Breakable objects howto.jpg|600px|The naming and hierarchy of the breakable objects in Modo. Please use the naming method your project uses (old/new)]]
 
* Here is how to break the model into pieces, notice that this example uses the OLD naming system, see above the right naming convention for the NEW naming
 
[[File:How to make a broken mesh.jpg|1400px]]
 
 
 
== Breakable Objects Setup in the Editor ==
 
 
 
; Adding Components
 
: Right-click on the type -> Add Component
 
 
 
; Creating new instances of components
 
: '''When adding a component''' 'Add and inherit'
 
: '''Otherwise:''' right-click -> Inherit new -> Select all sub-components that you want to create new copies of. Unselected components will remain shared
 
 
 
Add the following components to the *_breakable asset.
 
 
 
* BreakableComponent
 
* BreakTriggerComponent
 
* DoEffectOnBreakComponent
 
** Effect type: Inherit a *BreakParticleSystemEntity that somewhat fits with your object
 
** In the new ParticleSystemEntity insert your *_broken mesh into 'ModelResource'
 
** Find your *_broken mesh resource in the resource window, or right click on the type and select 'locate type model resource'
 
*** when selected, go to the properties window and tick the following:
 
*** AlwaysIncluded, AlwaysLoaded, Breakable
 
* GameHealthComponent
 
* HittableComponent
 
* PhysicsComponent
 
* PhysicsContactDamageComponent
 

Latest revision as of 09:41, 1 August 2023

3D Asset Workflow

Collisions

  • Collisions are very simple and very low poly meshes that tell the game engine where the collideable edges of the model are
  • Collisions can be divided into two categories; static and dynamic
    • Static objects are stationary, dynamic objects are dynamic, and can be e.g. thrown or kicked around the level, or otherwise interacted with
  • When making collisions, be wary of sharp edges or holes, in which the characters can get stuck

Static Collisions

  • Collisions for objects which can't be manipulated by the characters in the game
  • For example just a static piece of environment in the game that doesn't move in any way
  • Can be made in one layer with multiple objects colliding with each other
  • The collision layer must be parented with the original object
Naming: xx_static_collision

Example of the hierarchy:

  1. box
    1. box_static_collision

Dynamic Collisions

  • Collisions for objects which move and/or can be manipulated by the characters in the game, for example dropped or kicked
  • The collision objects can't be concave, so in most cases the dynamic collision must be made with many objects
  • These must be separated to different layers, and can't collide with each other
  • All the dynamic collision layers must be parented with the original object
Naming: xx_collision_dynamic(_01)

Example of the hierarchy:

  1. box
    1. box_collision_dynamic_01
    2. box_collision_dynamic_02
    3. box_collision_dynamic_03

Examples of Static and Dynamic Collisions via images

Static and dynamic collisions.jpg


Adding Collisions in Editor

  • Once the collisions for each object are done in Modo, and the models are exported to the Editor, you need to add Components to the type to make the collisions actually work
  • Most of the time you can just copy and paste the needed components from some existing model, that is similar to your new model
  • It's good to copy the Components from objects that have similar material or size, but the shape doesn't matter because your object will use the collision model you made for it in Modo

Image Guide to Adding Collisions in Editor, with Explanatory Texts

collision tips

  • Select the model in Type Tree and see its Properties
  • There should already be these Model Components
    • ModelComponent
    • TransformComponent
  • You need to either copy or search and add these components
    • HittableComponent
    • ContactEffectCreatorComponent
    • PhysicsComponent
      • StaticMesh (for static collision)
      • ConvexCompound (for dynamic collision)
  • Copy by selecting the object you want to copy from in Type Tree and right click "Copy Components", don't copy ModelComponent and TransformComponent, DO NOT COPY FROM DYNAMIC TO STATIC OBJECT OR FROM STATIC TO DYNAMIC!
  • If there aren't similar objects with collision in the game, Add by selecting the object you want to add to in Type Tree and right click "Add Component Type", then search the needed components
    • In this case, you can either Add or Add and Inherit. By just Adding, the Components stay shared with the type you copied it from, with Add and Inherit you create a separate copy of the Component

Teemu's collision tips