Is there a way to display game data externally in oolite

News and discussion of the PC port of Oolite.

Moderators: winston, another_commander

Post Reply
Cmd_viperdad
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Sun Apr 19, 2020 5:35 am

Is there a way to display game data externally in oolite

Post by Cmd_viperdad »

Hi everyone,

I'm new to the game and this is my first post on the forum. I'm building a cockpit and was hoping to display med data on external screens like flight simmers (not sure if that's the term) do with radio sets etc.

Sorry if this is in the wrong section or been asked before but I can't find any info on it.

Thanks
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Is there a way to display game data externally in oolite

Post by phkb »

Cmd_viperdad wrote: Sun Apr 19, 2020 5:47 am
I'm new to the game and this is my first post on the forum.
Welcome aboard, commander!
Cmd_viperdad wrote: Sun Apr 19, 2020 5:47 am
display med data on external screens like flight simmers
If you mean is it possible to read data from an active game and use it outside of Oolite, the answer is probably, yes, but not in the standard game. The Java Console debugging tool reads data from an active game, so you could potentially use the same pathways for this purposes. But you would need to install the developer release.
Cmd_viperdad
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Sun Apr 19, 2020 5:35 am

Re: Is there a way to display game data externally in oolite

Post by Cmd_viperdad »

Hmmmm, that sound complex but worth more research. Thank you for the info. I may just make some seven segments and led blink randomly lol.
User avatar
gilhad
Competent
Competent
Posts: 58
Joined: Tue Oct 29, 2019 12:03 pm

Re: Is there a way to display game data externally in oolite

Post by gilhad »

I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly :)

( tail -f Latest.log | grep "## "| myprog.sh )
Lady of Fate, we adore you . . .
Cmd_viperdad
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Sun Apr 19, 2020 5:35 am

Re: Is there a way to display game data externally in oolite

Post by Cmd_viperdad »

Thanks Gilad. That seems like a workable solution. Would it be better in java script of is it objective C the other on?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Is there a way to display game data externally in oolite

Post by phkb »

JavaScript is the weapon of choice for oxp development.

Actually, is the only weapon. But you’re still free to choose it. :D
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Is there a way to display game data externally in oolite

Post by hiran »

gilhad wrote: Sun Apr 19, 2020 11:02 pm
I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly :)

( tail -f Latest.log | grep "## "| myprog.sh )
This third point (maybe there is a way to send such data to some COM port or any other Arduino accessible place) is the blocker. OXPs cannot send data anywhere but the debug console or the logs.

However meanwhile there is a way out: newer versions of OoliteStarter behave like a debug console but rather than bluntly displaying the message in a window it forwards them to MQTT. Plus OoliteStarter is able to receive messages from MQTT and feed it into Oolite.

It allows to add MQTT code to Arduino (and similar) projects so these devices can interact with Oolite. Be it to render information or to collect information for Oolite.

Have a look at
- https://github.com/OoliteProject/Oolite ... figuration
- viewtopic.php?t=21653
- viewtopic.php?p=297155&hilit=mqtt#p297155
Sunshine - Moonlight - Good Times - Oolite
User avatar
gilhad
Competent
Competent
Posts: 58
Joined: Tue Oct 29, 2019 12:03 pm

Re: Is there a way to display game data externally in oolite

Post by gilhad »

hiran wrote: Tue Sep 10, 2024 6:32 pm
gilhad wrote: Sun Apr 19, 2020 11:02 pm
I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly :)

( tail -f Latest.log | grep "## "| myprog.sh )
This third point (maybe there is a way to send such data to some COM port or any other Arduino accessible place) is the blocker. OXPs cannot send data anywhere but the debug console or the logs.
For that is the fourth point - log it to file, have somewhere else running program, that read the log as it is written a acts on the data somehow (eg. send it to Serial port for Arduino, or display results in window, or anything else or all together :))

But MQTT is nice solution too
Lady of Fate, we adore you . . .
Post Reply