Edit Bot Object?
Edit Bot Object?
Any chance i can unload the AI module from a bot object to avoid all its calculations? for performance boost.
using fakeclient stuff via bot_manager.create_bot is no option as that has trouble calculating gravity and animations on the client..(unless there is a way to fix that ofc)
thanks!
using fakeclient stuff via bot_manager.create_bot is no option as that has trouble calculating gravity and animations on the client..(unless there is a way to fix that ofc)
thanks!
Re: Edit Bot Object?
one way, that comes to mind is using bot_zombie 1.
but my fear is tha itll not boost performance, but instead only "block" the botcmd and botcontroller, after it was already heavily calculated by the server.
so if anyone could give any insight on whether bot_zombie 1 will disable calculations instead of blocking ites execution that would also help
but my fear is tha itll not boost performance, but instead only "block" the botcmd and botcontroller, after it was already heavily calculated by the server.
so if anyone could give any insight on whether bot_zombie 1 will disable calculations instead of blocking ites execution that would also help
Last edited by D3CEPTION on Thu Sep 01, 2016 11:23 am, edited 1 time in total.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Edit Bot Object?
You may want to hook and block pre/post_think methods from being executed. This should prevent any logic to be performed on the specific entities.
Re: Edit Bot Object?
yeah, do you know WHICH ONES?
let me try to prepare some code:
now i need to find the specific dummy functions and use the above code on them?
or is there some global way to mute all actions on a secific entity?
edit: nvm you LINKED me to "pre_think", didnt see that
let me try to prepare some code:
Syntax: Select all
from entities.hooks import EntityPreHook
@EntityPreHook(EntityCondition.is_bot_player, dummy_function)
def dummy_function(args):
##handle args / return
now i need to find the specific dummy functions and use the above code on them?
or is there some global way to mute all actions on a secific entity?
edit: nvm you LINKED me to "pre_think", didnt see that
Re: Edit Bot Object?
thanks for the help so far.
"pre_think" seems to be sthn like a "1tick-priorto-server-excecution", mb similar to "run_command" just here with access ONLY to the player object. (ofc i can deactivate everything here via the playerobj, but the calculations for AI are still made somwhere else, i only block their execution here)
maybe the AI calculations are made in bot_manager?
so my idea would be to disable the whole module.
anyone got an idea or a hint? thanks in advance!
"pre_think" seems to be sthn like a "1tick-priorto-server-excecution", mb similar to "run_command" just here with access ONLY to the player object. (ofc i can deactivate everything here via the playerobj, but the calculations for AI are still made somwhere else, i only block their execution here)
maybe the AI calculations are made in bot_manager?
so my idea would be to disable the whole module.
Code: Select all
"from players.bots import bot_manager"
anyone got an idea or a hint? thanks in advance!
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Edit Bot Object?
I'm not too sure what you are trying to achieve exactly, could you elaborate with examples, description, etc?
Re: Edit Bot Object?
i want to copy a players UserCMD and use it on a bot.
Re: Edit Bot Object?
He wants to read the data from one player's UserCmd and make the bot mimic that player, preferably disabling all the bot's AI as it's not needed anymore.

My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.

- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Edit Bot Object?
Well, if you prevent the bot from running its logic, how will it run the commands you copied from that said player? You don't want to "disable" the AI, you want to inject your own data - which is totally different. Disassemble engine/server.so files and search for CSSBot methods (probably some CCSGameRules doing some checks internally as well) and from their name you may be able to find the right one. There is no magic solution here, hardcore digging is required.
Re: Edit Bot Object?
Isn't there a bot_mimic command? Also, you might try to hook run_command and overwrite the BotCmd object with the human player's UserCmd object?
Re: Edit Bot Object?
LOL idk what you are talking about there L'In20Cible ..
im only trying to find a way to get an empty player-object. ( i could buy csgo accounts and use them on a VM, but this is a bad way - does this emphasize my point better? ) im trying to disable any unneded calculations that are done by the server. i want a simple and clean player-botobject than i can use in my current code to transfer a players usercmd into a bots usercmd.
edit: for example, you talk about CSSBot methods. but my idea and question is to disable the whole module, not every function manually.
im only trying to find a way to get an empty player-object. ( i could buy csgo accounts and use them on a VM, but this is a bad way - does this emphasize my point better? ) im trying to disable any unneded calculations that are done by the server. i want a simple and clean player-botobject than i can use in my current code to transfer a players usercmd into a bots usercmd.
edit: for example, you talk about CSSBot methods. but my idea and question is to disable the whole module, not every function manually.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Edit Bot Object?
D3CEPTION wrote:edit: for example, you talk about CSSBot methods. but my idea and question is to disable the whole module, not every function manually.
Like I said, there is no magic. The bots logic is embedded into the server process, disabling the whole thing means manually blocking/modifying (by hooking, mutating pointers, etc) everything related to it. But again, you don't want to disable, you want to inject your own data. Find the method that process the moves, and you may be able to pass the UserCmd data to it. Also, Satoon mentionned "bot_mimic", I never played with that command but you should definitely play with that first.
Re: Edit Bot Object?
okay, im just wondering, because your "answer" seems to be rephrasing my "question" or statements ive already made. im also using my own code to copy a usercmd. its all working. the only technical problem is, that it always has a delay of 1 tick ( time difference of prehook ).
i doubt that bot_mimic will be realtime mimic, but ill look into it, thanks.
right now i really i just want to find the best way to use the most efficient player object, as said. i know that i can dig out every function to avoid bot calculation, but i was hoping that somebody has a better idea here maybe.
i said this before, but theres also the method with adding the player object with bot_manager.create_bot, but using the usercmd on this object, will fail at clientside physics and anim simulations. but that object is very ressource efficient as it seems.
i doubt that bot_mimic will be realtime mimic, but ill look into it, thanks.
right now i really i just want to find the best way to use the most efficient player object, as said. i know that i can dig out every function to avoid bot calculation, but i was hoping that somebody has a better idea here maybe.
i said this before, but theres also the method with adding the player object with bot_manager.create_bot, but using the usercmd on this object, will fail at clientside physics and anim simulations. but that object is very ressource efficient as it seems.
Re: Edit Bot Object?
Try bot_stop 1. That should disable almost everything in CCSBot::Update(), which does a lot of the logic.
Re: Edit Bot Object?
Ayuto wrote:Try bot_stop 1. That should disable almost everything in CCSBot::Update(), which does a lot of the logic.
any sourcecode where you found that? i know that bot_chatter 0 will also, additionally disable the radio commands. im just afraid that those built-in console commands will only disable execution, as mentioned above a few times, but maybe thats wrong.
until i have better solution i will use these 2 commands:
Code: Select all
bot_stop 1
bot_chatter OFF
Re: Edit Bot Object?
I assume that you actually have performance issues. Otherwise there would be no reason to ask that question at this point. If so, you could simply proof (or the opposite) this assumption by testing.
D3CEPTION wrote:im just afraid that those built-in console commands will only disable execution, as mentioned above a few times, but maybe thats wrong.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 88 guests