Description

VisualWoWSim is an implementation of the World of Warcraft UI system. It acts as the glue between the various content that makes up the UI and my Shear library that actually renders it. It does not attempt to emulate any other client or server functions.

One of the primary reasons I developed VisualWoWSim was to allow for easier debugging of World of Warcraft add-ons. World of Warcraft does not provide the standard debug library in its implementation of Lua, and it does not include a pdb (for good reason) that is necessary for visual debuggers like Decoda. VisualWoWSim includes both.

Additionally, it may be useful for add-on developers working on netbooks or machine with low specs. Since VisualWoWSim only renders the UI it requires significantly less resources than the World of Warcraft client. This also means that UI reload times are near instant. Furthermore, it does not require an internet connection. However, it does depend on a World of Warcraft install, primarily the MPQs.

Over 3,000 lines of test cases that execute in VisualWoWSim and World of Warcraft

Simulations

This section demonstrates various simulations. Note that for all World of Warcraft screenshots I have applied a black texture over UIParent so that the 3D area is not shown.

Simple Test Cases - Accuracy

I have written over 3,000 lines of test cases for the various widgets in Shear. These same set of test cases execute in World of Warcraft. This first screenshot (click to expand) shows the test cases rendered in VisualWoWSim.

This screenshot (click to expand) shows the exact same test cases rendered in World of Warcraft.

You'll notice that the two are very similar. The main difference is that VisualWoWSim does not attempt to render the minimap details. Secondly, the font rendering on the button does not yet correctly do formatting.

Below is a screenshot (click to expand) of the same rendering, but with widgets labeled by their type and test purpose.

Intermediate Test Case - Cellular Automata

Cellular Automata, one of my other projects, is able to function as a World of Warcraft addon. To test VisualWoWSim I loaded it up with no source changes.

It's a near perfect simulation. Cellular Automata is a fairly complex addon that uses four different widgets.

The Ultimate Test - Simulating the entire WoW UI

However, the ultimate goal of VisualWoWSim is to simulate the entire WoW UI environment. If you're unfamiliar with the default World of Warcraft UI, there are 168 XML files that describe templates and widgets for the default layout. Additionally, there are 184 Lua files that control the logic of the UI and bind them to the game's ~2000 UI functions.

The current status of VisualWoWSim is that it is able to load all of the default UI without errors and render them. This includes Load on Demand addons that World of Warcraft uses to help alleviate long load times. All files are loaded from standard World of Warcraft MPQs in real-time; BLPs and TTFs are converted to DirectX textures and custom font sheets, respectively.

It is not possible to tell from the video, but it takes my machine about 400 milliseconds to load the entire UI.

If you look closely you will be able to detect some issues. I am working on finishing the simulation and increasing the accuracy.

Code Samples

Saved Variables

World of Warcraft supports the serialization of Lua variables at the end of a session. It can then deserialize them and load them into the next session. This section will show the output World of Warcraft's serializer and the output of VisualWoWSim's serializer.

To test the output I created a simple script that tests all data types and recursive tables.

VisualWoWSim's output looks like this:

World of Warcraft's looks like this:

The only difference is that World of Warcraft uses implied array elements in table named "Frame" and VisualWoWSim uses explicit indexing. (Ordering is different because Lua does not guarantee the order of hashed elements in a table.) The result is the same.

This is the implementation of the serializer. It is implemented so that any stream type can be used, but in this case the only output stream is a file.

BLP Loading

This file shows VisualWoWSim's implementation for reading a BLP file and converting it to a DirectX texture surface. The implementation uses templates to support arbitrary data streams to load from. In this case, it supports loading from a physical file or from a memory stream (i.e. from a MPQ).

Downloads

Binary: Not yet available (Requires a valid World of Warcraft installation)