Plasma icon indicating copy to clipboard operation
Plasma copied to clipboard

Add message for changing fog environment settings

Open dpogue opened this issue 4 years ago • 3 comments

Add a new message (plFogTransitionMsg maybe?) to change the values of a plFogEnvironment. It should be possible to include this message in a Responder Modifier. This message probably belongs in PubUtilLib/plMessage.

Message Style: Fire-and-forget, no callbacks

Message Receivers: plFogEnvironment objects. If no receiver is provided when constructing the message, set the receiver to the plPipeline default fog environment.

Message data:

  • float fStart - new fog start value
  • float fEnd - new fog end distance value
  • float fDensity - new fog density value
  • hsColorRGBA fColor - new fog colour
  • float duration - unused but put it here now so it's available in the future without changing the message format

Message Handling: Add a plFogEnvironment::MsgReceive() handler that can receive plFogTransitionMsg messages and update the fog environment values based on the ones provided in the message.

Non-Goals:

  • Changing the fog type.
  • Smoothly animating or transitioning the fog values.
  • Tooling support in the PlasmaMax or korman plugins

Tasks:

  • [ ] Create a new plFogTransitionMsg class
  • [ ] Create a new plCreatableIndex for the new message type
  • [ ] Implement stream reading/writing for the message data
  • [ ] Message should set receivers to the default fog environment if no receivers are specified
  • [ ] Add message receiving support to plFogEnvironment
Bonus Tasks
  • [ ] Change the fog-related pfConsole commands to create and send plFogTransitionMsg messages.
    Only for colour, start/end, and density changes.

  • [ ] Change the fog-related pfPython API commands to create and send plFogTransitionMsg messages.
    Only for colour, start/end, and density changes.

  • [ ] Add support for plFogTransitionMsg to the libHSPlasma project.
    Do not start this until the pull request on H-uru/Plasma has been approved and merged.

dpogue avatar Aug 29 '20 04:08 dpogue

Out of curiosity: Has something like this existed in CC and was removed, or how else is it possible for a player to change the fog (for everyone) on Deep Island?

cwalther avatar Aug 29 '20 10:08 cwalther

That's done with console commands propagated over the network.

Hoikas avatar Aug 29 '20 14:08 Hoikas

@Hoikas That brings up a good point though, do we need to consider anything at the message level to support both local fog changes and fog changes that are visible across the network? I can definitely see potential use cases for both

dpogue avatar Aug 29 '20 19:08 dpogue