foxBot! ExAI-based Multiplayer Coop Bots

[Reusable] foxBot! ExAI-based Multiplayer Coop Bots 1.6

This thread contains content that may be reused, modified, or ported by anyone.

fox

Member
I got more than 1000 rings because a bot died multiple times in a single frame.
Interesting - any idea how you caused this to happen?

I play in Android and I still don't get it. Can you make it easier to explain
How do i add a bot in netgames? On android?
My best suggestion would be to use the singleplayer "Sonic & Tails" option, optionally using FF's Botskin mod. The bot should "just work" in that mode.

For more bots on Android, I think you'll need more than one device, unfortunately. If you do have a spare device, just start a multiplayer match with the mod loaded in the addons menu. On your second device, connect as usual, and then type "setbot 0" in the console.

I for the life of me can't get this to work at all, I've made shortcuts with the target name and everything, but nothing seems to work. Would anyone be willing to help me out here?
What does your shortcut look like? It should look something like:
"<path-to-srb2>\srb2win.exe" -config config-bot.cfg -connect localhost

Make sure you start a multiplayer game first with the mod loaded (via the addons menu or otherwise), then just alt-tab over and run that shortcut.

Note that config-bot.cfg can be any name you'd like - it's just the name of the config file for the bot to use (instead of the usual config.cfg).
 

Peppermint

sonic lost the game awards, model pack cancelled
I pretty much have one major issue, it always crashes once in a whole, it’s really annoying.
 

Omnitsu

Clown that's trying his best, or barely trying.
Is there any way to make the bots go super when you do? I was just curious since I'd be nice having them all be super alongside you.
 

CloneFighter

Mediocre Lua scripter
Is there any way to make the bots go super when you do? I was just curious since I'd be nice having them all be super alongside you.
I think they copy your movements exactly when they're REALLY close to you. Try turning Super when they're standing in you.
 

Omnitsu

Clown that's trying his best, or barely trying.
I think they copy your movements exactly when they're REALLY close to you. Try turning Super when they're standing in you.
I tried that, but it unfortunately didn't work. Someone told me that I should use BotSuper, but that only worked in single player. I added combi-ring at one point, and that worked for some reason. My only problem is, I don't want to be stuck to the other bots just so I can go super.
 
SP Fox Bot

Can you make a fox bot mod like this but for single player I really want to play with a lot of bots in single player because it does not lag the game and you can as many bots as you can so please make a bot mod where you can play with a lot of bots in single player please and thank you.
 

Modunlami

Member
That's a good idea and can you make a command call addbot if you don't know what it is is a old command that you can just type in the botsname and skincolor.
 
I remember this mod. I was in a random server online, joined to Greenflower Zone act 2 when I noticed the timer was over an hour or so. I then realized that it was because there were a bunch of idle random bots. Since I was playing as Tails, I decided to fly them to the exit so I could get everyone to the boss. But it seems those bots were not idle, they were just swarming... an AFK player. No one playing had the ability to kick that guy, so it was a painstaking task to try and single out that guy in the swarm of bots hovering around him and grab him with the weird Tails flight replacement some weird momentum mechanic overhall mod added making it incredibly hard to correct any mistakes. It took forever for us to drag his butt all the way to the sign post and get him and all the bots to win the act, but we did it. And then we beat the boss and pretty much gave up halfway through Techno Hill Zone act 1.

Overall, 10/10 mod, would play again.
 

FANMAN

Member
I read the instructions a few times, and it wasn't clear for me. Can you make a video? I only got the AI working, but you should be more clear about the number of bots part.




EDIT: I got it working.
 
Last edited:

Gage

yeah no
This is amazing, but I have the android version of the game, and multiplayer does not work for me, as I cannot open other windows. help
 

fox

Member
Version 1.1 is released! New downloads have been added to the original post.

Among other things, this version fixes a silly issue where the bot wouldn't respawn when used in singleplayer (d'oh!). It also properly supports super forms for bots:

attachment.php


Keep in mind that you share rings with your bots, and they still drain 1 ring per second each - see how long you can keep it going!

attachment.php


Besides that, there are a number of additions and bugfixes, such as a new HUD when playing as a bot and new commands like listbots to get a better idea of who's who in a game.

attachment.php


They are also much better at bopping multiple targets in a row:

attachment.php


Here's a full changelog:

v1.1 (2021-01-17):

General Changes:

  • Fix several issues with how bots take damage (e.g. "ouch" on lava w/ flame shield, etc.)
  • Enable ai_defaultleader by default, setting all connecting clients to bots unless disabled (easier setup)
  • Disable saving AI console variables to config, since they sync across netgames (didn't make much sense)
  • Fix SP bot issues - bot now respawns as expected, and no longer bugs out if Player 2 takes control
  • Improve teleporting - inherit leader's momentum / orientation, fix goofy 2D mode bugs, teleport more responsively in large bot groups
  • Fix some player preferences not being applied if adjusted while AI was in control of the player
  • Add "listbots" command to list all active bots (and players) in a nice "tree" format
  • Rewrite ai_debug as a more detailed HUD hook (instead of console log spam)
  • Add named values to ai_ignore, ai_hurtmode, and ai_statmode (e.g. ai_ignore "All")
  • Add simple HUD for bot clients! Shows assorted status info, toggled via ai_showhud
  • Fix various issues with bot super forms (and add AI for using super forms)
  • Remove grace period from leader when bot takes real damage (e.g. via ai_hurtmode)
  • Fix bots sometimes being able to pick up tossed rings when they shouldn't
  • Rework ai_defaultleader to allow specifying a random leader (32) and automatically arrange bots into a line
  • Prevent bots from keeping a pink Amy shield on hit (so they don't just constantly have one)
  • Improve documentation / bothelp command
AI Behavior Changes:

  • Improve chain-attacking - always use next closest target when switching, regardless of leader's speed
  • Allow grabbing monitors as "active" targets, like enemies (can do longer jumps to bop monitors)
  • Limit range Tails will attempt to fly-attack targets (unless already flying)
  • Use radius, height, and scale (for both bot and target) in calculating max target distances
  • Improve Tails carry logic - better chain-carry, avoid snapping leader's camera around on pickup
  • Fix issues with slopes and conveyors, including spindashing and thinkfly (up arrow) not working on them
  • Improve close-range following and running ahead of leader when we're faster
  • Improve pseudo-random behavior across multiple bots in a session (they won't all make the same "random" decision at the same time)
  • Fix relentlessly attacking MT_ROSY (oops)
  • Fix various Amy issues - avoid excessive friendly shield hammering, fix airhammers not working right
  • Allow Fang to jump-attack enemies with his tail bounce, and use this behavior on objects leader pushes against
  • Fix freaking out if swinging around on a mace
  • Improve "leader is pushing against something" helpmode logic, taking priority over combat
  • Fix sometimes respawning before leader was explicitly alive again
  • Improve targeting to prefer targets in current momentum direction
  • Fix standing around in water and losing time in special stages
  • Improve drowning logic to jump out of water when near the water surface, regardless of ability
  • Fix needlessly jumping for rings in reverse gravity
  • Allow super transformations via thinkfly (stand near bot and jump when golden up arrow is visible)
  • Add behaviors for super form abilities
  • Fix not always holding jump when crossing a predicted gap
  • Add spectator support for non-respawning game modes (can guide bots to next starpost when dead, etc.)
  • Ensure AI leaders think before their followers (fixes things like Tails carry between two bots)
  • Improve corner waypoint navigation, making it more reliable and reducing number of objects created
  • Fix issues with boredom in large groups
  • Relax target count requirements for using Armageddon Shield nuke
  • Other miscellaneous fixes and performance improvements
Finally, a very big thank you to everyone who joined the various test sessions, both for this update and for the original release. This was a lot of fun to work on and some of those sessions were very memorable (and very helpful for tracking down bugs). I've attached some bonus GIFs for kicks.

Enjoy!
 

Attachments

  • srb20116.gif
    srb20116.gif
    6.1 MB · Views: 200
  • srb20120.gif
    srb20120.gif
    2.7 MB · Views: 161
  • srb20125.gif
    srb20125.gif
    4.2 MB · Views: 162
  • srb20127.gif
    srb20127.gif
    3 MB · Views: 235
  • srb20129.gif
    srb20129.gif
    2.7 MB · Views: 193
  • srb20131.gif
    srb20131.gif
    3.5 MB · Views: 190
  • srb20157.gif
    srb20157.gif
    3.7 MB · Views: 183
  • srb20171.gif
    srb20171.gif
    3.6 MB · Views: 2,380
  • srb20161_cr.png
    srb20161_cr.png
    51.4 KB · Views: 2,134
Last edited:

clairebun

Community Noise Maker
Sonic Team Junior
The reason BuddyEX allows for "addbot" is because its bots are not real "players" as the engine sees them. The engine in its present state doesn't allow for the creation of player instances without a client, so FoxBot can't spontaneously create a bot and must rely on taking control over the instances of joined players.
 

CloneFighter

Mediocre Lua scripter
The reason BuddyEX allows for "addbot" is because its bots are not real "players" as the engine sees them. The engine in its present state doesn't allow for the creation of player instances without a client, so FoxBot can't spontaneously create a bot and must rely on taking control over the instances of joined players.
Yeah, that too.
 

fox

Member
In case it's at all useful for anyone, I thought I'd upload a quick "launcher" batch script designed to easily launch extra SRB2 instances for use with the bot:

1614986872865.png


This launches SRB2 with the specified config file (so each bot can have its own config - name/skin/etc.), and then immediately connects to localhost (your coop server). As it's just a simple batch script, it supports tab-completion when selecting a config file to launch the game with.

This was originally something I made while testing the bot to make my life easier, and realized this may be useful to others as well.

foxBotLauncher.zip contains a "bot" folder (with the launcher) and "Readme.txt" file detailing how to use this - please read it carefully if you get confused! :)

Edit: Here's a quick video showing how to use the simple launcher to connect the bot to a multiplayer game:


Please feel free to DM me on here or ping me on Discord if you have any trouble getting this working!

I also thought I'd upload a few bonus goodies made while I was originally working on this:

L_AllSuper.lua is a quick and dirty mod to allow super forms on any character. It was quickly written in the middle of a public v1.1 test netgame, and simply hooks the "jump" event to enable super form for your character. This was done so the logic wouldn't run every frame, but still catch skin changes mid-level. (some sort of "on skin change" hook would be more appropriate if implemented)

L_BotSkinPlus.lua is a modified version of FuriousFox's BotSkin mod, allowing you to also change skin color for both yourself and your bot in singleplayer (via "Sonic & Tails" mode). It operates the same as BotSkin, but with an added "color" argument:
botskin <skin> <color> playerskin <skin> <color>

Please consider all of these things Re-usable - I dedicate them to Public Domain, do whatever you'd like with them. :P

Enjoy!
 

Attachments

  • foxBotLauncher.zip
    19.3 KB · Views: 562
  • L_AllSuper.lua
    205 bytes · Views: 261
  • L_BotSkinPlus.lua
    1.7 KB · Views: 318
Last edited:

fox

Member
Cool but if I I'm asking to much can you make foxbot launcher on Android if you don't want to that fine
I would if I could! Unfortunately the multi-instance method doesn't work on Android, so I can't write any sort of launcher to do this. :(

For what it's worth, it looks like there's an outstanding merge request that would allow an "addbot" command for bot mods in future versions of SRB2. If this were ever implemented, there would be no need for running multiple copies of the game (or splitscreen) in order to use mods like this - which would be much easier to use on Android as a result.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Top