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.59k stars 3.22k forks source link

Action sorting/priority needs fixing #20264

Open ElectroJr opened 1 year ago

ElectroJr commented 1 year ago

Currently the order in which actions get added to the action bar is dependent on the order in which action entities get sent to a player. The client does do some sorting by priority, but that only works if all actions arrived at the same time.

I'm not sure what the best fix is. One option is to just networked the action toolbar assignment, so that the server can help determine the order of actions, but that would cause issues for client-side actions.

deltanedas commented 1 year ago

could you not mark an action as manually placed (false by default) then when new action is added sort them all by priority unless they are manually placed

Partmedia commented 1 year ago

There is actions priority sorting in ActionsSystem.cs, so it might be broken.

By might I mean definitely, because the current actions sort order is not deterministic (changes on every connection) and sometimes results in harm (priority -100) being sorted like this:

image

ElectroJr commented 1 year ago

There is actions priority sorting in ActionsSystem.cs, so it might be broken.

Theres currently a bug that should get fixed by #20260, but it won't fix this issue.

could you not mark an action as manually placed (false by default) then when new action is added sort them all by priority unless they are manually placed

I don't think automatically shuffling around actions unless they have been manually placed is a good idea. If something gets assigned to a number on the toolbar a player should be able to assume that the assignment won't unexpectedly change.