Allow programmable block to make HTTP/HTTPS web requests

Lee Conlin shared this feedback 2 years ago

It would be a nice feature to be able to write PB scripts that can send data to outside sources and request data from them.

For example, a script could send position updates to a custom API written by a script developer. Another script could read the position data from the API to plot a kind of star-map onto LCDs.

External API's could be used to handle more powerful computing, returning data directly to the game.

I'm sure other engineers could come up with many more uses for this.

Comments (2)


How about an outright RPC API instead, similar to kRPC for Kerbal Space Program? You could code and run a ton of functionality locally on your machine and only communicate input and output as necessary, freeing up a lot of script cycles, and you could, if you still needed HTTP(S) functionality, invoke established external libraries that do this already.



Programming block is in-game only - that means it should be able to access game world ONLY.


That's a very arbitrary and artificial rule.

Button blocks are in-game only, too, yet events external to the game can still affect it through the access that the game executable and process avails. (Hints: your vision, monitor, graphics card, graphics engine, operating system, HID drivers, HID electronics, momentary switches and optical sensors, your hands)


You might also notice that the rest of the game also interacts with the internet already.

If it makes you feel safer, it could require an antenna or some other specialised block on the grid and refer to it in the game as "accessing the galactic network".

Either way, having the ability for a PB to communicate with RESTful APIs on the internet would allow servers the ability to offload a large amount of processing to other applications.

Server owners should be able to set a list of allowed base URLs to prevent misuse.

For example, the PAM script by Keks is quite intensive and often prohibited on servers. With something like this, much of the complexity could be offloaded to an external service allowing the scripts and PBs themselves to be far more efficient, resulting in less lag.