Make vehicles upgradable (and refactor part exchanger system, oops) - #4798
Open
arimah wants to merge 2 commits into
Open
Make vehicles upgradable (and refactor part exchanger system, oops)#4798arimah wants to merge 2 commits into
arimah wants to merge 2 commits into
Conversation
Contributor
Author
|
Okay, I forgot the mail carrier, NFSD, syndicate and pirate hoverbikes had their own completely separate parents BECAUSE WHY NOT. I will fix. |
|
For what it's worth, I approve of this! Space is big and Void-Gliders should still be viable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the PR
This PR does two things I probably shouldn't have mixed but couldn't really separate.
Firstly, this PR reworks
PartExchangerSystemto be less of a horrible copy-pasted mess. Don't get me wrong, it's still a mess, but less so.Secondly, this PR enables vehicles to be upgraded, by adding a new component and tweaking the way the RPED interacts with it. Only hoverbikes and the hoverchair are made upgradable with this PR, but the new component also makes it trivial to make more vehicles upgradable in the future, and paves the way for allowing other aspects of a vehicle to be upgraded. (E.g. maybe we want ATV lights to be upgraded with capacitors in the future.)
Why / Balance
I love hoverbikes! They're so much fun, and travelling through space on a hoverbike with no ship to your name is awesome. However, it's painfully slow at times, especially now that the sector is really spread out and big. By upgrading your hoverbike with 8 super capacitors, you can reach speeds of 13.6 m/s – considerably faster than the standard 8, still much slower than a ship. Get lucky enough to find bluespace caps and you can get all the way up to 16 m/s, twice as fast as usual.
RPED is required to upgrade hoverbikes. It is not possible to disassemble the bike and tear out the components yourself. You have to right-click and select the 'Upgrade' verb. Left-click and Alt+click both interact with the storage system, oops. (For the YarRPED, the text changes to 'Downgrade'.)
I settled on the values as follows:
For the hoverchair, I just kinda picked values that seemed to make sense. Even with full bluespace capacitors, it's (slightly) slower than speed boots, but of course does not suffer slowdown from your hardsuit and weapon. It's probably fine. This vehicle is basically never actually used.
Technical details
Re
PartExchangerSystem: It was extremely confusing how some logic happened in one method, some other logic happened in another method, and nothing was named in a way that aided comprehension.InContainer? Which container – the RPED or the machine?! I've tried to rename things in a way that's hopefully sensible and straightforward, as well as useEntity<...>to pair IDs with components where appropriate. I'm not 100% fond of the callback hooks I needed for machine frames, but it's either that or duplicate an uncomfortable amount of code. I chose callbacks.The vehicle upgrade stuff should ideally be pretty self-explanatory. As it's currently written,
VehicleUpgradeComponentdoes not actually depend onVehicleComponent; you could slap it on any old entity to allow its speed to be upgraded. But the naming is meant to suggest that it be used for vehicles, and in future we might add moreUpgradableVehiclePropertymembers for vehicle-specific things.I also moved the client-side
VehicleSystemto_NF/Vehicle/EntitySystemsfor better symmetry with Shared and Server.How to test
Media
https://streamable.com/6w895m
Requirements
Breaking changes
Changelog
🆑