PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Feature Suggestion: 3 subtle widget ideas

HipHopHuman opened this issue Β· 9 comments

commented

I was thinking it would be cool to have these widgets:

  • Drone Condition: Upgrade Installed. This widget's purpose is to make the process of re-using programs in new drones or sharing drone programs a little easier through the power of validation. This widget will check if the drone has a given upgrade installed (specified with an Item Filter widget).
  • Send Toast Message. This widget's purpose is to act as a way for drones to notify the player of anything they want to be notified of from a remote location. When executed, this widget will activate a Toast Notification for the player that owns the drone. The notification text can be set with a Text widget, and the notification icon can be set with an Item Filter widget.
  • Broadcast Chat Message. This widget's purpose is a more general version of the previous one, but it outputs to the chatbox interface instead of the Toast Notification interface. The message text is set via a Text widget. It could have a configuration option (in the mod settings) to disable it to prevent abuse on servers. In addition, the widget itself could expose the following options:
    • "Broadcast" - A boolean value that if true, broadcasts the chat message to all online players. If false, it only sends the message to the owner of the drone.
    • "Limit range" - A boolean value that if true, only broadcasts the message to players within Range (Or perhaps instead of a range option, it uses the Area widget?).
    • "Range" - A number value that acts as the radius for the Limit range option.

The last two would be really useful to have, I used to make a lot of use of the functional equivalent of these notification features from "OpenBlocks" / "Random Things" back in the day.

commented

I'm not too happy about the ability to do any kind of broadcasting at all - even if it's optional. Some server admin will enable it, someone will find out and write a program to grief everyone by constantly broadcasting spam, and the mod gets a bad name. I think this really needs to be owner-only, or at the most very limited range (i.e. to owner and other players not more than 16 blocks away from the drone, say).

I agree that broadcasting is asking for trouble, but I personally would love to see a notification widget of some kind. Currently with big programs I use the edit sign widget frequently for feedback and debug.

My thoughts on a possible way of implementing:
Widget tied to @owner
Pneumatic Helmet required with program debug upgrade installed. The helmet options could allow for the user to turn off all notifications/messages due to spam from a user’s poorly implemented use of the widget or allow for periodic on demand remote check in.

The second point could be made optional within the widget itself, but I believe should be enabled by default.

commented

The first one's a good idea, and probably pretty easy to add.

As for the second two... I have thought about a chat widget before, but the problem here is that widgets are executed continuously and frequently, since drone programs loop. Writing a program where a chat widget is only executed once when it needs to be is potentially quite challenging, but I'm open to ideas here.

commented

Well, the first and most obvious idea is to just assume that the player is responsible enough to only use the widget in a tight isolated condition with lots of pre-emptive triggers, and if they happen to spam themselves silly, then that's on them.

Another idea would be to add an option for "maximum interval" that defaults to a generously large number, e.g. 5 seconds, and then the condition only triggers if that interval has passed since it was last executed.

Another idea, and probably the most elegant I can think of, is to treat the message as a stack data structure. So instead of having a "Send message to chat" widget, you'd have a "store message in stack" widget, and another widget that pops a message off of the stack. The stack could have a TTL for each message, where they get removed from the stack. The consideration with this one however is it will definitely be abused as an alternative way to store transient variables than having to use coordinates... but maybe that's not such a bad thing?

commented

It would probably be most useful to come up with a specific use-case for where drone chat would be useful, and design a program for that. Then we can see how easy or otherwise it is to control how often the chat widget gets hit...

Another less intrusive option would be to have chat messages rendered above the drone (a bit like a speech bubble) for a given length of time (possibly dependent on message length).

commented

It would probably be most useful to come up with a specific use-case for where drone chat would be useful, and design a program for that. Then we can see how easy or otherwise it is to control how often the chat widget gets hit...

Here are some use cases I can think of:

  • Remotely notifying the player of something when the player is not present (the Toast Notification widget can do this too, but that's limited in size). "Something" in this context could be, for example:
    • An intruder in the base (a mob or a player perhaps?)
    • A compressor did an explode. Oopsie.
    • The player 's Aerial Interface is dangerously close to running out of air and the player needs to be warned in case they are flying about the Nether.
    • An autocrafting operation that started 16 minutes ago has encountered an error
    • An autocrafting operation that started 16 minutes ago has completed
    • Ayo your fluix crystals are ready
    • Remember, that elusive Astral Sorcery constellation you're looking for is happening tonight!
  • Broadcasting details to server members about trades that the player will put on Amadron for high-demand items so the players can prepare to be the first to purchase. I know Amadron does it's own notification, but this will give the player more control.
  • Notifying a player that you're about to send a Drone to pick them up and teleport them to you.

Another less intrusive option would be to have chat messages rendered above the drone (a bit like a speech bubble) for a given length of time (possibly dependent on message length).

That does sound cool, but it doesn't solve the problem of "remote notifications", which is mainly what I'm hoping to achieve with these suggestions. Though that does get me thinking... If all of this is truly difficult to add, then what about this idea:

  • The icon/sprite for the "Remote" item changes to show a little red notification dot when a "Text" GUI widget value has changed
commented

Oh, it wouldn't be hard to add; actually fairly easy (although the toast output needs a little more coding, but nothing too difficult as far as I can tell).

Regarding chat functionality, I don't think there's a need for two separate widgets here - the output type can simply be an option for the chat widget. Possible outputs:

  • Toast popup
  • Chat window
  • Action bar window (i.e. the little ephemeral popup text you see above the hotbar when switching items)
  • Armor HUD text (obviously requires a Pneumatic Helmet)

I'm not too happy about the ability to do any kind of broadcasting at all - even if it's optional. Some server admin will enable it, someone will find out and write a program to grief everyone by constantly broadcasting spam, and the mod gets a bad name. I think this really needs to be owner-only, or at the most very limited range (i.e. to owner and other players not more than 16 blocks away from the drone, say).

commented

Regarding chat functionality, I don't think there's a need for two separate widgets here - the output type can simply be an option for the chat widget. Possible outputs:

That works too!

Action bar window (i.e. the little ephemeral popup text you see above the hotbar when switching items)

😱 I spent a while last year aggressively adding Console Experience to my packs and I forgot this even existed, that would be pretty cool.

I'm not too happy about the ability to do any kind of broadcasting at all - even if it's optional. Some server admin will enable it, someone will find out and write a program to grief everyone by constantly broadcasting spam, and the mod gets a bad name. I think this really needs to be owner-only, or at the most very limited range (i.e. to owner and other players not more than 16 blocks away from the drone, say).

That's fine, you have a lot more experience with the politics side of modding than I do so I trust your judgement.

Build 197 has the new Drone Condition: Upgrades widget. You can also grab a test program from https://pastebin.com/bk3T3mGD - the drone will suicide if it has no speed upgrades, or write the number of speed upgrades to a sign otherwise (adjust the sign position to suit).

It works wonderfully, I've just added it to my yeast drone program so now I'll never make the mistake of deploying my drone in a puddle of yeast again 🎊

commented

Build 197 has the new Drone Condition: Upgrades widget. You can also grab a test program from https://pastebin.com/bk3T3mGD - the drone will suicide if it has no speed upgrades, or write the number of speed upgrades to a sign otherwise (adjust the sign position to suit).

commented

I was thinking more about this last night, and I think I may have found something elegant:

  • The Chat Widget must require a Coordinate widget with a variable set.
  • When the Chat Widget executes, it will check the value of the variable
    • If the variable is 0, 0, 0 (meaning false), the Chat Widget will not execute, the program will simply continue
    • If the variable is anything other than 0, 0, 0 (meaning true), then the Chat Widget will execute. After it executes, it will set the variable to 0, 0, 0.

This means that by default, if the associated variable is true, the Chat Widget will only ever execute once and then never execute again. However, this gives the player a choice - they can either leave this setup as-is for one-time notifications, OR they can create a redstone contraption that handles the notification when the variable is false and resets the variable back to true so that the Chat Widget can run again.

If the player wants the notification to repeat, but wants to limit it to say, a maximum of once every 10 seconds, they can create a separate drone program that monitors this variable with a Condition: Coordinate Widget with one branch: if the variable is false, set it to true, then wait ten seconds.