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.13k stars 2.81k forks source link

Solution Editor is broken in mapping mode #25757

Open IamVelcroboy opened 4 months ago

IamVelcroboy commented 4 months ago

Description

Debug command for editing reagent containers has broken input fields.

Reproduction Enter into mapping setup right click on container->Debug->Edit Solutions->get this image

Screenshots

Additional context

IamVelcroboy commented 3 months ago

I did some further investigating into this and it appears to only be broken in mapping mode. 😪

It functions normally under other scenarios. But after entering mapping, it breaks.

(edited title, repro steps)

SlamBamActionman commented 2 months ago

I have looked into this, and while I have information to add I do not have a solution to the issue.

The reason the Solution Editor can not see any of the reagents is because of the following behavior:

Can we solve this? Sorta. But it comes with its own issues.

-SolutionContainerSystem can be initialized by running the methods from MapInit in ComponentInit. This creates containers that can be put in the SolutionContainerManagerComponent's Containers property, which in turn makes the Solution Editor work (and also makes puddles/containers visualize its reagents).

This is an example of a mop, which has been edited to include water in the dev_test.yml map.

- proto: MopItem
  entities:
  - uid: 328
    components:
    - type: Transform
      pos: 7.6382103,16.08618
      parent: 179
    - type: SolutionContainerManager
      solutions:
        absorbed:
          temperature: 293.15
          canMix: False
          canReact: True
          maxVol: 50
          name: null
          reagents:
          - ReagentId: Water
            Quantity: 25

Compare this to this empty mop, which I put in a test map after having SolutionContainerSystem initialized. Entity 19 is completely pointless as all that data is already in the MopItem prototype, and were I to edit the mop to start with water, that data would end up in entity 19.

- proto: MopItem
  entities:
  - uid: 4
    components:
    - type: Transform
      pos: -1.049206,1.8034062
      parent: 2
    - type: SolutionContainerManager
      solutions: null
      containers:
      - absorbed
    - type: ContainerContainer
      containers:
        solution@absorbed: !type:ContainerSlot
          ent: 19

- proto: ""
  entities:
  - uid: 19
    components:
    - type: MetaData
    - type: Transform
      parent: 4
    - type: Solution
      solution:
        maxVol: 100
        name: absorbed
        reagents: []
    - type: ContainedSolution
      containerName: absorbed
      container: 4

I do not know how to solve this. Without the containers, Solution Editor won't work. But with the containers, the serialization won't work.

There is an additional issue where initializing the containers on a map with puddles makes the Puddle component want to get serialized, which it can't due to its Entity<SolutionComponent> Solutions property not being serializable.

ShadowCommander commented 2 months ago

It's probably best to make a separate editor for mapping. That way we don't bloat the map files with unnecessary entities.