mrmin123 / kancolle-auto

Kantai Collection (Kancolle) bot/automation tool - DEPERECATED - see kcauto-kai:
https://github.com/mrmin123/kcauto-kai
54 stars 22 forks source link

Submarine switching not working #336

Closed usagi123 closed 7 years ago

usagi123 commented 7 years ago

Please read the FAQ/Common Issues section of the README before opening a ticket. Please remove sections of this template you do not find relevant when creating your ticket.

Environment details

Issue

Is the issue consistent (can be reproduced consistently) or is it transient (only happens sometimes)?:

After the game new update, I cannot used submarine switching anymore no matter how I config or re-download the new one.

Submarine switching setting: http://imgur.com/a/31SUi Video: https://youtu.be/uHevAIbM5qs

Console log (if applicable)

←[94m[2017-03-13 21:53:18] Focus on KanColle!←[0m
[log] App.focus:  [1608:KC3]
←[92m[2017-03-13 21:53:26] At Home!←[0m
←[94m[2017-03-13 21:53:26] Checking for returning expeditions!←[0m
←[94m[2017-03-13 21:53:26] Are there returning expeditions to receive?←[0m
←[94m[2017-03-13 21:53:27] No, no fleets to receive!←[0m
←[94m[2017-03-13 21:53:28] Navigating to repair screen with 0 sidestep(s)!←[0m
[log] CLICK on L(235,436)@S(0)[0,0 1600x900] (551 msec)
←[94m[2017-03-13 21:53:35] Attempting to conduct repairs on 1 ship(s)!←[0m
←[94m[2017-03-13 21:53:35] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(305,250)@S(0)[0,0 1600x900] (571 msec)
←[94m[2017-03-13 21:53:38] Check for critically damaged ships.←[0m
[log] CLICK on L(679,216)@S(0)[0,0 1600x900] (540 msec)
←[92m[2017-03-13 21:53:38] Starting repair on critically damaged ship!←[0m
←[94m[2017-03-13 21:53:40] Got valid timer (00:10:05)!←[0m
←[92m[2017-03-13 21:53:40] Repair should be done at 2017-03-13 22:02:40←[0m
[log] CLICK on L(851,534)@S(0)[0,0 1600x900] (531 msec)
[log] CLICK on L(599,476)@S(0)[0,0 1600x900] (561 msec)
←[94m[2017-03-13 21:53:44] 0 ships needing repairs left...←[0m
←[94m[2017-03-13 21:53:46] Navigating to fleetcomp screen with 0 sidestep(s)!←[0
m
[log] CLICK on L(151,235)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-13 21:53:50] Found ship that is under repair!←[0m
[log] CLICK on L(779,528)@S(0)[0,0 1600x900] (551 msec)
[log] CLICK on L(513,425)@S(0)[0,0 1600x900] (551 msec)
←[94m[2017-03-13 21:53:57] No ships critically damaged at the moment. Continuing
...←[0m
←[93m[2017-03-13 21:53:57] Not all ships under repairs are submarines, or not al
l submarines could not be swapped out! Waiting for repairs!←[0m
←[94m[2017-03-13 21:53:57] Lets resupply fleets!←[0m
←[94m[2017-03-13 21:54:00] Navigating to resupply screen with 0 sidestep(s)!←[0m

[log] CLICK on L(126,277)@S(0)[0,0 1600x900] (541 msec)
[log] CLICK on L(235,208)@S(0)[0,0 1600x900] (530 msec)
←[92m[2017-03-13 21:54:05] Done resupplying!←[0m
←[94m[2017-03-13 21:54:05] Focus on KanColle!←[0m
[log] App.focus:  [1608:KC3]
←[94m[2017-03-13 21:54:16] Going home with 0 or less sidestep(s)!←[0m
[log] CLICK on L(193,310)@S(0)[0,0 1600x900] (561 msec)
←[92m[2017-03-13 21:54:20] At Home!←[0m
←[94m[2017-03-13 21:54:20] Are there returning expeditions to receive?←[0m
←[94m[2017-03-13 21:54:21] No, no fleets to receive!←[0m
←[92m[2017-03-13 21:54:21] Next sortie!: 2017-03-13 22:02:40←[0m
←[92m[2017-03-13 21:54:21] -----←[0m
←[92m[2017-03-13 21:54:21] Next expedition at 2017-03-13 22:28:42 (~5 expedition
s conducted)←[0m
←[92m[2017-03-13 21:54:21] Next sortie at 2017-03-13 22:02:40 (~21 sorties condu
cted)←[0m
←[92m[2017-03-13 21:54:21] Next scheduled sleep at 2017-03-14 00:59:00←[0m

Relevant config snippet (if applicable)

###################################################################################################
# ========================================= IMPORTANT!! ========================================= #
# Please read config_detailed.ini or the wiki pages for guidance on setting up this file!         #
#   If kancolle-auto is configured improperly you increase the chance of losing ships or getting  #
#   banned for botting!                                                                           #
#                                                                                                 #
# Detailed explanation of config file:                                                            #
#   https://github.com/mrmin123/kancolle-auto/wiki/Setup-config.ini                               #
# Example configs:                                                                                #
#   https://github.com/mrmin123/kancolle-auto/wiki/Example-configs                                #
#   https://github.com/mrmin123/kancolle-auto/wiki/Event-configs                                  #
###################################################################################################

[General]
Program = KC3
RecoveryMethod = KC3
BasicRecovery = True
JSTOffset = 0
SleepCycle = 1
Paranoia = 0
SleepModifier = 0

[ScheduledSleep]
Enabled = True
StartTime = 0030
SleepLength = 3.5

[ScheduledStop]
Enabled = False
Mode = time
Count = 5

[Expeditions]
Enabled = True
Fleet2 = 5
Fleet3 = 21
Fleet4 = 38

[PvP]
Enabled = False
FleetComp = 1

[Combat]
Enabled = True
FleetComp = 1
Area = 3
Subarea = 2
CombinedFleet = False
Nodes = 1
NodeSelects =
Formations = line_ahead
NightBattles = False
RetreatLimit = 2
RepairLimit = 1
RepairTimeLimit = 0030
CheckFatigue = False
PortCheck = False
MedalStop = False
LastNodePush = False

[SubmarineSwitch]
Enabled = True
EnabledSubs = maruyu, i-26, i-8, i-58, i-19
ReplaceLimit = 
FatigueSwitch = False

[LBAS]
Enabled = False
EnabledGroups =
Group1Nodes =
Group2Nodes =
Group3Nodes =

[Quests]
Enabled = False
Quests = bd1, bd2, bd3, bd4, bd5, bd6, bd7, bd8, bw1, bw2, bw3, bw4, bw5, bw6, bw7, bw8, bw9, bw10, c2, c3, c4, c8, d2, d3, d4, d9, d11, e3, e4
CheckSchedule = 5
R-Jimenez commented 7 years ago

What sub(s) are in the fleet that you're trying to switch out? What equipment do they have?

usagi123 commented 7 years ago

I am trying to switch damaged maruyu from the fleet, repair her and use other subs to constantly grinding 3-2.

R-Jimenez commented 7 years ago

Hrm. Maruyu shouldn't have any equipment to worry about. Try the new code pushed today and the new config settings: https://github.com/mrmin123/kancolle-auto/issues/334

Sub switching has been going through a lot of work and bugfixing for a couple weeks. Hopefully this clears things up, but there might always be some more edge-cases. God speed ttk.

waicool20 commented 7 years ago

Try the script without the VM environment, afaik there have always been some problems on VM setups.

mrmin123 commented 7 years ago

@comtrends123 please try the latest release and report back

usagi123 commented 7 years ago

@waicool20 I'll try.

@mrmin123 I am running this latest release and new issue happened caused me cannot tested the sub switching function. They detecting the wrong damaged ship from light-damaged into moderately-damaged and looping in the dock all the time. Video: https://youtu.be/NGGZJfWLO5Q

Console log

[←[92m[2017-03-14 11:04:58] At Home!←[0m
←[94m[2017-03-14 11:04:58] Checking for returning expeditions!←[0m
←[94m[2017-03-14 11:04:58] Are there returning expeditions to receive?←[0m
←[94m[2017-03-14 11:04:59] No, no fleets to receive!←[0m
←[94m[2017-03-14 11:05:00] Refreshing home with 0 or less sidestep(s)!←[0m
[log] CLICK on L(220,299)@S(0)[0,0 1600x900] (561 msec)
[log] CLICK on L(189,325)@S(0)[0,0 1600x900] (561 msec)
←[94m[2017-03-14 11:05:06] Are there returning expeditions to receive?←[0m
←[94m[2017-03-14 11:05:07] No, no fleets to receive!←[0m
←[94m[2017-03-14 11:05:08] Navigating to combat menu with 0 sidestep(s)!←[0m
[log] CLICK on L(348,358)@S(0)[0,0 1600x900] (560 msec)
[log] CLICK on L(437,387)@S(0)[0,0 1600x900] (531 msec)
[log] CLICK on L(420,532)@S(0)[0,0 1600x900] (531 msec)
[log] CLICK on L(776,267)@S(0)[0,0 1600x900] (531 msec)
[log] CLICK on L(762,536)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:05:29] Checking fleet condition...←[0m
←[94m[2017-03-14 11:05:30] Light damage: 1; moderate damage: 1; critical damage:
 0←[0m
←[93m[2017-03-14 11:05:33] Ships (1) in condition below repair threshold! Sortie
 cancelled!←[0m
←[94m[2017-03-14 11:05:34] Focus on KanColle!←[0m
[log] App.focus:  [1852:Chrome]
←[94m[2017-03-14 11:05:43] Going home with 0 or less sidestep(s)!←[0m
[log] CLICK on L(183,315)@S(0)[0,0 1600x900] (541 msec)
←[92m[2017-03-14 11:05:49] At Home!←[0m
←[94m[2017-03-14 11:05:49] Are there returning expeditions to receive?←[0m
←[94m[2017-03-14 11:05:50] No, no fleets to receive!←[0m
←[94m[2017-03-14 11:05:51] Navigating to repair screen with 0 sidestep(s)!←[0m
[log] CLICK on L(210,413)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:05:56] Attempting to conduct repairs on 1 ship(s)!←[0m
←[94m[2017-03-14 11:05:56] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(317,264)@S(0)[0,0 1600x900] (551 msec)
←[94m[2017-03-14 11:05:58] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:05:59] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:06:01] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:06:01] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(398,250)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:06:02] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:06:03] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:06:04] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:06:04] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(416,398)@S(0)[0,0 1600x900] (541 msec)
←[94m[2017-03-14 11:06:07] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:06:08] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:06:09] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:06:09] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(308,242)@S(0)[0,0 1600x900] (561 msec)
...
truncated
...
←[94m[2017-03-14 11:09:06] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:07] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:09] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:09] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(385,238)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:09:12] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:13] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:14] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:14] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(407,423)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:09:17] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:18] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:19] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:19] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(294,253)@S(0)[0,0 1600x900] (531 msec)
←[94m[2017-03-14 11:09:22] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:23] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:24] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:24] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(322,413)@S(0)[0,0 1600x900] (550 msec)
←[94m[2017-03-14 11:09:26] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:27] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:28] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:28] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(349,247)@S(0)[0,0 1600x900] (541 msec)
←[94m[2017-03-14 11:09:31] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:32] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:34] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:34] Available docks: 3; repair queue: 1←[0m
[error] RobotDesktop: checkMousePosition: should be L(392,416)@S(0)[0,0 1600x900
]
but after move is L(579,304)@S(0)[0,0 1600x900]
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin.
[log] CLICK on L(392,416)@S(0)[0,0 1600x900] (541 msec)
←[94m[2017-03-14 11:09:37] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:38] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:39] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:39] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(311,402)@S(0)[0,0 1600x900] (551 msec)
←[94m[2017-03-14 11:09:42] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:43] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:44] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:44] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(450,253)@S(0)[0,0 1600x900] (521 msec)
←[94m[2017-03-14 11:09:46] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:47] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:48] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:48] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(366,246)@S(0)[0,0 1600x900] (520 msec)
←[94m[2017-03-14 11:09:51] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:52] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:53] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:53] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(297,431)@S(0)[0,0 1600x900] (541 msec)
←[94m[2017-03-14 11:09:55] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:09:56] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:09:57] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:09:57] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(291,425)@S(0)[0,0 1600x900] (590 msec)
←[94m[2017-03-14 11:10:00] Check for critically damaged ships.←[0m
←[94m[2017-03-14 11:10:01] Check for moderately-damaged ships.←[0m
←[94m[2017-03-14 11:10:02] 1 ships needing repairs left...←[0m
←[94m[2017-03-14 11:10:02] Available docks: 3; repair queue: 1←[0m
[log] CLICK on L(386,233)@S(0)[0,0 1600x900] (541 msec)
←[94m[2017-03-14 11:10:04] Check for critically damaged ships.←[0m
]
mrmin123 commented 7 years ago

I strongly suggest that this might be a VM issue. The 0.7 threshold for damages have not caused issues previously in my testing and production environments. As a matter of fact, raising the threshold caused many false negatives, but it might be what's required here.

  1. Open the pre-sortie screen in kancolle so that it shows a lightly and/or moderately and/or critically damaged ship.
  2. Uncomment/modify line 537 in kancolle-auto.py to this:
debug_find('dmg_moderate.png', 'Chrome', 0.7)
  1. Run kancolle-auto, and observe it as it goes through the matches it sees on-screen.
  2. Tweak the threshold (0.7 in the above example) until it matches only the moderately damaged ship.
  3. Repeat steps 2~4 with dmg_light.png
  4. Repeat steps 2~4 with dmg_critical.png
  5. Once you have a threshold that satisfies all damage states, modify line 11 in combat.py with your threshold:
DMG_SIMILARITY = 0.7  # Damage state icons

Again, I want to note that raising the threshold has caused false negatives for me (ie. ships that were critically damaged were NOT correctly identified as being critically damaged). As such, if you do modify the threshold, I'd watch it for a bit to make sure that the damage count outputs in the console are correct as kancolle-auto runs, and be ready to shut down kancolle-auto the moment it incorrectly ascertains the damage counts.

And if that doesn't work, ditch the VM.

(PS If you do go with the modifying threshold route, I'd be interested in knowing what value you end up with)

usagi123 commented 7 years ago

0.7 seem fine to me. Light, moderate or critical dmg are all matched. The result: http://imgur.com/a/jaGpK So it should be the problem of my VM. Wait me setup a new VM.

perryhuynh commented 7 years ago

Adding to this, I started encountering issues with VMWare Workstation 12 Pro 12.5.2 build-4638234, but did not have any issues after switching to Oracle VM VirtualBox as per #256

usagi123 commented 7 years ago

Everything work perfectly after running on new VM. Hope I won't mess VM this time, haha. Thanks everyone for the help! Much appreciated.

@perryhuynh my problem with Oracle VM is that it caused a huge suttering although I already give them twice the cpu and ram for it compared to VMware to run.