Group: Forum Members
Hi Dave, Sean
I stumbled across this thread while trying to solve a delay/lag issue I'm having with a script I've developed.
I've attached the script (archived as a .rar file with associated files) to this post. Basically the task is to turn off a bunch of lights as quickly as possible. After each light has been turned off by clicking on it, the participant must press a central button to commence the next trial (i.e. turn on the next light to be extinguished).
The problem is that there is a delay of a fraction of a second between each trial (e.g. the next light doesn't turn on immediately after clicking the central button). Since I'm trying to get the participants to do this as quickly as possible this is highly problematic.
I have a feeling the problem is to do with the stimuli. Each of the lights, and also the central button, are represented by two .jpg files - one corresponding to the on state and one corresponding to the off state. There is also a background .jpg file that makes the whole task look like it is being carried out on an actual machine (machine.jpg or machinewin.jpg). All the other stimuli are superimposed on top of this.
After reading through this thread, I've tried messing with the erase and post trial pause commands to try and eliminate the delay but to no avail. Please note that the default for all stimuli currently is erase=false, so erasing shouldn't be the problem.
Strange Observation No. 1: I HAVE managed to eliminate the delay by removing the background stimulus image (i.e. I removed it from /stimulusframes in all the trials. Once I do this, there is no delay. This seems very odd though, as the .jpg files are so small I can't imagine it's overworking my computer's memory.
Strange Observation No. 2: If I DO set all the stimuli to erase=true, the time taken to erase all the stimuli at the end of the trial does seem to match closely with the delay I'm experiencing. This may or may not be a coincidence.
Any ideas? I could always just remove the background image and make the task less pretty/realistic-looking, but I figure there must be a way to solve this.
NB: I have tried on multiple computers and the problem persists.
Hope you can help,