[Beta 15b] Escort appeard after enterning level 2nd time

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

[Beta 15b] Escort appeard after enterning level 2nd time

#1 Post by Graziel »

Moved down stairs nothing happend I had to come back up and 2nd time i entered(climbed down) escort appeared. Nothing in logs.
You are likely to be eaten by a grue

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#2 Post by Grey »

I've had this happen a few times in the last few versions. Especially happens in crypt-style dungeons.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#3 Post by darkgod »

This happens if the escort could not pop last time youwere there for some reason
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#4 Post by Graziel »

well there was plenty of room for him to pop up.
room looked something like this:
both doors locked and no mobs in sight.

Code: Select all

############
#..........#
#.........>#
+..........#
#..........#
#.<........#
#..........#
#####+######
You are likely to be eaten by a grue

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#5 Post by darkgod »

Does not mean it could pop, there is a minimun distance
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#6 Post by Graziel »

then why did he poped on 2nd time? i didnt open any doors and he was next to me. I think I could miss some of escorts because of this.
You are likely to be eaten by a grue

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#7 Post by yufra »

Graziel wrote:then why did he poped on 2nd time? i didnt open any doors and he was next to me.
Now that is odd... I thought the same thing as DG. Where did the the portal get dropped?
<DarkGod> lets say it's intended

Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#8 Post by Graziel »

it looked like this.
@ was the escort.

Code: Select all

############
#.........&#
#.........>#
+..........#
#..........#
#@<........#
#..........#
#####+######
You are likely to be eaten by a grue

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#9 Post by yufra »

DarkGod, maybe we could add a log message to let players know that the escort quest was not placed correctly so we can collect savefiles to test them. Graziel, if you still have the savefile let me know. Cheers!
<DarkGod> lets say it's intended

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#10 Post by greycat »

For whatever it's worth, I've run into this situation twice in Kor'Pul -- I'd get no escort quest while going down, but I got it while coming back up with the Shade's loot. The escortee appeared next to me by the down staircase. I haven't seen this in any other dungeon.

Vee
Thalore
Posts: 127
Joined: Tue Nov 02, 2010 10:27 pm

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#11 Post by Vee »

I've seen this in Kor'Pul as well. I guess it might be due to formerly closed doors, that are now open on the way back.
Ts and OF don't have doors, so there wouldn't be this problem.
greycat wrote:An intervention was required (kill -9)

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: [Beta 15b] Escort appeard after enterning level 2nd time

#12 Post by yufra »

All of the Kor'Pul problems are rooted in the Astar code not recognizing doors as "open" terrain when computing the portal distance. I looked at the Astar code and this is the check made on each terrain tile:

Code: Select all

self.map:checkEntity(tx, ty, Map.TERRAIN, "block_move", self.actor, nil, true)
So this takes us to mod/class/Grid.lua and the block_move function. Here "e" is "self.actor", "act" is "nil", and "couldpass" is "true".

Code: Select all

	-- Open doors
	if self.door_opened and e.open_door and act then
		if self.door_player_check then
			if e.player then
				Dialog:yesnoPopup(self.name, self.door_player_check, function(ret)
					if ret then game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened]) end
				end, "Open", "Leave")
			end
		else
			game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened])
		end
		return true
	elseif self.door_opened and not couldpass then
		return true
	elseif self.door_opened and couldpass and not e.open_door then
		return true
	end
The first option in the outer if statement checks if the terrain can be opened (self.door_opened), if the actor can open doors (e.open_door) and finally if we are actually acting or just checking (act). Inside of that case is a check used for vault doors and then the terrain tile gets switched with the open door terrain tile. This code won't affect the Astar check because act is nil in our case.

The second and third options in the outer if statement check... to be honest I am not 100% sure. I think this is where we need another option to fix the Astar check. The couldpass variable in my mind is asking "I know we aren't actually opening the door now, but if we wanted to could we?" Right now it looks like we are only handling the "no" side of that statement, and I suggest we add this code to the end:

Code: Select all

elseif self.door_opened and couldpass and e.open_door then
    return false
end
I actually think a larger refactor like below might be clearer, and will test it out in-game. This code assumes that the door's "does_block_move" will handle the cases where the actor cannot open doors, and only opens doors or returns false if we are just checking.

Code: Select all

	-- Open doors
	if self.door_opened then
		-- Blocks move if actor cannot open it
		if not e.open_door then
			return true
		end
		-- If we are acting, actually open them
		if act then
			if self.door_player_check then
				if e.player then
					Dialog:yesnoPopup(self.name, self.door_player_check, function(ret)
						if ret then game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened]) end
					end, "Open", "Leave")
				end
			else
				game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened])
			end
			return true
		-- If we are just testing
		elseif couldpass then
			return false
                else
			return true
		end
	end
EDIT: Well I got an escort and portal to drop when I started in a single closed door room, so that part looks good. The bad news? The escort moved right through the door without opening it. Some work obviously needs to be done... :D After setting the escort's "open_door" variable to true it worked, but this worries me that maybe other monsters that cannot open doors will know just enter them.

EDIT2: Ok, just confirmed that monsters are entering doors instead and I found the reason... does_block_move isn't set for doors. Oh! Well if we aren't going to rely on does_block_move then I will edit the code above (done and tested).
<DarkGod> lets say it's intended

Post Reply