Tuesday, August 21, 2007


I've now finished the restructuring of how labels and chat bubbles are handled. The new system is much more robust and efficient. Instead of creating the chat widgets from scratch every time a npc says something I now keep a dynamically growing pool of already allocated widgets from which I check out and return widgets once they're not shown anymore. I created some utility classes for general widget pool behaviour which should hopefully be reusable for other widgets in the future ("WidgetPool.h").
Labels are now shown for all entities that inherit from the "character" entity type. That includes pretty much all npc and animals in the game world. For now it's a hard coded check, but it could either be added as an Action to the modelmapping definitions, or as a new rule format (perhaps in lua?). If an entity is controlled by an outside client (i.e. a human) the name is pre- and suffixed with "!" signs. This will be very useful as it will now be easier to see which entities that are controlled by other users.
I also use a new, bolder font for the text. And I added some gradients. The latter might look a little garish, but it helps alot with showing the text on light backgrounds (white text on white background is no good...).
I also solved a strange issue where the text previously always lagged one frame behind the camera. So when the camera moved the text "swayed" a little. It looked quite strange. However, since I now listen for the actual Ogre render call before I position the windows, that issue has disappeared.

The guys over at fedora-games have been interested in packaging WF tech for a while. They already have builds of both Cyphesis and Sear, but alas no build of Ember. There were two reasons for this:
  • Ember used WFUT which in turn used Java, which was kinda cumbersome
  • Ember required Lua 5.0 and didn't work with Lua 5.1 which is what's shipped with Fedora
However, since some releases we're using libwfut and have no dependency on java anymore. That leaves the Lua issue. Yesterday I took a look at how hard it would be to allow for both Lua 5.0 and 5.1 to work with Ember. Turns out it wasn't hard at all: some #ifdefs later I had a working app which used Lua 5.1. This does however require that CEGUI is built with Lua 5.1, but there are patches available for that (Fedora itself builds CEGUI with 5.1).

All in all this might make me do a 0.5.1 release pretty soon, so that the Fedora guys can get cracking on getting Ember to be included in their package.

Friday, August 17, 2007


Yesterday I spent some time revamping the way labels are shown on entities. Currently they aren't shown at all, unless the entity speaks. Then a little "talk bubble" widget is shown. If the entity has some suggested responses, they will appear as clickable buttons. But after a while the widget will fade and disappear. This makes for very bad usability, since it's not possible to easily see the names of any near npc or other players without clicking on them. And it's of course not the way that all other virtual worlds does it.
The plans is therefore to provide a better mechanism for displaying labels on certain entities. I've added a blueprint for this to the Launchpad. The first step is to refactor the quite inefficient way of showing the labels that are currently in use. Instead of creating new CEGUI widgets every time a new label should be shown, and then deleting them afterwards we'll keep a pool of reusable widgets. And instead of doing a lookup of the active widgets every frame we'll use listeners that we attach to the entities and the models to actively listen for events that tell us directly whether to show or hide the labels. Currently it's all still in C++, but the plan is to somehow separate the actual widget creation and rendering into Lua scripts, while keeping the heavy book keeping code to C++. This should also let us mark those avatars that are currently possessed by a human players. There's already an attribute ("external") which marks these, though it's not used. By providing a marking it should be much easier to interact in the world. Currently you often start out in a world with 20+ inactive avatars, with no way to discern which ones are actual human beings (granted, one of the design goals of the AI is that the npc's should behave like humans, but we're not there yet).
So far I've gotten to the stage were a new labelling backend system is fully functional and in use. The next step would be to extend the Model format with information on what entity types to show labels for. Or perhaps it would be better to put that information in the ModelMapping format as an Action? Hmm...

Wednesday, August 15, 2007

Heads up

After returning from my vacation I yesterday added some status widgets to Ember. That's one of those things that's been bugging me for a while. It's not hard to do; I just never had time. Before I started I looked through most other major mmorpgs that people are playing. People generally like when they can reuse their existing knowledge between different applications. The way the interface works in almost all mmorpgs on the market today is very much standardized: you have your status widget, your map, your inventory and your message window.
So I looked through WoW, LOTR and Vanguard and used that as a base for how the default status widget looks in Ember. I reused some simple graphical elements that jayr had created earlier and think it looks ok. The left element always shows the status of the avatar, while the right element shows the status of the entity that the avatar uses something on.
I'm using the Launchpad more and more. I've put up bugs and blueprints there. My hope with the blueprints it that it will make the development process more transparent and in the end allow for other developers to chip in. Ember is still a one man project and I could sure need some help with it.