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

[WIP] [ENHANCEMENT] Arbitrary Equipment Slots #731

Draft
wants to merge 42 commits into
base: develop
Choose a base branch
from

Conversation

cclark25
Copy link
Contributor

@cclark25 cclark25 commented Jun 30, 2024

This PR contains WIP changes to enhance Equipment Slot customization, and I wanted to share it here to gauge interest.

The inspiration here is to modernize equipment controls. With the vanilla C Button item slots, the player has to dedicate 3 buttons to use 3 different items. This was improved with the DPad item slots enhancement, but that is an additional 4 buttons than need to be dedicated.
This is clunky on modern controllers IMO. Ideally it would be much more intuitive to use the same button(s) to use all/some items. Example: Bows, the Hookshot, and the Camera work best on a trigger button (such as R or L).
In 2ship especially, the addition of masks makes the vanilla equipment slots even more strained than in SoH, because the masks require an entire equipment slot for items that are largely just toggle switches and really don't need dedicated buttons for accessibility.
In addition to increasing the number of equipment slots, this also will free up buttons on the controller for other usages, such as splitting out A button actions into separate controls.

Anticipated features:

  • Customizable number of equipment slots to allow in addition to the C Buttons and DPad equips.
  • Alternative equipment slot controller logic.
    • Carousel Logic: Assign an arbitrary number of items to a single button, and use DPad Left/Right (or other buttons) to swap between them.
    • Single Button Item Logic: Items can be assigned to dedicated buttons to switch to them, but they can all be used using the same button.
    • Equipment Slot Item Restrictions: Equipment slots can be restricted to certain items. Examples: Only Masks, Only Bow and Hookshot, etc.
  • The new Arbitrary Equipment Slots logic is implemented with a more centralized object-encapsulated design, allowing modders to more easily create and plug-in new equipment logic options in addition to the pre-existing and new options.
  • Equipment Slot Display Customization Options:
    • RGB color selection.
    • Alpha and visibility control.
    • (CODE-MODE ONLY) Animated screen location (used by Carousel).
    • Custom icon size.
    • (POSSIBLE) Custom Slot Icon Loading (currently just defaults to a C Button icon).

This branch was branched off of another enhancement branch I was working on, which was separating certain control events into separate mappings. These changes include separating some A button controls into separate mappable buttons.
If this Arbitrary Equipment Slots Enhancement gets a lot of attention and demand, I may rebase to fast track this enhancement.

Build Artifacts

@cclark25
Copy link
Contributor Author

As-of commit cc82799, this enhancement successfully implements a prototype of the base functionality.
It adds 2 dedicated equipment slot buttons (recommended to use the L and R buttons).
The slots are red and blue, and currently move side-to-side at the top of the screen to demonstrate animation functionality that can be used in a Carousel option which I have yet to implement.
Items and Masks an both be assigned to these buttons, however non-transformation masks are currently unusable because of a bug that immediately deactivates the mask after activating it.
The custom item slots can also be used during item trade dialogues, though I have only tested this with the Deku Scrubs land deed trades so far.
The item assignments in the pause menu do not however account for swapping logic when the item is assigned to a different button, so the same item can be equipped to multiple slots.
The pause menu assignment animations are also broken currently, but this is mostly just cosmetic.

@Caladius
Copy link
Contributor

Would be beneficial for gauging interest if you add some screenshots and, preferably, a video of it in action to the GitHub PR. Big fan of modernizing controls especially when it adds additional features.

@cclark25
Copy link
Contributor Author

@Caladius I am having trouble getting a video small enough to upload to github here, so I will have to just share a screenshot for now.

Screenshot 2024-06-29 at 11 38 00 PM

In this screenshot, I am showing that there are 2 additional equip slots which use the L and R buttons, and currently have the Deku Stick and Deku Nuts equipped, respectively.
You can also see that the Deku Stick is currently held by Link, showing that the button works.

What you can't see in this screenshot is that the red and blue item slots are actually moving back and forth from left to right to demonstrate an animated position. This will be very useful when I make the Carousel-style item slot, as the currently active item slot will slide into place when swapping with the Dpad Left/Right buttons.

@cclark25
Copy link
Contributor Author

Okay, I managed to get a video recorded demonstrating the current functionality.

arbitrary-equipment-slots-demo.mp4

@cclark25
Copy link
Contributor Author

cclark25 commented Jul 1, 2024

I created a new implementation for arbitrary item slots that uses a carousel to switch between items.
It uses the R button to assign/use the item and the Dpad Left/Right to swap between each slot, with an animated rotation.

carousel_test.mp4

@cclark25
Copy link
Contributor Author

cclark25 commented Jul 1, 2024

I have added some configuration options to an enhancement menu to control the location, color, and number of item slots in the carousel.

carousel_test2.mp4

@cclark25
Copy link
Contributor Author

This enhancement is looking pretty good so far.
Right now, I am focussing on getting the arbitrary equipment slots configurations saving, and adding the assigned equipment to the save file.

There is currently an issue I found where bottles are completely broken. A slot with a bottle assigned will never update the contents of the assigned bottle, so they cannot be used to capture bugs, fish, or fairies, and when releasing a bug, fish, or fairy they don't empty the bottle's contents, essentially producing an infinite supply of whatever entity was in the bottle. The equipment slot also doesn't update with new contents if the bottle is updated elsewhere, such as from the save editor, another equipment slot, or buying an item in a store.

There are a number of other minor issues as well:

  1. There is no item-swap behavior when assigning an item to a slot when that item is already assigned to another slot.
  2. The item assignment animation does not animate to the correct screen location.
  3. Items assigned to arbitrary item slots are not highlighted in the pause menu.
  4. There is a possibility of weird visibility in certain HUD conditions in the game, such as in minigames. Not really sure where/how those might look without playing the entire game through.
  5. There isn't a way to hide the vanilla slots or control the count of each type of arbitrary equipment slots in the configuration window.

@cclark25
Copy link
Contributor Author

https://youtu.be/O5qVNbQ2ZKE

The 10 MB file size limit on Github is too limiting to properly demonstrate the functionality via video, so here is a Youtube link with the demos for the newest changes.

Since the last video, I have fixed a number of issues the core item slot behavior.
I have also polished the carousel a good bit, and added a configuration menu for customizing the layout and display options.
The config options also persist across executions of the 2ship app, and the items assigned to the arbitrary item slots and carousel are saved to the save file.

The biggest remaining issue is that the bottles don't still work, as I mentioned previously. Masks do work however.
Aside from that issue, these changes are currently in a playable state.

@cclark25
Copy link
Contributor Author

I also wanna say that feedback is welcome right now if anyone has thoughts on the implementation.

@cclark25
Copy link
Contributor Author

Okay I did some refactoring and now the arbitrary equipment slots now respect bottle contents.
Using a bottled item now consumes the item from the inventory and catching bugs/fish now work as expected.

@cclark25
Copy link
Contributor Author

I'm working on some logic to allow the user to configure the number of dedicated slots and carousels.
I intended to have this functionality from the start, as I envisioned 2 carousel slots on the screen: 1 using the Left/Right DPad controls and another using the Up/Down DPad controls.
This logic will also serve to disable the 2 arbitrary equipment slot types as well, by defaulting them to 0.

This multiple configuration flow is still a WIP.

I should also add that these flexible options for equipment slot configurations is heavily dependent on the Intent Control changes I made in Libultraship previously. Without those changes, it would be much more difficult to set up controls for these custom slots, and the number of slots would be limited to a static number for sure.
I'm not really sure that this Enhancement is even feasible without some mod to Libultraship increasing the number of isolated controls available, which is what my Intent Controls mod achieves currently.

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

Successfully merging this pull request may close these issues.

2 participants