Pages

Friday, December 30, 2011

On Graphical User Interface

The Graphical User Interface, known as a GUI or UI is one of the most important aspects in a game. It is what allows your player to understand the chaos of the game world. The UI gives the player information that if the game were real, the 'player' would already know, eg. Your health. The human doesn't have some meter attached to them telling them how healthy they are, no. A person knows when they are sick, or if they get a cut.

My current project has been key bindings in a GUI. Anyone who has played World of Warcraft or many other games with a multitude of abilities or spells (Dragon Age: Origins, another example) knows that you don't always have room for every ability or spell on your GUI and it ruins the game experience to have to open the spell book to cast a spell every time. This type of GUI mechanism is called a QuickBar. Each slot on the bar is bound to a key. At anytime one can either change to binding of the slot, or the spell in the slot.

First i wanted key bound spells. So i sat down and attempted a flat out c# solution. No success. Now, either i'm missing knowledge, (which is very likely) or it just isn't possible in a language like C#. To fix this i used the Lua wrapper, LuaInterface. It wraps Lua into a dll (for windows) and gives the programmer access to a Lua Virtual Machine. You can feed to VM scripts, which it compiles during run time and executes. I wrote a simple script that takes in a C# method and a key, links them together in a table, and when given a key, calls the linked function. Problem solved.

Now for the GUI implementation of this.... which is a WIP. I've currently coded the QuickBar and am researching live Combat Systems to get a better view on spell effects and such.

Until next time,
TNariksan.

No comments:

Post a Comment