Skip to content

Add searching phase to fleet view#615

Merged
myangelkamikaze merged 2 commits intomainfrom
AddSearchingPhaseToFleetView
Nov 29, 2025
Merged

Add searching phase to fleet view#615
myangelkamikaze merged 2 commits intomainfrom
AddSearchingPhaseToFleetView

Conversation

@myangelkamikaze
Copy link
Member

@myangelkamikaze myangelkamikaze commented Nov 29, 2025

The primary goal here is to display the BattleSearchValues.NotFound (kancolle kai) DetectionType.FailureNoPlane (EO) rate, which is useful in combined fleet leveling because it skips part of the searching animation, also known as "search cutting" (索敵カット).
Example:
https://twitter.com/kamekeshi/status/1994619727457783928

There's no good documentation for this anywhere. Wikiwiki doesn't have any numbers and the English wiki is written in a confusing way, is missing some details, and I'm not sure if their formula is correct either. Luckily, they included the source this time, which is kancolle kai source code, so I just copied everything from there.

Here is the main logic for getting the search result.
The main formula to note here is num1.
randDouble and num2 are used for calculating how many recons got shot down. We're not handling that, so those can be ignored.

protected BattleSearchValues execSearch(SakutekiInfo atk_info, SakutekiInfo def_info)
{
	double randDouble = Utils.GetRandDouble(1.0, 1.4, 0.1, 1);
	int key = atk_info.LostTargetOnslot.Count<KeyValuePair<Mem_ship, List<int>>>();
	int num1 = atk_info.BasePow + this.valanceShipCount[key] - this.valance1 + (int)Math.Sqrt((double)atk_info.Attack * 10.0);
	int num2 = atk_info.Attack - (int)((double)def_info.Def * randDouble);
	int num3 = this.randInstance.Next(20);
	return atk_info.Attack == 0 ? (num1 > num3 ? BattleSearchValues.Found : BattleSearchValues.NotFound) : (num1 > num3 ? (num2 > 0 ? BattleSearchValues.Success : BattleSearchValues.Success_Lost) : (num2 > 0 ? BattleSearchValues.Lost : BattleSearchValues.Faile));
}

This part is for calculating the BasePow and Attack from the main formula. It basically just gets the LoS from all boats and aircraft count from all recons. Added comments for the important parts but feel free to ask if I missed anything.
image

The aircraft proficiency code looks wrong. slotExp should be the internal aircraft level exp (0~120). The if statements look like they were meant to compare to slotExp but instead compare to alvPlus which doesn't make any sense since that one can at most be sqrt(120*0.2) which is 4.89897948557 so you never hit any of the ifs? I kept the code as is since this part isn't really relevant. We count probably figure it out via testing but that's a todo for the future.
image

Note: fail rate is capped at 100% and success rate doesn't have a cap, this is intentional so that you know how far over success cap you are when you're trying to search cut

@sonarqubecloud
Copy link

@myangelkamikaze myangelkamikaze merged commit 0975a8b into main Nov 29, 2025
3 checks passed
@myangelkamikaze myangelkamikaze deleted the AddSearchingPhaseToFleetView branch November 29, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants