Game logic - Controller – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
Enabling collision envelope will enable the object to collide with terrain and other entities. Currently the controller is using modified character controller, so the envelope shape is limited to capsule.
Enabling collision envelope will enable the object to collide with terrain and other entities. Currently the controller is using modified character controller, so the envelope shape is limited to capsule.


Envelope parameters
====Envelope parameters====
*'''Snaps to platforms''' - Whenever the object can snap to other platforms
*'''Snaps to platforms''' - Whenever the object can snap to other platforms
*'''Slope limit''' - Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value.
*'''Slope limit''' - Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value.
Line 26: Line 26:
*'''Skin width''' - Two colliders can penetrate each other as deep as their Skin Width.
*'''Skin width''' - Two colliders can penetrate each other as deep as their Skin Width.


Envelope size and position can be tweaked using the "Edit" button
*Envelope size and position can be tweaked using the "Edit" button
*'''Center''' - Collider offset in world space.
**'''Center''' - Collider offset in world space.
*'''Radius''' - Width of the collider.
**'''Radius''' - Width of the collider.
*'''Height''' - Capsule Collider  height.
**'''Height''' - Capsule Collider  height.


==Controller setup==
==Controller setup==

Revision as of 14:05, 9 April 2021

Description

Controller allows to animate objects using Visual scripting and is responsible for capturing players input. Any object with controller assigned can be then possessed and controlled by a player. In order to achieve smooth movement, controlled objects are simulated locally on the client and automatically synchronized with the server. Due to the multiplayer constraints, the controller script is severally limited in comparison to "standard" visual scripting, we call this local scripting.

  • Controller allows players to posses an object.
    • An object can be controlled (possessed) only by one player.
    • One controller can be assigned to multiple objects.
    • Controller is active even if the object is not possessed.

Setup

In order to make an object eligible for possession, first it has to be animated and allow "possession". Optionally it is possible to also setup a collision envelope, so that the object will collide with world.

  • Currently only capsule collision envelope is avalable

Object setup

  • Select an object you wish to control
  • Set the object as "Animated"
  • Enable "Can be possessed" atribute
  • Optionally: Set collision envelope

Collision setup

Enabling collision envelope will enable the object to collide with terrain and other entities. Currently the controller is using modified character controller, so the envelope shape is limited to capsule.

Envelope parameters

  • Snaps to platforms - Whenever the object can snap to other platforms
  • Slope limit - Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value.
  • Step offset - The collider will step up a stair only if it is closer to the ground than the indicated value.
  • Skin width - Two colliders can penetrate each other as deep as their Skin Width.
  • Envelope size and position can be tweaked using the "Edit" button
    • Center - Collider offset in world space.
    • Radius - Width of the collider.
    • Height - Capsule Collider height.

Controller setup

  • Custom controls
  • Enable Custom controls automatically


Visual scripting

Controller assign

Object posses

Controller script