Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Long Plan: Fleet Renumbering #22

Open
Vectorial1024 opened this issue May 11, 2020 · 7 comments
Open

The Long Plan: Fleet Renumbering #22

Vectorial1024 opened this issue May 11, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@Vectorial1024
Copy link
Owner

Note: not having this feature won't break the mod, so no need to rush this. But perhaps this will be interesting for users. If you are bored, perhaps think about this.

Problem Statement
People die if they are killed. It's the same for ships. In the base game, whenever a fleet leader dies, a certain fleet member will be promoted to the commander post. This is no problem in normal situations.

However, there is a problem with Civilian Fleets. There is a simple data structure in this mod keeping track of which fleet should get which fleet number (1, 2, 3, ...), by having a list of fleet leaders with their assigned fleet number. When the fleet leader dies and leadership is given to another ship, since the new leader is not in the remembered leader list, it would seem to be a new fleet, and the next available fleet number will be given out to the new leader, even though everybody is from the same old fleet.

Proposed solution(s)
A few right-click actions can be introduced:

  • Reassign fleet to smallest available number
  • Reassign fleet to largest available number
  • Swap leader with subordinate with best skill

We can think about the details of these actions in the long time ahead.

@Vectorial1024 Vectorial1024 added the enhancement New feature or request label May 11, 2020
@FormBurden
Copy link

Hmmm, this reminds me of JanPanthera (JP) mods, where he has a fleet re-name and re-numbering mods. I've tried them out, but they seem SO complicated with the amount of features the mod can do. All I want to do for re-naming, is have the base-name (whatever the ship I named), and as the fleet gets put together, maybe everyone getting a number named after them. E.g. Miner (which is Leader), then Miner-1, Miner-2, etc., for the Subordinates. Possibly a structured naming scheme if the ship is Large (L), Medium (M), Small (S). With the number.

Essentially something simple. Not sure if you've used his re-naming/re-numbering mods, but they're incredibly complicated and don't really explain how to get it the way you want it. You need to experiment, which I did, and yet I couldn't get something as simple as the above example.

This could possibly happen with your auto-naming for fleet.

@Vectorial1024
Copy link
Owner Author

To clarify, I am thinking of the "Civilian XX YY" fleet renumbering.

It happens to me sometimes. For example, I have "Civilian 1 Trading Fleet" doing their job. Suddenly, because of increased pirate//Xenon activity, the leader died. Eventually, the mod would rename the fleet to "Civilian 6 Trading Fleet" because the new leader is not recognized.

What I would like to do is to let player have the option to manually reassign the fleet to a smaller number. Since newer fleets get a higher fleet number anyways, the smaller but unused numbers are most likely available. So e.g. I have this "Reassign fleet to smallest available number", I select the Fleet-6 leader and click on that button, and then the fleet name becomes e.g. "Civilian 1 Trading Fleet".

@FormBurden
Copy link

Ah right, I get what you mean. Yeah, that would be nice. I got to the point of "fleet 56", and I usually have the option turned off of auto-rename since I like to manually re-name them. But yeah, the "fleet 56" type of thing is annoying. Would your solution work if you have the option turned off of auto-renaming the fleets? Such as "Civilian 6 Trading Fleet". And would be if Fleet 5 is taken (yet their is Fleet 8 already), it would name it to Fleet 5.

@Vectorial1024
Copy link
Owner Author

Credits to Steam user Alewx for inspiring me with this solution:

I make a global list of ship-to-fleet pairings that looks like

Ship ID ABC123 --> Fleet # 1

The fleet number will update whenever order sync occurs, or a reassignment/unassignment occurs. When I want a fleet number I can simply go to that global list and ask "what is the associated fleet number?" and then I will get my fleet number.

Let's take it slow and steady for now.

@Vectorial1024
Copy link
Owner Author

Alright, I got something working locally.

It may not be noticeable at first glance, but now, valid civilian fleets will "remember" their fleet numbers better. Members of Civilian Fleet 1 will forever stay Civilian Fleet 1 unless they got assigned to another Civilian Fleet. "Orphan fleet numbers" (i.e., a fleet that has a number but no members) are still not recycled yet; that is to be left for the future.

Fleet numbers sync from commander to subordinate (fetch-first) when ships dock, the same conditions for order syncing.

Existing auto-gen fleet numbers will be carried over; player-defined fleet names (and thus fleet numbers) are not touched.

Surviving fleet members taking command will retain the original fleet number.

If I implement "set fleet number to smallest unclaimed" and "set fleet number to next unclaimed" and also "set fleet number to largest" then fleet renumbering will be functionally complete (i.e., you can renumber any fleet to any (other) fleet number using those 3 and only 3 functions).

@Vectorial1024
Copy link
Owner Author

Fleet number retention is now out.

What remains would be the several UI buttons to manipulate fleet numbers, and then this can finally be closed.

@Vectorial1024
Copy link
Owner Author

SirNukes Mod Support APIs actually allows us to easily add extra buttons to the right click interaction menu, as demonstrated in my other (WIP) mod Station Logistics.

This means, manipulating fleet numbers should not be too difficult; we just need to add the appropriate buttons and then things should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants