Skip to content

hiinaspace/mainspring

Repository files navigation

Mainspring

Game for the Godot XR Game Jam March 2026.

Very exciting proof of concept for full body humanoid avatars with 3-point estimated tracking.

This depends on a small planar reflection patch to the godot engine (well sort of, the mirror won't work without it but the rest of the game does).

Humanoid IK is from https://github.com/V-Sekai/renik.

Alicia VRM model from https://3d.nicovideo.jp/alicia/.

Winding key model and sound effects from ServoGizmo.

Piano BGM by me.

Original notes for posterity

game premise: simple escape room VR game where you switch between controlling different bodies with different scale and movement ability.

you start off controlling a non-humanoid robot, but with a head and two hands with grippers on them, that are all hanging from the ceiling on joints (sort of like glados in portal). The robot is in a circular room. in reach of the robot is an automaton girl with a winding key on her back like a windup toy, but girl is regular sized (~1.2m tall). Outside of immediate reachable area there is a door, a desk with a small automaton girl (~20cm tall), and a small maze inside a glass case on the other side of the room. There is a skeleton key visible inside the maze. There is a desk with a panel with some narrative text for the player explaining that they are a robot and they need to unlock the door to win by winding up the automaton girls and pressing a button on the VR controller to switch control/viewpoint to one of the girls. There are buttons you can press with the robot hands to page between parts of the narration text, and you can grab the key on the back of the girl. Once you read the text and turn the key some, the narration prompts you to press a button, then you switch to the big automaton girl, with 3 point control over her arms and head. You can then also use the joystick to move around (xr-tools direct locomotion). However as you move, the spring powering the automaton girl winds down. if the spring loses tension then your viewpoint resets back to the robot. there is a button to respawn the automaton girl to her original position (if she deactivates too far from the robot). The girl can walk over to the other desk with the small girl automaton and pick it up and put it down somewhere. The small automaton can also be wound with a key on the back, and once that happens, you can switch control/view into the small automaton (with VR world scale compensating for size). The small girl can enter the maze and pick up the key and drop it into a slot. The big girl can then pick up the key and walk over to the door and put the key next to the lock, which then snaps into the lock and enables the door. then you can manually open the door and walk outside, where there is a message saying you won and you can walk around freely. End demo.

systems needed:

game state

  • narration text revealing
    • signals on world buttons to switch page of text displayed
  • after intro, enable switching viewpoints/bodies with controller buttons
    • deparent old IK targets (leave in place)
    • move xrorigin to new body
    • reparent and reset new IK targets
    • change visual layers on avatar head parts so it's hidden if active/visible otherwise
    • change xrserver world scale (and/or on XRorigin) to match armspan/height
    • change movement and playerbody size/speed/height
  • subscribe to winding key position move
    • on zero, if active body, switch back to initial robot
  • subscribe to signals on world buttons for reset
    • model origin back to spawn point
    • move ik targets back to default pose
    • change spring/energy back to zero
    • also reset key pickup position

door:

  • another hinge interactable
  • initially disabled, enable when key is collider enters lock collider

key pickup

  • regular pickup rigidbody

pickupabble small character

  • when not active, enable pickup/rigidbody
  • freeze rotation so stays upright

buttons

  • from xr tools demo, sends signal on physical press.

key winding:

  • haptics when holding pickups and position increases
  • some sort of "resistance" to turning the more it goes
    • scale input "force" from pickup handles
    • play more steady haptic the harder it is
  • when unwinding, record velocities of bones/root movement and increase pace of unwinding to match -> more energy when moving

About

wind-up anime girl VR game

Resources

License

Stars

Watchers

Forks

Contributors