[MOD/API] X4RestServer - External http API
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[MOD/API] X4RestServer - External http API
X4 Rest Server
X4 Rest Server aims to provide an external http/rest API for the game
This is mainly focused on other developers, to create external tools that provide extra functionality for second screens or similar.
It should work on Windows and Linux
The project should be primarily focused on data-out, not for interacting with the game from the far, or even cheating.
All without getting "modified"
We'll see how things shake out, however...
It works by loading a shared-library (.dll/.so) into the game.
The mod loads functions from the game, which are exposed via FFI, normally used for lua-scripts managing the game UI, and calls them directly. The results are then sent out as json via an inbuilt http-server
Due to the fact, that most code is generated, almost all endpoints use http-GET requests, even if changing values in the game. (We’ll see how long that stays…)
The project is currently in POC (proof of concept) stage.
A first alpha Release is available below
If you do want to contribute, feel free to check out the Github-Repo
Info / Download
https://alia5.github.io/X4-rest-server/
https://github.com/Alia5/X4-rest-server/releases
Demo:
[ external image ]
(click me)
X4 Rest Server aims to provide an external http/rest API for the game
This is mainly focused on other developers, to create external tools that provide extra functionality for second screens or similar.
It should work on Windows and Linux
The project should be primarily focused on data-out, not for interacting with the game from the far, or even cheating.
All without getting "modified"
We'll see how things shake out, however...
It works by loading a shared-library (.dll/.so) into the game.
The mod loads functions from the game, which are exposed via FFI, normally used for lua-scripts managing the game UI, and calls them directly. The results are then sent out as json via an inbuilt http-server
Due to the fact, that most code is generated, almost all endpoints use http-GET requests, even if changing values in the game. (We’ll see how long that stays…)
The project is currently in POC (proof of concept) stage.
A first alpha Release is available below
If you do want to contribute, feel free to check out the Github-Repo
Info / Download
https://alia5.github.io/X4-rest-server/
https://github.com/Alia5/X4-rest-server/releases
Demo:
[ external image ]
(click me)
Last edited by Alia5 on Thu, 7. May 20, 00:23, edited 6 times in total.
Re: [MOD/API][POC] X4RestServer - External http API
See a great oportunity for a second monitor info app, or even for example some galaxy news feed app fetching data from viewtopic.php?f=181&t=426035
Hoping that this project will get more attention.
Hoping that this project will get more attention.
X3 AP 3.1 + XRM
X3 AP 3.1 + LU
X3 AP 3.1 + LU
Re: [MOD/API][POC] X4RestServer - External http API
This sounds really good.
Could potentially also be used to build a "real" map of the current in-game sectors & economy with stations, trade offers etc being browsable in a GUI on a secondary PC or monitor, or to import existing station layouts into a station planner... there's great potential I guess as tools similar to what exists for Elite Dangerous could be build for example to allow better handling and understanding of your current ingame universe.
Could potentially also be used to build a "real" map of the current in-game sectors & economy with stations, trade offers etc being browsable in a GUI on a secondary PC or monitor, or to import existing station layouts into a station planner... there's great potential I guess as tools similar to what exists for Elite Dangerous could be build for example to allow better handling and understanding of your current ingame universe.
Re: [MOD/API][POC] X4RestServer - External http API
This is really, really awesome!! I cannot wait to see what cool things comes out of this.
Re: [MOD/API][POC] X4RestServer - External http API
From a layman perspective, what sort of information can it pull?
And how often can it update the information?
While I do not have the technical expertise to help with coding, I'm a designer and I'd love to design a use case for such a tool.
And how often can it update the information?
While I do not have the technical expertise to help with coding, I'm a designer and I'd love to design a use case for such a tool.
Re: [MOD/API][POC] X4RestServer - External http API
Pretty much everything that the ingame UI can show you.
Realtime.
Dev note: In the first iteration this is done via polling. At a later stage it is planned to look at how feasible it is to implement ServerSentEvents (SSE)
Re: [MOD/API][POC] X4RestServer - External http API
Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
Re: [MOD/API][POC] X4RestServer - External http API
Interacting with the game will definitely be implemented in a later version, but not in the way you imagined.
There are 1200 functions exposed that can probably all be used and I haven't looked through all of them, though.
There are 1200 functions exposed that can probably all be used and I haven't looked through all of them, though.
-
- Posts: 158
- Joined: Fri, 12. Jul 19, 14:03
Re: [MOD/API][POC] X4RestServer - External http API
This is already possible with the amount of progress SirNukes has made with his server. Someone just needs to spend the time making all of it.Max Bain wrote: ↑Fri, 1. May 20, 15:50Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
Re: [MOD/API][POC] X4RestServer - External http API
That would be really awesome I think and I think many ppl would like to play a bit together this way (and with mods).teleportationwars wrote: ↑Fri, 1. May 20, 19:13This is already possible with the amount of progress SirNukes has made with his server. Someone just needs to spend the time making all of it.Max Bain wrote: ↑Fri, 1. May 20, 15:50Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
Re: [MOD/API] X4RestServer - External http API
Awesome potential here! I've been wondering if the developers would themselves give us some read-only interface, but they may not have time.
Care to see what I've been creating? https://www.youtube.com/user/ytubrute
Re: [MOD/API] X4RestServer - External http API
I've just built a first POC for Linux!
It should be exactly the same as on Windows, functionality-wise.
Although, I haven't really tested this yet, as I cannot fully run X4 in my VM, and I currently don't currently have Linux installed on bare-metal.
https://github.com/Alia5/X4-rest-server ... /tag/0.1.1
Of course, one can build him-/herself
It should be exactly the same as on Windows, functionality-wise.
Although, I haven't really tested this yet, as I cannot fully run X4 in my VM, and I currently don't currently have Linux installed on bare-metal.
https://github.com/Alia5/X4-rest-server ... /tag/0.1.1
Of course, one can build him-/herself
-
- Posts: 153
- Joined: Thu, 2. Oct 14, 15:04
Re: [MOD/API] X4RestServer - External http API
I hope your work will get well.
I can see something like websites with satistic overviews, etc.
I can see something like websites with satistic overviews, etc.
Re: [MOD/API] X4RestServer - External http API
Do we have any indication from the X4 Devs that the DLL injection is not going to possibly be flagged through Steam or anything like that?
Re: [MOD/API] X4RestServer - External http API
Wow this is exciting !!
You have given me a project. (If I get a chance)
Make a website for displaying all the data, I'd look at logging account finance and storing that to an SQL lite data-base and use Google API to make charts showing asset changes over time periods chosen.
What would be interesting is getting global averages for all product prices and seeing how they change over time.
Man this is awesome!
You have given me a project. (If I get a chance)
Make a website for displaying all the data, I'd look at logging account finance and storing that to an SQL lite data-base and use Google API to make charts showing asset changes over time periods chosen.
What would be interesting is getting global averages for all product prices and seeing how they change over time.
Man this is awesome!
they have had almost 1000 years to terraform Aldrin, why are they all still sitting around a giant rock?
Catra wrote:
because you cant terraform a rock.
Catra wrote:
because you cant terraform a rock.
Re: [MOD/API] X4RestServer - External http API
Reading this literally made me jump back into the X universe, after a very long break. Years ago I've made a mod for X3 TC/AP which displayed ingame information on the Saitek X52 Pro's display, and also used the LEDs on the controller for various feedback. Your work could make it possible to port this to X4 now, and it could be even better than the original due to the possibilities in this API. I've waited out with X4 for quite long, but this was a trigger.
So I'm looking forward to see more of your work, and a big thank your for all the time invested in this.
So I'm looking forward to see more of your work, and a big thank your for all the time invested in this.
Re: [MOD/API] X4RestServer - External http API
bookmarked
Mods: RPG: Reputations and Professions, Social Standings and Citizenships, Crime has Consequences, Alternatives to Death. Missions/NPCs: Emergent Missions, NPC Reactions, Mod Parts Trader, High-sec Rooms are Locked, Hacking Outcomes, More Generic Missions, Waypoint Fields for Deployment. Others: Auto-cam, Friendly Fire Tweaks, Teleport From Transporter Room, Wear and Tear. QoL: Trade Analytics, Loot Mining, Ship Scanner, Signal Leak Hunter, Station Scanner, Surface Element Targeting, etc.
Re: [MOD/API] X4RestServer - External http API
I want to report a bug: This project is way to exciting!
I got it running on Linux
I got it running on Linux
Spoiler
Show
and may be aroused