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

Fleet preset with equipment preset from Noro6 #97

Closed XVs32 closed 1 month ago

XVs32 commented 4 months ago

What

How

  1. Load current fleet 1's ship and equipment only
  2. Name the file with <map>-<quest>, save in fleet_preset.json
  3. In fleet_switcher_core.py, detect whether fleet needs equipment reset

Result

Reference

XVs32 commented 3 months ago

OK... I found the noro6 simulator can help managing equipment and fleet for specific map Including Event map

Now this is interesting

the use case of customizing fleet and equipment preset could be config in noro6 then user can output the config from noro6 Kcauto reads the config and load the fleet, equipment, and sortie for you

that way users don't have to play with the config file, getting ship ids themselves anymore this could be a game changer

XVs32 commented 3 months ago

There are two problems at the moment...

  1. Both noro6 and kc3 simulator don't care the production no. of equipments, technically it is still possible for kcauto to find a equipment with only it's type id and level, those that's some works to do
  2. For kc3 simulator, it doesn't shows the ships and equipment the player has, you just mix whatever is available in the game, that's kinda hard to manage. noro6, however, shows what ships and equipments the player has, which is great. Tho It can't output all the config files all at one, so user will have to output the config one by one themselves, it's not good, but still way better then kc3 simulator.

I am going to slove the #.1 first, the #.2 .... maybe I can write a script to pull it or I will need to somehow decode the backup file provided from noro6...

XVs32 commented 3 months ago

This is about the 3rd time I am changing plan... I mean, everytime it is getting easier to make and use so it's all good but... LOL, I don't have the time to have a new plan every week, I really have to think this through

XVs32 commented 3 months ago

I was thinking...

It is kinda difficult to keep both old ship pool system and noro6 system together

Since ship pool system does not care about ship equipment and noro6 will reload(mess up other's) equipment set

I might... I mean, I will, drop the old ship pool system since noro6 has a gui to manage the fleet and it can handle equipment

XVs32 commented 3 months ago

For expedition though.... It is not one expedition a time but 3

I can have config for every single combination of exps (ex. 5, 6, 7 and 5, 34, 35) might use difference ships for exp 5

The old ship pool system works better here...

XVs32 commented 3 months ago

hmmmmmmm.........

Will need to keep the ship pool then At least for expedition

the equipment handling ability brings new possibility tho For example, I could now have ppl throw in random ships into expedition pool, and auto detect who has the dump or landing craft

XVs32 commented 2 months ago

the latest WIP can read noro6 config to load equipment and ship already, great news

Now I have to decide how to manage all those noro6 files I mean.. how to use these noro6 configs For example, do I keep a single file for expedition?

There are three issues here:

  1. What to do with maps don't have noro6 config? <= exception, stop kcauto for now
  2. What to do with auto expedition? <= Let ppl setup a noro6 for expedition ship pool, I will have to read the ships inside, judge if it can carry LC and drum, then decide which ship to use
  3. What to do with combat expedition? <= ppl has to setup specific noro6 config for this, I will have to decide which expedition is consider as a combat expedition
XVs32 commented 2 months ago

Let's work on all my combat noro6 config first....

XVs32 commented 2 months ago

holy sweet jesus, I found the decompress function in noro6 https://github.com/noro6/kc-web/blob/ec6359baedfb551c89a86c8347912ff716bc3d36/src/App.vue#L1656

Then I found the python version https://github.com/marcel-dancak/lz-string-python/tree/master

Now I can decompress the data from noro6 backup file Don't have to press the share button and copy the json one by one anymore!

kevin01523 commented 2 months ago

the lightbulb moment per post is amazing lmao

XVs32 commented 2 months ago

The work flow from read a noro6 backup file => load the equipment and ships => finish a manual selected sortie is done, sure there are some minor bugs to fix but the prove of concept is a success

next I will have to:

  1. Fix the equipment unload issue <= fixed
  2. Fix the equipment only reload issue
  3. Fix the broken Sortie mode: Auto <= not as bad as I thought, fixed too
  4. Start planning how on earth I am going to put noro6 and expedition together
XVs32 commented 2 months ago

For expedition....

I could simply exclude ships in any noro6 sortie config (starts with "B") All the left overs can be part of the expedition pool

Then I can read the api_mst_equip_ship :特殊装備 and api_equip_type :装備可能カテゴリのフラグ to determine if the ship is capable to carry LC

XVs32 commented 2 months ago

Get the remaining ships is not that difficult now it's time to separate these ships by ship type and LC carry capability

XVs32 commented 2 months ago

Wait a sec... User won't update noro6 every time they get a ship, especially not for those common ships Let's ignore ships which... let's say, under level 5

XVs32 commented 2 months ago

Next thing, what should the data structure looks like...?

First, it has to be base on ship type, that's the most important part but then, what to do with LC and drum capability?

Let's.....have two arrays(one for LC and one for drum), sort by:

  1. ship type, ship type which has most ships come first. For example, with 10DD, 3SS, 1AV and 5CL, DD comes first, CL is the next, then SS, AV
  2. LC/drum max carry count

This way Expedition module can simply go through the array to pick a ship with less conflict chance between fleets

There has to be some kind of greedy algorithm to solve this though.... Do I spend my time for it? that sounds cool....

XVs32 commented 1 month ago

Separate exp ships with ship type is done and I think of one thing I could use the heart "lock" as a flag If a ship doesn't have a "lock" She is not qualify as a exp member

XVs32 commented 1 month ago

I can sort the exp ships with max fuel + max ammo This can shows which ship cost less resources for exp

XVs32 commented 1 month ago

Looks good, I have the exp ships for each ship type sort by fuel/ammo cost (and level ) now

Next thing is to check if a ship is able to carry drum or LC

XVs32 commented 1 month ago

The current assign_exp_ship logic is placed in fleet_switcher_core, let's move it to fleet_core too

XVs32 commented 1 month ago

Rebuilding the assign_exp_ship function in fleet_switcher_core, am able to pass the ship requirement and exp_ship_pool to the function now

Next will be adding check if ship can carry LC or drum in ship core

XVs32 commented 1 month ago

Am able to assign ship and equipment now two bugs to solves:

  1. exp 37 is assigning 5 ships only, which should be 6
  2. lc and dc has to be optimize, or I won't have enough ships to load both lc and dc in a exp fleet
XVs32 commented 1 month ago

successfully obtained the exp id, ship id and equipment id using auto exp assign next thing is to send to data to ship and equipment swticher

XVs32 commented 1 month ago

HAHAHAHAHAHHAAAAAA ITS WORKINGGGGGGG

well there are still minor bugs

but it's WORKINGGGGGGGGGGGGGGGGG

XVs32 commented 1 month ago

Alright, the integrate of auto sortie and expedition is going well The test run looks ok, here are some issues:

  1. I did see some sortie/exp not having the correct fleet, probably due to fleet switch double check not working as expect, the fleet switch module has changed a lot in this branch tho, so let's see if this issue appear again
  2. kcauto_custom seem to be switching between different quest a lot, which brings a lot of equipment & ship switch, which takes up time

There are some optimizations needed to be done:

  1. The equipment switch system is worked base on equipment production id, which means, it might make a ship switch to another equipment, even if it is the same equipment(product) with the same level, which is kinda silly and time wasting
  2. This is not a kcauto issue tho, but maybe I would want to make use of ship copy in noro6 to minimize the equipment difference of the same ship between difference maps, in order to minimize equipment switch needed

After all the above are done, I would want to implement the PvP with noro6 config, then I am finally done with this branch

XVs32 commented 1 month ago

Found a new issue, kcauto_custom tries to access fleets which are still on expedition The solution is simple, skip expedition until all exp fleets are back

XVs32 commented 1 month ago

Test runs these days are working well I will slowing work toward noro6 config PvP, then this branch can finally close and merge into develop