Einzelnen Beitrag anzeigen
  #6139  
Alt 03.06.2024, 12:40
Tibono Tibono ist offline
Resurrection
 
Registriert seit: 22.05.2018
Ort: Frankreich
Alter: 63
Land:
Beiträge: 590
Abgegebene Danke: 3.525
Erhielt 1.393 Danke für 469 Beiträge
Aktivitäten Langlebigkeit
6/20 7/20
Heute Beiträge
1/3 ssssss590
AW: Mess Emulator für diverse Schachcomputer ist fertig!

Hi,

Alex, TMHO it looks like the timing provided in the plugins sometimes can't fit the way you run the engines. "Timing" means either the duration of key/square push, or the wait commands that are intentionally coded.
The "way you run the engines" relates to your host ability to provide enough resources and focus to run smoothly the emulation, or to whatever event can disturb.
Until few months ago I used a 12 years old laptop, featuring only two cores. To include the chess computer plugins in Arena tournaments I had to increase some (if not many) timings for some computers (even if most ran natively smoothly).
At some point I got bored with updating the plugins, I changed once for all the init.lua plugin located in CB-Emu\MessChess\plugins\chessengine.
Main change was from:
Code:
local function send_input(tag, mask, seconds)
	manager:machine():ioport().ports[tag]:field(mask):set_value(1)
	emu.wait(seconds * 2 / 3)
	manager:machine():ioport().ports[tag]:field(mask):set_value(0)
	emu.wait(seconds * 1 / 3)
end
to:
Code:
local function send_input(tag, mask, seconds)
	emu.wait(0.5)
	manager:machine():ioport().ports[tag]:field(mask):set_value(1)
	emu.wait(seconds)
	manager:machine():ioport().ports[tag]:field(mask):set_value(0)
	emu.wait(seconds * 2 / 3)
end
Other durations based on the "seconds" variable were increased this way (sample function): from
Code:
local function sb_select_piece(tag, seconds, x, y, event)
	if (event ~= "capture") then
		send_input(tag .. ":RANK." .. tostring(y), 1 << (x - 1), seconds)
	end
	if (event == "en_passant") then
		send_input(tag .. ":UI", 0x0008, seconds)	-- SensorBoard REMOVE
	end
end
to:
Code:
local function sb_select_piece(tag, seconds, x, y, event)
	if (event ~= "capture") then
		send_input(tag .. ":RANK." .. tostring(y), 1 << (x - 1), seconds * 1.2)
	end
	if (event == "en_passant") then
		send_input(tag .. ":UI", 0x0008, seconds * 1.2)	-- SensorBoard REMOVE
	end
end
and finally, for hard-coded durations, I replaced all 0.09 values by 0.1, such as from:
Code:
send_input(tag .. ":SPAWN", mask, 0.09)
to:
Code:
send_input(tag .. ":SPAWN", mask, 0.1)
Of course the run of tournaments is slightly slowed down, at the benefit of more secure running. I suggest you give this a try, and check the result.

Hope this helps,
Eric
Mit Zitat antworten
Folgende 2 Benutzer sagen Danke zu Tibono für den nützlichen Beitrag:
kamoj (03.06.2024), Luis (03.06.2024)