Heck Modifiers Testing - UGEcko/Chroodle GitHub Wiki
Heck Modifiers
This page was sampled from the Heck Wiki. This page adds more information for deeper understanding.
Modifiers allow you to do basic arithmetic on points. How these modifiers interact can be defined using operations and are done componentwise. These include:
opNone
opAdd
opSub
opMul
opDiv
The true value of modifiers are useful when using base properties which allow referencing some provided values which updates dynamically. This allows for things like following the HMD or setting an object's color to the player's note color. All base properties start with the 'base' prefix.
ex:
{
"b": -1,
"t": "AnimateTrack",
"d": {
"track": "tutorialnote0",
"color": ["baseNote0Color", [ 0.4, 0.4, 0.4, 1, "opMul"]] // take the color of left hand notes, and multiply the the rgb values by 0.4
}
},
{
"b": 48,
"t": "AnimateTrack",
"d": {
"track": "tutorialnote1",
"color": ["baseNote1Color"] // just use the right hand note color
}
}
Player Transform
-
baseHeadPosition
: Vector3 The players HMD Position -
baseHeadLocalPosition
: Vector3 The players HMD Position in (VR Only) -
baseHeadRotation
: Vector3 The players HMD World Rotation -
baseHeadLocalRotation
: Vector3 The players HMD Local Rotation (VR Only) -
baseHeadLocalScale
: Vector3 The players HMD Local Scale -
baseLeftHandPosition
: Vector3 The Left Saber Position -
baseLeftHandLocalPosition
: Vector3 The Left Saber Local Position (VR Only) -
baseLeftHandRotation
: Vector3 The Left Saber Rotation -
baseLeftHandLocalRotation
: Vector3 The Left Saber Local Rotation (VR Only) -
baseLeftHandLocalScale
: Vector3 The Left Saber Scale -
baseRightHandPosition
: Vector3 The Right Saber Position -
baseRightHandLocalPosition
: Vector3 The Right Saber Local Position (VR Only) -
baseRightHandRotation
: Vector3 The Right Saber Rotation -
baseRightHandLocalRotation
: Vector3 The Right Saber Local Rotation (VR Only) -
baseRightHandLocalScale
: Vector3 The Right Saber Scale
Color
-
baseNote0Color
: Vector3 (RGB) The Left Note Color -
baseNote1Color
: Vector3 (RGB) The Right Note Color -
baseObstaclesColor
: Vector3 (RGB) Returns the Walls Color -
baseSaberAColor
: Vector3 (RGB) The Left/Red Saber Color -
baseSaberBColor
: Vector3 (RGB) The Right/Blue Saber Color -
baseEnvironmentColor0
: Vector3 (RGB) The Left/Red Laser Color -
baseEnvironmentColor1
: Vector3 (RGB) The Right/Blue Lase Color -
baseEnvironmentColor0Boost
: Vector3 (RGB) The Left/Red Laser Boost Color -
baseEnvironmentColor1Boost
: Vector3 (RGB) The Right/Blue Laser Boost Color -
baseEnvironmentColorWBoost
: Vector3 (RGB) The White Laser Boost Color
Scoring (Floats are 4 point precision)
-
baseCombo
: Int The players combo -
baseMultipliedScore
: Int The players score. As the score can be unlimited, this isnt normalized to 0-1. Ex: A score of 1,000,000 will return 1,000,000. Doesnt factor misses -
baseImmediateMaxPossibleMultipliedScore
: Int The players max possible score which factors misses -
baseModifiedScore
: Int Same as baseMultipliedScore, but factors misses -
baseImmediateMaxPossibleModifiedScore
: Int The players max possible score which doesnt factor misses -
baseRelativeScore
: Float The players score percentage (ex: 95% returns 0.95) (0-1) -
baseMultiplier
: Int The players multiplier (1,2,4,8) -
baseEnergy
: Float The players energy (0-1) -
baseSongTime
: Float The current time in the map (in seconds) -
baseSongLength
: Float The song length (in seconds)
Swizzling
Swizzling is a technique commonly seen in graphics programming. It is used the same way here to arrange components of a Base Property Vector into a new vector to be used in any animation! Example:
Where "baseHeadLocalPosition"
= [0, 1, 2]
"baseHeadLocalPosition.zyx"
= [2, 1, 0]
As you can see, baseHeadLocalPosition.zyx
references the zyx
components of baseHeadLocalPosition
, mirroring the X and Z values
You can also do this with color (Still uses .xyzw for RGBA):
Where "baseSaberAColor"
= [0.1, 0.2, 0.3, 0.4]
"baseSaberAColor.zwyx"
= [0.3, 0.4, 0.2 ,0.1]
In this example, "baseSaberAColor.zwyx"
references "baseSaberAColor"
and rearranges "baseSaberAColor"
components. (".xyzw" -> ".zwyx" OR "rgba" -> "bagr")
Even modifiers that are only floats can be used with swizzling, as Heck stores all these properties as float arrays! However, because they are only 1-length arrays; y and z are NOT valid... It must be x.
Smoothing
Heck also provides smoothing to base properties. This is helpful for many cases if you are tracking any player property such as the head or sabers. Smoothing out their transform can make effects look cleaner.
You can implement this easily into any base property definition, simply add .s
to the end of any transform property string, then specify a number from 1 to 10 (1 being very high smooth, 10 being low smooth).
Ex: "baseLeftSaberPosition.s5"
Medium Smoothing.
Examples:
{
"b": 0,
"d": 500,
"track": "trackExample",
"animation": {
"position": ["baseSongTime.xxx"]
}
}
// Where "baseSongTime" = 10.3012
// position: [10.3012, 10.3012, 10.3012]
{
"b": 0,
"d": 500,
"track": "trackExample",
"animation": {
"position": ["baseLeftSaberPosition.s2", [1,2,0, "opMul"]] // SMOOTHED
}
}
// Where "baseLeftSaberLocalPosition" = [2,1.5,0.05]
// position: [2,3,0] | Uses mult operation to double Y axis and make Z axis always 0.
{
"b": 0,
"d": 500,
"track": "trackExample",
"animation": {
"color": ["baseSaberAColor",1]
}
}
// Where "baseSaberAColor" = [1,0,0]
// color: [1,0,0,1]