Closed R-Jimenez closed 7 years ago
The repair module has been monkey patched to death already XD I would consider a rewrite to make things for efficient/future-proof at this point.
That aside I also propose that when submarine switch is enabled, try to repair as many ships as possible. As I find that even with 3 open slots, the script only repairs the x no of damage ships calculated from the last sortie. It will be very useful for 3-2 leveling to make sure that a fresh supply of subs keeps on rolling. Otherwise the sortie per hour rate starts to drop the longer the script runs :/
The repair module is like good ork ship. It works pretty well despite being patched together with tape and well-wishes.
I agree with the idea of repairing as many ships as possible, but find that (at least with 3-2), after ten or fifteen minutes of constant sorties I've already got full docks, so the benefit would likely be minimal. I'd also be more concerned with filling up docks with less important ships, but this issue seeks to remedy that, so perhaps this is another avenue to pursue.
I think the general script flow is actually just fine given how it doesn't use any sort of caching, but there is always something you can speed up a bit.
Well what I meant was, usually since the docks are full, it can't repair immediately and the backlog just increases, kc-auto doesn't keep track of this backlog, so it ends up not repairing the remaining ships even when the docks are freed the next time it checks. Plus i think a dedicated repair only mode would be nice too :)
Definitely. I think modifying the repair check to be a maximization of repair dock usage as opposed to a minimization is a worthwhile change, so that when a repair is triggered, it goes ahead like you said and fills the docks. The concern would be blocking with subs and having to waste a bucket if needed, but if I modify the original rule to be that a sub can never use the last repair dock if a bucket is denied, then in essence the last dock a user has open is a bucket-only dock, like a VIP route.
So the theoretical design decision here is whether we want to fill all four slots with unbucketed repairs, and potentially waste buckets on those ships in order to clear the way for actual ships that need the repairs OR maintain a reserved bucket slot so that a ship that is denied a bucket for time or class reasons is never bucketed. I feel like the main scenario where this comes up is in training fleets (like 3-2), where the vast majority of repairs are going to be subs, and so having maximum active repair docks is more important. But really, we could do both and just lump this all together under an "AggressiveRepair" or "ReserveDock" option.
Care to explain what you mean by a "dedicated repair only mode"?
Sometimes you just got a huge backlog of ships and you don't really want to sortie thatll just increase it...so a repair only mode where it repairs ships until the backlog is gone while perhaps doing expeditions? would be nice.
Btw care to join this kancolle-auto discord server? I feel like mrminn should add this on the Readme so we can have more free discussions and easier support
Closing this since it was taken care of in another PR.
Had an idea for an enhancement of the repair system in the condition that the docks are full.
Currently, if the docks are full the system jots down the time and comes back later, going into subswitch if enabled. However, if you have a ship that needs repairs and would have used a bucket, you're blocked from doing so if smaller ships or subs are in the way. I know the repair time is supposed to be your tolerance for having the script waiting, but with the new submarine bucket use flag I have my docks filled with tank subs and if any of my training fleet gets hit and needs to be repaired, I'm blocked. So, two solutions as I see it:
Always have one dock open. Pretty simple solution, and one I think is shockingly effective. If you're blocked from a repair and want to bucket a ship to continue sorties, you'll have to bucket a slot open anyways. Making it so that any repair done while empty_docks = 1 is a bucket repair ensures there is always one dock open.
Bucket open a used slot if the ship being repaired would use a bucket. Follows number one, but moves the freeing step down the logic into the repair to be. While it follows logically on paper, given how the repair system actually flows this would be real tricky to code up, and would result in the same end-result/bucket use as the first option above.
So yeah. Now that I've got a grasp on the workflow (especially vis-a-vis the repair module), I've just been playing around with a few ideas I could contribute to the project. This could be just another config the user could toggle if they wanted some more sortie uptime, or perhaps this is just regular behavior if bucket use is enabled at all (if the script needs to use a bucket for any reason, it's natural to make sure it can do so when called upon).