Skip to content

Commit 7643b1b

Browse files
Revert "game mode as option to disable timeout termination"
This reverts commit 974f2e2.
1 parent e071e8c commit 7643b1b

2 files changed

Lines changed: 1 addition & 38 deletions

File tree

src/ale/games/supported/Pitfall.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ale/games/supported/Pitfall.hpp"
2929

3030
#include "ale/games/RomUtils.hpp"
31-
#include "ale/environment/stella_environment_wrapper.hpp"
3231

3332
namespace ale {
3433
using namespace stella;
@@ -56,8 +55,7 @@ void PitfallSettings::step(const System& system) {
5655
int timer_minutes = readRam(&system, 0xD8);
5756
int timer_seconds = readRam(&system, 0xD9);
5857
// Game terminates when: (1) all lives lost and logo screen shown, OR (2) timer runs out (00:00)
59-
// In legacy mode (mode 1), timer expiration is not checked for backwards compatibility
60-
bool timer_expired = m_terminateOnTimeout && (timer_minutes == 0 && timer_seconds == 0);
58+
bool timer_expired = (timer_minutes == 0 && timer_seconds == 0);
6159
m_terminal = (lives_byte == 0 && logo_timer != 0) || timer_expired;
6260

6361
m_lives = (lives_byte == 0xA) ? 3 : ((lives_byte == 0x8) ? 2 : 1);
@@ -102,7 +100,6 @@ void PitfallSettings::reset() {
102100
m_score = 2000;
103101
m_terminal = false;
104102
m_lives = 3;
105-
m_terminateOnTimeout = true;
106103
}
107104

108105
/* saves the state of the rom settings */
@@ -111,7 +108,6 @@ void PitfallSettings::saveState(Serializer& ser) {
111108
ser.putInt(m_score);
112109
ser.putBool(m_terminal);
113110
ser.putInt(m_lives);
114-
ser.putBool(m_terminateOnTimeout);
115111
}
116112

117113
// loads the state of the rom settings
@@ -120,33 +116,10 @@ void PitfallSettings::loadState(Deserializer& ser) {
120116
m_score = ser.getInt();
121117
m_terminal = ser.getBool();
122118
m_lives = ser.getInt();
123-
m_terminateOnTimeout = ser.getBool();
124119
}
125120

126121
ActionVect PitfallSettings::getStartingActions() {
127122
return {PLAYER_A_UP};
128123
}
129124

130-
// Returns a list of modes that the game can be played in.
131-
// Mode 0: Default mode with timer-based termination (terminates when 20-minute timer expires)
132-
// Mode 1: Legacy mode without timer-based termination (for backwards compatibility)
133-
ModeVect PitfallSettings::getAvailableModes() {
134-
return {0, 1};
135-
}
136-
137-
// Set the mode of the game.
138-
void PitfallSettings::setMode(
139-
game_mode_t m, System& system,
140-
std::unique_ptr<StellaEnvironmentWrapper> environment) {
141-
if (m == 0) {
142-
// Default mode: terminate when 20-minute timer expires
143-
m_terminateOnTimeout = true;
144-
} else if (m == 1) {
145-
// Legacy mode: do not terminate on timer expiration (original buggy behavior)
146-
m_terminateOnTimeout = false;
147-
} else {
148-
throw std::runtime_error("This mode is not supported for Pitfall.");
149-
}
150-
}
151-
152125
} // namespace ale

src/ale/games/supported/Pitfall.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,13 @@ class PitfallSettings : public RomSettings {
6969

7070
ActionVect getStartingActions() override;
7171

72-
// Returns a list of modes that the game can be played in.
73-
// Mode 0: Default mode with timer-based termination (terminates when 20-minute timer expires)
74-
// Mode 1: Legacy mode without timer-based termination (for backwards compatibility)
75-
ModeVect getAvailableModes() override;
76-
77-
// Set the mode of the game.
78-
void setMode(game_mode_t m, stella::System& system,
79-
std::unique_ptr<StellaEnvironmentWrapper> environment) override;
80-
8172
int lives() override { return isTerminal() ? 0 : m_lives; }
8273

8374
private:
8475
bool m_terminal;
8576
reward_t m_reward;
8677
reward_t m_score;
8778
int m_lives;
88-
bool m_terminateOnTimeout; // If true (default), game terminates when 20-minute timer expires
8979
};
9080

9181
} // namespace ale

0 commit comments

Comments
 (0)