space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.74k stars 3.48k forks source link

Centrifuging should let you pour off layers. #23230

Open moonheart08 opened 11 months ago

moonheart08 commented 11 months ago

Description

In other words, make centrifuging/separating of some kind let you dodge the need to sort chems with a chemmaster.

Could model this with setting a flag on the solution that gets removed upon modifying the solution in a way that isn't separating off a layer of chems. Maaaaybe have 0-0.1 units of jitter when pouring but frankly just let the chems be entirely separated through this manner if you have enough containers.

Fildrance commented 10 months ago

I tried to implement interface, similar to ChemMaster, but more specific for centrifuge (as issue describes). It worked out ok overall: image But there are some problems, on which i will be happy to accept advices: 1 - after attaching UI we need new way to tell player that vial is empty/there is no vial/solution is not dissolvable in centrifuge, and 'start' should not be available. Best way - leave 'start' button available but give some animation like 'CANNOT START - NO INPUT VIAL' for 1-2 seconds on client side. I honestly have no idea how to work with such client-side timers and not sure if its good idea to use this approach (as i saw none such stuff in other UI components). 2 - currently all liquids that are in input vial goes to buffer after centrifuge finishes working. Thats ok but it is not dissolving anything except very small list of stuff (mostly kinds of blood). It feels like it should dissolve any complex non-exotermic mix into its components, but it is not. Was it by design? Doubt that it will bring large impact anyways, sadly, as amounts of solution to work with is limited to 30u. 3 - sadly, ui is still very similar to chem master and hard to distinguish - missing some identity. Microwave and ChemMaster, for exmple, are kinda intuitive in that way. Any ideas? 4 - it feels like condenser requires something similar? Not sure how to reduce code duplication but maintain separation of thouse machines correcly.

Fildrance commented 10 months ago

As for solution - using SharedSolutionContainerSystem and ItemSlotsSystem inside SolutionContainerMixerSystem in the same way ChemMaster is doing, creating

0x6273 commented 10 months ago

This really shouldn't have a UI at all. After centrifuging a vial the solution should be layered, and when you pour from the vial into a different container it takes only from the top layer instead of the entire solution.

Fildrance commented 10 months ago

Well it solves UI not having identity problem for sure... How do player gonna know what is 'top layer'? I guess tooltip on machine can say it, but then again - no way to know 'what do you have inside' overall (all of the stuff wont fit into tooltip nicely). And getting 5-th layer reagent will take a lot of 'pour and dump', specially with 30u max amount of workable liquid. Is it really good solution?

moonheart08 commented 10 months ago

Reagents are ordered in their container. So the top layer is the top chem.

Do not add a UI for individually picking out chems.

Fildrance commented 10 months ago

Ok. So scenario should look like this:

  1. Player put vial with dissolvable solution into machine
  2. Player clicks on machine
  3. Machine plays animation
  4. Dissolved solution (every reagent in vial after reaction, even not reacted ones) moves to machine buffer, now inserted vial is empty inside machine, can be extracted empty
  5. Player clicks on machine and it pours liquid from top of buffer stack. Every time he clicks - it pours next.
  6. If buffer is empty - next click will start machine again and this will put all of them from vial to buffer again.

Is it correct?

Also, it seems centrifuge should not start if any quantity of ragents are present from previous experiment and new full vial is inserted, right? And do we need 'dump' option to clean up all that is left for at least some kind of QOL?

moonheart08 commented 10 months ago

Ok. So scenario should look like this:

1. Player put vial with dissolvable solution into machine

2. Player clicks on machine

3. Machine plays animation

4. Dissolved solution (every reagent in vial after reaction, even not reacted ones) moves to machine buffer, now inserted vial is empty inside machine, can be extracted empty

5. Player clicks on machine and it pours liquid from top of buffer stack. Every time he clicks - it pours next.

6. If buffer is empty - next click will start machine again and this will put all of them from vial to buffer again.

Is it correct?

Also, it seems centrifuge should not start if any quantity of ragents are present from previous experiment and new full vial is inserted, right? And do we need 'dump' option to clean up all that is left for at least some kind of QOL?

No, set a flag on the solution to change how it's pouring behavior works. Far simpler.

K-Dynamic commented 10 months ago

Chemical anaylsis goggles enable a sort of UI that lists all the chems in a puddle in the examination menu (unsure if sorted)

Fildrance commented 10 months ago

Ok. So scenario should look like this:

1. Player put vial with dissolvable solution into machine

2. Player clicks on machine

3. Machine plays animation

4. Dissolved solution (every reagent in vial after reaction, even not reacted ones) moves to machine buffer, now inserted vial is empty inside machine, can be extracted empty

5. Player clicks on machine and it pours liquid from top of buffer stack. Every time he clicks - it pours next.

6. If buffer is empty - next click will start machine again and this will put all of them from vial to buffer again.

Is it correct? Also, it seems centrifuge should not start if any quantity of ragents are present from previous experiment and new full vial is inserted, right? And do we need 'dump' option to clean up all that is left for at least some kind of QOL?

No, set a flag on the solution to change how it's pouring behavior works. Far simpler.

You mean VIAL that is extracted AFTER separation process should contain solution with some flag, that will pour out into other containers in sorted order? Until there is no content in vial, and then it'll just use usual mixing logic. And adding any other stuff into vial should mix them all togather again, right? Is SharedSolutionContainerSystem.SplitStackSolution and SharedSolutionContainerSystem.TryTransferSolution right direction then? I dont see any existing flag that will do such stuff, but adding one inside seems simple (but a bit dirty). Or am i searching in wrong place?

moonheart08 commented 10 months ago

The vial you centrifuged should gain the flag after being centrifuged. There should not be separate containers involved. The vial should lose this property if new contents get added.

Fildrance commented 9 months ago

Chemical anaylsis goggles enable a sort of UI that lists all the chems in a puddle in the examination menu (unsure if sorted)

Yeap, its sorted, so good luck understanding order. Its not that hard tho, last inserted is first to get out.