immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
214 stars 41 forks source link

Create ScreenRayTracker.cs #129

Open JAQuent opened 2 years ago

JAQuent commented 2 years ago

In additition to the screen tracker I also quickly edited the CSV session builder and created a TSV session builder with it because people might want to use "," in their strings.

jackbrookes commented 2 years ago

Hi, I don't have time to review right now but I can see several problems immediately, that would need to be addressed before merging. I will add comments.

JAQuent commented 1 year ago

Hey Jack, I've finally got around addressing your suggestions about the ray tracker because I never got notification of those until you closed the issue. Is there still point working on this? I am actually starting data collection for new project soon so I wanted to tidy all the code up including this. I've two questions: a) Why are the rows recorded twice. I think I might misunderstand how this might work. b) The reason I add the stop method On Trial Begin/End is because I think it only works if the update type is set to manual and I was under the impression that I have to do this like this then. Is that not true?

jackbrookes commented 1 year ago

a) Why are the rows recorded twice

The trackers have an updateType which can be LateUpdate, FixedUpdate, Manual. If we don't select manual, there will be multiple times RecordRow is called per frame

b) The reason I add the stop method On Trial Begin/End is because I think it only works if the update type is set to manual and I was under the impression that I have to do this like this then. Is that not true?

Regardless of UpdateType (which should not be needed to be set to manual) the UXF trial automatically calls the StopRecording method at the end of a trial - no need to hook into events

JAQuent commented 1 year ago

Hey, so when I don't attach the start and stop methods to the On Trial Begin/End then a .csv tracking file is saved but it is empty. Could that be because I use version 2.4.2?

As to your other question, I used manual because I wanted to be able to record mutliple rows per frames. See here https://github.com/immersivecognition/unity-experiment-framework/issues/91.

jackbrookes commented 1 year ago

Hey, so when I don't attach the start and stop methods to the On Trial Begin/End then a .csv tracking file is saved but it is empty. Could that be because I use version 2.4.2?

Yeah you would need to also restore the functionality to allow LateUpdate and FixedUpdate updateTypes to work

As to your other question, I used manual because I wanted to be able to record mutliple rows per frames. See here https://github.com/immersivecognition/unity-experiment-framework/issues/91.

Yeah I see - I think this is confusing because now the updateType must be set to manual. We would need a nicer way for this to work for it to be a part of UXF. It may be better to override the RecordRow() method for example

JAQuent commented 1 year ago

Do you have an idea how to do this? I happy to link into this.

Not sure how this will effect other things but would it be possible to simply take away the option fo the other update types and force manual here?