Skip to content

Expand data for star collector game#76

Merged
K-Meech merged 18 commits into
mainfrom
km/star-collector-data
May 12, 2026
Merged

Expand data for star collector game#76
K-Meech merged 18 commits into
mainfrom
km/star-collector-data

Conversation

@K-Meech
Copy link
Copy Markdown
Collaborator

@K-Meech K-Meech commented May 8, 2026

For #20

Expands star collector saved data with various measures including mean / peak / standard deviation of head yaw velocity. Relevant docs have been updated to match.

I had to add special handling for periods when the player goes out of range of the tracker. For example, if the player plays for 10 seconds, then walks away from the computer for the remaining 50 seconds of the game, getSpeed on HeadAngleBuffer will keep reporting the speed based on data from the first 10 seconds. The issue is that when the player is out of range, the tracker will not report any new data, so the buffer remains full of old data. When you request the speed based on the last 0.5 seconds (for example), it uses the timestamp of the last item in the buffer and counts back 0.5 seconds - so it keeps using old data collected much longer than 0.5 seconds ago.

Ideally, we could update the buffer so that it always counts back from the current timestamp (rather than the last timestamp in the buffer), but I couldn't find a way to get the current timestamp from the tracker when the player is un-detected, or an easy way to interpret the Tobii timestamps (as they aren't in isoformat). We could add our own isoformat timestamps to allow this, but wasn't sure if it was worth the extra code (as we would still need to keep the tobii timestamp too to ensure we aren't adding the same item multiple times). For now, I exclude any time periods where the player has gone out of range at any point. Any other suggestions very welcome!

@K-Meech K-Meech requested review from mmcleod89 and thompson318 May 8, 2026 10:31
Copy link
Copy Markdown
Member

@thompson318 thompson318 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had a look through and checked that I understand the logic for the speed calculation and checking player presence. It took me a while to satisfy myself that the logic will work as it is split between two functions (UpdateHeadYawBuffer and RecordHeadVelocity) and will depend on them being called in the right order. However I can't think of a more straightforward way of doing it and it should work well for short sampling periods.

I wonder if it would make life easier if we added an additional GameTimeStamp to GazeItem and HeadAngleItem in TrackerBuffers.cs then re-implement TobiiBuffer.GetItems to use GameTimeStamp rather than the timestamp from the tracker. Might be one for a separate PR.

My main request for this PR is that I think we should change velocity to speed throughout. Hopefully just a find and replace job. If David publishes this it will be important that the language is technically correct so we should get it right throughout.

Comment thread docs/star-collector.md Outdated
Comment thread projects/AstroBalance/Assets/Scripts/StarCollector/StarCollectorManager.cs Outdated
Comment thread projects/AstroBalance/Assets/Scripts/StarCollector/StarCollectorManager.cs Outdated
@K-Meech
Copy link
Copy Markdown
Collaborator Author

K-Meech commented May 11, 2026

Thanks for the review @thompson318 - I think I've addressed your main comments now:

  • changed velocity to speed
  • moved standard deviation into MathsUtilities
  • added some further explanation in the StarCollector docs on how the speed values are calculated

I also made a new issue to keep track of the points we discussed in the meeting: #77

Copy link
Copy Markdown
Member

@thompson318 thompson318 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think one minor clarification in the save parameter description on how speed is calculated. Can you check that please? If I've got it wrong we might need to review a bit more.

Comment thread docs/star-collector.md Outdated
Co-authored-by: Stephen Thompson <s.thompson@ucl.ac.uk>
@K-Meech
Copy link
Copy Markdown
Collaborator Author

K-Meech commented May 12, 2026

Thanks @thompson318 - good point! I agree that is a more accurate description of how the speed is calculated - I've commited your edits.

@K-Meech K-Meech merged commit 4a86b9d into main May 12, 2026
1 check passed
@K-Meech K-Meech deleted the km/star-collector-data branch May 12, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants