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

1–3 of 3 entries for Painting · Drawing the picture (of 61 in the journal), newest first. Show all

Painting · Drawing the picture Fix follow-up

Slanting lines drawn as lines: an addon's chart now matches the game

OAP Spell Stats draws its healing trend as a thin line, and in Lizzard the steep stretches came out as solid green blocks. Lizzard had never learned to draw a slanting line. Now all three of its painters do, and the chart matches the game.

The same OAP Spell Stats chart drawn by Lizzard after the fix. A thin green line with small squares at each point wanders across the chart, with no solid blocks, and the scattered squares around it are as in the game.
After the fix: the same chart, the same fights, the same framing. Each step is now a thin line between two points, and the chart matches the game's picture. Lizzard's three painters now draw only the pixels whose centres lie on a slanting line.
Read the entry: Slanting lines drawn as lines: an addon's chart now matches the game

The Trends chart joins each fight's average to the next with a two-pixel line. Lizzard laid every line out as the rectangle around it. That is exact for the upright and level lines of Blizzard's Edit Mode, which were all it had needed, but a slanting line was drawn by filling its rectangle. On a gentle slope the rectangle is thin enough to pass for a line. On a steep step it is a block as tall as the step.

Claude kept the rectangle as the area to draw and gave the painters the line itself: its two ends and its thickness. A pixel is drawn when its centre lies between the ends and within half the thickness of the line. The software painter that makes Lizzard's pictures, the Direct3D painter of the live window and the Godot painter all use that rule. Their tests draw steep, shallow, thick and textured lines and check that the painters agree pixel for pixel.

The pictures show the same 1,000 recorded fights in the game and in Lizzard. The game's is a crop of my screenshot. The picture before the fix was taken afterwards, from a kept copy of the earlier build, so that it matches the picture after the fix.

Still a guess: how the game finishes a line's ends, and whether it smooths their edges. At this size the pictures can't tell, so both are on Lizzard's list of unverified behaviour.

Follow-up, : The same afternoon, the rest of the addon's Lizzard reports. Its efficiency map turns its side label a quarter turn, and Lizzard could not turn text, so the addon laid the label flat. Text now turns in all three painters, about its starting end: that is how the game turns it, as the addon's author saw in game in October. Which point of the end it turns about is still a guess. Two smaller fixes came with it, for the addon's tests: a mouse-wheel step sent from Lua now works, and a test can open a world with its own saved fights instead of feeding them in as code. The last picture in the album shows the turned label.

Link to this entry
event Painting · Drawing the picture Decision

Painting moves to the graphics card, software kept on a switch

Dragging things around in Edit Mode was sluggish. Lizzard was repainting the whole picture from scratch, in software, every time anything changed.

Read the entry: Painting moves to the graphics card, software kept on a switch

I called the first suggestions sticking plasters, not the wound. Repainting only the part that changed I ruled out as a nightmare to get right without screen corruption. A test settled where the time went: even with the picture never sent to the screen, painting still took about 35 milliseconds.

So the painting moved to the graphics card. That brought it down, but most of what remained was copying the picture back from the card. Letting the card show the picture itself cut the drawing thread's time to 0.9 milliseconds a picture.

We kept the software painter as a reference: a test draws the same scenes both ways and fails if they drift apart. Not checked at the time: whether the mouse still reached the game through the card's surface.

Link to this entry
event Painting · Drawing the picture Investigation

An audit finds the real cause of the sluggish window

After a heavy day of work I asked for a full audit, report first. Among its findings was the real cause of the sluggish feel: the frame-box overlay, at 360 ms a picture.

Read the entry: An audit finds the real cause of the sluggish window

I asked for the conversation, the code and the documents to be audited, with a report before any change, then all of it fixed to restore confidence.

The real cost was the frame-box overlay: every visible frame filled whole, many the size of the screen, with a blend call per pixel, 360 ms a picture. Painted in bands across the cores it takes 18 ms, and a change reaches the screen in 36 ms instead of 387.

Four files over 400 lines were split to meet a line limit the sessions thought was mine. That evening I said it wasn't, and the rule was removed.

Link to this entry