diff --git a/_NOTICE b/_NOTICE index 1e14cf2..f0dd665 100644 --- a/_NOTICE +++ b/_NOTICE @@ -5,7 +5,6 @@ however, feel free to copy any snippets of code you find useful. TODOs: (that i can remember right now) - normalize and/or embed sprite type inputs - settle on a network architecture -- detect frames when Mario is in a controllable state - compute how many input neurons the network needs instead of hardcoding - add some detection for enemies later in the game - fix cfg.enable_overlay (smb.lua doesn't see it being changed) diff --git a/main.lua b/main.lua index 998f620..1d13a77 100644 --- a/main.lua +++ b/main.lua @@ -603,7 +603,7 @@ local function doit(dummy) empty(game.tile_input) empty(game.extra_input) - -- TODO: check if mario is in a playable state. + local controllable = game.R(0x757) == 0 and game.R(0x758) == 0 local x, y = game.getxy(0, 0x86, 0xCE, 0x6D, 0xB5) local powerup = game.R(0x754) local status = game.R(0x756) @@ -644,7 +644,7 @@ local function doit(dummy) if cfg.decrement_reward and reward_delta == 0 then reward_delta = reward_delta - 1 end - if not ingame_paused and game.get_state() ~= 'win_walking' then + if not ingame_paused and controllable and game.get_state() ~= 'win_walking' then -- note that we exclude points gained walking into the castle. -- this way, we avoid adding the timer-based fireworks to our reward, -- which are basically unwanted noise due to the way they trigger.