TeamPorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
484 stars 279 forks source link

Sharing a single bed, especially when there's multiple #1099

Open kd7uiy opened 8 years ago

kd7uiy commented 8 years ago

Somehow I suspect that isn't the intended behavior. I'm actually not sure how many there are, but when the time comes for sleep, the nearest unoccupied bed should be chosen, not just the nearest.

gif

crafty-geek commented 8 years ago

Consider as a fix:

Can the architecture have a flexible enough idea of occupancy so that, eg, a 2x2 table can have 4 meals as its occupants (or 3 meals and a potted plant, or whatever), while the 4 chairs or 2 benches around it have character occupants? Can stockpile / inventory-stack capacity be rejiggered to use this Furniture Occupancy architecture? Definite need for an "infinite" flag for maxocc

sboigelot commented 8 years ago

@crafty-geek We may want to just add this data as a furniture parameter. So only furniture that require it will have it. Then it's super flexible as you do whatever with it in lua.

pderuiter77 commented 8 years ago

You could also allow furniture to have an owner. If furniture has an owner, only the owner may interact with it (sleep in the bed). If there is no owner, you could use slots. having slots means you not only know who is using it, but also the position

kd7uiy commented 8 years ago

There's a couple of ways to do this that I can see. In particular are two use cases that I think we should consider:

  1. A resource that can only be used by 1 person
  2. A resource that could be used by many people at the same time.

Personally, I would like to see furniture having a maximum operating capacity. It seems to do this we would need to have a "Job Started" callback added to the Job, that is called only on the first frame of a started job. That frame for furniture would increment a counter. We also need to put in a check for each furniture that is something like "Is At Operating Capacity", which would return false if there is no more room. Lastly, we need to add a function upon job completion to remove a token, if that token was added.

I'm curious how such a system would interact with @vogonistic 's changes that he's been working on.

What do you guys think of this proposal for managing this bug?

sboigelot commented 8 years ago

I think we should just have the workspot being used by one character at a time. If you want more character using a single furniture, add more workspot (table, dance floor, ...)

kd7uiy commented 8 years ago

I like that idea actually, it makes a lot of sense. That being the case, we just need some method of determining if a given workspot is being used, and add in the check for it.

pderuiter77 commented 8 years ago

So basically you work with slots, where each slot may be occupied / reserved by a character. For a bed you could make the character permanently reserve the slot, preventing another character from using it. Giving each slot a position also means you know where to render this on screen