Joe91 / fun-bots

A highly customizable and configurable bot mod for your Venice Unleashed Battlefield 3 server.
https://discord.gg/zNk3qCzk6x
237 stars 45 forks source link

Add option to balance players per team #228

Closed Venlious closed 2 years ago

Venlious commented 2 years ago

Inspired by this question: https://community.veniceunleashed.net/t/human-player-team-balancer-required/2837

The bots are perfect when the player counts are low. I prefer using the bots to fill up some of the empty slots as they are replaced by players, so you can have fun while waiting.

However, I noticed that whenever a new player would join they'd always join the same team. This pull request fixes that by automatically assigning a user to the team with the fewest players in it (ignoring bots).

This is my first time working with lua and my first time working with the Venice Unleashed API. I'll glady listen to your feedback. I have added Config.BalancePlayersIgnoringBots as an option which is false by default.

Firjens commented 2 years ago

Merge into dev and not master.

Joe91 commented 2 years ago

@Venlious really nice done. Do you plan some more features or modifications? If you want I can grant you access to the repo if you like... But a PR is just fine too :-)

Venlious commented 2 years ago

Thanks! I'm pretty new to Venice Unleashed and hosting a BF3 server. I might get around to adding more features/modifications in the future but I wouldn't count on it. No need for repo access (at least for now).