Skip to content

Rocket launch updates#80

Open
K-Meech wants to merge 8 commits into
mainfrom
km/small-rocket-fixes
Open

Rocket launch updates#80
K-Meech wants to merge 8 commits into
mainfrom
km/small-rocket-fixes

Conversation

@K-Meech
Copy link
Copy Markdown
Collaborator

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

Decided to split these small fixes into a separate PR, rather than rolling them in with the save data for #20 . Mostly small fixes that make testing the rocket launch game easier, or make it simpler to access values that change between games to add to the save data.

  • reduced gazeTolerance setting from 300 to 2 in the unity editor (otherwise the entire game field of view is within the gaze target range)

  • when useMouseForTracker is checked, I added a line to make sure the mouse world position is used (rather than raw coordinates). This means that when the checkbox is ticked, and the game is played in the editor, mousing over the launch code box advances the numbers, while holding the mouse towards the edges doesn't (so it's matching what the real gaze point would do)

  • For the save data, I wanted to capture all values that vary between games. Due to shakeSpeedReduction this includes the minimum required head speed (different for pitch vs yaw games). To make this easier to capture in the save data, I split this into two variables minimumSpeedPitch / minimumSpeedYaw which get chosen between at the start of the game to populate minimumSpeed. Potentially this is also easier to read at a glance, then having to multiply minimumSpeed by shakeSpeedReduction.

  • I also wanted to capture the final gazeTolerance for each game. This was challenging for the current setup as:

    • In the call to gazeBuffer.gazeSteady, the gazeTolerance is passed as gazeTolerance * gazeTol.magnitude (with gazeTol.magnitude being based on a measure of the size of the target object). This means the actual gaze tolerance used for the calculation isn't equal to gazeTolerance.
    • The size of the target object (the launch code box) doesn't always match the gaze tolerance. E.g. when the gazeTolerance was set to 300 (covering the full screen), the box was still much smaller.

To get around this, I added some code to scale the target object (and launch progress ring) to match the input gazeTolerance. This should mean the size always matches, so if you look just outside the launch code box the numbers won't advance, while just inside they will. This means gazeTolerance can get passed directly to gazeBuffer.gazeSteady also, meaning this saved value will accurately reflect the tolerance used.

Happy to change / discuss any of these points - thanks!

@K-Meech K-Meech requested review from mmcleod89 and thompson318 May 15, 2026 10:02
@mmcleod89
Copy link
Copy Markdown
Collaborator

The code looks good, I'll be able to double check how it works in play when I get home and have access to my eye tracker!

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.

2 participants