adamqqqplay / dota2ai

Ranked Matchmaking AI: An improved Dota2 AI based on Valve's default AI. Has more than 3 million subscribers on Steam.
http://steamcommunity.com/sharedfiles/filedetails/?id=855965029
GNU General Public License v3.0
309 stars 85 forks source link

Game fails to start #150

Closed dino572 closed 3 months ago

dino572 commented 4 months ago

This happens around half the time when I try to start a lobby. The bots pick their heroes, but the last but does not pick any hero. Then, I am all other players are kicked from the lobby. We can try to reconnect, but it does not work. The game never starts. This only happens if the players pick their heroes early. If we wait until last, it does not happen. Is it possible that the bot is trying to pick a hero that a player already picked? And that causes the bot to halt, causing the game to fail to start.

adamqqqplay commented 4 months ago

@dino572 Thanks for your report.

@ArcherWayne Could you take a look here? Thanks in advance.

ArcherWayne commented 3 months ago

I'll take a look into this issue.

ArcherWayne commented 3 months ago

hello, @dino572 ,

I tried to reproduce this problem and see if I can find out where goes wrong for the bots not picking their heroes.

However, this problem never occurs in every scenario I tested. This means that the game almost always starts as intended for me. So I didn't understand where it could go wrong.

I tried pick first and bots just pick other heroes in the pool and the game starts normally. I also tried limits the hero pool to be less than the number of bot slots, and when the bots have no heroes to pick, it went into penalty time and the game started to cut down their gold. But when the penalty time was over, bot just get a random hero and the game starts just the same, and I was not kicked from the lobby even once.

"players kicked from the lobby" looks like a server issue and there is no way this script could help. I always play and test this script in a custom lobby, and host the lobby locally. Perhaps playing this way could avoid the issue.

dino572 commented 3 months ago

Thanks for trying! I have a video here: https://youtu.be/bdcpY1lfDMs It shows the bug. I can reproduce it, but only around 25% of the time. Do you think the bug is unrelated to RMMAI?

ArcherWayne commented 3 months ago

Hello, @dino572 ,

Thanks to your illustration video I was able to recreate the exact issue and its just like you said: it occurs only around 25% of the time.

I was able to pull the debug informations from the client console and it give me some insights about how this issue happened.

After the bots picked to the last few slots, the serves tick dropped, and from the debug messages I think the server connection was lost at this moment and the lobby was not able to reconnect with the server since. After around 2000 retries the client return a NETWORK_DISCONNECT_TIMEDOUT message, which basically means that it takes too long to reconnect with the server so the game gives up, and discards the session, then shutdown the connection. Thats why the players are kicked from the lobby.

This is all I can read from the console debug information. I am not sure this is caused solely by the server or some hidden interactions between the dota2ai script and the server. I tested this issue on Singapore, Japan, Taiwan, Stockholm servers and these all have this issue. However, this issue never occurs (at least for me) if the server location is set as local host. I hope this could avoid this problem.

dino572 commented 3 months ago

Well done! Thank you.