here is some info #pragma once #include "../../Framework.h" #include "PhysObj.h"…
- User
here is some info #pragma once #include "../../Framework.h" #include "PhysObj.h"
namespace RLGSC { // https://github.com/AechPro/rocket-league-gym-sim/blob/main/rlgym_sim/utils/gamestates/player_data.py struct PlayerData { uint32_t carId; Team team;
PhysObj phys, physInv; CarState carState; // matchAssists: being the passer to a teammate who shot and scored // matchBumps: any bump against an opponent, including demos int matchGoals = 0, matchSaves = 0, matchAssists = 0, matchShots = 0, matchShotPasses = 0, matchBumps = 0, matchDemos = 0, boostPickups = 0; bool hasJump; bool hasFlip; float boostFraction; // From 0 to 1 bool ballTouchedStep; // True if the player touched the ball during any of tick of the step bool ballTouchedTick; // True if the player is touching the ball on the final tick of the step void UpdateFromCar(Car* car, uint64_t tickCount, int tickSkip); const PhysObj& GetPhys(bool inverted) const { return inverted ? physInv : phys; } };} #pragma once #include "../../Framework.h"
namespace RLGSC { // https://github.com/AechPro/rocket-league-gym-sim/blob/main/rlgym_sim/utils/gamestates/physics_object.py struct PhysObj { Vec pos; RotMat rotMat; Vec vel, angVel;
PhysObj() = default; PhysObj(const BallState& ballState); PhysObj(const CarState& carState); // Rotate 180 degrees around Z axis, scales everything by (-1, -1, 1) PhysObj Invert() const; // Mirror along X axis PhysObj MirrorX() const; };} #pragma once #include "PlayerData.h" #include "../CommonValues.h"
namespace RLGSC { struct ScoreLine { int teamGoals[2] = { 0,0 };
int operator[](size_t index) const { return teamGoals[index]; } int& operator[](size_t index) { return teamGoals[index]; } }; // https://github.com/AechPro/rocket-league-gym-sim/blob/main/rlgym_sim/utils/gamestates/game_state.py struct GameState { float deltaTime = 0; // Time that has passed since last update ScoreLine scoreLine; int lastTouchCarID = -1; std::vector<PlayerData> players; BallState ballState; PhysObj ball, ballInv; std::array<bool, CommonValues::BOOST_LOCATIONS_AMOUNT> boostPads; std::array<bool, CommonValues::BOOST_LOCATIONS_AMOUNT> boostPadsInv; std::array<float, CommonValues::BOOST_LOCATIONS_AMOUNT> boostPadTimers; std::array<float, CommonValues::BOOST_LOCATIONS_AMOUNT> boostPadTimersInv; // Last arena we updated with // Can be used to determine current arena from within reward function, for example // NOTE: Could be null Arena* lastArena = NULL; // Last tick count when updated uint64_t lastTickCount = 0; GameState() = default; explicit GameState(Arena* arena) { UpdateFromArena(arena); } const PhysObj& GetBallPhys(bool inverted) const { return inverted ? ballInv : ball; } const auto& GetBoostPads(bool inverted) const { return inverted ? boostPadsInv : boostPads; } void UpdateFromArena(Arena* arena); }; - Assistant