base timed inputs on start of trial time
This commit is contained in:
parent
3e7aeb3c91
commit
946f05bd3e
1 changed files with 3 additions and 1 deletions
4
main.lua
4
main.lua
|
@ -856,6 +856,7 @@ local function do_reset()
|
||||||
|
|
||||||
jp = nil
|
jp = nil
|
||||||
screen_scroll_delta = 0
|
screen_scroll_delta = 0
|
||||||
|
trial_frames = 0
|
||||||
emu.frameadvance() -- prevents emulator from quirking up.
|
emu.frameadvance() -- prevents emulator from quirking up.
|
||||||
|
|
||||||
load_next_trial()
|
load_next_trial()
|
||||||
|
@ -942,7 +943,7 @@ local function doit(dummy)
|
||||||
|
|
||||||
if cfg.time_inputs then
|
if cfg.time_inputs then
|
||||||
for i=2,5 do
|
for i=2,5 do
|
||||||
local v = band(total_frames, lshift(1, i)) == 0 and -256 or 256
|
local v = band(trial_frames, lshift(1, i)) == 0 and -256 or 256
|
||||||
insert(extra_input, v)
|
insert(extra_input, v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1001,6 +1002,7 @@ local function doit(dummy)
|
||||||
nn.reshape(X, 1, gcfg.input_size)
|
nn.reshape(X, 1, gcfg.input_size)
|
||||||
nn.reshape(tile_input, 1, gcfg.tile_count)
|
nn.reshape(tile_input, 1, gcfg.tile_count)
|
||||||
|
|
||||||
|
trial_frames = trial_frames + cfg.frameskip
|
||||||
if cfg.enable_network and get_state() == 'playing' or ingame_paused then
|
if cfg.enable_network and get_state() == 'playing' or ingame_paused then
|
||||||
total_frames = total_frames + cfg.frameskip
|
total_frames = total_frames + cfg.frameskip
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue