-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic leaning #805
Automatic leaning #805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but how do we incorporate this for the sourcebots branch? I'd love to have this functionality added for them.
We can add a server only section which checks if a player is a bot, and does the same thing as whats done client side for the local player except with far fewer tracelines. We could add a time variable so that bots stop leaning only after a set number of seconds pass without the conditions for maintaining their current leaning state, to make their behavior look more natural while saving resources. |
Actually a smarter way to go about this with a very similar end result would be to only perform the calculation for leaning for bots every x seconds |
If there's an issue of this causing a perf spike with high bot counts, you could also consider staggering this for example with modulo of the bot index, so that you're guaranteeing at most X expensive operations per think cycle regardless of the bot count. Something like (pseudocode): Or some other measurement of how much time you're willing to spend in that routine per one bot think. This can work well for spreading work that doesn't necessarily need to be applied for every bot at the same exact tick. And actually this might even be acceptable for things like general decision making and sensing for the bots, as real humans also have differences in their reaction times; so it should feel natural, even if bots sometimes react a few milliseconds slower. Although if you wanted to make this kind of optimization more fair, you could loop a random permutation so the bots that happened to be blessed with lower entity indices aren't always faster to react. Or use some other kind of balancing metric. But this starts to get increasingly off-topic 😅 |
Description
Automatic leaning. Currently using automatic leaning prevents the use of manual leaning completely.