Raised This Month: $51 Target: $400
 12% 

[CS:GO] Two small questions about bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 05-14-2017 , 11:28   [CS:GO] Two small questions about bots
Reply With Quote #1

Currently doing some refactorings in my Timer replay plugin, and got two questions about how bots work together with SM/in general:

1.) Does the CreateFakeClient() function do the same as ServerCommand("bot_add")?
As in, create bots which can be controlled through OnPlayerRunCmd?
Looking at the C++ implementation, it calls engine->CreateFakeClient, while bot_add runs through some more boilerplate code (command handling).

2.) The infamous error "Could not add bot, the game is full", happens quite often as soon as the server reaches 40+ real players on certain maps.
Now, I have already looked into this some time ago, and tried to overcome the problem by manually creating some more info_terrorist_spawn/info_ct_spawn entities in the same origin as one randomly picked, already existing spawn, but that didn't help either.
Looking at some reverse engineered SE2007 binaries, it seems like the amount of available spawns is cached in GameRules::Think() only once (if m_bInitalized is not set).

Now, I would have thought about maybe doing the same thing I have already tried (creating spawns manually), and just patch out the check in the CreateFakeClient/bot_add command, but considering I am only a beginner in RE, that wouldn't be quite easy for me.
Did anyone else have that problem already and somehow found a solution for it?
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-14-2017 , 19:58   Re: [CS:GO] Two small questions about bots
Reply With Quote #2

1) Last time I tried this in Source IIRC, the fake client would move, but wouldn't turn when you set its angles, so they're not interchangeable as replay actors. Might be different in CS:GO though.

I figure making a working fake client would be simpler than making a bot and battling its AI and the bot rules and stuff, but I'm not sure what would be involved.

2) Couldn't you just add more spawns beforehand?
Miu is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 05-15-2017 , 13:50   Re: [CS:GO] Two small questions about bots
Reply With Quote #3

1.) Alright, will try it - thanks!

2.) How do you mean beforehand?
I know I could just add them through Stripper, but that would require me/my admins to go through 300+ maps and check if they have a "bot problem".
That's why I thought about simply creating the entities OnMapStart, but that didn't solve my problem the last time I tried it (simply took the first spawnpoint, and copied its position to the new one).
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 05-15-2017 , 14:50   Re: [CS:GO] Two small questions about bots
Reply With Quote #4

Seems like CreateFakeClient doesn't do anything useful, it just adds a client "name" (parameter which I passed to CreateFakeClient), which is just stuck in "connecting" state.
Guess I will go back to the usual bot_add calling.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode