Api?

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Re: Api?

Post by Killjaeden »

AquilaRossa wrote: Sun, 8. Sep 19, 08:41
External applications can processes data
A second of sync lag going thru a gate would not worry me though if the trade off was not getting really low FPS on stations etc. Not everybody has 16 or more threads, but it's heading that way (64 core Threadripper might be happening and a 16/32 core/thread Ryzen is due very soon, while I think Intel are going with 10 for desktop and 20 or more on their mega buck HEDT stuff). I would like the game to use those all threads though. it uses 8 cores max at the moment, or 8 just threads?
Someone posted a breakdown of x4 cpu usage. One thread for universe sim, two for rendering / simulation of current sector and one for something else. Idk how true that is - devs would know best.
So as far as cpu utilization goes there are lots of reserves on modern systems that are unused, still.
X4 is already hitting the limit at times, and cpu's won't get much more clockspeed in future either. So if it wont use more cores in future, we would already be at "premature dead-end" of the code base, like it was the single-core for X3 :gruebel:
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
SirNukes
Posts: 549
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Api?

Post by SirNukes »

Tamina wrote: Mon, 9. Sep 19, 17:57 One last question: X4 functions as a client? So X4 is connecting "to" pipes, created by an external server site?
I am asking because I just googled a bit and it seems easy to connect to pipes but difficult to create them, and rules out other high-level languages at this point. So it is either C++ or your Python :)


I wonder if it would be possible to use TCP/UDP sockets instead of pipes in your project :) (Not asking you to do it, but theoretically)
X4 is a client in my setup. It could be written the other way around, though serving takes a little more setup and is easier done on its own without messing around with C/lua dll bindings. Plus I wanted to keep the dll minimal, since some people might be concerned about security.

Clients are not actually that much simpler than servers in practice. While they can be opened as normal files (easy), that leaves them doing byte mode access (a headache). Opening them as client pipes allows for a simpler messaging mode. In general, a language just needs to provide appropriate Windows API bindings for pipe access.

I don't have experience with sockets (though I didn't have experience with pipes before this either). However, they look to be very heavyweight for simple local IPC. I don't really want to be bogging down X4 with socket protocol stuff, particularly for every-frame communication like with the hotkeys mod. Anyone is free to set up sockets if they want, replacing the dll and updating the lua code appropriately (and the python code if using my host server).

Return to “X4: Foundations”