XFME home

Tutorial · 6

Making layouts

From a game's ROMs to a finished layout: MFME's editor, XFME's designer, and your artwork as a glass lit from behind. Worked through on Rainbow Riches Dublin Up (Barcrest / Inspin, MPU6) and its DX artwork.

1. What you need

  • The game: its ROMs and .gam in a folder of their own. Work on a copy.
  • The glass: a PNG of the whole glass as it is printed, at a good size (the designer halves anything over 3000 pixels). See-through where the reels show, with the lamp areas drawn as they look lit.
  • The last black: a PNG the same size, lined up with the glass. Black wherever light must not pass, clear where it shows: every lamp opening and the reel windows. Keep separate openings apart with black, even a thin line, because each clear area is lit only by its own bulbs. Name it so it says last black or mask (here DublinUp_DX_last_black.png) and keep it beside the glass.
  • A names file (optional, but it makes the designer far easier): <game>.placement.tsv beside the .gam, the lamps by name. You can learn one from the game's test mode (section 4).
  • A layout that already runs the game, however plain: its reels, displays and buttons, so you can see lamps light as you work. Or begin from the ROMs alone (the box in section 2).
The Dublin Up DX glass, see-through at the reel windows and displays, beside its last black: black everywhere except the lamp openings and windows
Dublin Up's DX artwork: the glass (left, the checks show where it is see-through) and its last black (right, clear only at the openings).

2. Start with the game running

Load the game. Here Dublin Up runs on a plain development layout: its reels, displays, buttons and a grid of test lamps, nothing pretty, but every part works. Everything you do from here happens with the game live, so lamps light and buttons press as you go.

If you are writing the .gam by hand, set Layout to your layout's file, and edit the .gam only while XFME is closed: XFME writes it back when a game closes.

Starting from the ROMs alone

  1. Design > Layout / Game > New Layout closes the game (it asks Exit Game, Are you sure?) and gives an empty layout.
  2. Design > ROM Loader: choose the platform, Load the program ROMs (and the sound ROMs), then Start.
  3. The game runs on the empty layout, and XFME adds its technology's default panel: the display along the top and the usual buttons on the usual switches along the bottom, plus the door and test switches on the toolbar, enough to reach the test mode. Most technologies have one (MPU4, MPU5, Scorpion 4 and 5, Impact, M1A/B, Epoch, ProConn and more); MPU6 and Pluto 5 / 6 do not yet.
  4. Carry on in the designer (section 3). Make XFME layout (section 6) writes the finished layout and points the game at it.
MFME's ROM Loader window: the game path, the program, sound, video and slave ROM lists with Load and Clear, the platform, Start and Stop
Design > ROM Loader.
An MPU4 game started from its ROMs on an empty layout: its display at the top showing INIT CST, and a row of buttons along the bottom: Cancel, Hold 25, Hold 26, Hold 27, SW 28, SW 29, SW 30, Start, SW 47
An MPU4 game started from its ROMs: XFME has added the MPU4 panel, the display and nine buttons.

3. Open the designer

Extras > Placement Panel. Edit Mode comes on and the window widens by the designer's sidebar, so the layout keeps its size. The designer's own bar runs along the top.

  • The bar: Undo / Redo for designer changes, Save layout, Save layout as, Load artwork, the Blackout overlay, Off glass, All lamps Brightness / Spread, Make XFME layout, Close designer.
  • The sidebar: what artwork is loaded; Lamps or LED digits; the sections of the names file; n placed / m; Only what the game has lit (the list keeps only lamps that light while it is ticked: watch a lamp light, then drag it); Learn from test mode and Review; Find; the list (▢ not placed yet, ✓ placed, gold = lit in the game now); then the settings of whatever is selected.
XFME Desktop with Dublin Up on its development layout and the designer open: the designer's bar along the top and its sidebar on the right listing the lamps by name
Dublin Up on its development layout, the designer open. The sidebar lists the game's 492 lamps by name, from its names file.

4. Lamp names

The designer is much easier when it knows the lamps by name. Dublin Up's names come in its rr_dublinup_mpu6.placement.tsv. For a game without one, Learn from test mode reads the names from the game's own lamp test, the way an engineer would walk through it. Here it is on Bugs Money (Heber Pluto 5), which had no names file:

  1. Put the machine in its lamp test, as on the cabinet (Bugs Money: hold the door switch, leave the meter display, Test, Hold 3 to 3.1 LAMPS, Start, Cancel).
  2. Press Learn from test mode, then step through every lamp with the game's own buttons. The status line counts as you go and shows the step on the display now, and the list shows each learned name.
  3. Stop learning, then Review...: one row per step. A lamp the test lights alone is ticked; where the test lights one of its own button lamps, choose which from the list; names can be edited.
  4. Save names file writes <game>.placement.tsv beside the .gam (an old one is kept as a dated .bak), and the sidebar reloads with the names.
Bugs Money in its lamp test with Learn running: the sidebar says Learning: 39 lamps named, 4 to choose; Now: 109 3 NUDGE, lamp 198
Learning: 39 lamps named, 4 to choose · Now: 109 3 NUDGE → lamp 198.
The Learn review: 187 steps of the lamp test, 183 lamps named, 4 to choose; one row per step with the test number, name, lamp and a choice on the button lamps
Review: 187 steps, 183 lamps named, 4 button lamps to choose.

Saved, the sidebar lists Bugs Money's lamps by name (Saved 183 lamp names in bugs.placement.tsv). Learn reads the game's alpha display; dot-matrix displays, ProConn terminals and video screens are not read yet, and Learn for MPU6 games such as Dublin Up is still being tested. Until it arrives, Dublin Up comes with its names file.

5. Load the artwork

Load artwork... and choose the glass. XFME finds the last black beside it (a picture of the same size whose name says last black or mask); if there is none, or more than one, it asks you for it. Then:

  • big artwork is halved until its long side is 3000 pixels or less (in the last black a pixel stays clear only where all the pixels it came from were, so thin black lines between openings survive);
  • the glass becomes the layout's background, unlit, across the layout's width;
  • the glass's clear areas are found and the reels move into them: reel 0 into the first window from the left, reel 1 the next, and so on;
  • the sidebar's top line says what was loaded: Artwork: DublinUp_DX_glass.png · 370 openings · 4 reels placed.

Drag the Blackout overlay slider up to see the last black over the layout while you work.

The Dublin Up DX glass loaded under the development layout: reels now sit in the glass's windows, the third reel window showing the hi-lo numbers 3, 2, 12; the development layout's test lamps and displays still on top of the art
The DX glass loaded: four reels have moved into the glass's windows, filled from the left. Not all are in the right one: the third reel window shows the hi-lo numbers (3, 2, 12). The development layout's test lamps and displays still sit on top.
The same view with the blackout overlay up: the last black shown in pink over the layout
The blackout overlay up: the last black (pink) over the layout.

Check every reel. The designer fills windows from the left, so a reel can land in the wrong one: here the development layout's spare reel 0 went into the BANK / CREDIT window, and the hi-lo number reel and the cash reel (the cash reel sits behind the crock) need moving by hand.

6. Make the XFME layout

Make XFME layout... writes a new folder beside the .gam holding the layout: glass.png, lastblack.png, the components (components.v20), the names file and <game>.mrl. It loads it and asks whether to make it the game's layout (the .gam is kept as .gam.bak). From now on the sidebar shows an XFME layout's settings: Spread, Brightness, Fill, Opening, Legend and Bulb colour.

Every component of the old layout comes across as it was: the reels, displays and buttons keep working, and you can move or delete them before or after this step.

The designer after Make XFME layout: the sidebar now shows Spread, Brightness, Fill, Opening, Legend, Lamp output and Bulb colour; the development layout's components still on the glass
The XFME layout made: the sidebar's settings are now a bulb's. The development layout's components are still on the glass (its 477 lamps count as placed until they go).

7. Arrange the components on the art

In Edit Mode, put every component the game needs onto the art and delete what the art makes unneeded (here on the layout just made; doing it before Make XFME layout works the same):

  • Displays into their windows: the award digits into the MEGA STREAK ladder, the BANK / WIN PAID / CREDIT display into its window.
  • Buttons over the painted buttons, or turned into clickable lamps (section 10).
  • Stand-in lamps, labels and test cells: delete them. The bulbs behind the glass replace the lamps.
  • Operator switches you still want as keys but not on view: put them outside the layout area, or delete them.
  • Reels: keep their proportions. Properties > Height = the window's height × the band's width / the window's width keeps the symbols in shape.

Drag a box from empty space to select a group, Shift-click to add or remove one, then drag the group or press Delete. Shift+arrows nudge by one pixel; right-click a group for Alignment, Quick Align and Size; Design > Component List finds a component that is hidden or off screen.

A box selection over the development layout's area, the selected components drawn white
A box selection over the development layout's test lamps, switches and cells.
After Delete: the clean DX glass with the reels in their windows, 0 placed of 492
Delete: the clean glass, the reels kept (0 placed / 492). This box took everything else, the displays and the coin entries too (COIN IN greys out); on your own layout keep those or put them back (section 10 for coins).

8. Place the bulbs

Drag a lamp's row from the list and drop it in the middle of its opening on the glass. On an XFME layout the lamp becomes a light source: a bulb behind the glass, exactly where you dropped it. In Edit Mode each bulb shows as a dot (gold while lit); drag a dot to move it. The quickest way to find a lamp: tick Only what the game has lit, watch the lamp light in the game, then drag its row.

Click a dot to set that bulb:

  • X / Y: its place. Lamp output: the lamp number that lights it (change it to move the bulb to another lamp).
  • Spread: how far its bright centre reaches. The light never leaves its opening: the last black stops it.
  • Brightness: 100 % is the artwork at full brightness in front of the bulb. Fill: how much light spreads evenly over the whole opening (higher is flatter).
  • Bulb colour: warm white unless you choose; a coloured bulb tints the light. Unplace removes it.

Several bulbs can light one opening (their light adds up), and one lamp can have several bulbs: drop its row again. LED digits: switch the list to LED digits; dropping a digit makes its seven segments and point as lamps, wired as the names file says.

Dublin Up with every bulb placed: a dot on every lamp opening of the glass, 472 placed of 492
Every bulb placed: 472 of the game's 492 lamps have a bulb on this glass.
The sidebar with the TAKE IT bulb selected: X 855, Y 771, Spread 22, Brightness 100 percent, Fill 15 percent, Lamp output 155
The TAKE IT bulb selected.
Zoomed in on the Pots o' Gold panel: a dot on each pot and on each rainbow arrow
Zoomed in (PgUp): a bulb in each pot and arrow.

9. Reel lamps: the reel grid

The reel grid for reel 3: five rows by three lights, the light buttons, Board colour ticks and Unlit 70
Reel 3's grid.

Reel lamps belong to the reel, not the glass (a bulb inside a reel window sits under the reel and never shows).

  1. Click the reel. The sidebar shows its grid: the window's five rows (2 above, Above, Payline, Below, 2 below) by Light 1, Light 2 and Light 3.
  2. Drag lamp rows onto the cells, or drop a lamp straight onto the reel: it goes into the row under the pointer, on the first free light. Delete clears a selected cell.
  3. The Light 1 / 2 / 3 buttons set each light's bulb colour. Board colour lights the reel in the colour the game sends (Dublin Up's reels are white, red, green or blue as the game drives them; MFME only ever drew the white).
  4. Unlit: how bright the reel is where no lamp is lit (0 black, 255 fully lit; about 70 looks right).

10. Buttons and coins on the art

When the buttons or the coin slot are part of the artwork, make them clickable lamps so the artwork stays clean: a Lamp component (right-click > New > Lamps > Lamp) over the painted button, with the button's switch in the Lamp page's Button field, no pictures, Graphic and No Outline ticked. It draws nothing, a click presses the switch, and its key (Shortcuts) still works. For a coin slot choose the Coin instead of a switch. Light the button with a bulb behind it. Bring it to the front (right-click > Bring To Front) so nothing covers it.

11. Finish, save and play

  • Off glass: how bright the glass is with its lamps off, as in a lit room.
  • All lamps: Brightness / Spread scales every bulb at once (each keeps its own setting).
  • Save layout (F7): the previous file is kept as .bak.
  • Close the designer, leave Edit Mode (Ctrl+E) and play: coins, every button, the lamps in the game's lamp test, the reels landing on the line, every display.
The layout made on this page running in attract: the DX glass lit from behind by its bulbs; the award ladders and the BANK / CREDIT display empty, the hi-lo numbers 3, 2, 12 in the third reel window and the round hi-lo window empty
The layout made on this page, running in attract: the bulbs light the glass. Still to do, as section 7 says: the award ladders' digits and the BANK / CREDIT display (the box took them), and the reels (the hi-lo numbers sit in the third reel window).
The finished Rainbow Riches Dublin Up DX layout in attract: lit award ladders from 70.00 down to 5.00, INSERT COINS on the display, the three main reels in their windows and the hi-lo number 12 in its round window
The finished Dublin Up DX layout on the same artwork: the award ladders lit, INSERT COINS on the display, every reel in its own window, the bulbs tuned.

12. When something is wrong

You seeLook at
The game starts on its old layoutThe .gam's Layout line (edit it only with XFME closed).
A lamp never lightsIts number (the names file, or the game's lamp test); on an XFME layout, that its bulb is inside an opening.
Light spills into a neighbourThe last black has no black line between the two openings.
Reel lamps do nothingThe reel grid: lamps in the rows, a light colour set, Unlit below 255.
Reel symbols sit off the lineThe reel's Band Offset; Reversed if it spins the wrong way.
A reel is in the wrong windowLoad artwork fills windows from the left: drag the reel to its own window.
A button on the art does not pressThe clickable lamp's Button number, and that it is in front (Bring To Front).
The Layout Font Check window opensA font the layout writes with is missing: put it in the game's Fonts folder. MFME's own MFME.ttf comes with XFME.
Changes vanishedSaved? (F7). The .bak beside the file is the previous version.