Skip to main content

Using a Character in Your Game

A character plays in your game through the Pixi Puppet node. This page shows how to wire it by hand. The AI can do the same wiring for you when it imports a character (see With the AI Agent).

Setting it up​

  1. Add Pixi Puppet (Add → Game Engine) inside your Pixi Stage or a Pixi Container in it.
  2. Set Package URL to the character's file, for example assets/characters/leprechaun/character.xgc.json. The folder alone also works.
  3. Set Height (px), for example 400. At 0 the character is drawn at its source size, which is often 1500 px or more.
  4. Set X and Y. Scale X -1 mirrors it (Height still applies).

Node in tree

Property panel

When Ready fires, the character is loaded, and Clips and Params list what it has.

Two ways it plays​

ModeHow it startsWhat picks the clip
DirectThe defaultYou: Clip (default idle), Loop, Fade (s), Speed, Play, Stop
Round eventsThe first time any of Round Start, Round Result, Round Settled, Feature Enter, Feature Exit, Tap or Trigger State firesThe character's own moments (set in the Studio's Moments), under the market's rules

Once round events have started, they drive the character for good. Clip, Play and Stop are then ignored, and Blocked says clip-input-ignored: round events drive this character.

Use direct mode for a menu screen or a cut-scene. Use round events in a slot.

Wiring the round​

Wire your round's signals into the node's Round Events inputs, and set the values before you fire the signal that reads them.

InputFire it whenReadsIn a typical XGENIA slot, for example
Round StartA spin startsStakePixi Reel Controller's On Spin Start
Round ResultThe server's result is inWin, Stake, Feature, Feature Confirmed, TierWhen the spin request succeeds and you know the win
Round SettledThe round is over and the win has been shown—Pixi Reel Controller's On Celebration End, or On All Stopped for a losing spin
Feature EnterA bonus or free spins startFeature (its name, required)The free-spins start
Feature ExitIt endsFeature (the same name), Win (the bonus total)The free-spins end
TapThe player taps something that should poke the character—Your own hit area

Round wiring

The values:

ValueMeaning
StakeThe round's paid stake
WinThe round's win. Only the ratio of win to stake matters, so any unit works, as long as both use the same one
TierOptional: none, small, big or mega, to use your game's own tiers instead of the default ones
FeatureThe feature's name, for example free_spins. Leave empty when there is none
Feature Confirmedtrue when the server's result already holds the feature. Anticipation only plays then

Without round wiring the character just plays its idle clip.

What plays​

The round doesThe character plays (moment)
Round StartSpin, then Watching reels until the result
Round Result with a confirmed featureAnticipation, then the result
Round Result with a winSmall / Big / Mega win, then Resting
Round Result with no win, or a win the market does not celebrateStays at rest
Feature EnterBonus enter, then In bonus for every round of the bonus
Feature ExitBonus exit, then the bonus total is celebrated against the stake that triggered it
TapTapped (or the tap zone's reaction), then back to what it was doing

A missing clip is skipped (or replaced: a missing win_mega falls back to win_big, then win_small). Round Result cuts the spin reaction short; a second Round Result in one round is refused. Round Settled sends a waiting character home at once and lets a running celebration finish.

Win tiers​

By default the tier is worked out from win ÷ stake:

WinTier
50× the stake or moremega
10× or morebig
more than 0small
0none

The node has no inputs for these thresholds. To use your game's own tiers, send Tier with Round Result. A win at or below the stake is never more than small.

Market rules​

Market (in the Behaviour group) applies the rules of where the game is played. Changing it starts the behaviour again from rest.

RuleDefaultUKGLI-19
Celebrate a win at or below the stakeyesnoyes
Taps during a roundreactignoredreact
Minimum time between rounds—2.5 s (warned in the console)—
Anticipation without a server-confirmed featurenevernevernever
Celebrate before the resultnevernevernever
Idle extras during a roundnevernevernever

The character is presentation only. It receives the round outcome after the server has decided it and plays animation to show that outcome. It has no input into the outcome, the random number generator, the paytable, the win amount or the round's timing. It cannot shorten the time to a result: it offers no skip or quick-stop, and in the UK profile taps during a round do nothing. It never celebrates before the server result arrives, and it plays anticipation only when the result already contains the feature, so it never suggests a win that is not coming. The same events at the same times always give the same clips.

Art rule (GLI-19)

Animations must not make one symbol look like another paying symbol. Keep character clips from mimicking your symbols.

Taps​

  • Pointer taps reach the character only if it has at least one tap zone (set in the Studio's Moments). Then a click on it (on a part at least half opaque) fires Tapped with Tapped Part.
  • In direct mode, a tap on a part with a zone plays that zone's clip once on top of what is playing.
  • In round-event mode, the tap is the Tapped moment, with the zone's own clip and face if the part has one.
  • The Tap input is a tap with no part: it plays the Tapped moment.

Taps are ignored for 3 seconds after one is accepted, during celebrations, anticipation, bonus transitions and the spin reaction, for 1.5 s after the round settles, and in the UK during the whole round.

Sounds and effects from clip events​

Clips carry events: cheer, coins, shake… When one fires, the node fires Event with Event ID and Event Type (sfx, fx, shake or custom). Wire them to your sound and effect nodes, for example: play the cheer sound when Event ID is cheer.

Events to sound

The events the automatic rig puts in its clips:

ClipLengthEvents
idle4 s, loops—
spin_start0.9 ssfx spin_hup
spin_watch2 s, loops—
anticipation1.3 ssfx gasp
win_small1.7 ssfx chuckle
win_big2.8 ssfx cheer, fx coins, shake small
win_mega3.8 ssfx gasp, sfx cheer, fx coins ×2, shake big
bonus_enter1.5 ssfx gasp, fx sparkle
bonus_idle2 s, loops—
bonus_exit1.3 s—
tap_react0.9 ssfx hey

Clip Finished and Finished Clip tell you when a clip that does not loop ends.

Looking at the pointer​

Turn Look At on and feed Look X / Look Y a point in the same space as the node's X / Y, for example the pointer position. The head turns towards it. Characters without look-at report this character cannot look at a point.

Holding a slider​

To hold one slider at a value over whatever plays (a character that keeps smiling, a hat that stays off), set Param Name (for example Smile) and Param Value, then fire Set Param. Release Param gives it back to the clips. The Params output lists the slider names.

Forcing a moment​

State + Trigger State plays a moment by name: spin_start, win_small, win_big, win_mega, anticipation, bonus_enter, bonus_exit, tap_react, idle, no_celebration. The same rules apply. For example, anticipation only plays when this round's result confirmed a feature.

One character riding another​

A parrot on a pirate's shoulder, a rider on a dragon:

  1. On the carrier (the pirate), set Name, for example pirate.
  2. On the rider (the parrot), set Ride On = pirate and Ride Bone = one of the pirate's bones (see Skeleton in the Studio). Turn With Bone (on by default) turns the rider with the bone.
  3. The rider's own X, Y and Rotation become an offset from that bone.

One character riding another: Riding

On the riderDoes
Share MomentsThe rider gets the carrier's round events (not its taps) and plays its own clips under its own market
Share SlidersSlider names, comma-separated (for example HeadTurnX, Blink): the rider copies the carrier's values every frame

Status and errors​

OutputTells you
Ready, Is Ready, LoadingLoad progress
ErrorWhy nothing shows — see Troubleshooting
StateThe moment it is in
BlockedWhat the last event was refused for, for example market-no-celebration-at-or-below-stake, tap-cooldown, not-ready

An event sent before the character has loaded is dropped (not-ready). Fire round events after Ready.

Performance​

  • One draw call per atlas page: most characters are one draw call.
  • Copies of the same character share its pictures.
  • A hidden character (Visible off, Alpha 0, or a hidden parent) is not drawn, but its clips keep time, so events still fire.
  • Speed 0 freezes it; Reload reads the file again after it was re-saved outside the Studio.
Was this page helpful?