Action Space

const convertActionToGame = (actions) => {
const movementInput = new Vector3()
if (actions.up) {
movementInput.y = 1
}
else if (actions.down) {
movementInput.y = -1
}
return movementInput
}
const getActionOneHot = (inputs) => {
const action = [0, 0, 0]
if (this.pressed["KeyW"]) {
action[0] = 1 // Up
}
else if (this.pressed["KeyS"]) {
action[1] = 1 // Down
}
else {
action[2] = 1 // idle
}
}Last updated