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

Allow bays to carry multiple categories of ship #9896

Open
Amazinite opened this issue Mar 7, 2024 · 4 comments · May be fixed by #9906
Open

Allow bays to carry multiple categories of ship #9896

Amazinite opened this issue Mar 7, 2024 · 4 comments · May be fixed by #9906
Labels
enhancement A suggestion for new content or functionality that requires code changes

Comments

@Amazinite
Copy link
Collaborator

Problem Description

Currently, a bay is defined as follows:

  • bay <category> <x#> <y#>

Only a single category can be listed for a bay. Therefore, we can't have bays that say hold both fighters and drones; fighter and drone bays must always be distinct from one another at the moment.

Related Issue Links

#4610 Mass-limited bays as opposed to category-limited bays.

Desired Solution

Allow bays to define multiple categories of ship that can dock in the bay. This would come in the form of a primary category and a list of secondary categories. All listed categories of ship could dock at this bay.

bay <primary category> <x#>, <y#>
	"secondary categories" <secondary categories...>

The purpose of the primary vs secondary category split is because the UI currently displays bays by their category.
image
To have bays be listed by the combination of categories that they allow would be rather wordy, or it might be confusing if we listed the total number of bays that can contain ships of a certain category. For example, if fighter bays could also allow drones to dock, I wouldn't want the above image to read "drone bays: 10, fighter bays: 4", because that makes it sound like the ship has 14 bays in total when in actuality it only has 10 in total.

Alternative Approaches

The ships that are able to be carried are defined by a categories list.

# Ships of these types can be carried by other ships.
category "bay type"
"Drone"
"Fighter"

Perhaps we could have some similar config node that says that all fighter bays can also include drones.

Additional Context

The idea is to allow fighter bays to store both fighters and drones, as drone bays are very limited across the entire game. Allowing fighter bays to store drones would make using certain drones a lot more viable. The descriptions of drones would need to be updated to let the player know that drones can also go in fighter bays.

All fighter bays across the game would be changed at a content level to also allow drones to be installed. Given that this would be a content change, old ships in player save files wouldn't be able to store drones in fighter bays, nor would plugins automatically receive this change. If the alternative approach is taken, this would not be the case.

@Amazinite Amazinite added the enhancement A suggestion for new content or functionality that requires code changes label Mar 7, 2024
@OcelotWalrus
Copy link
Contributor

Definitely a nice addition!

@xX-Dillinger-Xx
Copy link

xX-Dillinger-Xx commented Mar 7, 2024

Maybe, change the name of the bays to something like Landing Bays or Docking Bays. I think it makes more sense if the bays are to become universal. Will it make it easier to use with the UI?

EDIT: forget this comment, the 3rd approach sounds great.

@Amazinite
Copy link
Collaborator Author

Amazinite commented Mar 9, 2024

Third approach: create a new root node bay. We'd keep category "bay type" to define which ships can be carried. We'd then have these named bay nodes that specify which ships from the "bay type" category they include. When defining a bay hardpoint on a ship, the type of bay that it is would use the named bay types instead of the category of ship that the bay holds. To make things easy, we could just have "Fighter" and "Drone" bay types where "Fighter" bay types can carry both fighters and drones so that we don't need to change any ship definitions to account for this new behavior.

# The categories of ship that can be carried in bays.
category "bay type" 
 	"Drone" 
 	"Fighter"

# Fighter bays carry both fighters and drones.
bay "Fighter"
	"Fighter"
	"Drone"

# Drone bays carry only drones.
bay "Drone"
	"Drone"

# This "Fighter" bay refers to the "Fighter" bay node instead of the "Fighter" category.
ship ...
	bay "Fighter" x y

For the sake of compatibility with plugins that may have added new "bay type" category entries, we'd need to also fall back onto looking for a category instead of a bay node if no bay node is found.

# Imagine a plugin added a new bomber bay type.
category "bay type" 
 	"Drone" 
 	"Fighter"
 	"Bomber"

# Since vanilla doesn't have a "Bomber" bay node, this would fail if we didn't 
# fall back onto looking at the "bay type" category if no bay node with this name
# exists.
ship ...
 	bay "Bomber" x y

This maintains the customization options of the first approach while maintaining backwards compatibility with save files and plugins like the alternative approach.

@tibetiroka
Copy link
Member

Third approach: create a new root node bay. [...]

I really like this idea. We should make sure that these bay nodes can be expanded, so plugins can add new ship types to existing bays without having to redefine the entire node (which would not work if multiple plugins wanted to add new entries to the same bay).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion for new content or functionality that requires code changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants