Text Message Injection?

Tips, tactics, and general discussion for Evochron Legacy.
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Text Message Injection?

Post by matchbox2022 »

Was curious if there was any way to "dynamically" add text to Evochron as a message...similar to how I could type a message in chat and even in Single player it will show up in the message box.
Idea being (limited to some characters) of having 2 text files...one to tell the game "messageinputswitch is on" and another what messageinput actually is in perhaps a single string variable. In the switch, the game could check while a pilot is loaded on start, every so often in a variable of milliseconds to see if messageinput exists, and then print it to the message box...
Perhaps the first line in messageinput could be the colour of the message, and the second, third be the output of the text to the players messagebox?

To avoid meaningless loops, it could simply delete the file after printing. After the ms interval has passed, it would check to see if the text file exists. If it doesn't, the game moves on with life.

Just a thought for future mods and perhaps even scripts for quests to dynamically generate messages based on circumstances currently the game doesn't look at. Currently this is done by modders through wave files, but I feel to not annoy the player and give them a preference for no sound, echoing some short string text would be better.

The game DOES this when logging onto a server, probably printing some server message, so there's obviously "a way in" I just wish I knew how!
The only other way I can think of is with scripting some key presses and I really don't want to do that, it's awful and clunky and gets in the way of the player input.
I don't know how hard it would impact performance, obviously a small interval to check isn't ideal, perhaps starting at every 1 - 2 seconds as a minimum allowed value?

Crazy idea, I don't know if there's already a way built into evochron to do this or not, or some back alley way in from what I can see of its behaviour.

I've seen at least a couple tools people have used to manipulate the exported data the game currently uses (which are great additions), I suppose what it is missing is a way "in" to inform the player.
User avatar
Vice
Administrator
Administrator
Posts: 11558
Joined: Fri Apr 25, 2003 1:38 am

Re: Text Message Injection?

Post by Vice »

Outside of quest events/stages, no not currently. An internal file query would indeed likely introduce some negative performance implications. I can't think of a 'clean' way to do that at the moment, but I'll ponder it for a bit and reply here if something comes to mind.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 13936
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Re: Text Message Injection?

Post by Marvin »

Do you have a couple examples of how this would work? Or why you would want it? Would it be necessary to have this part of the game instead of an overlay like the (now defunct) Navigator's Assistant?
User avatar
Vice
Administrator
Administrator
Posts: 11558
Joined: Fri Apr 25, 2003 1:38 am

Re: Text Message Injection?

Post by Vice »

It might be possible to preload time driven text messages, adding them to the message log when the targeted time is reached. This would parallel the quest system (basically just duplicating it for the non-quest mode). But it may carry the limitation of one load operation at startup, manual loading by the player when prompted, or something similar. So I'm not sure how useful such an option would be for the end objective. Nor how it would be any different/better than the quest option.

An overlay or other external approach might be a better route as there'd likely be less chance of the game having to interrupt something else it needs to do in order to load and queue a message from a file.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Re: Text Message Injection?

Post by matchbox2022 »

I was specifically thinking about custom messages when you dock at certain outposts, and for the voice attack profile I was looking at on here the voice addition is extremely annoying for every little action, but as text it would be far less intrusive and still get the point across that your voice was "verified" and things are being preformed.
Add to that for my hardcore modification, some people simply might not want random sounds blaring or alerts playing, as it gets annoying over time...so a gentle nudge of text would likely suffice much better in those circumstances.

Sure, it is super duper easy "outside of the game" in batch or an application but that definitely breaks immersion for those on VR or without multimonitors.
The quest is fine for some things, but anything "dynamic and day to day evochron" it won't do.
The ultimate would be something akin to typing in a command such as "plotto: pearl" and a batch script seeing it in the messagelog and going "aha, I know what to do, checking a directory of familiar planets, your current location, and sending key presses to the nav console to plot a course using known gates...all while you go get scotch.
That is not happening anytime soon.......that'd be an insane amount of work to do.....but it's possible, something like, "mine" and it doing likewise while you begin at an asteroid, and it monitors your bays, while you get scotch.

However instead of getting a blip on a cmd prompt, html browser, or a sound effect.....having the response be a real text input to your screen just makes sense and is less intrusive (so you know it actually worked versus it broke or some condition isn't met...other than you're out of scotch).

I'm unaware of any overlays or applications that would really work for this purpose, or easily compatible with VR...though that's the simplest route obviously
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 13936
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Re: Text Message Injection?

Post by Marvin »

Since it's already possible to import most of the game data into a 3rd party program, an overlay could be developed to display some kind of comment every time certain situations arise. Using C# you could probably program most of the audio playback, similar to what's in VA ... which I'd find more helpful than trying to read extraneous information in Chat (if you don't want audio, then a pop-up message, independent from Chat, is more likely to get my attention).
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Re: Text Message Injection?

Post by matchbox2022 »

Yah, but this is primarily for me, I'd appreciate it just being "in game" and easy to access.
Making a popup message is not ideal, and I can already do audio alerts it's just that they can get annoying to some people, so I figured this was a better minimalist way of doing it. The only thing imo that'd work would be some kind of overlaid injector, like reshade, but again I don't want to be adding too many "other things" that people would need to run to properly access any scripts I make. Plus then there's the compatibility with VR aspect....it just seems more and more to me to use what the game already has, a working message box that does a lot of these things already.
User avatar
Vice
Administrator
Administrator
Posts: 11558
Joined: Fri Apr 25, 2003 1:38 am

Re: Text Message Injection?

Post by Vice »

I'll run some performance tests and analyze what kind of impact chronically polling for file existence and data might have on the game, then maybe try out some ideas if the results are positive. I could see this panning out using a two stage system. First, the existence of one file during startup would prompt the game to look for a message file (and maybe provide a way to set the frequency of checking in milliseconds). Second, if the file exists (likely in the save data folder), the game waits for the specified timeframe, then checks for the existence of another file holding a message (again in the save data folder). If the second file exists, the game loads the message line(s) and then displays them in game, then deletes the file to make room for new messages. This way, custom text could be imported and if the message queue file still exists, any external program would know that the game hasn't yet loaded and displayed the pending text message. Once the file is cleared, the external program would know that it can send another message when needed.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
User avatar
Vice
Administrator
Administrator
Posts: 11558
Joined: Fri Apr 25, 2003 1:38 am

Re: Text Message Injection?

Post by Vice »

Ok, performance tests went well. Here are some notes I've formulated for the system:

To enable the text import mode, create a text file named 'messagelogoutput.txt' inside the game's save data folder (default location '\Documents\EvochronLegacySE') and in the first line, specify how frequently you want the game to check for messages in milliseconds (more frequent checks may result in more of a performance impact). A good average might be 1000 for checking once a second. Once enabled, the game will look for a file named 'messagelogqueue.txt' inside the same save data folder. If that file exists, then the game will load the data using the following format:

- Number of lines to load
- Line text
- Text color in RGB format

So for example, if two lines of data were to be displayed, it would look like this:

2
Line one text.
0,255,0
Line two text.
0,255,255

Line one would be loaded and displayed in green while line two would be loaded and displayed in cyan. The game will then delete the 'messagelogqueue.txt' file to make room for any future messages to be displayed.

I've e-mailed you a link to a test build with this feature available.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Re: Text Message Injection?

Post by matchbox2022 »

*giggles* man you're the best Dev ever. This would be a huge addition for modders.
User avatar
Craig68x
Ensign
Ensign
Posts: 37
Joined: Mon Mar 08, 2021 7:46 am
Location: Texas

Re: Text Message Injection?

Post by Craig68x »

For the layman people who may be reading this:
  • Exactly what does this do?
  • For what purpose?
  • Is this for multiplayer only?
  • Why would I need this?
  • What are the benefits?
Stuff like that...
User avatar
Vice
Administrator
Administrator
Posts: 11558
Joined: Fri Apr 25, 2003 1:38 am

Re: Text Message Injection?

Post by Vice »

Exactly what does this do?
This allows modders to display custom text messages within the game's internal message log, rather than requiring such text to be overlayed on top or integrated into the game's quest system.
For what purpose?
If they want to display a message to the player from an external program. For example, a program designed to interact with the game using the existing savedata system or to provide control input could report results or responses to the player after the player completes an action (such as giving a command or selecting an option).
Is this for multiplayer only?
No, single player and multiplayer.
Why would I need this?
You may not. This would primarily be for those interested in using third party programs to interact with the game.
What are the benefits?
It allows custom notifications to be displayed to a player outside the confines of the quest system, audio only, or requiring an overlay of some kind. By providing access to the message log, such notifications can be displayed within the game's internal rendering and message log systems, allowing the player to use the same viewing method as all other in-game messages with the same controls and options.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 13936
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Re: Text Message Injection?

Post by Marvin »

For example, I suppose a modder could add the ability of Chat to display the time of day (local or zulu) every 60 seconds.
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Re: Text Message Injection?

Post by matchbox2022 »

It's a tool, not really a feature that most players will use. It wouldn't add anything to anyone playing the game vanilla, but "in theory" if you really wanted to you could send a 3rd party tool message as an injected message into the game.
For my hardcore mode and the voice attack functionality, if you don't want voices but some kind of minimalistic confirmation of a command or event without audio, this would simply make a message ingame to confirm that it happened. That's my main focus with this tool.

It opens a lot of creativity for mods, the ability to get info in and out of game easily. messagelog is also a very recent addition and is already being used by Voice Attack to determine alot of extra information to dictate to you by the voice overlay.
So now, if literally Im playing with VR, it can tell me what a program monitoring a stock price for example notices. That 3rd party app could auto export a log, and my batch file can check if it's changed within a range, if it has it would export an alert file which my batch could translate into an echo message to print into the game, and therefore no switching windows and I can stay in VR knowing something about my computer (this would work for CPU throttling too or any errors generated on my host computer while streaming). I could ask it to play a song in game chat, the batch would recognize my command from the messagelog, and pipe back the song as well as a confirmation that yes I'm playing this for you now as a command in game. So there's no window switching to confirm, it will tell me in game if it was successful, nor issues in VR with it.
Possibilities are endless :P Can also be used for dynamic events even during quests or stories that stretch outside of your Evochron game.
matchbox2022
Commander
Commander
Posts: 609
Joined: Fri Nov 13, 2015 3:21 pm

Re: Text Message Injection?

Post by matchbox2022 »

Marvin wrote: Sun Mar 28, 2021 3:50 pm For example, I suppose a modder could add the ability of Chat to display the time of day (local or zulu) every 60 seconds.
Yup, but that's pretty lame. imo it'd be much more useful for integrating with other 3rd party apps focused on Evochron.
for me, that'd be something like hardcore mode or overclocking via in game text with input text to the game warnings if there's too much real heat.
I can do all of that, my issue was getting "into" the game.
If could also dynamically overclock when next to planets etc, but I'd like to not have to confirm things are working by removing a headset or switching my only window out of full screen...this way the game will just tell me via the batch "broker" script.