Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Dwarf Fortress over SSH/Telnet  (Read 20239 times)

Random832

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #15 on: March 27, 2009, 07:53:38 am »

Well for unix clients you can't send cp437 because the characters simply aren't present in the 8-bit fonts commonly used [you could send utf-8 i guess]

Anyway, I could probably write the code in platform-independent .NET which could run in mono.
« Last Edit: March 27, 2009, 07:59:35 am by Random832 »
Logged

Vucar Fikodastesh

  • Bay Watcher
  • Grand Master Explorer
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #16 on: March 27, 2009, 12:57:47 pm »

Anyway, I could probably write the code in platform-independent .NET which could run in mono.

And on a Pocket PC.

I hope. :(
Logged
I think it's a vastly amusing thought that elephants are so afraid of heights that when Dwarves invented the Z-axis, they couldn't bear to face dwarves in combat anymore.

Mr.Person

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #17 on: March 27, 2009, 05:02:34 pm »

If the client runs on, say, DOS, could you run DF through DOS (in a sense)?
Logged
Youtube video of the year, all years.
Hmm...I've never been a big fan of CCGs - I mean, I did and still do collect Pokemon cards, but I never got heavily into the battling and trading thing.

By definition that makes you a fan since you still buy them.

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Dwarf Fortress over SSH/Telnet
« Reply #18 on: March 27, 2009, 11:17:58 pm »

Well for unix clients you can't send cp437 because the characters simply aren't present in the 8-bit fonts commonly used [you could send utf-8 i guess]

Anyway, I could probably write the code in platform-independent .NET which could run in mono.
Anyway, if you do insist on writing your own client, I recommend just extending the ANSI escape sequences considering there's already a reference server using telnet.

Btw, if the protocol requires sending those long strings, that's probably just bad.

I discovered through help with testing, that my simple ANSI version was still horrendously slow and was unresponsive (approx data rate of 1-3kb / sec).  It only became marginally useful after I limited the update rate to about 10 frames a second, even then it was still very laggy.
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #19 on: March 28, 2009, 10:56:23 am »

Well for unix clients you can't send cp437 because the characters simply aren't present in the 8-bit fonts commonly used [you could send utf-8 i guess]

Anyway, I could probably write the code in platform-independent .NET which could run in mono.
Anyway, if you do insist on writing your own client, I recommend just extending the ANSI escape sequences considering there's already a reference server using telnet.

Btw, if the protocol requires sending those long strings, that's probably just bad.

What long strings? Oh, are you misinterpreting my description? Each "01 " is supposed to be one byte - not all of them are printable characters so i used a hex dump. "01 4F 18" in my protocol is the equivalent of "1B 5B 37 39 3B 32 34 48" [i.e. ESC[79;24H"] in ANSI.

For anything you'd actually be sending in ANSI, this protocol's version of that would be shorter - if you're sending a whole frame at a time in ANSI [rather than just updating the parts that change] and setting the attibutes for every character, that's up to eighteen kilobytes per frame, as opposed to six for my protocol's full-frame-update code. If you're sending less, less will be required.

And have you considered a black-and-white version? Removing color info (or limiting it in some way) removes a lot of the data, and should be good enough for spectating.

The problem with "extending the ANSI escape sequences" is that I would then have to implement all of the ansi escape sequences in the first place, which means more work, which means more time before we can even think about adding support for graphics etc.

Incidentally - how smart is your program about scrolling? Does it in any way know if the reason the screen is being redrawn is because everything in the main window is being moved ten spaces downwards because the user is scrolling up? That could be captured very efficiently in an extended protocol
« Last Edit: March 28, 2009, 11:00:59 am by Random832 »
Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Dwarf Fortress over SSH/Telnet
« Reply #20 on: March 28, 2009, 12:55:05 pm »

I asking was more about the usage of "SETCURS", "SETATTR", etc.  But from what you said, I'll take it as a no.

Actually it run-length encoded the attribute changes and did partial updates.  One of the first changes I made, after I got the server working and sending screens.

I hadn't thought of sending black-and-white, but it again comes to a ton of information loss.

I was actually going to implement scrolling detection, but since I found  no easy way to convey scrolling through ANSI, I never bothered to implement it.
Logged

Random832

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #21 on: March 28, 2009, 01:04:14 pm »

I asking was more about the usage of "SETCURS", "SETATTR", etc.  But from what you said, I'll take it as a no.

Actually it run-length encoded the attribute changes and did partial updates.  One of the first changes I made, after I got the server working and sending screens.

I hadn't thought of sending black-and-white, but it again comes to a ton of information loss.

I was actually going to implement scrolling detection, but since I found  no easy way to convey scrolling through ANSI, I never bothered to implement it.

There are ANSI extension commands for scrolling - VT100 commands for vertical scrolling (only problem is it scrolls the whole width of the window, you'd have to redraw the sidebar) and you could insert/delete for horizontal scrolling (one command per line, but better than redrawing the whole screen). Those are reasonably well-supported by all terminal emulators. Inserting is also the way most programs get around being unable to draw to the lower right corner without scrolling - draw to the position immediately before it and then insert.
Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Dwarf Fortress over SSH/Telnet
« Reply #22 on: March 28, 2009, 03:53:01 pm »

(only problem is it scrolls the whole width of the window, you'd have to redraw the sidebar)
I believe that's why I didn't find it useful enough, because with the sidebar, I'd still end up sending half of the screen, just to scroll by one.
Logged

MHardeman25

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #23 on: April 20, 2011, 03:39:15 pm »

The way I would have approached it is to stream a video of Dwarf fortress, and just stream back keystrokes from the client. Seems like a no brainier really. I think I might just work on that if I get some spare time.
Logged

Adeon

  • Bay Watcher
  • Obey.
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #24 on: April 20, 2011, 04:20:09 pm »

tl;dr - Dwarf Fortress? Possible over Telnet or SSH?

Linux version of Dwarf Fortress has TEXT print mode which makes it run in a terminal. So it's easy to run it through SSH.

Dfterm2 was made for this kind of thing on Windows. It enables telnet play and can manage multiple DF games at the same time (if wanted). http://www.bay12forums.com/smf/index.php?topic=50643.0
Logged
I make dead people. Dfterm3

Kadath

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress over SSH/Telnet
« Reply #25 on: April 21, 2011, 04:05:24 am »

The way I would have approached it is to stream a video of Dwarf fortress, and just stream back keystrokes from the client. Seems like a no brainier really. I think I might just work on that if I get some spare time.




Also,
Quote
X11 forwarding with SSH seems to work for me, although it's kind of laggy.
Logged
Pages: 1 [2]