![]() |
#1 |
Scout
Join Date: May 2009
Posts: 40
![]() |
Angband borg-friendly?
Hi,
After reading the borg-related recent posts, I thought about it: Does exist any standard approach/implementation/technique/feature like Windows DDE that can be used the same way in the Linux, Windows and Mac ports of Angband? This could lead to an interesting feature: borgs, bot players, etc., created by users as separate, plugin software. What would be necessary: - Add code to "listen" and "answer" the bot process, which would be another application. A protocol would be, probably, needed. No privileged information here, just an equivalent to the information shown in the screen (perhaps the simple screen dump would be enough and easier to implement). - Adjust the user-input code to accept input from keyboard or from this secondary input source. It would be funny to see a character played by a "ghost" player (like the 3.0.9 borg), and the developers hurrying to annouce: "My borg implementation is better", "Mage-optimized borg" or even "The best angband borg ever" ![]() |
![]() |
![]() |
![]() |
#2 |
Veteran
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 1,019
![]() |
You mean something like a pipe, or a simple TCP server+client?
|
![]() |
![]() |
![]() |
#3 |
Scout
Join Date: May 2009
Posts: 40
![]() |
Both could be used. The TCP/IP approach would add undesired side effects: a network-ready O.S. with TCP/IP protocol installed. I think almost every machine that runs angband today has TCP/IP installed (except NDS, I guess). This would lead to two different releases. Some people here wouldn't be happy
![]() Pipes: I know Windows has support to named pipes for interprocess communication. But what about Linux and Mac? The implementation for these OS'es would be similar? |
![]() |
![]() |
![]() |
#5 | |
Veteran
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 1,019
![]() |
Quote:
![]() I suppose the biggest issue now is whether the Nintendo DS has them (pipes, not pizza). But even if it doesn't, I guess it wouldn't be hard to #ifdef out all the related stuff from the DS port. |
|
![]() |
![]() |
![]() |
#6 | |
Veteran
Join Date: Jun 2008
Location: Los Angeles
Posts: 1,069
![]() |
Quote:
![]()
__________________
A(3.1.0b) CWS "Fyren_V" NEW L:50 DL:127 A++ R+++ Sp+ w:The Great Axe of Eonwe A/FA W H- D c-- !f PV+++ s? d P++ M+ C- S+ I- !So B ac++ GHB? SQ? !RQ V F: |
|
![]() |
![]() |
![]() |
#7 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,725
Donated: $40
![]() |
I don't think the input is a problem--after all, you can redirect standard input. The difficulty is how do you do the map? Right now, the borg works by screen scraping. To do that over a pipe, you basically need to implement another terminal interface, (maybe main-borg.c)
|
![]() |
![]() |
![]() |
#8 | |
Prophet
Join Date: Mar 2008
Posts: 2,724
![]() |
Quote:
Is there an easy way to make it read from stdin? |
|
![]() |
![]() |
![]() |
#9 | |
Angband Devteam member
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 42
Posts: 1,516
![]() |
Quote:
In the terminal, the input is coming from the controlling terminal, which isn't just a file descriptor but is actually a PTY. The different is that the curses code uses various ioctls and stuff to change the input between blocking/non-blocking IO, as well as various other things that curses does. So if you want to be in the middle logging input, you can't just use tee but you have to actually allocate your own pseudoterminal, set it up, etc. I started writing a script to try to "wrap" angband, passing the data back and forth asynchronously so you could have a log of input and/or output while still playing the game. I'm not optimistic about how well it will work given the potential buffering issues and the fact that curses does a lot of pty-level hackery that you'd have to make sure to actually intercept and pass off to the "real" terminal. I guess the short answer was "no". |
|
![]() |
![]() |
![]() |
#10 | |
Knight
Join Date: May 2009
Posts: 560
![]() |
Quote:
I'm not too keen on nds coding, (and I don't have the adapter yet to try) but here's a lib that should do tcp-ip |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Angband Borg 3.0.9 and windows | Zappa | Vanilla | 38 | October 27, 2010 21:31 |
Any recommended variants that are fairly noob-friendly? | BlackFlame | Variants | 15 | October 10, 2009 08:41 |
Towards an eco-friendly 3.1 | Donald Jonker | Vanilla | 22 | January 27, 2009 15:29 |
APW angband borg halts? | chief | Vanilla | 1 | December 1, 2008 22:21 |
Angband and the Borg on Linux | wastedyouth | Vanilla | 20 | July 23, 2008 01:08 |