AI humans

Bald ist es soweit: Unsere nächste Leitstellenfahrt findet statt. Weitere Informationen findet ihr hier.

  • This article will explain everything about AI passengers and pedestrians.

    1. Definition

    In OMSI, it is possible to change or create AI humans who act as passers-by or passengers in the game. These are also known as "Humans". Passers-by move on created paths. Passengers spawn at stops, but only move on paths on the map after getting off. The AI humans can also interact with the player by greeting them when they board, buy tickets, complain about the driving style or the temperature on the bus.

    2. File structure

    2.1. Humans folder

    The OMSI main folder contains the Humans directory, which contains a collection of different subfolders. Each of these subfolders contains configuration files, texture files and model files that are required to display the humans in the game.

    2.2. *.hum-file

    The file with the extension ".hum" contains configuration data for the AI human.

    2.2.1. Model keyword

    Code
    [model]
    {relative path to the .cfg file}


    This section defines the path to the model configuration file.

    2.2.2. Seating height keyword

    Code
    [seatheight]
    {decimal number – seat height in metres}


    This value sets the seating height (in the bus, at bus stops) of the human. However, it should be noted: The lower the value, the higher the person sits.

    2.2.3. Humangeom keyword

    Code
    [humangeom]
    {decimal number – Foot distance in metres}
    {decimal number – Height in metres}


    The first value defines the distance between the feet of the human.

    The second decimal number represents the absolute height of the human, which can be read off from for example Blender.

    2.2.4. Left keyword

    Even if the section is labelled "left", the values for the right side of the body must be entered.


    This section contains information about the positions of various parts of the model's body. These values should be read from for example Blender. In general, the x-axis moves the position of the respective body part forwards (negative value) and backwards (positive value). The y-axis also moves the body part to the right or left. The z-value sets the height of the body part.


    Not all body parts require three values!


    The following picture shows the positions of the body parts:

    2.2.5. Voice keyword

    Code
    [voice]
    {Folder name for the ticket pack folder of the map}


    This section sets the voice of the human being used. The value is a reference to the voice folder in which the audio files are stored. This voice folder is located in the main folder, under TicketPacks\{TicketPackOfTheMap}\{VoiceFolder}.

    2.2.6. Walk_param keyword

    Code
    [walk_param]
    {decimal number - Step size in metres}
    {decimal number - Angle of the upper arm in degrees}
    {decimal number - Animation intensity hands}
    {decimal number - Animation intensity hips}
    {decimal number - Animation intensity waist}


    The animation intensity of some body parts and other parameters for the human walking movement are defined here. The "angle of the upper arm" describes the movement of the upper arm towards the centre of the human. A larger value also increases the inclination of the upper arm towards the centre of the body.

    2.2.7. Mass keyword

    Code
    [mass]
    {decimal number – Mass in tonnes}


    This section defines the mass of the human in tonnes.

    2.2.8. Age keyword

    Code
    [age]
    {whole number – Age}


    This keyword defines the age of the human. This setting tells OMSI which tickets are for which human.

    2.3. More keywords

    OMSI ignores other keywords that are known from *.sco files, for example, and are entered in the *.hum file. It is therefore not possible to use sounds, scripts or similar.

    2.4. *.cfg-file

    The file with the extension ".cfg" contains configuration data for the AI human model. Although it is originally known as a model configuration file, a new keyword called [setbone] can be used in this context. All other commands can be used in this file as usual. he path to this file is specified in the *.hum file with the model keyword.

    2.4.1. Setbone keyword

    Code
    [setbone]
    {Name in Blender}
    {negative whole number – Internal bone count}


    The setbone keyword is used to define a new bone for a human's mesh. The name can be chosen freely, but it must correspond to the name of the respective vertex group in Blender. Moreover, the negative integer is used as an internal value. This value should be a number between -2 and -14 (both inclusive), as an OMSI human has a total of 13 bones. The following table shows the internal value depending on the position of the bone:


    Internal value Bones Suggested name Position of the bone in Blender
    -2 Thigh – Left OS_L
    -3 Thigh – Right OS_R
    -4 Lower leg – Left US_L
    -5 Lower leg – Right US_R
    -6 Upper arm – Left OA_L
    -7 Upper arm – Right OA_R
    -8 Forearm – Left UA_L
    -9 Forearm – Right UA_R
    -10 Hip Hip
    -11 Chest Main
    -12 Head Head
    -13 Hand – Left Hand_L
    -14 Hand – Right Hand_R

    3. Blender

    This section briefly explains how to set up the human mesh in Blender for use in OMSI and then export it correctly.

    3.1. Mesh

    The mesh can have any shape. The only thing to note is that the human mesh forms a T-shape. The legs should therefore be in a row and the hands should be stretched out straight towards +x and -x. The person should be looking in the +y direction.

    3.2. Vertex groups

    So-called vertex groups are required so that the AI human is also animated in OMSI. If the mesh of the human is selected in Blender, the vertex groups can be viewed in the "Properties window" under the "Data" tab:

    [attach=‘202714’,‘none’,‘true’][/attach]

    An OMSI human only requires these vertex groups for the animations. An armature is not required

    .


    Two options are available for creating vertex groups and assigning the associated vertices to these groups:

    1. The manual way – "Weight Paint": This mode can be used to select the vertices belonging to the vertex group. This mode can also be combined with the second option and enables a high degree of accuracy in the selection.
    2. The automatic way – Using an armature: After creating the armature, the vertex groups are generated when connecting to the mesh using Ctrl + P and, for example, With Automatic Weights.

    Explaining Blender is beyond the scope of this Wiki article. Further information on Blender can be found here:

    3.3. O3D-Exporter

    To export the mesh later with the vertex groups from Blender, the following Blender add-on is required: Blender OMSI-Exporter from Road-hog 123.

    Only the exporter specified here supports the export of the vertex groups created with skin weights. It is important to note that this add-on currently works with Blender versions 3.3 and 3.5.

    3.4. Export

    When exporting, the mesh must be selected and exported via add-on with File > Export > OMSI Mesh (.o3d). When exporting, the "Skin Weights" checkbox must be ticked.

Teilen

CC BY-SA 4.0

Sämtliche Inhalte unseres OMSI-Wiki sind unter Creative Commons Namensnennung & Weitergabe unter gleichen Bedingungen (CC BY-SA 4.0) lizensiert.