Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Super precise timing needed #342492
09/28/10 17:04
09/28/10 17:04
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
I'm working on a game that will be used as a spatial navigation task for fMRI & MEG research, and so I need to be able to output a logfile with extremely precise timing. From what I understand, ticks are a constant 1/16 of a second, and so total_ticks/16 should be a decent measure at least providing timing information to +/- 62.5 ms. There's also a timer function for information within one frame cycle, but this won't be suitable for longer periods of time such as a five minute scan of the brain. Is there a way to achieve more accurate timing precision than working in ticks? Also, are ticks an absolute constant of 1/16 of a second that can be relied on for this?

Last edited by gSet; 09/28/10 17:06.

"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Super precise timing needed [Re: gSet] #342493
09/28/10 17:16
09/28/10 17:16
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
time_frame give the duration of the last frame in ticks(1/16 secs), but it can have valuse like 0.1
if the last frame is 0.1 ticks it means it took 1/160 secs.


3333333333
Re: Super precise timing needed [Re: Quad] #342494
09/28/10 17:20
09/28/10 17:20
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
LOL I like your signature...

So is there a variable I can use that relies on time_frame and can act as a timer for information as to when events occured?


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Super precise timing needed [Re: gSet] #342497
09/28/10 18:05
09/28/10 18:05
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
that is the time_frame variable itself.

try this out(copy/paste to sed and run)
Code:
#include <acknex.h>
#include <default.c>

var timePassed = 0;
var lastFrameDuration = 0;
var totalTimeFrame = 0;
var tickInMilisecs = 62.5;
FONT* arialMid ="Arial#14";
PANEL* infoPanel ={
	pos_x = 10; pos_y = 10;
	digits(0,0,"Total Frames:%.1f",arialMid,1,total_frames);
	digits(0,20,"time_frame in ticks:%.6f",arialMid,1,time_frame);
	digits(0,40,"time_frame in milisecs:%.6f",arialMid,1,lastFrameDuration);
	digits(0,60,"Total time frame in ticks:%0.6f",arialMid,1,totalTimeFrame);
	digits(0,80,"Total time passed in milisecs:%0.6f",arialMid,1,timePassed);
	digits(0,100,"Total time passed in secs:%0.6f",arialMid,0.001,timePassed);
	flags = SHOW;
}


void main(){
	fps_max = 30;//play with this
	while(1){
		totalTimeFrame += time_frame;
		lastFrameDuration = time_frame*62.5;
		timePassed += lastFrameDuration;
		wait(1);
	}	
}



Precision of the var type is debatable though it should be precise enough.


3333333333
Re: Super precise timing needed [Re: Quad] #342589
09/29/10 15:05
09/29/10 15:05
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
Looks like this works exactly like I need it to - Clever! I should even be able to simplify it to timePassed += time_frame*62.5. It does seem to jerk slightly when loading the next level, is this compensated for or will this delay build up as more levels are completed?

Edit: After some playing around, it looks like this delay is compensated for following hard-drive access. This is a great solution - I'll let you know how reliable the timing is after I do some testing!

Last edited by gSet; 09/29/10 15:13.

"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Super precise timing needed [Re: gSet] #342622
09/29/10 18:12
09/29/10 18:12
Joined: Feb 2006
Posts: 52
C
carlpa Offline
Junior Member
carlpa  Offline
Junior Member
C

Joined: Feb 2006
Posts: 52
I have used GS in developing reaction time tests. The maximum accuracy with the engine is one frame-cycle. This can be as little as 5 msec but is computer and program dependent. Another serious concern for mseconds of accuracy is the time it takes for the BIOS or operating system to poll the input devices and the hardware response times of those devices. This is the reason that I try to have data be a difference between two measures.

I am very curious what technology you will use that can be near an MRI scanner.

Thanks


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet
Re: Super precise timing needed [Re: carlpa] #342727
09/30/10 13:27
09/30/10 13:27
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
I'm glad you asked, actually. The study consists of two parts - First MEG, then fMRI. Not many people know what MEG is so I'll give you the quick rundown... Basically it measures the very tiny magnetic fields generated by the brain, and by looking at the patterns of the fields we can locate sources of electrical activity (i.e., clusters of firing neurons, postsynaptic responses). Because of this all magetic sources are shielded by a special and very expensive type of wall. fMRI is the opposite of course, in which your body's molecular orientation is manipulated with the use very strong magnetic fields... As a result, in both cases, only non-magnetic metals can be near the scanners. So that part's actually not too difficult - We just place a projector outside the room, with the image coming through a small waveguide. When a subject is laying in the MRI facing upward, they have a mirror which allows them to see a projector screen behind them. Then, and MRI compatible (non-magnetic) joystick which runs through another waveguide to a stimulus computer (which is also connected to the projector of course) allows them to play our game!

The way our setup works, the important thing is going to be synchronizing parralel port output to the projector's refresh rate - and we've got a system in place that will do this. The parralel port is how we record the timing of events while using MEG, and we needed the high precision for this because MEG is known for extremely high temporal resolution. fMRI on the other hand, would do just as well with a temporal resolution as low as even half a second, because we'll be instituting a block design in which subjects brain activation will be contrasted in 30 second sets.

As for the testing, I haven't gotten around to it but here's the plan - I'm essentially going to run the engine, and create a logfile which corrosponds to a high-contrast onscreen event. Simultaneously, a photo-diode will record the event on the projector screen... And any consistent difference can be hard-coded into the creation of the logfile!

So that's my rant. Sorry, I just find this stuff fascinating grin

edit: If you're interested in the details of the study, let me know and I can tell you about it.

Last edited by gSet; 09/30/10 13:42.

"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Super precise timing needed [Re: gSet] #342737
09/30/10 15:06
09/30/10 15:06
Joined: Feb 2006
Posts: 52
C
carlpa Offline
Junior Member
carlpa  Offline
Junior Member
C

Joined: Feb 2006
Posts: 52
Thank you and very clever. I would like to know more. I am a Neurologist in clinical practice but have been in academic medicine most of my career. Can one measure Event Related Potentials with MEG. In theory anything seen with EEG should be seen with MEG. I would be willing to help if I can.

CER

Email carl.rosenberg@acmchealth.org


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet
Re: Super precise timing needed [Re: carlpa] #342743
09/30/10 15:36
09/30/10 15:36
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
That's awesome - It's always great to talk to someone involved in neuroscience. Yes, MEG is very similar to EEG but without the issue of signal distortion due to the scalp, since magnetic fields aren't affected by it. Because of this ERPs are one of the primary focal points of MEG research, along with oscillatory neural activity which you also find in EEG research.

I'll keep your offer in mind, but it seems like we've got a pretty full team right now and as a result everything is under control. Our focus is the localization and lateralization of language and memory areas in presurgical epilepsy patients. The task I'm developing is designed to elicit (typically) right hippocampal activation using allocentric spatial navigation techniques... Later it will be integrated with another task I've developed which is a simple memory game intended to elicit activation related to verbal working memory. When the two are eventually combined we should have a single paradigm for localization of working memory for both language and spatial skills.

The study also incorporates MEG alongside EEG to localize epileptogenic regions that are the cause of the patients' epilepsy symptoms. Our goal is to use a combination of MEG, EEG and fMRI to produce a functional laterality index with higher sensitivity and specificity than either MEG or fMRI alone. And of course I'm excited to be incorporating video games into research, because they're a passion of mine wink


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Super precise timing needed [Re: gSet] #342831
10/01/10 13:45
10/01/10 13:45
Joined: Feb 2006
Posts: 52
C
carlpa Offline
Junior Member
carlpa  Offline
Junior Member
C

Joined: Feb 2006
Posts: 52
Excellent. Please keep me in mind. I would love to see any reprints of articles. You can contact me at the above Email address. I shall look for your results in the literature. Good luck.

It is good to see more researchers using GS or other engine in neuroscience. What surprises me is that you are the first one I have discovered on this forum. I am sure there are others. Perhaps we should start a new "Topic"?


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1