XVs32 / kcauto_custom

kcauto_custom, the successor to kcauto, a Kantai Collection (Kancolle) bot / automation tool
https://xvs32.github.io/kcauto_custom/
GNU General Public License v3.0
9 stars 2 forks source link

Auto expedition fleet algorithm #47

Open XVs32 opened 1 year ago

XVs32 commented 1 year ago

What

How

Result

Reference

XVs32 commented 1 year ago

First, I will list the ship type needed in expedition here

XVs32 commented 1 year ago

In some cases, ship type is replaceable

Fow example, if DD is needed, DD_2_BUCKET or DD_3_BUCKET can also do the job.

Here is all cases I can think of at the moment: DD->DD_2_BUCKET->DD_3_BUCKET, CV->CVL->CVE

XVs32 commented 1 year ago

If a required slot is a free slot (any ship type you want), the priority should be

SS > DE > DD > CL > CT > CA > CVL > CV > BBV > DD_2_BUCKET > DD_3_BUCKET > CVE > AV > AS

The reason being is, SS, DE and DD etc. required less fuel and ammo, and DD_2_BUCKET, DD_3_BUCKET, CVE etc. are too rare to use in a free slot.

XVs32 commented 1 year ago

A expedition fleet preset look up table is needed for the auto expedition fleet to work. For example. 2 free slot is needed for #1 expedition.

Turns out the expedition json file contains the info of ships needed for an expedition, I will just have to decode it.

XVs32 commented 1 year ago

The auto fleet set up process should be something like "fill in the blanks" and kcauto should fill in those rare blanks first (ex. DD_3_BUCKET, AS)

The priority could simply be the reverse from https://github.com/XVs32/kcauto_custom/issues/47#issuecomment-1588991962

A pic a needed to show the process

XVs32 commented 1 year ago

The overview would be something like this:

XVs32 commented 1 year ago

There are many requirements for an expedition:

About flag ship type, the only expedition that specified the flag ship type in expedition 1~40 is expedition 24 北方航路海上護衛, which needs CL as flag ship, luckily, the expedition json does define the "reqComposition" as "1CL,4DD,1XX", so the CL would naturally become the flag ship when kcauto tries to find a ship set for the expedition.

Although, when kcauto tries to handle the flag ship level requirement, it might wants to shift ships around in a fleet, and that is not allowed if the type of flag ship is fixed. That needs further design and attention.

XVs32 commented 1 year ago

The basic version is running, there are still a lot of exception handling and optimization to do, but it is coming together and it can kinda run now.

Here are the things that will need further attention:

  1. What to do if kcauto cannot find a valid fleet to assign from the ship pool. Sol: It should skip the current Expedition and try the next one
  2. Actually handling the wildcard ship type("XX"). Sol: needs to sort the priority of ship type in Expedition
  3. Allow ppl to use not all the fleets for "auto" mode expedition. Sol: But why? Semi auto...?
  4. What if the player does not unlocked all expedition yet? Sol: Get the Expedition list from api
  5. Handle exception when failed to switch a ship? Sol: Freeze the Expedition for 15 mins
  6. Handle level requirement. Sol: Sort the ship list for every ship type base on level
XVs32 commented 1 year ago

Sometimes kcauto does not load the correct fleet for exp, probably cause by fleet data not updating

Edit: Do not see this happening again now

XVs32 commented 10 months ago

First thing first, I will have to find the complete list of Expedition In KC3, the expedition info is build in KanColleHelpers.js But sadly it is not a simple json file, and it is not easy to get info from it

I give up, I will just make it myself, the hrs I put in was enough for me to fill in the list already LOL

XVs32 commented 10 months ago

The full list of expedition is done.

Next step is adding fleet statuses detection(firepower, anti-air etc.) adding available expedition detection

Then theoretically it should work

Although.... for expeditions which has statuses threshold, there is quite a high chance that the threshold can't be meet using the ships in ship pool I might have to set up a system for player to save the fleet and equipment set for each expedition, only when no preset is available, kcauto will attempt to auto assign ships for expedition. This part might have to wait till fleet reset https://github.com/XVs32/kcauto_custom/issues/84 is done

XVs32 commented 1 month ago

A good new here is the Noro6 config for expedition is working now The new plan will become:

  1. For normal expedition, kcauto should detect the flag ship/fleet sum level requirement, and assign a suitable fleet when in auto mode
  2. For combat expedition (ex.D2, D3), user will have to setup their own fleet in noro6, these expeditions are only enabled when combat module is disabled