Lua script

-- feos, 2021
-- parses movie file and collects various stats on the specified input button
-- no need to load the movie into emulator, just provide its path and run the script

local filename = "happylee-supermariobros,warped.fm2"
local mnemonic = "A"
local separator = "|"

local currentItemStart = 0
local inputs = 0
local sequences = 0
local inputsCheck = 0
local sequencesCheck = 0
local inputsCheckPassed = false
local sequencesCheckPassed = false

local frames = {}
local durations = {}

local movie = io.open(filename, "r")

for line in movie:lines() do
	if string.find(line, separator) == 1 then
		table.insert(frames, line)
	end
end

movie:close()

print(" " .. filename)
print(" Parsed " .. #frames .. " frames")
print(" ")

for frame = 1, #frames+1 do
	if frames[frame] and string.find(frames[frame], mnemonic) then
		inputs = inputs+1
		
		if frame == 1 or string.find(frames[frame-1], mnemonic) == nil then
			currentItemStart = frame
		end
		
		if currentItemStart > 0
		and (not frames[frame+1] or not string.find(frames[frame+1], mnemonic)) then
			sequences = sequences + 1			
			local duration = frame+1 - currentItemStart
			
			if duration > 0 then			
				if not durations[duration] then
					durations[duration] = 1
				else
					durations[duration] = durations[duration] + 1
				end
			end
			
			currentItemStart = 0
		end
	end
end

print(" Total " .. mnemonic .. " input count: " .. inputs)
print(" Ratio: " .. #frames / inputs)
print(" ")
print(" Total consequtive " .. mnemonic .. " sequences: " .. sequences)
print(" Ratio: " .. #frames / sequences)
print(" ")
print(" Sequence durations")

for duration, count in pairs(durations) do
	inputsCheck = inputsCheck + duration * count
	sequencesCheck = sequencesCheck + count
	print(" " .. duration .. "-frame: " .. count)
end

print("")
print("Debug checks")

if inputs    == inputsCheck    then inputsCheckPassed    = true end
if sequences == sequencesCheck then sequencesCheckPassed = true end

print("Inputs check passed (" .. inputs .. " == " .. inputsCheck .. "): "
	.. tostring(inputsCheckPassed))
print("Sequences check passed (" .. sequences .. " == " .. sequencesCheck .. "): "
	.. tostring(sequencesCheckPassed))

"A" button

Output

happyleev3-smbfds.fm2
Parsed 9893 frames

Total A input count: 678
Ratio: 14.591445427729

Total consequtive A sequences: 132
Ratio: 74.94696969697

Sequence durations
1-frame: 69
2-frame: 6
3-frame: 14
4-frame: 8
5-frame: 2
6-frame: 6
8-frame: 1
9-frame: 4
10-frame: 3
12-frame: 1
14-frame: 2
15-frame: 1
16-frame: 1
17-frame: 1
18-frame: 4
19-frame: 1
22-frame: 1
24-frame: 1
28-frame: 2
29-frame: 1
30-frame: 1
31-frame: 1
32-frame: 1
happylee-supermariobros,warped.fm2
Parsed 17868 frames

Total A input count: 2596
Ratio: 6.8828967642527

Total consequtive A sequences: 286
Ratio: 62.475524475524

Sequence durations
1-frame: 95
2-frame: 12
3-frame: 17
4-frame: 10
5-frame: 10
6-frame: 19
7-frame: 6
8-frame: 8
9-frame: 9
10-frame: 4
11-frame: 4
12-frame: 10
13-frame: 8
14-frame: 3
15-frame: 6
16-frame: 6
17-frame: 5
18-frame: 6
19-frame: 2
20-frame: 2
21-frame: 3
22-frame: 5
23-frame: 1
24-frame: 2
25-frame: 2
26-frame: 2
27-frame: 2
28-frame: 4
29-frame: 1
30-frame: 5
31-frame: 7
32-frame: 10
mars608,happylee-smb-warpless,walkathon.fm2
Parsed 91304 frames

Total A input count: 13509
Ratio: 6.7587534236435

Total consequtive A sequences: 1503
Ratio: 60.747837658017

Sequence durations
1-frame: 673
2-frame: 88
3-frame: 44
4-frame: 32
5-frame: 45
6-frame: 29
7-frame: 21
8-frame: 32
9-frame: 50
10-frame: 26
11-frame: 22
12-frame: 21
13-frame: 22
14-frame: 19
15-frame: 17
16-frame: 14
17-frame: 23
18-frame: 44
19-frame: 18
20-frame: 28
21-frame: 17
22-frame: 10
23-frame: 9
24-frame: 13
25-frame: 16
26-frame: 11
27-frame: 13
28-frame: 10
29-frame: 8
30-frame: 10
31-frame: 15
32-frame: 20
33-frame: 10
34-frame: 14
35-frame: 23
36-frame: 5
37-frame: 3
38-frame: 1
39-frame: 4
41-frame: 3
43-frame: 3
44-frame: 1
45-frame: 2
47-frame: 1
48-frame: 1
49-frame: 3
50-frame: 1
51-frame: 2
52-frame: 2
56-frame: 3
80-frame: 1
cuteqt_tehh_083_happylee-supermariobros-maxcoins.fm2
Parsed 94370 frames

Total A input count: 15896
Ratio: 5.9367136386512

Total consequtive A sequences: 2345
Ratio: 40.243070362473

Sequence durations
1-frame: 1165
2-frame: 131
3-frame: 103
4-frame: 68
5-frame: 79
6-frame: 73
7-frame: 70
8-frame: 76
9-frame: 30
10-frame: 40
11-frame: 45
12-frame: 74
13-frame: 33
14-frame: 21
15-frame: 26
16-frame: 14
17-frame: 22
18-frame: 17
19-frame: 17
20-frame: 15
21-frame: 13
22-frame: 15
23-frame: 8
24-frame: 15
25-frame: 15
26-frame: 14
27-frame: 10
28-frame: 7
29-frame: 4
30-frame: 12
31-frame: 14
32-frame: 42
33-frame: 1
34-frame: 6
35-frame: 9
38-frame: 2
39-frame: 4
40-frame: 1
41-frame: 1
42-frame: 1
43-frame: 1
44-frame: 3
47-frame: 2
48-frame: 1
50-frame: 3
51-frame: 2
52-frame: 3
53-frame: 1
54-frame: 2
55-frame: 2
56-frame: 1
57-frame: 1
58-frame: 1
60-frame: 3
62-frame: 2
63-frame: 1
67-frame: 1
74-frame: 1
76-frame: 1
happylee_mars608-smb-warpless.fm2
Parsed 67117 frames

Total A input count: 10460
Ratio: 6.4165391969407

Total consequtive A sequences: 1372
Ratio: 48.919096209913

Sequence durations
1-frame: 596
2-frame: 65
3-frame: 61
4-frame: 112
5-frame: 22
6-frame: 31
7-frame: 32
8-frame: 29
9-frame: 31
10-frame: 25
11-frame: 16
12-frame: 28
13-frame: 28
14-frame: 21
15-frame: 23
16-frame: 16
17-frame: 9
18-frame: 26
19-frame: 11
20-frame: 14
21-frame: 16
22-frame: 12
23-frame: 10
24-frame: 9
25-frame: 8
26-frame: 9
27-frame: 11
28-frame: 11
29-frame: 5
30-frame: 11
31-frame: 13
32-frame: 59
44-frame: 1
46-frame: 1
dasmilekat_happylee_mars608-supermariobros-allitems.fm2
Parsed 71438 frames

Total A input count: 10745
Ratio: 6.6484876686831

Total consequtive A sequences: 1661
Ratio: 43.009030704395

Sequence durations
1-frame: 827
2-frame: 49
3-frame: 64
4-frame: 79
5-frame: 48
6-frame: 37
7-frame: 38
8-frame: 48
9-frame: 27
10-frame: 38
11-frame: 42
12-frame: 37
13-frame: 32
14-frame: 28
15-frame: 24
16-frame: 30
17-frame: 21
18-frame: 19
19-frame: 27
20-frame: 28
21-frame: 19
22-frame: 13
23-frame: 10
24-frame: 8
25-frame: 12
26-frame: 7
27-frame: 5
28-frame: 4
29-frame: 7
30-frame: 5
31-frame: 3
32-frame: 4
33-frame: 3
34-frame: 2
35-frame: 1
36-frame: 2
38-frame: 1
39-frame: 1
40-frame: 1
41-frame: 1
42-frame: 3
43-frame: 1
44-frame: 2
45-frame: 1
49-frame: 1
58-frame: 1
happylee,kriller37,dasmilekat,kosmic,periwinkle-supermariobros-minimum_a_presses.fm2
Parsed 37525 frames

Total A input count: 2869
Ratio: 13.079470198675

Total consequtive A sequences: 62
Ratio: 605.24193548387

Sequence durations
1-frame: 5
2-frame: 3
3-frame: 1
4-frame: 2
5-frame: 1
7-frame: 1
9-frame: 1
11-frame: 1
12-frame: 1
14-frame: 2
15-frame: 2
16-frame: 1
17-frame: 1
18-frame: 1
19-frame: 1
20-frame: 1
21-frame: 1
22-frame: 1
24-frame: 1
25-frame: 1
26-frame: 1
27-frame: 2
28-frame: 3
29-frame: 2
31-frame: 2
32-frame: 17
58-frame: 1
39-frame: 1
35-frame: 3
1533-frame: 1
brandonevans-supermariobros-minimumpresses.fm2
Parsed 20917 frames

Total A input count: 3684
Ratio: 5.6777958740499

Total consequtive A sequences: 125
Ratio: 167.336

Sequence durations
1-frame: 14
2-frame: 1
3-frame: 2
4-frame: 1
5-frame: 2
6-frame: 4
7-frame: 2
8-frame: 1
10-frame: 2
11-frame: 1
12-frame: 4
13-frame: 5
15-frame: 1
16-frame: 3
17-frame: 3
18-frame: 1
19-frame: 1
20-frame: 3
21-frame: 3
22-frame: 3
23-frame: 5
24-frame: 3
26-frame: 2
27-frame: 1
28-frame: 5
29-frame: 4
30-frame: 2
31-frame: 1
32-frame: 4
33-frame: 1
34-frame: 2
35-frame: 2
36-frame: 1
39-frame: 2
40-frame: 1
41-frame: 3
43-frame: 1
44-frame: 2
45-frame: 5
46-frame: 1
47-frame: 2
48-frame: 1
49-frame: 2
51-frame: 2
52-frame: 1
53-frame: 1
55-frame: 2
56-frame: 1
57-frame: 3
62-frame: 1
73-frame: 1
222-frame: 1
157-frame: 1
229-frame: 1
smb1 min jumps height.fm2
Parsed 21576 frames

Total A input count: 395
Ratio: 54.622784810127

Total consequtive A sequences: 377
Ratio: 57.230769230769

Sequence durations
1-frame: 374
9-frame: 1
6-frame: 2

Table

Movie Frames Inputs Ratio Sequences Ratio
[1365] FDS Super Mario Bros. "-3 stage ending" by HappyLee in 02:44.61 9893 678 14.591445427729 132 74.94696969697
[1715] NES Super Mario Bros. "warps" by HappyLee in 04:57.31 17868 2596 6.8828967642527 286 62.475524475524
[2676] NES Super Mario Bros. "warpless, walkathon" by Mars608 & HappyLee in 25:19.23 91304 13509 6.7587534236435 1503 60.747837658017
[2977] NES Super Mario Bros. "maximum coins" by TEHH_083, HappyLee & CuteQt in 26:10.25 94370 15896 5.9367136386512 2345 40.243070362473
[3728] NES Super Mario Bros. "warpless" by HappyLee & Mars608 in 18:36.78 67117 10460 6.4165391969407 1372 48.919096209913
[4313] NES Super Mario Bros. "all items" by DaSmileKat, HappyLee & Mars608 in 19:48.68 71438 10745 6.6484876686831 1661 43.009030704395
[4444] NES Super Mario Bros. "minimum A presses" by HappyLee, Kriller37, DaSmileKat, Kosmic & periwinkle in 10:24.39 37525 2869 13.079470198675 62 605.24193548387
Submission
#3556: Brandon's NES Super Mario Bros. "minimum presses" in 05:48.04 20917 3684 5.6777958740499 125 167.336
#7132: Killedragon's NES Super Mario Bros. "-3 stage ending" in 05:59.01 21576 395 54.622784810127 377 57.230769230769

HomePages/feos/ButtonStats last edited by feos on 6/1/2022 8:10 AM
Page History Latest diff List referrers View Source