Bowling Level Setup

From Blue Mars Developer Guidebook

Jump to: navigation, search
There are security restrictions on this article


Overview of Level Setup

This page details how the Bowling game is setup for one lane. Bowling assets, scripts and triggers are setup in the Beach City level and organized in a separate level layer.

Entity setup

The following entities are placed in the level.

(1) AvatarTrigger, (2) TagPoints, (3) Balls, (4) Chairs

Avatar Trigger

Number (1) in the image above, an ARAvatarTrigger is placed at the beginning of a lane near the ball rack; Property settings are pictured below.

The Popup dialogs section explains what happens upon entering this trigger.

ARAvatarTrigger Properties


Number (2) in the image above, TagPoints (RollupBar>AI>TagPoint) are placed to mark these locations:

(2a) Starting Position, named TagPoint_startpos_<lane#> - position is used for the avatar's position at the start of a turn
(2b) Ball return, named TagPoint_ballreturn_<lane#> - position & direction is used for setting the position of a returned ball, and adding impulse to roll in the forward direction of the TagPoint
(2c) Pin 1 position, named TagPoint_pin_<lane#> - position & direction is used to align the pins and the pin resetter machine, and this direction is used as the lane's forward direction

Bowling balls

Number (3) in the image above, four bowling balls are placed on the ball return rack

  • The balls are instances of the Entity Archetype "ball" found in the DataBase View (View>Open View Pane> DataBase View), and are loaded from the Game/Levels/AR/Common/Libs/EntityArchetypes/Bowling.xml file
  • Entity Archetypes allow the model, physics settings, etc. to be defined once for an entity
  • They are named ball_lane<lane#>_p<plyr#> (e.g., ball_lane3_p1) and referenced by name in script (System.GetEntityByName by name in scripts)


Number (4) in the image above, chair entities are placed in the couch and are marked as "HiddenInGame" in EntityParams, used to seat players during multiplayer games. Four chairs are linked to the Supervisor entity with Link Names "chair1"-"chair4", as shown below.

These reserved seats (the first two spots on the couch) are only accessed within the game. The third spot is accessible by any player since the couch is an ARChair entity - upon clicking the couch, a player is seated on the third cushion. There are also a number of ARChair entities in the level used for the stools and booths in the back of the alley.


Pins are Entity Archetypes, similar to the bowling balls.

  • Ten pins are placed in the level (Entity Archetype "pin" from DataBaseView) and linked to the Supervisor entity with Link Names "pin"
  • The supervisor script uses these links to access the pins, so their object names don't matter
  • Pictured below, pins are setup by the supervisor according to the Pin TagPoint location (2c above, grayed out here because it is frozen)


Popup dialogs

ARConfirmTeleport entity - enter/exit the alley

Two ARConfirmTeleport entities are placed in the level to handle entering and exiting the bowling alley.

See the ARConfirmTeleport page for more details about this setup, which includes an ARAvatarTrigger, a destination TagPoint, and a simple FlowGraph.

ARConfirm entity - choose game mode

In the FlowGraph, the avatar trigger is connected to the lane's updater to check if the lane is available ("not owned"); if so the ARConfirm entity starts, bringing up a popup dialog. The player's choice (single player or multiplayer button) is passed on to the supervisor which spawns the corresponding mode's script. This FlowGraph, shown below, is a bit ugly--it's a working solution until the next implementation of matchmaking.

ARConfirm dialog Properties FlowGraph setup launches the game if the lane is available

Bowling game entity setup

The game entities are placed in the level (in the AR_BeachCity level, these entities appear in the RollupBar Entity Browser under AR>Common>Minigames>Bowling) and Properties, links and FlowGraph nodes are setup. These entities - ARBowlingUpdater and ARBowlingSupervisor - are represented by yellow "AR" icons in the image at the top of the page. The ARBowlingStatsDisplay script controls the leaderboard using web utilities and Flash Material, the same way the golf display is controlled by the ARGolfStatsDisplay.

"Updater" entity communicates game events to spectators

The ARBowlingUpdater's syncPeriod Property is set to 333, meaning spectators receive game events every 333ms or 3 times per second. One ARAvatarTrigger encompasses the alley and uses a ScriptCommand to initialize all lanes for spectators.

  • The Enabled and OnlyLocalAvatar and checked, but StopOnEnter is not checked; DimX,Y,Z are set to 36, 40, 5.
  • The ScriptCommand contains calls to launch each lane's updater as well as the leaderboard.
EntityNamed("ARBowlingUpdater1"):GameStart();EntityNamed("ARBowlingUpdater2"):GameStart(); ... EntityNamed("ARBowlingUpdater6"):GameStart(); 
  • The ScriptCommandLeave stops the leaderboard from refreshing every minute.

"Supervisor" entity launches game

ARBowlingSupervisor is placed in the level with Properties pictured below, including a GameClass unique to this lane and area id's matching the gutter, pin and pit areas below.


Pictured in this image: gutter, pin and pit areas, which are labeled with specific AreaId's used in script, and target the lane's ARBowlingSupervisor entity: Image:bowl_setup_areaParams.jpg


  • Lane, gutter and pit models have collision proxies which interact with the ball and pins.
  • Solids (RollupBar>Objects tab>Solid) are placed as borders to prevent avatars from walking down the lanes or beyond the boundary of the alley
    • the solid's material is assigned a special SurfaceType, mat_ar_forbidden, which prevents an avatar from walking over the solid
  • Building interior and exterior geometry, decals, a VisArea and a few lights complete the alley setup

Sound effects

The sound effects are triggered by surface types coming in contact as described on the Material Effects page. Three bowling-specific surface types are used to define Material Effects: mat_bowlingBall, mat_bowlingPin, and mat_bowlingLane (floor). The four types of collisions are listed in the row/column intersections in the Material Effects spreadsheet, which point to sound effects defined in the collisions.xml.

  • ball-pin
  • ball-lane
  • pin-pin
  • pin-lane

Material Effects for bowling-specific collisions

User Interface files

UI Flash Movie files can be found in Game/Levels/AR/Common/Libs/UI/Bowling. These are referenced in the Hud table of the single and multiplayer scripts.

Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools