Studio › Manual › VR

VR Simulator (⇧⌘F5)

Room > VR > Play in VR Simulator (⇧⌘F5, or the goggles button beside Run in the toolbar and in the 3D view) plays your GameMaker VR game on this Mac, with no headset: in a window of its own, with sound, the head and hands played with the mouse, the keyboard and a game controller. It works for any GameMaker project with the VR tools: one you added them to with Add VR to Project, or one that has the GMVR extension already. Part of Studio Pro: on a free account it shows the Studio Pro box.

Each time, Studio:

  1. Saves everything, as Run does.
  2. Brings its own copy of the project up to date, in Studio's cache folder (~/Library/Caches/com.guidrygames.studio/vrsim): only the files that changed are copied. In the copy the VR extension is left out, and a Mac stand-in for it and the simulator take its place. Your project and its headset build are never changed. A project with a stand-in of its own (scripts/scr_gmvr_sim) keeps it, with the scripts its desktop project (<name>Sim.yyp) lists.
  3. Builds the copy for the Mac with GameMaker's Igor builder, when something changed. The first time takes a minute or two; Output shows how it's going, and Problems lists GameMaker's errors in your project's own files. With nothing changed it starts at once.
  4. Starts the game in the room you're editing. In a level (a room with an editor profile) it starts in that level, and with the level name the profile's own play command uses.

Press it again to close the simulator and start it again with your changes. Pressed while it builds, it stops the build.

Controls. Click in the window to take the mouse, and press Esc to let it go. F1 in the window shows every binding.

  • Look round: the mouse, or the controller's right stick.
  • Trigger: left click or F (the controller's RT and LT). Grip: right click or G: one click grips, the next lets go (RB and LB, held).
  • A, B, X, Y: 1, 2, 3, 4 (the controller's own). Menu: M (Start).
  • Move a hand: hold Space (right) or Shift (left) and move the mouse; the wheel takes it out or in. Tab switches the hand the mouse works. H puts the hands back.
  • Walk (real steps): W A S D. Q and E turn 45 degrees. C crouches.
  • Thumbsticks: I J K L the left, the arrow keys the right (the controller's left stick and d-pad).
  • R recentres. F3 takes the headset off and puts it back on.

Both hands' rays cross the dot in the middle of the window, so you aim by looking.

What it needs. GameMaker with its macOS module, signed in to GameMaker on this Mac once, and about 3 GB of space. Like Enter in Headset, it's for signed-in Guidry Games accounts (see Signing in for VR).

What it doesn't show. It tests your game, not the headset: comfort, frame rate, tracking and the real controllers need the Quest (Build & Run on Headset). Hands are placed and pointed, not turned, and haptics aren't felt.

If the game plays flat, it starts VR only on Android. Output then says the game hasn't started VR. Let it start VR in the simulator too: where it calls vr_init, test os_type == os_android || (variable_global_exists("sim_on") && global.sim_on), as the VR Room template does. global.sim_on is set only in the simulator's build.

If it quits straight away, Output shows the game's last lines and where its log is (vrsim.log in the copy's folder). If GameMaker's build stops, its errors are in Problems: the same errors GameMaker itself would show for the project, including "Cannot load project because linking failed" problems (the file and line GameMaker names).

A stand-in of your own (scripts/scr_gmvr_sim) must call the simulator's live mode, or its window stays black and takes no input. Studio checks before it builds and says which calls are missing. The four calls:

  • sim_live_frame(__sim()) in gmvr_frame_begin, after it sets stat[0] and stat[1] and before it writes the head and hands. This one draws the window and reads the mouse, keys and controller; without it Studio doesn't start the simulator.
  • sim_live_tan() in its projection, as the eye's [tan x, tan y].
  • sim_live_ipd(0.032) (half the distance between the eyes) where it offsets the two eyes.
  • sim_live_draw_eye(_e) in gmvr_end_eye, after the game's draw of that eye (the simulator's controllers and rays).

Studio's own stand-in makes all four; copy them from it.

Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.