LUI stands for "Lua UI", and is the scripting framework used by the Call of Duty engine for all 2D menus, HUDs, 3D waypoints, etc since Black Ops 2. In Black Ops 3, Treyarch released ModTools to allow the modding community they currated back in 2008 to continue modding on new versions of the game engine, unlocking more possibilities. However, this newer release of modtools did not include the ability to modify the game's lua files to run custom UI code. Other modders in the community have since added support, however it is very rudimentary, and frustrating to work with. This rudimentary support leaves several problems including very poor iteration time, no error support from the lua interpreter, and a complicated animation/state system. My LUI editor aims to solve these issues by providing custom content creators the ability to drag & drop UI images in a photoshop-like manner, provide keyframing animation tools, and automatic code generation to streamline the process.
This is a showcase of features I implemented in my tool that I am proud of. Almost all of the code is from-scratch, the only libraries I heavily rely on are Freetype and Harfbuzz.
Live reload, or hot-reload, or whatever you wish to call it, allows for all the code in the application to be automatically
updated when a change is detected in engine.dll
. This allows me to quickly make, for example,
a debug ImGui window that shows the camera transforms without having to close the program.
One of the most common tasks a user will do is use the asset browser to add specific images to their UI scene.
This involves waiting on the disk, memory, and image parsing (stb_image) to load the image for use, which takes way longer than 1 frame to finish.
I added a dedicated asset loading thread that enables loading very large images, or whole directories full of large images, without
any hitching or blocking the main input/render thread of the program.
Here it is in action:
Since the LUI editor allows users to zoom in and closely inspect their work, it was important to me that fonts
scale efficiently and smoothly. I used Freetype to implement signed distance field fonts and rolled my own simple font atlas generator on top of it. There's still improvements and bug fixes to be made, but
overall the quality is good, performance is great, and text layout is mostly working!