-
Notifications
You must be signed in to change notification settings - Fork 22
Asset generation guide
All image assets should be generated and saved as PNG-24 lossless.
In general, when kancolle-auto finds a match on-screen, it is designed to click in a random (x,y) coordinate within the match itself. This means that if you generate an image for kancolle-auto to match and click on, the entirety of that image must be clickable in-game. Any portion of the generated image that does not act as a clickable location in-game will lead to sporadic failures downstream. This is obviously not an issue if you are image matching just for the presence of a match, not to interact with it.
Examples:
Good | Bad (w/ caveat) |
---|---|
Every part of this image is a button in-game | Only the center circle of this image is a valid button in-game! As-is, this is unusable! |
The caveat for the above bad example is that we would specify a smaller valid clickzone for this image within kancolle-auto (see below).
In general, expedition item assets should be 340px wide and 25px tall. Alignment becomes a bit arbitrary due to the nature of the fonts used, so it is recommended that new assets be aligned to previously generated assets with similar numbers/ranks.
The Event-specific expedition assets are a bit different as they do not contain the expedition # in the image since the expedition # changes every Event.
Examples:
ensei_name_06.png |
ensei_name_38.png |
Expedition 6 | Expedition 38 |
Images should be named using the following nomenclature and placed in the expedition.sikuli
folder:
-
ensei_name_[expedition #, 0-padded to 2 digits].png
- Examples:
ensei_name_06.png
,ensei_name_38.png
- Examples:
The 'sortie panel' is the big image/panel you press to select which world or Event you'd like sortie to. When generating these images the primary thing to keep in mind is how the sortie panel could change as the player progresses through the level:
- Is there a TP/HP bar? This would disappear once the level is cleared and its display is variable as the player progresses through the map, thus the area where the TP/HP bar is should be excluded for maximum compatibility.
- Once the level is cleared, where would the S-rank medal go? The medals are variable and the S-rank medal is the largest, thus the area where the S-rank medal appears should be excluded for maximum compatibility.
- When EOs are opened up, where does the EO arrows cover up the panel? Clicking on the EO arrows is different from clicking on the panel itself, thus any area where the EO arrows will appear should be excluded.
- Does LBAS availability change over the course of the level? If LBAS availability changing is a known occurrence on the leevl, the LBAS banner location should be excluded.
Taking all of the above into consideration, this generally means that the horizontally the center 1/3 or 1/4, and vertically the bottom 1/2 of the panel images are the areas where these sortie panel assets will be derived from.
Examples:
_event_panel_1-4.png |
_event_panel_2-1.png |
_event_panel_1-2.png |
1-4 (E-4) | 2-1 (E-4) | 1-2 (E-2) |
Images should be named using the following nomenclature and placed in the combat.sikuli
folder:
- Standard worlds:
combat_panel_[world#]-[map# in world].png
- Examples:
combat_panel_1-6.png
,combat_panel_2-3.png
- Examples:
- Event worlds:
_event_panel_[event screen#]-[map# in screen].png
- Examples:
_event_panel_1-4.png
,combat_panel_2-1.png
- Note that if the panel is for E-6, but the first screen had E-1 ~ E-3, the second screen has E-4 ~ E-5, and the third screen has E-6, the image should be named
_event_panel_3-1.png
as it is the third screen (3)'s first panel (1).
- Examples:
When clicking on nodes, whether it is for node selection or LBAS assignment, kancolle-auto is designed to click on the center 10px by 10px area of the matched area. Programmatically, it means that the click location is randomly generated from the area that extends 5px up, 5px right, 5px down, and 5px left from the center pixel of the matched area.
The generated asset itself should be 70px by 70px large. The extra padding is provided so that kancolle-auto can select the right node based off of the node's surroundings.
For node selection images, the screenshot should be captured when the blue radiating ring is at its smallest possible or not visible. Any incidental graphics such as the fleet icon's speech bubble should also be captured. Circular nodes should be in the complete center, 25px from every edge. Air battle nodes are more difficult to align, so they should be aligned to the most recent previous Event's assets.
Examples:
_node_E-2-E.png |
_node_E-3-V.png |
_node_E-2-K.png |
Aligned circular node | Aligned air battle node | Not aligned, but showing incidental graphics |
Images should be named using the following nomenclature and placed in the combat.sikuli
folder:
- Standard worlds:
node_[world#]-[map# in world]-[node].png
- Examples:
node_4-5-C.png
,node_4-5-E.png
- Examples:
- Event worlds:
_node_E-[event map#]-[node][_cleared].png
- Examples:
_node_E-2-E.png
,_node_E-3-V.png
- Examples:
For LBAS assignment images, two assets should be created: one with no reticle on it, and another with the first reticle on it. Nodes should be aligned just like node select assets. Boss nodes, like air battle nodes, should be aligned off to the most recent previous Event's assets.
Examples:
_node_lbas_E-1-I_1.png |
_node_lbas_E-1-I_2.png |
_node_lbas_E-1-I_1_cleared.png |
_node_lbas_E-1-I_2_cleared.png |
_node_lbas_E-2-M_1.png |
_node_lbas_E-2-M_2.png |
Aligned node with no LBAS assignment | Aligned node with first LBAS assignment | Same node, post-clear, with no LBAS assignment | Same node, post-clear, with first LBAS assignment | Aligned boss node with no LBAS assignment | Aligned boss node with first LBAS assignment |
Images should be named using the following nomenclature and placed in the combat.sikuli
folder:
- Standard worlds:
node_lbas_[world#]-[map# in world]-[node][_1/_2].png
- Examples:
node_lbas_6-4-N_1.png
,node_lbas_6-4-N_2.png
- Examples:
- Event worlds:
_node_lbas_E-[event map#]-[node][_cleared][_1/_2].png
- Examples:
_node_lbas_E-1-I_1.png
,_node_lbas_E-1-I_cleared_2.png
- Examples:
In general, submarine list assets should be 145px wide and 14px tall. The first character of the ship class text should be 30px from the left edge of the image, and the bottom of the ship class text should be right at the bottom of the image.
The empty space to the right of the end of the submarine name should be retained in the image unless the submarine's non-Kai and Kai variants are of the same variant, such as I-13 (non-Kai and Kai both SSVs) and I-168 (non-Kai and Kai both SSs). For these the image should be cropped starting 1px right of the non-Kai'ed name.
Examples:
fleetcomp_shiplist_submarine_i-26.png |
fleetcomp_shiplist_submarine_i-19-kai.png |
fleetcomp_shiplist_submarine_i-168.png |
I-26 (SS) | I-19-Kai (SSV) | I-168 (non-Kai and Kai both SS; note right-crop) |
Images should be named using the following nomenclature and placed in the combat.sikuli
folder:
-
fleetcomp_shiplist_submarine_[sub name].png
- Examples:
fleetcomp_shiplist_submarine_i-26.png
,fleetcomp_shiplist_submarine_i-19-kai.png
- Examples:
Sometimes it is very useful to test if your image and similarity settings work properly (similarity % needs to be low enough to match under different conditions, but high enough to not return false matches). Enter the debug_find()
global function. This function can be used by un-commenting the call to it in kancolle_auto.py
:
# initialize kancolle_auto
# debug_find('dmg_critical.png', 'Chrome', 0.75) # For debugging purposes only!
while True:
to
# initialize kancolle_auto
debug_find('dmg_critical.png', 'Chrome', 0.75) # For debugging purposes only!
while True:
The three arguments to debug_find()
are:
- The full image asset name, including file extension, that you want to test
- The name of the browser/program you have Kantai Collection running in
- (Optional; defaults to kancolle-auto's default of
0.8
) Custom similarity %
Use this function by modifying the call as needed then running kancolle-auto as normal with your Kantai Collection game screen displaying the screen you want to test matches against. debug_find()
will loop through all matches with the specified parameters, print their location, dimensions, and match % on the console, and move the mouse over every match, before exiting. If there are no matches found, it will report that no matches were found before exiting.
Sample function call:
debug_find('fleetcomp_shiplist_submarine_i-8.png', 'Chrome', 0.95)
Sample output:
[log] App.focus: [2160:Chrome]
+ Sikuli match object for 'fleetcomp_shiplist_submarine_i-8.png' in window 'Chrome'
+ with minimum similarity of 0.95:
M[374,382 155x14]@S(S(0)[0,0 1600x900]) S:1.00 C:451,389 [-1 msec]
M[374,354 155x14]@S(S(0)[0,0 1600x900]) S:1.00 C:451,361 [-1 msec]
M[374,326 155x14]@S(S(0)[0,0 1600x900]) S:1.00 C:451,333 [-1 msec]
M[374,298 155x14]@S(S(0)[0,0 1600x900]) S:0.99 C:451,305 [-1 msec]
[info] Exit code: 0