tiltedphoques / TiltedEvolution

Skyrim and Fallout 4 mod to play online!
https://wiki.tiltedphoques.com/tilted-online/
Other
1.06k stars 220 forks source link

Implementation of a Trade UI #325

Open Thercious opened 2 years ago

Thercious commented 2 years ago

Description

This is a proposal for the implementation of a Trade UI to the game. *Mockup images will be edited in after this proposal has been submitted. Mockups added!

How it would work:

User Experience

Adding a proper UI for trading between players would greatly improve the player's experience with the mod, being effective to improve interactions in many scenarios:

• Crafting items for others, • Sharing loot between party members, • Paying/rewarding other players for services • Avoiding sync issues with disappearing loot or wrong item numbers • Nullifying the need to pickpocket (and reverse-pickpocket), with their consequences

Trade Requests:

Pressing 'E' to talk to other players would display the trading option while the other character is within interaction range.

Note: This could also be used to implement other features, including an in-game Invite to Party functionality, which is out of the scope of this proposal

image

• When receiving a trade request, the player would see a pop up on their screen, remaining visible for 5 seconds. After being hidden, pressing F2/Right-CTRL would make it visible, together with the Chat and other buttons. Then it could be accepted or dismissed. • If the trade request is ignored for over 60 seconds, it is removed. • To prevent spam requests, a maximum number of 4 trade requests could be set for both requesting and receiving players, and if past that number, the request would be denied, with the requesting user receiving a "This user has too many trade requests already" error message. • Another option to prevent unintented spam requests would be an option to automatically decline requests from players outside your own party - understanding that, ideally, only one party should exist per server.

User Interface Implementation

After the trade request is accepted, a modified version of the inventory screen would appear:

image

• Instead of displaying both the player inventory and trading box as alternating tabs, the trading box would be displayed to the right, containing the lists of to-be-traded items from both players • Two temporary containers are created to contain the player's items, with the items from the other player being displayed as read-only lists for each other - this allows for the players to mouse-over the items, and check their stats/enchantments on the preview area. • After confirming that the items are correct, both players have to click on a "Confirm Trade" checkbox before the "Trade" Button is enabled, so that the items are transfered to each player's inventory, or the trade is cancelled and the items are returned to their inventories.

Backend Implementation

This is where the fun begins. I don't have enough backend experience to code it, but I hope it is well explained enough for someone with the proper skills (and time, and patience) to be able to contribute.

• For the trade to be done, the items would have all their data recreated on the other player's game, by copying and transfering it over the server, including custom names for enchanted items (which should require work similar to how character names are sent over). • When the trade is confirmed by both players and the items recreated for each receiving player, their originals must be removed/deleted from the temporary box, to allow for consistency. The game already has too many ways to exploit item economy, so yet another way of duplicating items; is neither needed or fun for everyone involved. • To ensure the safety of the players during their trade, players should be able to quick exit the trading screen, with the items being automatically returned for each of them. Same thing could happen if one of them enter combat (PvE or PvP), suffer any damage or die.


Constructive feedback is always welcome. I hope we can improve on this idea and add it as a feature on the mod.

RobbeBryssinck commented 2 years ago

Honestly, for this to be done, I'd suggest improving the inventory system a bit.

Thercious commented 2 years ago

Added the mockups that I made. I hope it's a good reference.

DJLegends1011 commented 2 years ago

igod that trade ui looks clean asf!

Sturlen commented 2 years ago

I think this might a bit outside the scope of a coop mod. You already need to trust you coop partners not to cheat, so I think a full trade window with scam prevention is unnecessary. I do however like the concept of easily sending items to your partner.

Such a system would only require the client to give you a send to interaction and the server to implement something like player1.sendItemTo(Player2), as the server already keeps track of everyone's inventory.

Also, your UI concept looks very well designed.

Thercious commented 2 years ago

My intented purpose for it is that both players receive positive feedback from the UI that their trade is ready to get done. It's one extra step (and not an essential one for the trade itself to be completed), but it should give players a feeling of security when doing so.

I didn't intend for it to be a scam prevention feature, since I also agree with you on it being outside of the scope of a coop mod, it would be futile on a game like Skyrim, where it's so easy to cheat and multiply items. Playing with friends we can trust is the best anti-cheat anyways.

P.S.: The send to interaction gave me an idea for a "mail" system. Will think on it, and maybe make some more UI concepts as a separate feature suggestion in the future. I hope this is still the most appropriate place to make these.

Enzayer commented 2 years ago

Something like this would also be possible to fix the crafted enchantments disappearing from items when dropping.

My idea would be to use the enchanting tables code already in each players game to create a new identical version of the item on that players character.

Basically, call for information from the original item being traded, feed that to the enchanting table code of the receiving player to produce an identical item, then destroy the original item from the giving player (maybe port it under ground if needed so it can de-spawn in peace).

RobbeBryssinck commented 2 years ago

Something like this would also be possible to fix the crafted enchantments disappearing from items when dropping.

My idea would be to use the enchanting tables code already in each players game to create a new identical version of the item on that players character.

Basically, call for information from the original item being traded, feed that to the enchanting table code of the receiving player to produce an identical item, then destroy the original item from the giving player (maybe port it under ground if needed so it can de-spawn in peace).

Unfortunately, a system like this doesn't "fix" the current underlying problems with inventories and enchanted items. In fact, a trading system would have to be built on top of the currently faulty inventory system.

As I said before, before we can even start thinking about a trading system, the current inventory system needs to be improved.

Enzayer commented 2 years ago

Sorry, "fix" was not the proper word to use for this. I'm proposing more of a work around kluge. My suggestion doesn't fix the inventory system, but it does solve the problem of not being able to "pass" an enchanted item from one player to the other.

I've not delved into the meat of Skyrim moding, but I can't see why you couldn't (in the background) fool the system into thinking that the Receiving player created the item in question through the same code used to create it on the Sending player when they used the enchanting table to create it in the first place. Yes, the two items will not have the same variable in the Enchanted item's list of each player, but there would be equivalent items that were created.

TJHeeringa commented 1 year ago

How me and my Skyrim together pantner are currently trading is by standing next to a chest or barrel. In order to give the item from one to the other, the giver puts the item in the container and the taker takes it out. Would it not be possible to fake a container, where you can both put stuff in and pull stuff out? Or allow for system like with followers, where you can freely access the other inventory?

This might give an issue with people trading unfairly, but at the same time: this is not an MMO. Your are most likely playing with close friends, so I don't worry that.

PS: If there is no chest nearby, we use pickpocketing as our workaround.