spacechase0 / StardewValleyMP

Temporary solution for multiplayer until official multiplayer is released.
MIT License
38 stars 18 forks source link

Sharing house #14

Open spacechase0 opened 8 years ago

spacechase0 commented 8 years ago

Enough people have asked that I should probably work on this, especially since official MP will be next year.

Not sure how marriage will be affected.

phoenx34 commented 7 years ago

Yeah, although based on the code this could be rather complicated. A place to start could be adding another house to both the client and server's farms. For example, the client would see and be able to enter the server's house and vice versa, but do not share a singular house. At least then marriages would not be affected because the houses are separate. An implementation could just add an option to the starter house, asking if you wish to enter your house or the other (server or client, respectively) person's house.

spacechase0 commented 7 years ago

Nah, sharing houses would actually be easier. I already have separate houses for the host and each client. I hacked a bunch of stuff to make it work with multiple. :P The host sees FarmHouse, FarmHouse_Client1, FarmHouse_Client2, but Client1 sees FarmHouse_Host, FarmHouse, and FarmHouse_Client2. Similar for Client2.

(See StardewValleyMP.Multiplayer: isPlayerUnique, processLocationNameForPlayerUnique, getUniqueLocationName, fixLocations. That stuff hooks into pretty much everything dealing with locations, especially the packets.)

Marriages are a good point though. I think it should it be fine, since other clients barely know others are married. It'll definitely be something I need to look into.

As for visiting other houses, I would definitely like to do that. With a debug build, you can do "/instance " in the chat to visit another house. Changing furniture and stuff doesn't sync though. Plus this obviously isn't very user friendly.

phoenx34 commented 7 years ago

I can try making a simple in game ui or a clickable button on the house to make something more user friendly, and I will take a look at marriages. Awesome hack for the host and client separate houses!

spacechase0 commented 7 years ago

Alright. You should probably make it a new IClickableMenu, just like ChatMenu. You shouldn't need a new packet, just warp the player to the appropriate house.

spacechase0 commented 7 years ago

One thing about visiting other houses is that we probably need to find a way of preventing them from moving furniture. This might be easy, but I haven't looked into it.

Keeping chests from opening should be fine. That's already done to keep two people from opening one at the same time.