![]() |
#21 | |
Rookie
Join Date: Apr 2011
Posts: 18
![]() |
Quote:
jtw |
|
![]() |
![]() |
![]() |
#22 |
Angband Devteam member
Join Date: Apr 2007
Posts: 334
![]() |
I haven't tried it yet, but you may want $HOME/Library/Preferences/Angband. (I wonder whether it is more idiomatic to use $HOME/Library/Application Support/Angband instead...)
|
![]() |
![]() |
![]() |
#23 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
After compiling the game with the borg enabled and you use ^zu what does the borg say in the log? Does it say something like 'no valid borg.txt file found'? |
|
![]() |
![]() |
![]() |
#24 |
Apprentice
Join Date: Sep 2008
Posts: 74
![]() |
I now have the 3.20 version running in XScreensaver (on fedora core 13, I see no reason why other distros would differ in this case), with some judicious comparing from this thread: http://angband.oook.cz/forum/showthread.php?t=1598 and the suggestions from APWhite from this thread.
Minor pains: - I seem to have broken the ^z key combo, but starting with -x does autostart the borg. - I have not yet looked into getting multiple 'windows' on the root window. |
![]() |
![]() |
![]() |
#25 | |
Rookie
Join Date: Apr 2011
Posts: 18
![]() |
Quote:
Now, why would i be getting an "Out of memory" window that pops up after about 6 hours causing the game to abort while borg is running (and not saving before it does). And is there a way (besides the screensaver) to get borg to respawn upon death? jtw Last edited by jtwadsworth; April 19, 2011 at 03:35. |
|
![]() |
![]() |
![]() |
#26 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,559
Donated: $60
![]() ![]() |
Quote:
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
|
![]() |
![]() |
![]() |
#27 |
Apprentice
Join Date: Sep 2008
Posts: 74
![]() |
Steps:
# Get the borg src (320borg.zip) mkdir ./borg-src cd ./borg-src # Lower case extract files unzip -L -a path/to/320borg.zip # change all '#include "tvalsval.h"' in .h and .c files to '#include "object/tvalsval.h"' # copy all files that do not exist in angband source tree to it # get vroot.h from somewhere (I took it from Nick's files in http://angband.oook.cz/forum/showthread.php?t=1598) # personally, I just did a make install eventually, and put # '/usr/local/games/angband -x \n\' in my XScreensaver files # (see the above mentioned thread for details.) Most thanks actually go to 'JoeB' and Nick for doing the work in 2009! diffs (Large!): One change in the borg files: Code:
diff --exclude *.o ../angband-3.2.0-borg/src/borg9.c ./original-borg-src/borg9.c 5c5 < #include "object/tvalsval.h" --- > #include "tvalsval.h" 6035d6034 < if (auto_start_borg) cmd = 'z'; 6052,6057c6051 < < /* Hack -- don't run this if auto_start_borg is TRUE */ < if (auto_start_borg == FALSE) < { < if (!get_com("Borg command: ", &cmd)) return; < } --- > if (!get_com("Borg command: ", &cmd)) return; Changes to original Angband 3.2.0 sources: Code:
diff --exclude *.o ../angband-3.2.0-borg/src/birth.c ../angband-3.2.0/src/birth.c 496d495 < * apw -- screensaver needs extern 498c497 < extern void wield_all(struct player *p) --- > static void wield_all(struct player *p) 1065,1146d1063 < #ifdef ALLOW_BORG < /* Generate our first borg */ < if (screensaver) < { < player_init(p_ptr); < do_birth_reset(quickstart_allowed, &quickstart_prev); < rolled_stats = FALSE; < < /* Male */ < p_ptr->psex = 1; < player_generate(p_ptr, NULL, NULL, NULL); < /* Human */ < p_ptr->prace = 0; < player_generate(p_ptr, NULL, NULL, NULL); < reset_stats(stats, points_spent, &points_left); < generate_stats(stats, points_spent, &points_left); < rolled_stats = FALSE; < /* Warrior */ < p_ptr->pclass = 0; < player_generate(p_ptr, NULL, NULL, NULL); < reset_stats(stats, points_spent, &points_left); < generate_stats(stats, points_spent, &points_left); < rolled_stats = FALSE; < < /* Set adult options from birth options */ < for (i = OPT_BIRTH; i < OPT_CHEAT; i++) < { < op_ptr->opt[OPT_ADULT + (i - OPT_BIRTH)] = < op_ptr->opt[i]; < } < < /* Reset score options from cheat options */ < for (i = OPT_CHEAT; i < OPT_ADULT; i++) < { < op_ptr->opt[OPT_SCORE + (i - OPT_CHEAT)] = < op_ptr->opt[i]; < } < < /* Get a new character */ < get_stats(stats); < < /* Update stats with bonuses, etc. */ < get_bonuses(); < < /* There's no real need to do this here, but it's tradition. */ < get_ahw(); < get_history(); < < roll_hp(); < < squelch_birth_init(); < < /* Clear old messages, add new starting message */ < history_clear(); < history_add("Began the quest to destroy Morgoth.", HISTORY_PLAYER_BIRTH, 0); < < /* Reset message prompt (i.e. no extraneous -more-s) */ < msg_flag = TRUE; < < /* Note player birth in the message recall */ < message_add(" ", MSG_GENERIC); < message_add(" ", MSG_GENERIC); < message_add("====================", MSG_GENERIC); < message_add(" ", MSG_GENERIC); < message_add(" ", MSG_GENERIC); < < /* Give the player some money */ < get_money(); < < /* Outfit the player, if they can sell the stuff */ < if (!OPT(adult_no_selling)) player_outfit(p_ptr); < < /* Initialise the stores */ < store_reset(); < < /* Now we're really done.. */ < event_signal(EVENT_LEAVE_BIRTH); < < return; < } < < #endif /* ALLOW_BORG */ Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/cmd-misc.c ../angband-3.2.0/src/cmd-misc.c 90c90,91 < if (!screensaver) --- > /* Ask first time */ > if (!(p_ptr->noscore & NOSCORE_BORG)) 92,106c93,103 < /* Ask first time */ < if (!(p_ptr->noscore & NOSCORE_BORG)) < { < /* Mention effects */ < msg_print("You are about to use the dangerous, unsupported, borg commands!"); < msg_print("Your machine may crash, and your savefile may become corrupted!"); < message_flush(); < < /* Verify request */ < if (!get_check("Are you sure you want to use the borg commands? ")) < return; < < /* Mark savefile */ < p_ptr->noscore |= NOSCORE_BORG; < } --- > /* Mention effects */ > msg_print("You are about to use the dangerous, unsupported, borg commands!"); > msg_print("Your machine may crash, and your savefile may become corrupted!"); > message_flush(); > > /* Verify request */ > if (!get_check("Are you sure you want to use the borg commands? ")) > return; > > /* Mark savefile */ > p_ptr->noscore |= NOSCORE_BORG; 189d185 < #ifndef ALLOW_BORG /* apw --borg uses ESC and Space which trigger this. */ 191d186 < #endif diff --exclude '*.o' ../angband-3.2.0-borg/src/config.h ../angband-3.2.0/src/config.h 100c100 < #define ALLOW_BORG --- > /* #define ALLOW_BORG */ 103c103 < #define SCORE_BORGS --- > /* #define SCORE_BORGS */ 105,106d104 < /* Allow the borg to runs as XScreenSaver */ < #define XSCREENSAVER Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/dungeon.c ../angband-3.2.0/src/dungeon.c 1390d1389 < #ifndef ALLOW_BORG /* APW, not a good idea with the borg. He jumps levels too quickly. Burn up your drive. */ 1392d1390 < #endif 1484,1485d1481 < /* Hack -- Start the Borg is auto_start_borg is TRUE */ < if (auto_start_borg) do_cmd_borg(); diff --exclude '*.o' ../angband-3.2.0-borg/src/externs.h ../angband-3.2.0/src/externs.h 8,27d7 < #ifdef ALLOW_BORG < /* Screensaver variables for the borg. apw */ < extern bool screensaver; < extern char screensaver_inkey_hack_buffer[1024]; /* apw */ < extern int screensaver_inkey_hack_size; < extern const byte adj_dex_ta[]; < extern const byte adj_str_td[]; < extern const byte adj_dex_th[]; < extern const byte adj_str_th[]; < extern const byte adj_dex_blow[]; < extern const byte adj_dex_dis[]; < extern const byte adj_int_dis[]; < extern const byte adj_int_dev[]; < extern const byte adj_wis_sav[]; < extern const byte adj_str_dig[]; < extern const byte adj_str_wgt[]; < extern const int adj_con_mhp[]; < extern void wield_all(struct player *p); < #endif /* ALLOW_BORG */ < 190d169 < extern bool auto_start_borg; Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/init2.c ../angband-3.2.0/src/init2.c 3646,3664d3645 < #ifdef ALLOW_BORG /* apw */ < /* Allow the screensaver to do its work */ < if (screensaver) < { < /* Start new character */ < if (!file_exists(savefile)) < { < event_signal(EVENT_LEAVE_INIT); < return TRUE; < } < else < /* Load existing character */ < { < event_signal(EVENT_LEAVE_INIT); < return FALSE; < } < } < #endif /* ALLOW_BORG */ < Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/main.c ../angband-3.2.0/src/main.c 209c209 < if (auto_start_borg == FALSE) pause_line(Term->hgt - 1); --- > pause_line(Term->hgt - 1); 352,359d351 < case 'X': < case 'x': < /* debug_opt(arg); < continue; */ < { < auto_start_borg = TRUE; < break; < } 360a353,355 > case 'x': > debug_opt(arg); > continue; 380,381c375 < /* puts(" -x<opt> Debug options; see -xhelp"); */ < puts(" -x Auto-start Borg"); --- > puts(" -x<opt> Debug options; see -xhelp"); Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/main-win.c ../angband-3.2.0/src/main-win.c 467c467 < /* static bool screensaver = FALSE; /* /* apw moved to externs */ --- > static bool screensaver = FALSE; 3224c3224,3231 < * Either start a new character or load up the old one --- > * If no savefile is present or then go through the steps necessary > * to create a random character. If a savefile already is present > * then the simulated keypresses will either clean away any [-more-] > * prompts (if the character is alive), or create a new random > * character. > * > * Luckily it's possible to send the same keypresses no matter if > * the character is alive, dead, or not even yet created. 3226c3233,3239 < if (!file_exist) --- > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Gender */ > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Race */ > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Class */ > screensaver_inkey_hack_buffer[j++] = 'n'; /* Modify options */ > screensaver_inkey_hack_buffer[j++] = '\r'; /* Reroll */ > > if (!file_exists) 3227a3241 > /* Savefile name */ 3229,3238c3243,3244 < screensaver_inkey_hack_buffer[j++] = ' '; /* Return */ < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ < } < else /* Savefile present, get past the start up screens */ < { < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ < screensaver_inkey_hack_buffer[j++] = ' '; /* Character info */ --- > for (i = 0; i < n; i++) > screensaver_inkey_hack_buffer[j++] = saverfilename[i]; 3240a3247,3249 > screensaver_inkey_hack_buffer[j++] = '\r'; /* Return */ > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Character info */ > 3249a3259,3272 > * Make sure the "OPT(cheat_live)" option is set, so that the Borg can > * automatically restart. > */ > screensaver_inkey_hack_buffer[j++] = '5'; /* Cheat options */ > > /* Cursor down to "cheat live" */ > for (i = 0; i < OPT_OPT(cheat_live) - OPT_CHEAT; i++) > screensaver_inkey_hack_buffer[j++] = '2'; > > screensaver_inkey_hack_buffer[j++] = 'y'; /* Switch on "OPT(cheat_live)" */ > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Leave cheat options */ > screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Leave options */ > > /* 3963,3964c3986 < /* td = (term_data *)GetWindowLong(hWnd, 0); */ < td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA); --- > td = (term_data *)GetWindowLong(hWnd, 0); 4009,4010c4031,4032 < /* td = (term_data *)GetWindowLong(hWnd, 0); */ < td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA); --- > td = (term_data *)GetWindowLong(hWnd, 0); > 4017,4022c4039 < /* SetWindowLong(hWnd, 0, (LONG)(my_td)); */ < #ifdef _WIN64 < SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td); < #else < SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td)); < #endif --- > SetWindowLong(hWnd, 0, (LONG)(my_td)); 4352,4353c4369 < /* td = (term_data *)GetWindowLong(hWnd, 0); */ < td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA); --- > td = (term_data *)GetWindowLong(hWnd, 0); 4361,4366c4377 < /* SetWindowLong(hWnd, 0, (LONG)(my_td)); */ < #ifdef _WIN64 < SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td); < #else < SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td)); < #endif --- > SetWindowLong(hWnd, 0, (LONG)(my_td)); 5183,5189d5193 < /* Set command hook (apw)*/ < cmd_get_hook = win_get_cmd; < < /* Set up the display handlers and things. (apw)*/ < init_display(); < initialized = TRUE; < Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/main-x11.c ../angband-3.2.0/src/main-x11.c 110,111d109 < #include "vroot.h" < #include "main.h" 113,115c111 < #ifdef XSCREENSAVER < #include <signal.h> < #endif /* XCREENSAVER */ --- > #include "main.h" 2026,2041d2021 < /*static int verify_special = 0; < < extern char (*inkey_hack)(int flush_first); < static char screensaver_inkey_hack_buffer[1024]; < static int screensaver_inkey_hack_index = 0; < static char screensaver_inkey_hack(int flush_first) < { < verify_special = 0; < return screensaver_inkey_hack_buffer[screensaver_inkey_hack_index++]; < }*/ < < static int exit_now = 0; < void shutdown_xscreensaver(int x) < { < exit_now = 1; < } 2048,2058d2027 < #ifdef XSCREENSAVER < static int first_time = 1; < < if (exit_now) < { < exit_now = 0; < do_cmd_save_game(); < exit(0); < } < #endif < 2072,2123c2041 < case TERM_XTRA_EVENT: < < #ifdef XSCREENSAVER < < if (first_time) < { < < #if 0 < int i, j; < < /* Mega hack - try to start the borg < * < * The simulated keypresses will be processed when < * play_game() is called. */ < < inkey_hack = screensaver_inkey_hack; < < j = 0; < < screensaver_inkey_hack_buffer[j++] = '*'; /* Gender */ < screensaver_inkey_hack_buffer[j++] = '*'; /* Race */ < screensaver_inkey_hack_buffer[j++] = '*'; /* Class */ < screensaver_inkey_hack_buffer[j++] = '*'; /* Class */ < screensaver_inkey_hack_buffer[j++] = '*'; /* Class */ < screensaver_inkey_hack_buffer[j++] = '\r'; /* Reroll */ < screensaver_inkey_hack_buffer[j++] = '\r'; /* Name */ < screensaver_inkey_hack_buffer[j++] = '\r'; /* Start */ < < /* < * Now start the borg */ < < screensaver_inkey_hack_buffer[j++] = KTRL('Z'); < for (i = 0; i < 10; i++) < screensaver_inkey_hack_buffer[j++] = ESCAPE; < screensaver_inkey_hack_buffer[j++] = KTRL('Z'); < screensaver_inkey_hack_buffer[j++] = 'z'; < < Term_keypress('\n'); < Term_keypress(27); < Term_keypress(27); < Term_keypress(27); < Term_keypress(27); < Term_keypress(26); < Term_keypress('z'); < #endif < < first_time = 0; < signal(SIGTERM, shutdown_xscreensaver); < return 0; < } < #endif < return (CheckEvent(v)); --- > case TERM_XTRA_EVENT: return (CheckEvent(v)); 2132,2136c2050 < case TERM_XTRA_CLEAR: Infowin_wipe(); < #ifdef XSCREENSAVER < //x11_selection->drawn = FALSE; < #endif < return (0); --- > case TERM_XTRA_CLEAR: Infowin_wipe(); return (0); Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/Makefile.src ../angband-3.2.0/src/Makefile.src 14,22d13 < borg1.h \ < borg2.h \ < borg3.h \ < borg4.h \ < borg5.h \ < borg6.h \ < borg7.h \ < borg8.h \ < borg9.h \ 69,77d59 < borg1.o \ < borg2.o \ < borg3.o \ < borg4.o \ < borg5.o \ < borg6.o \ < borg7.o \ < borg8.o \ < borg9.o \ Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/variable.c ../angband-3.2.0/src/variable.c 46,51d45 < #ifdef ALLOW_BORG < /* Screensaver borg things. apw*/ < bool screensaver = FALSE; < bool auto_start_borg = FALSE; < #endif /* ALLOW_BORG */ < Code:
diff --exclude '*.o' ../angband-3.2.0-borg/src/z-virt.h ../angband-3.2.0/src/z-virt.h 51,58d50 < /* Allocate a wiped array of type T[N], assign to pointer P */ < /* apw --screensaver begin */ < #define C_MAKE(P, N, T) \ < ((P) = C_ZNEW(N, T)) < /* Allocate a wiped thing of type T, assign to pointer P */ < #define MAKE(P, T) \ < ((P) = ZNEW(T)) < /* apw -- screensaver end*/ |
![]() |
![]() |
![]() |
#28 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,559
Donated: $60
![]() ![]() |
Cool - me of 2009 was clearly smarter than the current version...
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#29 |
Veteran
Join Date: Apr 2008
Location: Germany
Posts: 2,295
![]() |
I installed the borg again, but seeing him maltreat a priest by running around with shiny newly enchanted heavy metal armour but at -1 speed and with only 2 spell points at level 9 breaks my heart.
Setting his evaluation of all AC to zero should instantly boost performance. |
![]() |
![]() |
![]() |
#30 | |
Angband Devteam member
|
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
borg screensaver apwhite |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Borg for 320 is running. | APWhite | Development | 200 | January 12, 2012 10:46 |
Screensaver for 320 almost ready! | APWhite | Development | 1 | January 14, 2011 15:36 |
Screensaver needs to rewrite some code | APWhite | Vanilla | 0 | October 16, 2007 21:19 |