PavelZinchenko / event-horizon-main

GNU General Public License v3.0
28 stars 6 forks source link

RFC: Advanced Fleets #428

Open juh9870 opened 3 months ago

juh9870 commented 3 months ago

This is a request for comments. I propose my changes and unresolved questions, and once enough feedback is gathered and questions are resolved, I will proceed to make a PR, implementing changes that were discussed. This approach fosters better communication regarding major changes, and allows for fearless PR implementation, knowing that the changes are at least desirable, and we are moving in the right direction.


Summary

Improvements to the Fleet files system, allowing for greater customization akin to Loot files.

Motivation

Current fleets are too limited, It is hard to make proper "boss fights", and impossible to recreate something like base capture fight.

Approach

Database changes

Instead of specific ships, mod maker can optionally specify "fleet nodes" in the fleet file, akin to Loot nodes. They can still continue to use the default fleet format if they don't need the advanced control. This is achieved by transforming Fleet into a switch-type, just like ObjectPrefab or Technology.

Fleet types

The last two varians are here for performance and simplicity reasons. While I do believe they are possible to fully recreate via the new system, it would require a pretty complicated fleet file. Having those options here would be an easy solution for newer mod makers who don't want to deal with the whole complexity.

Fleet Nodes

These are initial batch of nodes that I plan to implement. More nodes may be added in the follow-up PRs.

This node list is not final and is subject to change during the implementation. If you feel like some essential node or field is missing, feel free to post in this thread so we can discuss it.

BuildRequirements

These conditions are checked for every build to decide if it should spawn.

Technical Info

I can't estimate the performance impact of this PR. I will try my best for it to remain negligible, but even in the worst case, I don't expect any noticable performance impact, since fleets are calculated relatively infrequently. Even in the worst case of player hopping across new nodes, we get "seconds between fleets" and not "fleets per frame"

Breaking Changes

None. Mod makers can continue to use the simple fleet format if they wish to.

Follow-up work

If this RFC is accepted and implemented, it will open the doors for more fleet nodes types and even more in-depth customization, but I will leave that for the future RFCs and PRs.

TheGreyRadical commented 3 months ago

Not directly on the fleet improvement, but related to it. It would be good if non-configurable events also considered BuildFaction over ship's own faction, so that other faction's ships could be included on local pirates / base capture if needed.

Kipyatochkov commented 3 months ago

I propose to make it possible to register the Allied fleet. Additionally, it would be possible to make an option that allows ships from the player's fleet to engage in battle. All this will allow to create massive fights similar to those from EHF

juh9870 commented 3 months ago

@Kipyatochkov this is outside the scope of this RFC

Qsfff commented 3 months ago

It would also be nice if LocalPirates and BaseCapture would have their own configure files (unique, like all files in settings folder)

juh9870 commented 3 months ago

I believe making base capture and local pirates fleets configurable would be easy to make as a follow-up PR after this RFC is implemented