Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old August 14, 2008, 16:52   #11
Zikke
Veteran
 
Join Date: Jun 2008
Location: Los Angeles
Posts: 1,068
Zikke is on a distinguished road
Yep, that T.O. logic is what killed my 50 ranger with the Death Drake. Are you the author of this? Or just passing it along?
Zikke is offline   Reply With Quote
Old August 15, 2008, 03:49   #12
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by roustk View Post
Still not tested, but Teleport Other is the only spell that uses this code. Mainly the standard tele other logic, but also the "tele other things that threaten my sea of runes on level 100 when Morgoth is around" logic. The fix should be good.
The fix is not good. The ifelse logic was clearly wrong, but the borg forgets these walls when it updates the map between shots.

borg_update_map() in borg5.c needs to be updated, and I'm not quite sure how. The problem is around line 3562, where it marks "old wall/door grids as probably floor grids" when one disappears. As noted in the comment for borg_update_map, this assumption is good "unless the grid contains a monster which can pass through walls".

I believe that the correct fix is to check if there is a monster on the space, check if it has RF2_PASS_WALL, and then leave the map unchanged. One example of this logic is around line 4680 in borg5.c, where FEAT_INVIS grids (unknown probable floor) are converted into FEAT_FLOOR (unless a PASS_WALL monster is there).

Unfortunately, since I had never looked at the borg code before yesterday, I don't know if there is a way to get borg_kills[] from borg_grids[][] coordinates. I'd rather not loop over all known monsters for every space...

[Edited: "forgets" in first paragraph was "doesn't remember".]
roustk is offline   Reply With Quote
Old August 15, 2008, 04:00   #13
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by roustk View Post
The fix is not good. The ifelse logic was clearly wrong, but the borg forgets these walls when it updates the map between shots.
To be clear, I added debugging output just before my modified ifelse in borg6.c. The latest level 40 character died with logging like:
Code:
# Perhaps wall near targetted location (31,91)
# Guessing wall (31,91) under ghostly target (31,91)
...
# Spell pathway tests: 1, 57, 0
# Logging Spell pathway (30,91).
# Spell pathway tests: 2, 57, 21
# Logging Spell pathway (31,91): Xaren, danger 2000
# Attempting to cast T.O.
The debugging line is produced by:
Code:
        borg_note(format("# Spell pathway tests: %d, %d, %d",
          ag->feat,ag->info,ag->kill));
The borg thinks that the space it is standing on (30,91) is FEAT_FLOOR while the space the Xaren is on (31,91) is FEAT_INVIS (presumed floor), even though it set to FEAT_WALL_SOLID at the "Ghostly wall" comment.

(This also answers my question about how to get from grids to kills -- ag->kill.)
roustk is offline   Reply With Quote
Old August 15, 2008, 19:49   #14
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
Quote:
Originally Posted by roustk View Post
Definite bug.

Check around line 9509 of borg6.txt (where the "Logging Spell pathway" notes are generated).

The borg should check for walls before it checks for targets, so the correct structure of the ifelse is:
Code:
                if (!borg_cave_floor_grid(ag))
                {
                        borg_note(format("# Logging Spell pathway (%d,%d): Wall 
grid.", n_y, n_x));
                        break;
                }
                else if (ag->kill)
                {
                        borg_note(format("# Logging Spell pathway (%d,%d): %s, d
anger %d",
                                  n_y, n_x, (r_name + r_info[kill->r_idx].name),
                                  borg_danger_aux(c_y,c_x, 1, ag->kill, TRUE)));
                }
                else
                {
                        borg_note(format("# Logging Spell pathway (%d,%d).", n_y
, n_x));
                }
It lost another level 45 HT Mage to a pack of Dreads, several of whom were protected from TO by this bug. (EDIT: while I was fixing this, another lvl 43 mage died to an Ethereal Dragon in this way.)

NOTE: I have not actually tested this yet. I want to double-check what other spells use this particular piece of code -- some (StM against golems?) probably want to check for the target before the wall. APWhite knows this code better, so he may be able to immediately confirm that this is the right fix.
Indeed, this would not be the correct fix for the behavior. This is only a reporting routine. It does not determine the relative value of doing the deed. What you are after is getting him to not shoot at a "ghostly" or PASS_WALL creature unless that critter is on a absolutely known floor grid.

The fix will be in borg6.c in borg_launch_bolt_aux_hack() about line 5795 in my version of borg6.c (for 309B). This routine is part of a larger process to assess the relative value of each grid along a pathway. There have been two checks for PASS_WALL creatures in this routine. Somehow these PASS_WALL creatures are making it through.

The next place to check would be to catch him in the act and see why he is miss-id'ing the grid. Most likely he is tagging the grid under the PASS_WALL monster as a floor grid. I have investigated that several years ago and made some changes to correct it.

It is possible that the problem is related to the type of wall grid that borg is using. Most of the time, he assumes walls are the FEAT_WALL_EXTRA variety (Granite). In a few places, he uses the FEAT_WALL_SOLID (another granite). I will go through and replace the FEAT_WALL_SOLIDs with _EXTRAs but I am not fully convinced it will solve this issue. Look for the update on the webpage.

I will also try to catch the borg targetting ghostly critters and see if I can track it down.
APWhite
APWhite is offline   Reply With Quote
Old August 15, 2008, 20:21   #15
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
Quote:
Originally Posted by roustk View Post
To be clear, I added debugging output just before my modified ifelse in borg6.c. The latest level 40 character died with logging like:
Code:
# Perhaps wall near targetted location (31,91)
# Guessing wall (31,91) under ghostly target (31,91)
...
# Spell pathway tests: 1, 57, 0
# Logging Spell pathway (30,91).
# Spell pathway tests: 2, 57, 21
# Logging Spell pathway (31,91): Xaren, danger 2000
# Attempting to cast T.O.
The debugging line is produced by:
Code:
        borg_note(format("# Spell pathway tests: %d, %d, %d",
          ag->feat,ag->info,ag->kill));
The borg thinks that the space it is standing on (30,91) is FEAT_FLOOR while the space the Xaren is on (31,91) is FEAT_INVIS (presumed floor), even though it set to FEAT_WALL_SOLID at the "Ghostly wall" comment.

(This also answers my question about how to get from grids to kills -- ag->kill.)


This is very useful information. He is really not supposed to target FEAT_INVIS grids, as seen in my post earlier (borg_launch_bolt_aux_hack()). But clearly, it is doing so in this instance. It is not from Offset Targetting either, I stopped that long ago. I will see if I can catch him and step him through the process.

BTW, how old is the borg code that you are working with. It is updated every few weeks.

APWhite
APWhite is offline   Reply With Quote
Old August 15, 2008, 21:39   #16
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by APWhite View Post
BTW, how old is the borg code that you are working with. It is updated every few weeks.
The downloaded zip is dated Aug 11, 10:07. I don't know whether that is the time I downloaded it or whether that is when you posted it, however. Definitely this week, though.

I have made three changes, and now the borg seems to be dying in typical ways (last good char was fighting a Cherub and ARedD, got in trouble, tele self, landed among a pack of gravity hounds).

The changes are these:
* borg5.c around line 3566, in borg_update_map(). PASS_WALL monsters tell the borg nothing about what they are standing on, so leave the map unchanged.
Code:
                    /* Mark old wall/door grids as probable floor grids */
                    if (!borg_cave_floor_grid(ag))
                        {
                          if (!(ag->kill))
                            ag->feat = FEAT_INVIS;
                          else
                            /* Leave PASS_WALL monsters alone */
                            if (!(r_info[borg_kills[ag->kill].r_idx].flags2 
                                & RF2_PASS_WALL ))
                              ag->feat = FEAT_INVIS;
                        }
* borg6.c around line 10488, in borg_defend_aux_tele_away(). Add an explicit check for monsters standing on FEAT_WALL_SOLID.
Code:
        /* Never shoot through walls */
        if (!(ag->info & BORG_VIEW)) continue;
        if ((ag->feat & FEAT_WALL_SOLID)) continue;
* borg6.c, in borg_log_spellpath(). As you point out, they only affect logging, not behavior.

I'm still shocked at how well the borg does with a horrible character. It is still getting about 1-in-30 artifactless Half-Troll Mages to clvl 40 and dlvl 30, and has gotten several below 2000'. Very good playing logic.
roustk is offline   Reply With Quote
Old August 15, 2008, 23:22   #17
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by roustk View Post
I have made three changes, and now the borg seems to be dying in typical ways (last good char was fighting a Cherub and ARedD, got in trouble, tele self, landed among a pack of gravity hounds).
The borg demonstrating why tele self is a last resort. If you walk out of a room and see Bill coming up the hallway towards you, teleport him away, not yourself. This was a level 41 HT Mage at 1750':
Code:
& Key <1>
# Creating a monster 'Bill the Stone Troll' at (10,104), danger: 38, HP: 1100, Time: 1161, Index: 344
# Loc:9,104 Dep:35 Lev:41 HP:517/517 SP:321/328 Danger:p=2000
# Protected by Resistance (borg turns:13; game turns:8)
# Protected by Mystic Shield
# Protected by PFE
# Casting Teleport Self (1,5).
& Key <m>
& Key <b>
& Key <f>
# Danger Level 1.
The Gravity hound breathes gravity.
The Gravity hound resists. <3x>
Gravity warps around you.
You feel yourself moving slower!
You have been stunned.
It breathes gravity.
Gravity warps around you.
The Gravity hound breathes gravity.
Gravity warps around you.
You have been heavily stunned.
The Gravity hound breathes gravity.
Gravity warps around you.
It breathes gravity.
Gravity warps around you.
The Gravity hound breathes gravity.
The Gravity hound resists. <3x>
The Giant yellow scorpion disappears!
The Gravity hound resists. <3x>
Gravity warps around you.
The Gravity hound breathes gravity.
The Gravity hound resists. <2x>
Gravity warps around you.
You have been knocked out.
The Gravity hound breathes gravity.
The Gravity hound resists.
Ignoring Messages While KO'd
The Gravity hound resists.
Gravity warps around you.
You die.
roustk is offline   Reply With Quote
Old August 16, 2008, 05:46   #18
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
I don't think I've ever seen a death like this one. I can't fault the borg for this death, however.

The borg was playing around with a 5-headed Hydra in the moat around a jelly pit on 2150'. It decided, quite reasonably, to shoot-n-scoot. Unfortunately, a phase door landed next to a pile of Death molds. Not quite sure how many, but they got 22 attacks and killed a full-health 571 HP character before the next move.

Code:
The 5-headed hydra misses you. <4x>
# Creating an object '& Iron Shot~' at (153,9)
# Possibility of being surrounded (2/0)
# Loc:9,150 Dep:43 Lev:47 HP:571/571 SP:16/287 Danger:p=53
# Protected by Mystic Shield
# Protected by PFE
# Safe to Shoot'N'Scoot. scary squares: 17/100
# Casting Phase Door (0,2).
& Key <m>
& Key <a>
& Key <c>
# Shoot N Scoot. (Danger Level 7.1)
The Death mold releases spores at you. <2x>
It gestures in shadow.
Darkness surrounds you.
The Death mold releases spores at you. <4x>
You feel your life draining away!
The Death mold releases spores at you. <3x>
It gestures in shadow.
Darkness surrounds you.
The Death mold releases spores at you. <5x>
You feel your life draining away!
The Death mold releases spores at you. <2x>
You feel your life draining away!
It gestures in shadow.
Darkness surrounds you.
The Death mold releases spores at you. <2x>
It draws psychic energy from you!
The Death mold releases spores at you. <4x>
You die.
roustk is offline   Reply With Quote
Old August 16, 2008, 17:51   #19
Zikke
Veteran
 
Join Date: Jun 2008
Location: Los Angeles
Posts: 1,068
Zikke is on a distinguished road
Have you posted the update that makes it not continue to try to TO when the target is in a wall? I just lost another high level one to that bug
Zikke is offline   Reply With Quote
Old August 18, 2008, 03:52   #20
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
A couple of these deep mages have been killed by invisible monsters. The message log indicates that they were invisible ("It"), but the borg thought that it could see invisible:
Code:
skill 1203 (_SINV) value= 1.
skill 1347 (_DINV) value= 1.
Looking through their equipment, I don't see anything that grants SInv (artifactless game).

I think that this error may be due to an apparent change in the mage spellbooks -- "Detect Invisible" is a one-turn effect, not a timed effect. This means that the borg_see_inv value is probably being set wrong in borg6.c around line 11722.

I've moved the borg_spell_fail() call below "snap shot" rather than below "long time". Testing whether that helps.

Edit: The last one killed had this equipment at 2200':
Code:
a) a Pike of *Slay Animal* (2d5) (+12,+9) (+2)
b) a Long Bow of Accuracy (x3) (+18,+10)
c) a Ring of Resist Poison
d) a Ring of Intelligence (+5)
e) an Amulet of Sustenance
f) a Wooden Torch of Brightness (3225 turns)
g) Balance Dragon Scale Mail (-2) [30,+8] (charging)
h) a Cloak of the Magi [1,+10] (+2)
i) a Large Metal Shield of Elvenkind [5,+13] (+1 to stealth)
j) a Golden Crown of Serenity [0,+9]
k) a Set of Leather Gloves of Free Action [1,+8]
l) a Pair of Soft Leather Boots of Speed [2,+9] (+6)
roustk 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
Ironband update Antoine Variants 11 February 24, 2008 04:10
APW borg on OS X pesachyonah Vanilla 7 February 12, 2008 11:56
309 Borg Update APWhite Vanilla 1 October 11, 2007 10:29
Borg 3.0.9 Progress Update APWhite Vanilla 3 August 10, 2007 03:15
No-update svn revisions ekolis Vanilla 1 July 19, 2007 23:43


All times are GMT +1. The time now is 17:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.