Skip to content

dilirity/r5_apex_bots

Repository files navigation

AI usage disclosure

The work in this repo is done by a person who knows how to code and AI. The main reason for the AI usage is, is the lack of time to learn C++ or Squirrel to fully understand things.

Goal

The goal of the project is to have Bots in Apex Legends R5Reloaded, that can navigate a complex map, loot and shoot at enemies. Using abilities based on the legends they are might be added depending on the complexity.

You need Apex running https://github.com/dilirity/r5sdk/tree/bots instead of the regular repo - https://github.com/R5Reloaded/r5sdk.

Bindings (so I don't forget later)

Shortcuts

Add to r5sdk\game\platform\cfg\system\autoexec_client_dev.cfg

bind g "script BotAI_Spawn(0, 3)" // Create Bangalore (0) bot in player team (3). This is based on free roam, I dunno what the player team is in other game modes.
bind f "script bot_place_waypoint()"  // Place waypoint on the navmesh where the crosshair is pointing at, for the bot to go to.
bind e "kick TestBot" // Remove all bots. For some reason all bots get kicked using this cmd. Maybe because of the same name :D
bind z "host_timescale 0.1" // Slow things down. Easier to understand what is happening when bots do something.
bind x "host_timescale 1" // Back to normal speed.

r5sdk\game\platform\cfg\system\autoexec_dev.cfg

navmesh_draw_range "2900" // Draw navmesh in a 2900 unit radius. This is good for performance on my machines and enough to see what we need.
navmesh_draw_enable "1" // Enable navmesh drawing.
navmesh_draw_type "0" // The small navmesh used by bots/pilots.
navmesh_draw_traverse_portals "1" // Enable drawing of traverse portals.
navmesh_draw_traverse_portals_type "1,2,3,4,5,8,19" // Only draw portal types that a human should traverse. Showing all using -1 is too much, this makes it easier to debug visually. This is only possible with the modified version of the console command.
navmesh_draw_portals "1" // Draw the portals connecting the navmesh tiles.
navmesh_draw_tile_bounds "1" // Draw the bounds of the navmesh tiles.
navmesh_draw_show_tile_ids "1" // Colors the tiles based on their IDs. Less taxing on the eyes :D

Setup (or how to get back to the dev state in case my house burns down)

The main r5sdk repo

https://github.com/R5Reloaded/r5sdk

Active branch (p4sync) checked out in:

G:\projects\r5sdk

It's easier to symlink the entire game to G:\projects\r5sdk\game, but I just moved it in there.

Need to run G:\projects\r5sdk\CreateSolution.bat to generate sln in G:\projects\r5sdk\build_intermediate, for VS 2019.

The r5_scripts repo

https://github.com/Mauler125/r5_flowstate

Active branch (r5r_scripts_2025f) checked out in:

G:\projects\r5_flowstate

Replaces the game's scripts directory G:\projects\r5sdk\game\platform\scripts using symlink:

mklink /D "G:\projects\r5sdk\game\platform\scripts" "G:\projects\r5_flowstate"

Bots mod (this repo)

Since the game needs to be in G:\projects\r5sdk\game to test things easily and that's ignored under version control, we still need this mod running in the game with version control. To work around this, I'm using a symlink from where this repo is checked out, to G:\projects\r5sdk\game\mods\botai.

mklink /D "G:\projects\r5sdk\game\mods\botai" "G:\projects\botai"

Props to @ttvmkos (mikos) from the r5reloaded discord.

Shortcut for game exe

Created a shortcut for the exe into the G:\projects\r5sdk\build_intermediate folder, so I can easily run VS 2019 and the game after it crashes (I do tend to crash it because I have no clue what I'm doing with C++ haha).

G:\projects\r5sdk\game\r5apex.exe -novid -dev -devsdk +script_dump_on_init 1

Syntax highlighting in Cursor for rSquirrel (Respawn Squirrel)

https://github.com/sandwh1ched/VSC-rSquirrel

Active(?) branch (main) checked out in:

G:\projects\VSC-rSquirrel

Symlinked to cursor user extensions:

mklink /D "C:\Users\dilirity\.cursor\extensions\VSC-rSquirrel" "G:\projects\VSC-rSquirrel"

TODO

Add actual meaningful contents here.

About

This repo is for implementing bots using AI like Opus and ChatGPT for R5 Reloaded Apex Legends.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors