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
310 stars 85 forks source link

Captain Mode Game Logic Update. #89

Open ArcherWayne opened 1 year ago

ArcherWayne commented 1 year ago

The ban/pick in captain mode needs to be updated.

Now there are 7 bans, instead of 5 bans.

ArcherWayne commented 1 year ago

I think there is a problem in the condition of if-elseif-else-end logic in captain mode.

The original script cannot ban or pick any hero.

A preliminary fix is underway.

The debug console information goes too fast and I can't read any thing, is there any way to stop the console information during the strategy phase?

JoshdanG commented 1 year ago

You can disable various channels if they aren't interesting to you. You can tell which channel a log message is from because it will be in brackets at the beginning E.g. "[Server] Invalid action (42)". Assuming you are looking for your own print messages, they will be on the [VScript] channel, so don't disable that. Anything without a listed channel is on General.

// Important, but we get a lot of errors which could be overwhelming
log_flags Developer +donotecho

// Probably not important
log_flags "HLTV Server" +donotecho
log_flags Particles +donotecho
log_flags GCClient +donotecho
log_flags ResourceSystem +donotecho
log_flags "Entity System" +donotecho
log_flags SteamNetSockets +donotecho
log_flags RenderSystem +donotecho
log_flags SndOperators +donotecho

// Sometimes have useful information, sometimes noise
log_flags General +donotecho
log_flags Server +donotecho
JoshdanG commented 1 year ago

The other option would be to slow down time.

sv_cheats true
host_timescale 1.0

Set host_timescale < 1 to go slower than realtime. You can also use dota_pause in the console or DebugPause() in the code to completely stop and give yourself a chance to catch up.

JoshdanG commented 1 year ago

Finally, if it's your own messages that are flooding things, and managing the ebb and flow of the time tides is likewise overwhelming, you may want to throttle printing. One way to do that would be to only print on certain frames. E.g. the code below will only print messages when the frame is exactly at the second and exactly 0.5 seconds afterward. There are 30 logic frames per game second, and they are properly aligned with seconds (i.e. they don't drift). The code below probably has some rounding issues for different numbers.

function utilityModule.SecondsPrint(message)
    local fps = 2
    if (DotaTime()*fps) == math.floor(DotaTime()*fps) then
        print(message)
    end
end
ArcherWayne commented 1 year ago

thanks alot, that helps!