OAP Lizzard A game interface engine
Game interfaces, outside the game Settings

Building Lizzard / The development journal

Project journal

Milestones, decisions, experiments, mistakes and fixes, newest first. Open an entry for what was checked, the outcome and what is still uncertain. An entry written after the day it describes says when it was written.

Journal entries

Find entries

51–60 of 61 entries, newest first.

event Stage 5b · Stand-in game Milestone

A stand-in game, driven from the controls window

Before the first real addon, I wanted enough of Blizzard's interface to show party frames, on a stand-in game controlled from the tool window. Units, the group and their events were built and measured against the game.

Read the entry: A stand-in game, driven from the controls window

I asked whether forming a group in Lizzard would fire every event the game would. A probe recorded the real events, in order, while I formed a party in game, and Lizzard now fires them the same way; 88 of 94 probe cases match. The probe's first try set off the game's 'blocked' dialog, so events the game marks as restricted are now left out.

Loading Blizzard's unit frames brought a long tail, from 27,400 text strings to three loader bugs. By the evening the party frame loaded without errors in both games. Still open: comparing the party frames with screenshots from the game.

Link to this entry
event Game data · The game's own data Decision

Game data from my SQL Server, SQLite if packaged

Game tables are read from my SQL Server database of the game's data, with a SQLite file as the second source for a packaged copy, through one read-only path.

Read the entry: Game data from my SQL Server, SQLite if packaged

I was building a SQL Server database from the game's data and asked whether the stand-in game should use it. It does, through one read-only path, with SQLite as the second source if Lizzard is ever packaged.

The database's client package pulled in a cryptography package with two published security advisories, and I asked for that to be fixed first. First use: the classes. Forever has no class 13, where Retail has the Evoker.

Link to this entry
event Stage 5 · Text Milestone

Text, and the project goes under git

The work so far went into git, and Lizzard began drawing text with FreeType built from source, Blizzard's own font objects and the game's font files. The sixth probe run brought 83 of 88 text cases into line with the game.

Read the entry: Text, and the project goes under git

That morning the work since 23 October went into git as one first commit, with 295 tests passing. Until then the history was kept only in PLAN.md. Since then each piece of work ends with a commit.

The WoWData data export arrived and matched the agreed contract, with 20 TrueType fonts, the same in both games. FreeType 2.14.3 was built from source with its signature checked, chosen over the 17-day-old 2.15.0 as the more proven release. Blizzard's font XML loads 427 font objects without errors, text is measured with kerning, wrapping and inline textures, and font strings draw in their frame's draw order.

Against the Retail screenshot, the probe window's title and its 'OK' now look as in game, ink rows identical. The sixth probe run measured flags, shadows, rounding and widths; the engine follows them, and every template piece matches. Known differences: two of seven widths and two of five sizes a pixel out, because the width rule is a best fit, and the title one pixel to the left. The outline is an approximation, copies of the glyph rather than a stroke.

Link to this entry
event Display window · The game's screen Milestone

A display window that mimics real screens, and one pixel rule

Before text, the display window learned to behave like a real screen, with a set resolution, scroll bars, zoom and full screen. Then positions became the game's own 32-bit numbers.

Read the entry: A display window that mimics real screens, and one pixel rule

When I tried the zoom, it flickered. In a C++ Windows program I'd have hooked the erase and paint messages by then, and I said so. The view was rewritten so that nothing moves on screen, and then it was smooth.

Then I asked how fractional game coordinates were handled: at 4K a game unit is nearly three pixels. Positions are now kept as the game's own 32-bit values, so UIParent's scale of 0.6399999856948853 matches exactly, and one rule turns edges into pixels: a pixel is inside when its centre is. A probe run measured a strip of thin lines, and with pixel snapping on, every line lands where Lizzard puts it.

Not verified: how the game picks its scale at other resolutions, and drawing with pixel snapping off.

Link to this entry
event Game data · The game's own data Decision

A data contract, a font engine and two ideas for later

Three decisions of 28 October: game data not in the client's own exports comes only from an agreed WoWData export; text will use FreeType; and a UI designer and a Visual Studio IDE are recorded for later.

Read the entry: A data contract, a font engine and two ideas for later

I asked what would break if WoWData's working folders were deleted. Lizzard had been reading some files from one of them. So I made a rule: data not in the game's own exports comes only from an agreed WoWData export, in an agreed format and folder.

For text, FreeType, built from source into the solution as Lua is. SixLabors.Fonts was turned down for its commercial licence, and Windows' own text drawing as the least like the game.

Two side ideas were put away for later: a drag-and-drop UI designer, and a full IDE, 'one window', perhaps inside Visual Studio.

Link to this entry
event Stage 3 · Textures and art Correction

Like with like: a plan that could not have worked

Claude planned to check its drawing of Forever's files against a capture from Retail, and the probe couldn't have dumped what it was asked for anyway. I pointed out both; settings for each game and a comparison done by code followed.

Read the entry: Like with like: a plan that could not have worked

I told the session to check its instructions and its code: what it had described wasn't possible with the code as it was. A Retail capture says nothing about drawing Forever's files, because the two games' code, art and atlas tables differ. And the probe's template dump could never have recorded anything below each template's top frame.

Now each game has its own settings and files, and the runner compares the probe's results by code. The fourth Retail run matched all 1,251 atlases and 58 of 59 cases. The same checks on Forever waited for its return.

Link to this entry
event Stage 4 · Mouse and events Milestone follow-up

Mouse, events and the clock

Stage 4 gave Lizzard a mouse, events and a clock: frames answer hovering, clicks, the wheel and dragging, events can be fired by hand, and timers run.

Read the entry: Mouse, events and the clock

Any event name the game doesn't know raises an error, as it does in the game, and the window redraws only when something visible has changed. A new Events tab fires an event by hand.

Nine probe cases for input ran on Retail: four differed and were fixed, and I tried the mouse in the live window the same day. Still not verified: the drag threshold, and the order in which overlapping frames are tested for the mouse and frames receive an event.

Follow-up, : Presses whose release never arrives are now cancelled. If the window loses the focus while a button or key is held, no release script runs for it; the window used to fake a key-up instead, running bindings nobody had asked for. The change began as a patch from another project that uses Lizzard, and reviewing it found four faults, the worst a held movement key that would never have stopped. Not yet tried by hand.

Follow-up, : A click now lands where the mouse was when it was made. Mouse moves arrive faster than they can be handled, so Lizzard keeps only the newest position of those waiting. That one position was shared by every waiting move, so when the interface was busy (a load, a slow addon), a click followed by more movement was handled as if made at the later spot, and a button could be missed or a drag start in the wrong place. A click, key or wheel now closes the run of moves before it. A review by another project that uses Lizzard pointed to it; a test that holds the interface busy and clicks reproduced the miss before the change. Not tried by hand, since it needs a stalled interface.

Link to this entry
event Stage 3 · Textures and art Milestone

Textures, Blizzard's XML and the first real template

Lizzard drew its first real Blizzard window: ButtonFrameTemplate, the frame the OAP addons use, built by Blizzard's own XML and Lua from the game's own art.

Read the entry: Textures, Blizzard's XML and the first real template

Getting there meant reading the game's art: Lizzard's own BLP reader opened every one of the 113,471 files in Forever's art export. Blizzard's shared interface XML loads in about a second.

The template drew. Several rules behind it, such as how tiles are counted and how textures are sampled, were still guesses to check against a screenshot from the game, and many of Blizzard's own files still logged errors at load.

Link to this entry
event Stage 2 · Frames and layout Milestone

Frames and layout, measured in game by a probe addon

Stage 2 built frames, anchors and layout, and a probe addon measured the same cases in the real game. Three runs on Retail took Lizzard from 27 of 31 cases to 42 of 42.

Read the entry: Frames and layout, measured in game by a probe addon

Forever's servers were down until 4 November, so I asked whether a probe addon could measure the same cases on Retail in the meantime, to be rerun on Forever later.

The first Retail run matched 27 of 31 cases. The four that differed taught Lizzard small rules, such as frame types ignoring case and children taking their parent's strata and level. The second run matched 39 of 41 and the third 42 of 42. The same cases on Forever were still to be run.

Link to this entry
event Stage 1 · Lua from C# Milestone

Real Lua 5.1, built inside the Visual Studio solution

Lizzard runs real Lua 5.1.5, built from lua.org's source by a C++ project in the Visual Studio solution. The first way of building it lasted less than a day.

Read the entry: Real Lua 5.1, built inside the Visual Studio solution

The first try built Lua with a script so that the dotnet command could still build everything. But what I needed most was a solution Visual Studio itself could build, test and run, and dotnet can't build C++ projects. So Lua became an ordinary C++ project in the solution.

Lua raises errors with longjmp, which must never jump over .NET's code, so a small C layer sits between Lua and the C# functions it calls.

I had to ask twice for Start Debugging to open the live window. Visual Studio keeps the start-up project per user, outside the solution file, so Claude set it through Visual Studio's automation and checked it by starting the debugger.

Link to this entry