Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Soldier horns and picking the "nearest entrance" (Or maybe I just don't understand horn behaviour well enough?)
New Topic New Poll Post Reply
Poster Message
LovaP48
Level: Master Delver
Rank Points: 103
Registered: 05-31-2019
IP: Logged

File: Soldier weirdness.hold (2.1 KB)
Downloaded 37 times.
License: Public Domain
icon Soldier horns and picking the "nearest entrance" (+2)  
In my recently posted hold, A Walk in the Park, I use a soldier horn in one of my rooms to activate a pressure plate in a secluded area Beethro would not be able to reach.
I copied this room over into a new hold, which is attached, I tried to strip it fairly barebones. The two adjacent rooms are empty, I simply wanted to keep the exits and not have "errors".
FYI, I use DROD 5.1.0.6512.

The setup:
I have a horn which is, purely tile-wise, equally apart from two entrances to the east, both being accessible. The aim is to get the soldier to spawn in the southern entrance of these two.
While initially testing, I thought that this is done by some tiebreaking behind the scenes, in which south-eastern direction is somehow preferred to north-eastern.
Seeing KituU's demos, I realized that this does not always happen with the trapdoor & bridge setup that I have in my room.

Labelling the trapdoors with numbers like this (B stands for the bridge between, W for water):
Click here to view the secret text

here are the results of all possible dropped trapdoors and the location of the soldier spawn.
Click here to view the secret text


Is this intended?
Can anyone point me to a resource about soldier horns, if this was discussed before somewhere?
Or maybe explain exactly HOW do soldier horns work?
01-06-2023 at 05:01 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4592
Registered: 02-20-2007
IP: Logged
icon Re: Soldier horns and picking the "nearest entrance" (+3)  
hyperme's "A Detailed Guide to DROD Pathfinding" doesn't mention horns specifically, but since they need to find the closest of multiple targets, they probably have very similar issues to the types discussed. In short: the pathfinding algorithm is impossible for humans to predict because it's inherently chaotic, and making changes to the room that are off the path can change the outcome.

What this means for room design is that if you want a horn to prefer tile A to B, and especially if you want this to be something the player has to achieve deliberately as part of a puzzle, you should try to make sure the player has some way of making the path to A shorter, rather than relying on the algorithm's tiebreaking.

____________________________
50th Skywatcher
01-06-2023 at 05:28 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
LovaP48
Level: Master Delver
Rank Points: 103
Registered: 05-31-2019
IP: Logged
icon Re: Soldier horns and picking the "nearest entrance" (0)  
Nuntar wrote:
hyperme's "A Detailed Guide to DROD Pathfinding" doesn't mention horns specifically, but since they need to find the closest of multiple targets, they probably have very similar issues to the types discussed. In short: the pathfinding algorithm is impossible for humans to predict because it's inherently chaotic, and making changes to the room that are off the path can change the outcome.

What this means for room design is that if you want a horn to prefer tile A to B, and especially if you want this to be something the player has to achieve deliberately as part of a puzzle, you should try to make sure the player has some way of making the path to A shorter, rather than relying on the algorithm's tiebreaking.
Thanks for the swift reply, Nuntar. I'll take a skim of the linked guide.
Also will try and tweak the room so this is no longer an issue!
01-06-2023 at 05:43 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1064
Registered: 06-23-2006
IP: Logged
icon Re: Soldier horns and picking the "nearest entrance" (+4)  
Horns shouldn't be subject to pathfinding "chaos", as they use a modified version of brain pathing which doesn't have the flaws that make Stalwart-style pathing unpredictable.

However, there is some weirdness with how room entrances are handled. To determine the "entrance score" for a tile, multiple it's brain score by 100, then add the smaller of the player's X distance or Y distance from that tile. Yeah.

(Having just found out about this I should make an update to the pathing post.)

____________________________
[Insert witty comment here]
Qzvlkx?
01-06-2023 at 06:18 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1064
Registered: 06-23-2006
IP: Logged
icon Re: Soldier horns and picking the "nearest entrance" (+3)  
On closer inspection, the bad comparator function that makes Stalwart-style pathing unpredictable is also present in the algorithm that generates brain pathmaps. But since the evaluation order doesn't matter for the final outcome (each tile gets a score), it didn't cause problems.

Except when horns are involved. If two entrances get the same score, they will be subjected to pathfinding "chaos". This because an entrance has to be picked, and there isn't any tiebreaking for equally-scored entrances, so the winner is the one that's earlier in the list of reachable entrances.

Since there are only 44 published rooms with horns according to the search tool, I think fixing this is likely to be safe. Plus a non-zero amount of published rooms have been literally erased due to a bug fix so eradicating some demos isn't that bad.

____________________________
[Insert witty comment here]
Qzvlkx?

[Last edited by hyperme at 01-08-2023 12:27 PM]
01-08-2023 at 11:50 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Soldier horns and picking the "nearest entrance" (0)  
Thank you, hyperme!

PR

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
05-15-2023 at 04:58 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Soldier horns and picking the "nearest entrance" (Or maybe I just don't understand horn behaviour well enough?)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.