OrionFive / Hospitality

Orion's "Hospitality" and more
https://www.patreon.com/orionmods
GNU General Public License v3.0
91 stars 54 forks source link

Changed the order of claiming bed and approaching it. #744

Closed Taranchuk closed 1 year ago

Taranchuk commented 1 year ago

In vanilla pawns are claiming beds before approaching them so multiple pawns will know the owner before claiming. The PR should fix the issues with claiming double beds.

Taranchuk commented 1 year ago

Alternatively, the job could be simply removed and the claiming bed logic could be just moved to the sleep job (the same way the game operates), but I'm not sure if this change is welcome.

OrionFive commented 1 year ago

I'm also not a fan of guests claiming the beds before they approach them. This used to work fine before the other PR. I don't see why this needs to be changed now. There must be a better fix.

Taranchuk commented 1 year ago

Well, it's how the game operates with colonists. They claim beds only when are searching for sleep jobs and before pathing to them. And if not change the logic, then multiple bed spot support for guests is not possible to make. So we can't have guest couples sleeping with the same bed or in other mod cases, bunk beds where multiple people can sleep together on the same building.

Taranchuk commented 1 year ago

In this mod I'm trying to add a support for Hospitality, this mod was designed with Hospitality in mind. Unfortunately, the way how Hospitality assign guest beds makes it impossible unless we change this. https://github.com/Taranchuk/Bunk-Beds

OrionFive commented 1 year ago

I like the bunk bed idea. But I'm not willing to compromise on how guests claim beds (go there, claim the bed). So we have to find a different way to fix it.

Taranchuk commented 1 year ago

Well, it will be tough to find another fix. Because with group beds, the pawns have to get to know the other owners before the job is even issued so they can know if they can share the bed. The game solves this with instant bed claiming. We could solve this by reserving a bed when making a bed claim job. With this, other pawns will either look for other beds or the claim job will not be assigned until the beds are unreserved.

OrionFive commented 1 year ago

The way Hospitality solves it is by going to an available bed. If it has been claimed in the meantime, it should try to find a new bed, where sharing is possible. No reserving required.

OrionFive commented 1 year ago

I'm looking into it right now, maybe I can find a fix. Because most of Hospitality's bed code is made with multiple bed users in mind (it used to work fine in the past).

Taranchuk commented 1 year ago

You could check it with the Bunk Beds mod. Before my PR guests wouldn't share bunk beds while colonists can share the bunk beds fine

OrionFive commented 1 year ago

The main issue I see right now is that Ideology forbids most pawns from sharing a bed. I'll try it with Bunk Beds, assuming it modifies this restriction.

OrionFive commented 1 year ago

I think the issue is that with Bunk Beds it works, but it doesn't without. I'm still trying to verify that, though.

Taranchuk commented 1 year ago

Bunk Beds will just allow everyone to share bunk beds. It also has some harmony patches, but nothing that changes the way how sharing works.

OrionFive commented 1 year ago

Turns out that I can't reproduce the issue with or without bunk beds. So there must be another factor at play. Maybe a mod or a specific circumstance. Ideology is a factor, because some ideologies find it fine that pawns share a bed while others don't. But I can't get them to stand around.

OrionFive commented 1 year ago

I'm gonna wait for the users who reported the issue to provide logs.

Taranchuk commented 1 year ago

I think you could reproduce the issues if you have a lot of visitors arriving at your base.

OrionFive commented 1 year ago

I tried it with varying amounts of beds and "visitor group (max)" which sends 16 at once.

OrionFive commented 1 year ago

Okay, Ideology is the issue. The "Free Lovin" trait restricts who will sleep in the same bed together. If the first person claiming the bed has a strict Ideology and the second a free one, the second can still claim the bed, but the first will then refuse to sleep in it. So what's needed is an added check for each Owner's Ideology when someone wants to claim the bed. However, for bunk beds this wouldn't apply so maybe we'll need a patch or something.

OrionFive commented 1 year ago

I made issue #747 regarding this.