Skip to content

monaverse/BallMazeTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

BallMazeTemplate

The example blender files in this project serve as a guide to making playable Maze 3d glb objects.

These objects can then be minted and played on the webgl based Maze Game hosted at: https://monaverse.com/play/ball-maze

This guide will teach you the specifications of a maze glb that make it compatible with the game.

Installation

To get started, make sure you have Blender 4.1 or later installed!

Table of Contents

Object Hierarchy

When the Ball Maze game loads a maze glb, it looks for a specific object hierarchy to attach scripts, add physics colliders, and size the ball appropriately. This automation makes a plain 3d maze object playable!

├── BallMaze
│   ├── Ball
│   ├── BoardX
│   │   ├── BoardY
│   │   │   ├── BoardFloor
│   │   │   ├── Goal.Empty
│   │   │   ├── SpawnPoint.Empty
│   │   │   ├── Hole.Empty
│   │   │   ├── Wall
│   │   │   ├── Ramp
│   │   │   └── OuterWall
│   │   ├── AxisY
│   │   └── AxisX

BallMaze

This object can have a mesh and should represent the outer shell of the maze. It will NOT receive a collider.

  • Max Size: x=8m,y=8m,z=2m
  • Scale: x=1,y=1,z=1
  • Location: x=0,y=0,z=0
  • Rotation: x=0,y=0,z=0
BallMaze

Ball

This object should be a sphere with a diameter of 1m, the scale of this object determines the size of the ball in the game.

  • Size: x=1m,y=1m,z=1m
  • Scale: x=1,y=1,z=1
Ball

BoardX

This object can have a mesh and should represent the outer ring of the maze floor. It will NOT receive a collider.

  • Scale: x=1,y=1,z=1
  • Rotation: x=0,y=0,z=0
    • The game will rotate the board around the local y axis at a range of -5 to 5 degrees when the user moves horizontally.
  • Origin: the game will pivot the board at this point.
BoardX

BoardY

This object does not require a mesh, instead all the floors, walls, ramps, holes, spawnpoint, and goal rotate with it.

It will NOT receive a collider, but its children will.

Make sure that there are walls that surround the maze floor to prevent the ball from rolling off the board.

  • Scale: x=1,y=1,z=1
  • Rotation: x=0,y=0,z=0
    • The game will rotate the board around the local x axis at a range of -5 to 5 degrees when the user moves vertically.
  • Origin: x=0,y=0,z=0 (!important)
BoardY

BoardFloor

This object must contain the word BoardFloor in its name.

It will receive a Box Collider

This object will have holes punched in it. Note that since it receives a Box Collider, the ball would roll right over the holes were it not for the Hole.Empty objects, which are described in the next section.

  • Scale: x=1,y=1,z=1
  • Rotation: x=0,y=0,z=0
BoardFloor

Hole.Empty

There should be one Hole.Empty object for each hole on the board.

Each Hole.Empty object must contain Hole in the name.

It will receive a small sphere Trigger that detects when the ball enters it.

  • Scale: the scale should be relative to 1.0 == 1meter
    • for example, a hole with a .3m diameter should have a cooresponding Hole.Empty with a scale of x=.3,y=.3,z=.3
  • Rotation: x=0,y=0,z=0
  • Origin: the origin of each Hole.Empty should be at the center of the geometry of each hole on the BoardFloor
Hole.Empty

Goal.Empty

There should be one Goal.Empty object at the end of the maze.

The Goal.Empty object must contain Goal in the name.

It will receive a small box Trigger that detects when the ball enters it.

  • Scale: the scale should be relative to 1.0 == 1meter
Goal.Empty

SpawnPoint.Empty

There should be one SpawnPoint.Empty object at the start of the maze.

The SpawnPoint.Empty object must contain SpawnPoint in the name.

This object should contain a mesh that marks the start of the maze.

  • Scale: x=1,y=1,z=1
  • Origin: the ball with be spawned at the origin of this object.
SpawnPoint.Empty

Ramp

Ramps receive a convex mesh collider. This allows them to serve as wedge shaped ramps or walls in the maze.

The collider will follow the contours of the mesh, keep them simple and make sure there are not concave surfaces. (eg. a cheese wedge is convex, a crescent moon shape is concave)

A Ramp object must contain Ramp in the name.

  • Scale: x=1,y=1,z=1
Ramp

Wall

Walls receive a box collider. This allows them to serve as simple platforms and walls in the maze.

A Wall object must contain Wall in the name.

  • Scale: x=1,y=1,z=1
Wall

OuterWall

OuterWalls receive a box collider. This allows them to serve as an outer wall for the BoardFloor

An OuterWalls object must contain Wall in the name.

  • Scale: x=1,y=1,z=1
OuterWall

Axis

Axis meshes are for decoration, they should rotate around the axes of BoardX and BoardY

Axis

Exporting A Maze

We'll be exporting this maze as a GLB file.

To begin, right click on the BallMaze object in your scene hierarchy and select Select Hierarchy

Select Hierarchy

All of your objects should now be selected.

Selected Objects

From your File menu, select Export/glTF (2.0) (.glb/.gltf)

Selected Objects

In the export panel, make sure Format is gltfBinary (.glb) is selected. This will export one .glb file with materials and textures packed inside.

Make sure to also select Include\Selected Objects and Mesh\Apply Modifiers (if you used modifiers to punch out holes)

Export Panel

Fill out your file name and complete the export.


Testing A Maze

To test a maze, upload it to a web server. I typically use a pinning service like Pinata to host my files.

I right click on the uploaded file and select copy the link address.

Export Panel

Load the game up in your desktop browser, hold the p key and while holding the p key, press the o key. This allows you to load a glb manually.

Paste the url to your glb file into the prompt and wait for it to load.

Manually Load Maze

If all goes well you should be able to play your maze! If not, then review the specs above or reach out to me on the MONA Discord to troubleshoot.


Minting A Maze

I'll compile a tutorial for setting up a contract on manifold.xyz later, but for now if you have a preferred contract provider, make sure that when you mint the object, you mint the glb file and add the following trait to the token:

Trait: "3D Object Type" Value: "Ball Maze"

Then register your contract with us on the MONA marketplace by reaching out on the MONA discord.

Once your contract is listed, the Ball Maze game will allow other players who own the token to load it into their games!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors