Documentation ¶
Index ¶
- Constants
- type BallInfo
- type BallPrediction
- type BoostPad
- type BoostPadState
- type BoxShape
- type Color
- type ControllerState
- type DesiredBallState
- type DesiredBoostState
- type DesiredCarState
- type DesiredGameInfoState
- type DesiredGameState
- type DropShotBallInfo
- type DropshotTile
- type FieldInfo
- type GameInfo
- type GameMessagePacket
- type GameMessageStruct
- type GameState
- type GameTickPacket
- type GoalInfo
- type LoadoutPaint
- type MatchSettings
- type MutatorSettings
- type Physics
- type PlayerClass
- type PlayerConfiguration
- type PlayerInfo
- type PlayerInput
- type PlayerInputChange
- type PlayerLoadout
- type PlayerSpectate
- type PlayerStatEvent
- type PredictionSlice
- type QuickChat
- type RLBot
- func (socket *RLBot) DebugMessageAdd(text string) error
- func (socket *RLBot) DebugMessageClear() error
- func (socket *RLBot) SendDesiredGameState(desiredGameState *DesiredGameState) error
- func (socket *RLBot) SendMessage(dataType uint16, data rlData) error
- func (socket *RLBot) SendQuickChat(quickChatSelection int8, teamOnly bool) error
- func (socket *RLBot) SendReadyMessage(wantsBallPredictions, wantsQuickChat, wantsGameMessages bool) error
- func (socket *RLBot) SetGetInput(handler func(gameState *GameState, socket *RLBot) *ControllerState) error
- type ReadyMessage
- type RenderGroup
- type RenderMessage
- type Rotator
- type ScoreInfo
- type SphereShape
- type TeamInfo
- type Touch
- type Vector3
Constants ¶
const ( DropshotTile_Unkown = iota DropshotTile_Filled DropshotTile_Damaged DropshotTile_Open )
const ( PlayerClassType_RLBotPlayer = iota PlayerClassType_HumanPlayer PlayerClassType_PsyonixBotPlayer PlayerClassType_PartyMemberBotPlayer )
const ( DataType_TickPacket = iota + 1 DataType_FieldInfo DataType_MatchSettings DataType_PlayerInput // Depercated!!! DataType_ActorMapping // Depercated!!! DataType_ComputerId DataType_DesiredGameState DataType_RenderGroup DataType_QuickChat DataType_BallPrediction DataType_ReadyMessage DataType_MessagePacket )
const ( GameMode_Soccer = iota GameMode_Hoops GameMode_Dropshot GameMode_Hockey GameMode_Rumble GameMode_Heatseeker GameMode_Gridiron )
const ( MatchLength_Five_Minutes = iota MatchLength_Ten_Minutes MatchLength_Twenty_Minutes MatchLength_Unlimited )
const ( MaxScore_Unlimited = iota MaxScore_One_Goal MaxScore_Three_Goals MaxScore_Five_Goals )
const ( OvertimeOption_Unlimited = iota OvertimeOption_Five_Max_First_Score OvertimeOption_Five_Max_Random_Team )
const ( SeriesLengthOption_Unlimited = iota SeriesLengthOption_Three_Games SeriesLengthOption_Five_Games SeriesLengthOption_Seven_Games )
const ( GameSpeedOption_Default = iota GameSpeedOption_Slo_Mo GameSpeedOption_Time_Warp )
const ( BallMaxSpeedOption_Default = iota BallMaxSpeedOption_Default_Slow BallMaxSpeedOption_Default_Fast BallMaxSpeedOption_Default_Super_Fast )
const ( BallTypeOption_Default = iota BallTypeOption_Cube BallTypeOption_Puck BallTypeOption_Basketball )
const ( BallWeightOption_Default = iota BallWeightOption_Light BallWeightOption_Heavy BallWeightOption_Super_Light )
const ( BallSizeOption_Default = iota BallSizeOption_Small BallSizeOption_Large BallSizeOption_Gigantic )
const ( BallBouncinessOption_Default = iota BallBouncinessOption_Low BallBouncinessOption_High BallBouncinessOption_Super_High )
const ( BoostOption_Normal_Boost = iota BoostOption_Unlimited_Boost BoostOption_Slow_Recharge BoostOption_Rapid_Recharge BoostOption_No_Boost )
const ( RumbleOption_No_Rumble = iota RumbleOption_Default RumbleOption_Slow RumbleOption_Civilized RumbleOption_Destruction_Derby RumbleOption_Spring_Loaded RumbleOption_Spikes_Only RumbleOption_Spike_Rush )
const ( BoostStrengthOption_One = iota BoostStrengthOption_OneAndAHalf BoostStrengthOption_Two BoostStrengthOption_Ten )
const ( GravityOption_Default = iota GravityOption_Low GravityOption_High GravityOption_Super_High )
const ( DemolishOption_Default = iota DemolishOption_Disabled DemolishOption_Friendly_Fire DemolishOption_On_Contact DemolishOption_On_Contact_FF )
const ( RespawnTimeOption_Three_Seconds = iota RespawnTimeOption_Two_Seconds RespawnTimeOption_One_Seconds RespawnTimeOption_Disable_Goal_Reset )
const ( // Restart the match if any match settings differ. This is the default because old RLBot always worked this way. ExistingMatchBehavior_Restart_If_Different = iota // Always restart the match, even if config is identical ExistingMatchBehavior_Restart // Never restart an existing match, just try to remove or spawn cars to match the configuration. // If we are not in the middle of a match, a match will be started. Handy for LAN matches. ExistingMatchBehavior_Continue_And_Spawn )
const ( GameMap_DFHStadium = iota GameMap_Mannfield GameMap_ChampionsField GameMap_UrbanCentral GameMap_BeckwithPark GameMap_UtopiaColiseum GameMap_Wasteland GameMap_NeoTokyo GameMap_AquaDome GameMap_StarbaseArc GameMap_Farmstead GameMap_SaltyShores GameMap_DFHStadium_Stormy GameMap_DFHStadium_Day GameMap_Mannfield_Stormy GameMap_Mannfield_Night GameMap_ChampionsField_Day GameMap_BeckwithPark_Stormy GameMap_BeckwithPark_Midnight GameMap_UrbanCentral_Night GameMap_UrbanCentral_Dawn GameMap_UtopiaColiseum_Dusk GameMap_DFHStadium_Snowy GameMap_Mannfield_Snowy GameMap_UtopiaColiseum_Snowy GameMap_Badlands GameMap_Badlands_Night GameMap_TokyoUnderpass GameMap_Arctagon GameMap_Pillars GameMap_Cosmic GameMap_DoubleGoal GameMap_Octagon GameMap_Underpass GameMap_UtopiaRetro GameMap_Hoops_DunkHouse GameMap_DropShot_Core707 GameMap_ThrowbackStadium GameMap_ForbiddenTemple GameMap_RivalsArena GameMap_Farmstead_Night GameMap_SaltyShores_Night GameMap_NeonFields GameMap_DFHStadium_Circuit )
const ( QuickChat_Information_IGotIt = iota QuickChat_Information_NeedBoost QuickChat_Information_TakeTheShot QuickChat_Information_Defending QuickChat_Information_GoForIt QuickChat_Information_Centering QuickChat_Information_AllYours QuickChat_Information_InPosition QuickChat_Information_Incoming QuickChat_Compliments_NiceShot QuickChat_Compliments_GreatPass QuickChat_Compliments_Thanks QuickChat_Compliments_WhatASave QuickChat_Compliments_NiceOne QuickChat_Compliments_WhatAPlay QuickChat_Compliments_GreatClear QuickChat_Compliments_NiceBlock QuickChat_Reactions_OMG QuickChat_Reactions_Noooo QuickChat_Reactions_Wow QuickChat_Reactions_CloseOne QuickChat_Reactions_NoWay QuickChat_Reactions_HolyCow QuickChat_Reactions_Whew QuickChat_Reactions_Siiiick QuickChat_Reactions_Calculated QuickChat_Reactions_Savage QuickChat_Reactions_Okay QuickChat_Apologies_Cursing QuickChat_Apologies_NoProblem QuickChat_Apologies_Whoops QuickChat_Apologies_Sorry QuickChat_Apologies_MyBad QuickChat_Apologies_Oops QuickChat_Apologies_MyFault QuickChat_PostGame_Gg QuickChat_PostGame_WellPlayed QuickChat_PostGame_ThatWasFun QuickChat_PostGame_Rematch QuickChat_PostGame_OneMoreGame QuickChat_PostGame_WhatAGame QuickChat_PostGame_NiceMoves QuickChat_PostGame_EverybodyDance // Custom text chats made by bot makers QuickChat_MaxPysonixQuickChatPresets // Waste of CPU cycles QuickChat_Custom_Toxic_WasteCPU // Git gud* QuickChat_Custom_Toxic_GitGut // De-Allocate Yourself QuickChat_Custom_Toxic_DeAlloc // 404: Your skill not found QuickChat_Custom_Toxic_404NoSkill // Get a virus QuickChat_Custom_Toxic_CatchVirus // Passing! QuickChat_Custom_Useful_Passing // Faking! QuickChat_Custom_Useful_Faking // Demoing! QuickChat_Custom_Useful_Demoing // BOOPING QuickChat_Custom_Useful_Bumping // The chances of that was 47525 to 1* QuickChat_Custom_Compliments_TinyChances // Who upped your skill level? QuickChat_Custom_Compliments_SkillLevel // Your programmer should be proud QuickChat_Custom_Compliments_proud // You're the GC of Bots QuickChat_Custom_Compliments_GC // Are you <Insert Pro>Bot? * QuickChat_Custom_Compliments_Pro // Lag QuickChat_Custom_Excuses_Lag // Ghost inputs QuickChat_Custom_Excuses_GhostInputs // RIGGED QuickChat_Custom_Excuses_Rigged // Mafia plays! QuickChat_Custom_Toxic_MafiaPlays // Yeet! QuickChat_Custom_Exclamation_Yeet )
const ( RenderType_DrawLine2D = iota + 1 RenderType_DrawLine3D RenderType_DrawLine2D_3D RenderType_DrawRect2D RenderType_DrawRect3D RenderType_DrawString2D RenderType_DrawString3D RenderType_DrawCenteredRect3D )
const ( GamesMessageType_PlayerStatEvent = iota GamesMessageType_PlayerSpectate GamesMessageType_PlayerInputChange )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BallInfo ¶
type BallInfo struct { Physics Physics LatestTouch Touch DropShotInfo DropShotBallInfo Shape SphereShape }
BallInfo The physics last touch and etc on the ball
type BallPrediction ¶
type BallPrediction struct { // A list of places the ball will be at specific times in the future. // It is guaranteed to sorted so that time increases with each slice. // It is NOT guaranteed to have a consistent amount of time between slices. Slices []PredictionSlice }
BallPrediction Contains a slice of predictions. Expected size is 6 * 60. 6 secounds 60 predictions for every secound
type BoostPadState ¶
type BoostPadState struct { // True if the boost can be picked up IsActive bool // The number of seconds since the boost has been picked up, or 0.0 if the boost is active. Timer float32 }
BoostPadState The state of a given boost pad
type ControllerState ¶
type ControllerState struct { // -1 for full reverse, 1 for full forward Throttle float32 // -1 for full left, 1 for full right Steer float32 // -1 for nose down, 1 for nose up Pitch float32 // -1 for full left, 1 for full right Yaw float32 // -1 for roll left, 1 for roll right Roll float32 // true if you want to press the jump button Jump bool // true if you want to press the boost button Boost bool // true if you want to press the handbrake button Handbrake bool // true if you want to press the 'use item' button, used in rumble etc. UseItem bool }
ControllerState Define the state of a controller
type DesiredBallState ¶
type DesiredBallState struct {
Physics Physics
}
DesiredBallState The desired ball state for a desired game state
type DesiredBoostState ¶
type DesiredBoostState struct {
RespawnTime float32
}
DesiredBoostState The desired boost state for a desired game state
type DesiredCarState ¶
DesiredCarState the desired car state for a desired game state
type DesiredGameInfoState ¶
type DesiredGameInfoState struct { WorldGravityZ float32 GameSpeed float32 Paused bool EndMatch bool }
DesiredGameInfoState the desired fam info for a desired game state
type DesiredGameState ¶
type DesiredGameState struct { BallState DesiredBallState CarStates []DesiredCarState BoostStates []DesiredBoostState GameInfoState DesiredGameInfoState ConsoleCommands []string }
DesiredGameState Send a desired game state. useful for repeating the same scnerio
type DropShotBallInfo ¶
DropShotBallInfo info on a dropshot ball
type DropshotTile ¶
type DropshotTile struct { // The amount of damage the tile has sustained. TileState int8 }
DropshotTile info on a dropshot tile
type FieldInfo ¶
type FieldInfo struct { BoostPads []BoostPad // These will be sorted according to (y * 100 + x), and BoostInfo will be provided in the same order. Goals []GoalInfo }
FieldInfo BoostPad and goal info
type GameInfo ¶
type GameInfo struct { SecondsElapsed float32 GameTimeRemaining float32 IsOvertime bool IsUnlimitedTime bool // True when cars are allowed to move, and during the pause menu. False during replays. IsRoundActive bool // True when the clock is paused due to kickoff, but false during kickoff countdown. In other words, it is true // while cars can move during kickoff. Note that if both players sit still, game clock start and this will become false. IsKickoffPause bool // Turns true after final replay, the moment the 'winner' screen appears. Remains true during next match // countdown. Turns false again the moment the 'choose team' screen appears. IsMatchEnded bool WorldGravityZ float32 // Game speed multiplier, 1.0 is regular game speed. GameSpeed float32 // Tracks the number of physics frames the game has computed. // May increase by more than one across consecutive packets. // Data type will roll over after 207 days at 120Hz. FrameNum int32 }
GameInfo info about the game. Alot of these are self explainitory
type GameMessagePacket ¶
type GameMessagePacket struct { Messages []GameMessageStruct GameSecounds float32 FrameNum int32 }
type GameMessageStruct ¶
type GameMessageStruct struct { GameMessageType int PlayerStatEvent *PlayerStatEvent PlayerSpectate *PlayerSpectate PlayerInputChange *PlayerInputChange }
type GameState ¶
type GameState struct { GameTick *GameTickPacket BallPrediction *BallPrediction MatchSettings *MatchSettings MatchSettingsOK bool FieldInfo *FieldInfo FieldInfoOK bool GameMessage *GameMessagePacket GameMessageOK bool }
GameState the game state struct
type GameTickPacket ¶
type GameTickPacket struct { Players []PlayerInfo BoostPadStates []BoostPadState Ball BallInfo GameInfo GameInfo TileInformation []DropshotTile Teams []TeamInfo }
GameTickPacket Send every tick and describes the current state of the game
type GoalInfo ¶
type GoalInfo struct { TeamNum int32 Location Vector3 Direction Vector3 Width float32 Height float32 }
GoalInfo where are the goals??
type LoadoutPaint ¶
type LoadoutPaint struct { CarPaintId int32 DecalPaintId int32 WheelsPaintId int32 BoostPaintId int32 AntennaPaintId int32 HatPaintId int32 TrailsPaintId int32 GoalExplosionPaintId int32 }
LoadoutPaint The paint information about a player
type MatchSettings ¶
type MatchSettings struct { PlayerConfigurations []PlayerConfiguration GameMode int8 GameMap int8 SkipReplays bool InstantStart bool MutatorSettings MutatorSettings ExistingMatchBehavior int8 EnableLockstep bool EnableRendering bool EnableStateSetting bool AutoSaveReplay bool // The name of a upk file, like UtopiaStadium_P, which should be loaded. // If specified, this overrides gameMap. On Steam version of Rocket League, // this can be used to load custom map files, but on Epic version it only // works on the Psyonix maps. Still useful because maintaining the gameMap // enum as new Psyonix maps are added is annoying. GameMapUpk string }
MatchSettings The current match settings
type MutatorSettings ¶
type MutatorSettings struct { MatchLength int8 MaxScore int8 OvertimeOption int8 SeriesLengthOption int8 GameSpeedOption int8 BallMaxSpeedOption int8 BallTypeOption int8 BallWeightOption int8 BallSizeOption int8 BallBouncinessOption int8 BoostOption int8 RumbleOption int8 BoostStrengthOption int8 GravityOption int8 DemolishOption int8 RespawnTimeOption int8 }
MutatorSettings What mutator settings are set
type PlayerClass ¶
PlayerClass A player type and skill level if psy bot
type PlayerConfiguration ¶
type PlayerConfiguration struct { // Cannot be named 'class' because that breaks Java. // Cannot be named 'playerClass' because that breaks C#. Variety PlayerClass Name string Team int32 Loadout PlayerLoadout // In the case where the requested player index is not available, spawnId will help // the framework figure out what index was actually assigned to this player instead. SpawnId int32 }
PlayerConfiguration Information about a given player
type PlayerInfo ¶
type PlayerInfo struct { Physics Physics ScoreInfo ScoreInfo IsDemolished bool // True if your wheels are on the ground, the wall, or the ceiling. False if you're midair or turtling. HasWheelContact bool IsSupersonic bool IsBot bool // True if the player has jumped. Falling off the ceiling / driving off the goal post does not count. Jumped bool // True if player has double jumped. False does not mean you have a jump remaining, because the // aerial timer can run out, and that doesn't affect this flag. DoubleJumped bool Name string Team int32 Boost int32 Hitbox BoxShape HitboxOffset Vector3 // In the case where the requested player index is not available, spawnId will help // the framework figure out what index was actually assigned to this player instead. SpawnId int32 }
PlayerInfo Info on a specific player
type PlayerInput ¶
type PlayerInput struct { PlayerIndex int32 ControllerState ControllerState }
PlayerInput rlData for a player input
type PlayerInputChange ¶
type PlayerInputChange struct { PlayerIndex int32 ControllerState ControllerState // These are provided by Rocket League, and I'm passing them through. Theoretically they could be // inferred by jump + pitch + roll, but nice to have clarity. DodgeForward float32 DodgeRight float32 }
PlayerInputChange information about a players input changing
type PlayerLoadout ¶
type PlayerLoadout struct { TeamColorId int32 CustomColorId int32 CarId int32 DecalId int32 WheelsId int32 BoostId int32 AntennaId int32 HatId int32 PaintFinishId int32 CustomFinishId int32 EngineAudioId int32 TrailsId int32 GoalExplosionId int32 LoadoutPaint LoadoutPaint // Sets the primary color of the car to the swatch that most closely matches the provided // RGB color value. If set, this overrides teamColorId. PrimaryColorLookup Color // Sets the secondary color of the car to the swatch that most closely matches the provided // RGB color value. If set, this overrides customColorId. SecondaryColorLookup Color }
PlayerLoadout The aperance information about a player
type PlayerSpectate ¶
type PlayerSpectate struct {
PlayerIndex int32
}
/ Notification when the local player is spectating another player.
type PlayerStatEvent ¶
/ Notification that a player triggers some in-game event, such as: / Win, Loss, TimePlayed; / Shot, Assist, Center, Clear, PoolShot; / Goal, AerialGoal, BicycleGoal, BulletGoal, BackwardsGoal, LongGoal, OvertimeGoal, TurtleGoal; / AerialHit, BicycleHit, BulletHit, JuggleHit, FirstTouch, BallHit; / Save, EpicSave, FreezeSave; / HatTrick, Savior, Playmaker, MVP; / FastestGoal, SlowestGoal, FurthestGoal, OwnGoal; / MostBallTouches, FewestBallTouches, MostBoostPickups, FewestBoostPickups, BoostPickups; / CarTouches, Demolition, Demolish; / LowFive, HighFive;
type PredictionSlice ¶
type PredictionSlice struct { // The moment in game time that this prediction corresponds to. // This corresponds to 'secondsElapsed' in the GameInfo table. GameSeconds float32 // The predicted location and motion of the object. Physics Physics }
PredictionSlice ball prediction for a given time
type QuickChat ¶
type QuickChat struct { QuickChatSelection int8 // The index of the player that sent the quick chat PlayerIndex int32 // True if the chat is team only false if everyone can see it. TeamOnly bool MessageIndex int32 TimeStamp float32 }
QuickChat rlData for a qucikcaht
type RLBot ¶
type RLBot struct { PlayerIndex int32 // contains filtered or unexported fields }
func Connect ¶
Connect (port int) (Socket, error) Initiate the connection to RLBot returns a socket and a error on failure. Default port is 23234
func (*RLBot) DebugMessageAdd ¶
func (*RLBot) DebugMessageClear ¶
func (*RLBot) SendDesiredGameState ¶
func (socket *RLBot) SendDesiredGameState(desiredGameState *DesiredGameState) error
SendDesiredGameState Send a specific game state. Good for testing
func (*RLBot) SendMessage ¶
SendMessage (dataType uint16, data rlData) error Send a data payload to RLBot, returns a error on failure
func (*RLBot) SendQuickChat ¶
SendQuickChat This will allow your bot to be toxic. Who doesn't want that?
func (*RLBot) SendReadyMessage ¶
func (socket *RLBot) SendReadyMessage(wantsBallPredictions, wantsQuickChat, wantsGameMessages bool) error
SendReadyMessage Send the ready message to RLBot
func (*RLBot) SetGetInput ¶
func (socket *RLBot) SetGetInput(handler func(gameState *GameState, socket *RLBot) *ControllerState) error
SetGetInput (handler func(gameState *GameState, socket *Socket) Set your tick handler function and start listening for gameTickPackets
type ReadyMessage ¶
type ReadyMessage struct { // If this is set, RLBot will send BallPrediction data back to the client when available. WantsBallPredictions bool // If this is set, RLBot will send QuickChatMessages to the client when available. WantsQuickChat bool // If this is set, RLBot will send MessagePacket data back to the client when available. WantsGameMessages bool }
ReadyMessage rlData for ready message
type RenderGroup ¶
type RenderGroup struct { RenderMessages []RenderMessage /// The id of the render group Id int32 }
type RenderMessage ¶
type RenderMessage struct { RenderType int8 Color Color /// For 2d renders this only grabs x and y Start Vector3 /// For 2d renders this only grabs x and y End Vector3 /// Scales the x size of the text/rectangle, is used for rectangles assuming an initial value of 1 ScaleX int32 /// Scales the y size of the text/rectangle, is used for rectangles assuming an initial value of 1 ScaleY int32 Text string /// Rectangles can be filled or just outlines. IsFilled bool }
type ScoreInfo ¶
type ScoreInfo struct { Score int32 Goals int32 OwnGoals int32 Assists int32 Saves int32 Shots int32 Demolitions int32 }
ScoreInfo score info on a specific player
type SphereShape ¶
type SphereShape struct {
Diameter float32
}
SphereShape Defines a shape of a sphere
type Touch ¶
type Touch struct { // The name of the player involved with the touch. PlayerName string // Seconds that had elapsed in the game when the touch occurred. GameSeconds float32 // The point32 of contact for the touch. Location Vector3 // The direction of the touch. Normal Vector3 // The Team which the touch belongs to, 0 for blue 1 for orange. Team int32 // The index of the player involved with the touch. PlayerIndex int32 }
Touch Anything you would want to know on a ball touch