So I thought I was on a role when I got to this point:
I had successfully butchered the consoleframework library and managed to nab a C# wrapper for NCurses which I was chopping up and adding to as needed. (I could put a character anywhere on screen.)
But sadly that's as far as I can get without more specific C/NCurses knowledge. - The hurdles here are that I can't see a way to get C# to play nicely with the colours (and fear it would be slow and clunky anyway with lots of pre-calculated combinations of background and foreground) and I can't get it to display codepage 437 or any UTF8 characters even when going down the suggested route of using ncursesw (the W apparently stands for wide-characters (longer than 8 bit)).
You can see the simplicity of the program I was trying to test out (left) and the monstrosity I was attempting to interface with (right) here:
I just feel this is out of my reach; we made all these innovations in cross-compatible game engines, but left out cross-compatible consoles by the looks of it. (The suggested solution is to go one layer higher than this and use CursesSharp - but this seems to expect the Windows user to have PDCurses installed and the Linux user to have NCurses installed - a tall ask for a simple text game: it's not exactly Crysis) (Not to mention the CursesSharp documentation suggests the Windows PDCurses integration doesn't even work yet and the library hasn't been updated in 5 years or so.)
I once again retire in vain hopes someone says something like "Oh, this is easy - I do this all the time - just do X,Y,Z and boom, addressable Linux terminal characters
"
</deflated>
EDIT:I stumbled around last night coming to terms with having to just make my own terminal using something like MonoGame (a whole project in itself but well within my abilities) but then as I was turning in for the night I realised the example I'd tried for
consoleframework had been using cyrillic characters and colours so there must be a way to do it - plus, I had all the source code.
Setting out this morning, I managed to track down exactly the point in their code where they're pushing characters and colours to the screen in a nice O(n²) just like me :D. This showed me what I needed to do in order to display UTF-8 characters, so that's one hurdle overcome, however the colours just seem to emanate from a black box (despite me thinking I'd laid eyes on the code to do this yesterday).
One final problem I did not anticipate was that the default terminal in the Ubuntu VM I'm using is not automatically set to a monospace font. I can't seem to find a way to set this programmatically online but sure enough if the user sets it themselves, it is at least possible to get this output now: (notice the smiley faces)
So there is still the matter of colour, input and music to overcome, but I fear this may reach a point where the best solution is to simply say to any Linux user: "Set your console font to monospace when playing Startron or it's gona look odd."
The battle rages on...
EDIT2:Ok I've worked out how colour works - sadly this seems to be done by pushing pairs of foreground and background colour into memory (which I suspect is costly to perform on the fly) so I'm going to need some big table of precalculated pairs for all the combinations by the looks of it.
I also need to figure out how one is to get to all 16 colours afforded by the Windows console (NCurses only seems to have 8 presets). I'm hoping this is controlled with the A_STANDOUT or the A_DIM attributes I've been seeing in demos. But failing that, there does appear to be a handle for providing custom RGB values which I would just match to the Windows 10 console if it came to that.
(Oh and good news, it appears once the terminal has been set to a monospaced font, it keeps that setting, so Linux users need only apply this the first time they run Startron.)
The battle rages slightly less fiercely now...
EDIT3:Accessing all 16 colours for foreground is not a problem - the A_DIM attribute affords me this palette swap nicely - I am attempting to find a way to do the same for background colour. :S
EDIT4:Apparently just going beyond the original 8 colours defined in the NCurses library allows me to specify bright and dark without needing the A_DIM attribute (which is good because it was refusing to work simultaneously on foreground
and background which would have been a severe limitation for Startron.
So having cracked that one as well, with the exception of a black character on a black background (top left), I've not only got access to all 256 combinations (precalculated and ready for Strartron when I need it) but also copied all their RGB values from cmd.exe which is a bonus I was not expecting when embarking on this journey. (It is highly likely I will be making an entire API available for this cmd.exe -> Linux parity work so others can benefit from this if they so wish.)
EDIT5:I have input working!
My next port of call here is to tidy all this up into some kind of a wrapper and then swap to the Startron source to go about implementing an OS switcher and dealing with any dotnet problems.
(I'll deal with the music another day once I've established I can get Startron to actually run on Linux ... finally
)