Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old April 3, 2017, 21:47   #1
Gwarl
Adept
 
Join Date: Jan 2017
Posts: 103
Gwarl is on a distinguished road
Borg?

I haven't been able to find/use a working borg. I have seen that the WPMBorg is updated reasonably often but the binaries don't seem to be giving me a borg - ctrl+z just suggests I press ?

I've noticed many variants have borg message/borg status windows as options and in the drop down window menus there's a greyed out 'screensaver'. Where can I get a working borg, for any version/variant, not that fussy which.
Gwarl is online now   Reply With Quote
Old April 3, 2017, 22:04   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 51
Posts: 6,315
Donated: $60
Nick is on a distinguished road
The APW borg for 3.4.1 is the most recent Vanilla borg, and can be found here.

One of the first things I did as maintainer was to remove the borg, because even early changes I was making were breaking it so horribly that I was spending more time on the borg than the game. I was not at all happy about that - I was introduced to Angband via the borg - but saw no option.

I live in hope that someone will rewrite the APW borg or write a new one, but that person is not likely to be me.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old April 4, 2017, 01:39   #3
Gwarl
Adept
 
Join Date: Jan 2017
Posts: 103
Gwarl is on a distinguished road
What's the history of the both? I saw the thangorodrim page with a lot of dead links, but were there any releases with a Borg included as part of the vanilla game?
Gwarl is online now   Reply With Quote
Old April 4, 2017, 01:56   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 51
Posts: 6,315
Donated: $60
Nick is on a distinguished road
I believe the borg first came into the official codebase about 3.1, and was there until 3.5.1.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old April 4, 2017, 18:13   #5
Siemelink
Rookie
 
Join Date: Feb 2014
Location: Hungary
Posts: 16
Siemelink is on a distinguished road
Quote:
Originally Posted by Nick View Post
The APW borg for 3.4.1 is the most recent Vanilla borg, and can be found here.

I live in hope that someone will rewrite the APW borg or write a new one, but that person is not likely to be me.
I've played with the thought from time to time. What kept me is the rather steep learning curve. So much code.
I always found the borg clumsy with gathering game data. It is all coded double! Once in the game and once for the borg. I know that is proper separation, but it dooms the maintainer to endless code updates to match game changes. Hackers just shrug and would read game data directly.
Another approach is that the game prepares read-only tables for the borg / display / addons to use. Maybe this would survive game updates best.

Nick,
how do you feel the separation could be handled?

Regards, Willem.
Siemelink is offline   Reply With Quote
Old April 4, 2017, 19:11   #6
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,725
Derakon is on a distinguished road
A proper Borg implementation would basically exist as a new virtual terminal and input source, so it would read the output provided by the game just like a human player would and send input keystrokes just like a human player would. Well, except that it would be able to see "tile (5, 10) has a blue "Z" in it" instead of having to do computer vision.

This would require writing code to let the borg make sense of the more textual aspects of the game, like reading the inventory, understanding modifiers on equipment, etc. So it's not ideal from that perspective. The way I would solve that would be to provide a way for the core engine to expose object data in a non-text format, though. So you could ask the engine "give me the monster data for all monsters in LOS" and it would return a list of monster structs, for example. Or "give me the object data for the item in inventory slot 5". Nothing that the player couldn't determine through the normal UI, but a lot easier for a computer program to interpret, while still maintaining good separation between the engine and the borg.
Derakon is offline   Reply With Quote
Old April 4, 2017, 20:51   #7
Pondlife
Scout
 
Join Date: Mar 2010
Location: UK
Posts: 35
Pondlife is on a distinguished road
Quote:
Originally Posted by Derakon View Post
The way I would solve that would be to provide a way for the core engine to expose object data in a non-text format, though. So you could ask the engine "give me the monster data for all monsters in LOS" and it would return a list of monster structs, for example. Or "give me the object data for the item in inventory slot 5". Nothing that the player couldn't determine through the normal UI, but a lot easier for a computer program to interpret, while still maintaining good separation between the engine and the borg.
That would basically be writing an Angband API, which would allow many different front-ends to play the game.
__________________
Playing roguelikes on and off since 1984.
rogue, hack, moria, nethack, angband & zangband.
Pondlife is offline   Reply With Quote
Old April 4, 2017, 21:18   #8
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,725
Derakon is on a distinguished road
Quote:
Originally Posted by Pondlife View Post
That would basically be writing an Angband API, which would allow many different front-ends to play the game.
Yes, exactly. As I understand it, we have a pseudo-API currently in the virtual terminal system and ways of sending input to the game, but the "exchange format" the API uses is not really conducive to anything besides displaying game content in something like the traditional display.
Derakon is offline   Reply With Quote
Old April 4, 2017, 22:32   #9
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 51
Posts: 6,315
Donated: $60
Nick is on a distinguished road
The game is now set up so that when you play
  • the interface accepts keystrokes and interprets them as commands, then pushes them onto the game's command queue;
  • the game sends events to the interface when the game state changes, so the interface can display them.

There are actually some build tests which run a small game by pushing command directly, so
Code:
	cmdq_push(CMD_WALK);
	cmd_set_arg_direction(cmdq_peek(), "direction", 2);
	run_game_loop();
	cmdq_push(CMD_WALK);
	cmd_set_arg_direction(cmdq_peek(), "direction", 8);
	run_game_loop();
	cmdq_push(CMD_GO_DOWN);
	run_game_loop();
steps down, steps up and then goes down the stairs, and
Code:
	cmdq_push(CMD_WALK);
	cmd_set_arg_direction(cmdq_peek(), "direction", 2);
	run_game_loop();
	cmdq_push(CMD_DROP);
	cmd_set_arg_item(cmdq_peek(), "item", player->upkeep->inven[0]);
	cmd_set_arg_number(cmdq_peek(), "quantity", player->upkeep->inven[0]->number);
	run_game_loop();
	cmdq_push(CMD_EAT);
	cmd_set_arg_item(cmdq_peek(), "item", square_object(cave, player->py, player->px));
	run_game_loop();
steps down, drops some food on the floor and then eats it (ew). This is how the borg should drive the game, but I don't think that's really the question.

I guess really the borg should be getting all its information from the events (see game-event.h); the main issue there is that a lot of the information is wrapped up into EVENT_MAP, which tells the display how to update.

I don't know how helpful this is - I haven't thought in depth about how a borg should work.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old April 6, 2017, 00:05   #10
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,809
Donated: $40
takkaria is on a distinguished road
Also the map_info() function returns a struct for a given grid that tells you what's in it, some of which you can cheat from and some of which is just what the player can see:

Code:
struct grid_data {
	u32b m_idx;				/* Monster index */
	u32b f_idx;				/* Feature index */
	struct object_kind *first_kind;	/* The kind of the first item on the grid */
	struct trap *trap;		/* Trap */
	bool multiple_objects;	/* Is there more than one item there? */
	bool unseen_object;		/* Is there an unaware object there? */
	bool unseen_money;		/* Is there some unaware money there? */

	enum grid_light_level lighting; /* Light level */
	bool in_view; 			/* Can the player can currently see the grid? */
	bool is_player;
	bool hallucinate;
};
I think this plus the command queue stuff means the borg could drive the game fairly well without recourse to screen-reading.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Borg 3.4.1 updated APWhite Vanilla 13 October 2, 2015 18:55
The APW borg comes to v4 Magnate v4 0 November 15, 2011 23:49
Angband 3.2.0 Borg kurie Vanilla 56 October 14, 2011 12:26
Borg on Twitter APWhite Development 9 May 3, 2011 10:17
softcoded borg grassy Vanilla 1 September 7, 2010 12:18


All times are GMT +1. The time now is 20:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.