Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old July 27, 2017, 17:33   #101
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
Still got one problem left:

Code:
..O...#
##.~###
.....@#
#####.#
....#.#
The ogre here has a damaging tile to his southeast and doesn't want to move, though the tile south is open and perfectly viable. I imagine that the "noise" value for that tile isn't high enough so it's discarded.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old July 27, 2017, 17:49   #102
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
Would be the same if there was a monster instead of a damaging tile:

Code:
		/* Get the heard noise, compare with the best so far */
		heard_noise = base_hearing - cave->noise.grids[y][x];
		if ((heard_noise > best_noise) && (cave->noise.grids[y][x] != 0)) {
			/* Best so far */
			best_noise = heard_noise;
			best_direction = i;
			found_direction = true;
			if (square_monster(cave, y, x)) {
				monster_blocking = true;
			}
			continue;
		} else if ((heard_noise == best_noise) && (cave->noise.grids[y][x] != 0)
				   && (!square_monster(cave, y, x)) && monster_blocking) {
			/* Equal best so far, and no monster in the way */
			best_direction = i;
			found_direction = true;
			monster_blocking = false;
			continue;
		}
The south tile is processed first with heard noise = best noise and no monster, but monster_blocking is false so it's discarded. The southeast tile is processed next with heard noise > best noise, so it's chosen and monster_blocking is set to true. Unfortunately, no other tile is viable, so the monster will try to go southeast and fail.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old July 27, 2017, 22:26   #103
kandrc
Swordsman
 
Join Date: Dec 2007
Posts: 299
kandrc is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
Still got one problem left:

Code:
..O...#
##.~###
.....@#
#####.#
....#.#
The ogre here has a damaging tile to his southeast and doesn't want to move, though the tile south is open and perfectly viable. I imagine that the "noise" value for that tile isn't high enough so it's discarded.
If this were Nethack, I'd say that a projectile launched over that tile should catch fire and do fire damage.

To be clear, I would not advocate that for Angband.
kandrc is offline   Reply With Quote
Old July 27, 2017, 23:01   #104
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,864
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by PowerWyrm View Post
Still got one problem left:

Code:
..O...#
##.~###
.....@#
#####.#
....#.#
The ogre here has a damaging tile to his southeast and doesn't want to move, though the tile south is open and perfectly viable. I imagine that the "noise" value for that tile isn't high enough so it's discarded.
Interesting one - note that if the damaged tile didn't allow sound, the ogre would just move south. So the current situation reflects the fact that the ogre knows the way it wants to move is south-east, but can't.

At some point I'm planning to do better short-range pathfinding; probably a combination of sight and sound, so a monster can pick its way around obstacles between it and a seen point of higher noise.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old July 28, 2017, 09:49   #105
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
Oh and smell is never used...

Code:
int best_noise = base_hearing - cave->noise.grids[my][mx];

...

/* If no good sound yet, use scent */
if (!best_noise) ...
best_noise is always defined, scent code never triggers...
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old July 28, 2017, 10:43   #106
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Nick View Post
Interesting one - note that if the damaged tile didn't allow sound, the ogre would just move south. So the current situation reflects the fact that the ogre knows the way it wants to move is south-east, but can't.

At some point I'm planning to do better short-range pathfinding; probably a combination of sight and sound, so a monster can pick its way around obstacles between it and a seen point of higher noise.
In fact, he could also move east, it's the same sound value. He would go south because the code processes south before east. If the pit was rotated 90 degrees clockwise, we would have an endless loop:

Code:
.#.#.
.#.#.
.#..O
.#.~.
##.#.
..@#.
#####
West and south are both equivalent, but south is processed first, so the ogre goes to a dead end, moves back north one square to his initial position, but moves south again because it's processed before northwest. I guess it will be tricky to solve all pathfinding problems... for equal grids, you would have to guess the best path recursively by looking at the "next" steps and see which one would give the best result. This would ensure in this example that the ogre goes west to the open path instead of going south in a dead end.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old July 28, 2017, 11:09   #107
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
There's also the "traffic jam" problem:

Code:
########
qqqqqq.@
########
Depending on which monster is processed first, the result can be quite different: if monster indices are ordered from right to left, all monsters will be able to move to the right in one turn; if monster indices are ordered from left to right, it will take six turns for all monsters to move to the right (every monster will "bump" into each other, except for the rightmost one).
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old July 28, 2017, 13:56   #108
Patashu
Knight
 
Patashu's Avatar
 
Join Date: Jan 2008
Posts: 526
Patashu is on a distinguished road
You solve the 'traffic jam' problem by letting monsters who are blocked get a second chance to move before the player can move again. (This is how Crypt of the Necrodancer solves the problem, for example.) A simple way to do this is to deduct a small amount of energy rather than a full move's worth of energy.

You solve the 'infinite loop' problem by ensuring a monster never uses a distance metric for pathfinding purposes that doesn't take into account things it considers obstacles. So if a monster refuses to step into lava, they should never use a pathfinding metric that considers lava a pathable tile. (If that's not applicable, the idea of looking 1-2 steps ahead sounds like it will work for common cases.)
__________________
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu
Patashu is offline   Reply With Quote
Old July 28, 2017, 15:30   #109
Mars
Scout
 
Mars's Avatar
 
Join Date: Apr 2007
Location: Netherlands
Posts: 31
Mars is on a distinguished road
Re: Traffic jam: Depending on the type of enemy, shouldn't it in some cases be the intended behavior to have them hindering each other in narrow passageways? A small tactical advantage when there's a pack of bloodthirsty enemies trying to get to your location all at once, bumping into each other.
__________________
Mostly retired Angband player. I just don't have the time .
Mars is offline   Reply With Quote
Old July 28, 2017, 16:41   #110
Huqhox
Adept
 
Huqhox's Avatar
 
Join Date: Apr 2016
Age: 49
Posts: 114
Huqhox is on a distinguished road
Quote:
Originally Posted by Mars View Post
Re: Traffic jam: Depending on the type of enemy, shouldn't it in some cases be the intended behavior to have them hindering each other in narrow passageways? A small tactical advantage when there's a pack of bloodthirsty enemies trying to get to your location all at once, bumping into each other.
This seems reasonable, based on intelligence maybe? So creatures with enough intelligence keep pace behind the creature in front whereas the less intelligent ones get in each other's way trying to get to you and slow everyone down
__________________
"This has not been a recording"
Huqhox 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
Some Sil issues fph Sil 12 January 4, 2013 01:41
Gear Issues Monkay AAR 1 February 25, 2012 18:32
Compilation issues. Tiburon Silverflame Development 8 March 1, 2010 21:34
DaJAngband Issues Prismatic Variants 12 February 15, 2010 16:08
Compiling Issues Gregian Vanilla 13 July 2, 2008 15:35


All times are GMT +1. The time now is 23:03.


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