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–2 of 2 entries for Display window · The game's screen (of 61 in the journal), newest first. Show all

event Display window · The game's screen Change of direction

The live window on three threads

The live window had been built on one thread. I found it sluggish, and it was split into interface, logic and drawing threads, with a rule to use threads wherever they pay.

Read the entry: The live window on three threads

I asked for frame and loop rates. Every step counted as a change, because Blizzard's code keeps setting the same values, so the whole scene was redrawn every step. Setters that change nothing no longer count.

Then I asked whether logic and drawing were properly separated. They weren't: one thread did everything. I was shocked it had been single-threaded at all. Now a logic thread owns the world and Lua, a drawing thread paints, and the window's thread only shows pictures and passes input on. When I still saw single-digit frame rates, the painting was split across all the cores too: 50 ms a scene became 9.

My rule since: use threads wherever they pay.

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