Terminal Emulator within Unity

Hi all,

We are working on a non-game warehouse simulator which needs a dumb terminal interface to access an external stock management system.

We need to access this interface from within our Unity project.

Although we could attempt to build a freestanding app with a global floating window to sit on top of our Unity app it would be wonderful if we could somehow build a terminal emulator into our Unity project.

Can anyone see a way of building a Terminal Emulator into a Unity project?

Thanks

Jeff

It really depends.

Which terminal do you want to emulate? VT100, 3270, 5250? Some terminals are ASCII, but most are EBCDIC. While most of it is achievable as the protocols are thoroughly documented, I doubt you’ll be able to hook unity into a twinax adapter to actually talk to a midrange/mainframe.

If it’s not true terminal emulation you’re after, but just a telnet type interface talking through a socket you opened then that’s a piece of cake.

Hi Quietus,

I like the sounds of this ‘piece of cake’ :slight_smile: Yes all we need is a simple telnet type interface - similar to OSX Terminal app.

It would be great if this could be a kind of floating window within our Unity game so it can be moved around and positioned on screen.

Any pointers or an example would be awesome.

Many thanks

Jeff

Actually it looks like it will requite VT100 Terminal Emulation.

A simple telnet interface is easy, as it’s a simple matter of using a gui textarea with a terminal font.

VT100 is similar in concept, but the execution will take more work. VT100 uses the escape character as a signal for a command sequence.

http://ascii-table.com/ansi-escape-sequences-vt-100.php

They’re usually fixed width 80 or 132 columns. This makes your job of parsing the data a bit easier, as you can use an array to effect line wrap, moving the cursor about and such. You then simply construct a series of gui labels in your window, one for each line of the resulting array.

Scrolling regions might be a bit more complicated, but still doable.

The thing is though, do you really need to emulate the terminal, or just retrieve the data from a socket you open and use that within your non-game? Maybe if it’s true terminal emulation you want, it would be better just to have Unity launch an external app when appropriate. You could always use the shell to pipe the output to a file and have Unity read that.