No Man's Sky Modding Wiki
(Adding categories)
Tag: categoryselect
Tags: Visual edit apiedit
Line 45: Line 45:
 
*'''REFERENCE''' - allows you link another SCENE file into this SCENE file, because you know you like putting SCENE files inside SCENE files. This gives a lot of flexibility, as it allows you to create a custom object and place already existing objects from the game into your scene.
 
*'''REFERENCE''' - allows you link another SCENE file into this SCENE file, because you know you like putting SCENE files inside SCENE files. This gives a lot of flexibility, as it allows you to create a custom object and place already existing objects from the game into your scene.
 
**SCENEGRAPH - the relative path to the desired SCENE.
 
**SCENEGRAPH - the relative path to the desired SCENE.
  +
__FORCETOC__
 
  +
<source lang="xml">
  +
<Property value="TkSceneNodeData.xml">
  +
<Property name="Name" value="NameForThisNode" />
  +
<Property name="Type" value="REFERENCE" />
  +
<Property name="Transform" value="TkTransformData.xml">
  +
<Property name="TransX" value="0" />
  +
<Property name="TransY" value="0" />
  +
<Property name="TransZ" value="0" />
  +
<Property name="RotX" value="0" />
  +
<Property name="RotY" value="0" />
  +
<Property name="RotZ" value="0" />
  +
<Property name="ScaleX" value="1" />
  +
<Property name="ScaleY" value="1" />
  +
<Property name="ScaleZ" value="1" />
  +
</Property>
  +
<Property name="Attributes">
  +
<Property value="TkSceneNodeAttributeData.xml">
  +
<Property name="Name" value="SCENEGRAPH" />
  +
<Property name="AltID" value="" />
  +
<Property name="Value" value="MODELS\WHATEVER\WHATEVER.SCENE.MBIN" />
  +
</Property>
  +
</Property>
  +
<Property name="Children" />
  +
</Property>
 
</source>__FORCETOC__
 
[[Category:Object MBIN's]]
 
[[Category:Object MBIN's]]

Revision as of 01:51, 21 December 2016

SCENE's (also known as SCENEGRAPHS) are MBIN files used as containers for object references in the game. SCENE files can reference a lot of things - including ENTITIES, EFFECTS, other SCENES, MESHES and so forth. Using SCENE files, you can attach scripts and objects together into one form, like a prefab.

All objects in the game are spawned from SCENE files from plants, ships, and to even your multitool. As you will eventually find out, SCENE files are extremely powerful and can be used for more than just stringing objects together.

For those already used to game development, SCENE files are similar to Unity GameObjects - they are containers that reference models, sounds, scripts, and more.

Scene Nodes

Each SCENE file contains Scene Nodes (TkSceneNodeData) which is a complete data struct that defines the basic structure of a SCENE. These include:

  • Name - the name of the scene file. The root node of the scene file usually bears the directory and the name of the scene itself i.e. a DRONE.SCENE has the name "MODELS\COMMON\ROBOTS\DRONE"
  • Type - the type of scene node. This will influence the attributes declared within in the Attribute container. The types are listed in a category further below.
  • Transform - the vector3 (x, y, z) position, rotation, and scale of an object
  • Attributes - depending on the scene node Type, different fields will be declared here along with their corresponding values. Each attribute has a Name, AltID, and Value. The AltID is usually empty.
  • Children - each scene node can have more scene nodes as children

Scene Node Types

  • MODEL - this scene node type references a GEOMETRY MBIN. Most SCENE files have this as the type used for their root node.
    • GEOMETRY - this one single property simply references a GEOMETRY MBIN file i.e. "MODELS\COMMON\ROBOTS\DRONE.GEOMETRY.MBIN" Geometry files are also serialized XML's containing 3D models for the game.
  • MESH - this scene node explicitly takes mesh data from a root node's referenced GEOMETRY file to be displayed in-game. It is important to note that mesh data is obviously not supposed to be manually written by a human. See the Importing Custom Models page to see how this is done.
    • BATCHSTART
    • BATCHCOUNT
    • VERTSTART
    • VERTEND
    • FIRSTSKINMAT
    • LASTSKINMAT
    • MATERIAL - path to the MATERIAL MBIN this mesh uses.
    • ATTACHMENT - a path to the ENTITY MBIN this mesh uses. ENTITY files are MBIN's that define behaviors or interactions.
  • COLLISION - this node type is responsible for rendering collisions for objects with a wide array of options possible. Much like the MESH node, data here is usually created during the import of custom models.
    • TYPE - collisions can be in the form of meshes, or use more performance-efficient shape primitives provided by the engine
      • Sphere
      • Cylinder
      • Capsule
      • Sphere
      • Mesh collision
  • JOINT - possibly an element of the model's skeletal animation rig?
  • LOCATOR - an empty node that simply holds transform data. These can be used quite heavily by ENTITY files for a number of things such as interactions being placed at specific locations with them as well as things like the location of the scanner icon if your object is scannable.
  • LIGHT - allows a light source to be attached to the SCENE file.
    • FOV - controls the arc of a light's emission. 90 creates a 90-degree spotlight, while 360 does what a standard pointlight does.
    • FALLOFF - controls how light fades away over distance.
    • INTENSITY
    • COL_R - Red component of the colour. All colours are on a scale from 0 to 1, with 0 being 0 and 1 being 255 in the usual RGB decimal colour convention.
    • COL_G - Green component.
    • COL_B - Blue Component.
    • MATERIAL - always set to MATERIALS/LIGHT.MATERIAL.MBIN
  • REFERENCE - allows you link another SCENE file into this SCENE file, because you know you like putting SCENE files inside SCENE files. This gives a lot of flexibility, as it allows you to create a custom object and place already existing objects from the game into your scene.
    • SCENEGRAPH - the relative path to the desired SCENE.
        <Property value="TkSceneNodeData.xml">
          <Property name="Name" value="NameForThisNode" />
          <Property name="Type" value="REFERENCE" />
          <Property name="Transform" value="TkTransformData.xml">
            <Property name="TransX" value="0" />
            <Property name="TransY" value="0" />
            <Property name="TransZ" value="0" />
            <Property name="RotX" value="0" />
            <Property name="RotY" value="0" />
            <Property name="RotZ" value="0" />
            <Property name="ScaleX" value="1" />
            <Property name="ScaleY" value="1" />
            <Property name="ScaleZ" value="1" />
          </Property>
          <Property name="Attributes">
            <Property value="TkSceneNodeAttributeData.xml">
              <Property name="Name" value="SCENEGRAPH" />
              <Property name="AltID" value="" />
              <Property name="Value" value="MODELS\WHATEVER\WHATEVER.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Children" />
        </Property>