microsoft / jericho

A learning environment for man-made Interactive Fiction games.
GNU General Public License v2.0
261 stars 43 forks source link

env.world_changed() outputs True everytime for game Reverberations #16

Closed vishaljain3991 closed 5 years ago

vishaljain3991 commented 5 years ago

I was trying to use env.world_changed() for the game Reverberations. But, it returns True everytime even when the command really didn't lead to state change. Sample script:

import jericho
current_game_name = 'reverb'
current_game_file = current_game_name + '.z5'
t  = jericho.FrotzEnv(current_game_file, seed=12)
_,_, _, _ = t.step('verbose')

for i in range(20):
    current_game_text, score, _, _= t.step(' ')

current_game_text, score, _, _= t.step('look')
print('BEFORE LOOK: {}'.format(current_game_text))
print('\n')
current_game_text, score, _, _= t.step('get boost')
print('\"get boost\" feedback: {}'.format(current_game_text))
print('World changed? {}'.format(t.world_changed()))
print('\n')
current_game_text, score, _, _= t.step('look')
print('AFTER LOOK: {}'.format(current_game_text))

Output:

BEFORE LOOK: 
Behind the Counter
You are behind the counter at "Mr. Tasty's Pizza Parlor". To the southwest is the rest of the restaurant.

"get boost" feedback: You can't see any such thing.
World changed? True

AFTER LOOK: 
Behind the Counter
You are behind the counter at "Mr. Tasty's Pizza Parlor". To the southwest is the rest of the restaurant.

Is it an issue with the game or code? I assumed that the code would work for all the supported games in the suite.

MarcCote commented 5 years ago

I'm not sure if that's the case here but it might be that something else in the world is changing (e.g. NPCs). If that's the case you wouldn't necessarily see any difference in the output of the look command. I may try to combine world_changed() with other clues like the output of look and inventory. That said it wouldn't be bulletproof but i think there's nothing much else we can do at the moment.

vishaljain3991 commented 5 years ago

@MarcCote hmm yeah I glanced through the code and there doesn't seem to be anything that could be changed with code. I think the world keeps changing (NPCs) even though the output of look and inventory remains the same. This might be this game's quirk! :(

mhauskn commented 5 years ago

Sorry for late reply. I've pushed an update the world change detection for Reverb that should fix this problem.

mhauskn commented 5 years ago

@vishaljain3991 - I believe this issue has been addressed. Please reopen if it's still a problem.