The Dragon King
Blades, Bookkeeping and Lists 
Friday, February 15, 2008, 08:24 PM - Dragon King
Just before the 360 was released with it's blade menu I had a working beta of dk with the exact same idea. Way to steal my thunder m$!!! :-P Anyway, my blade, like their's pops up regardless of where you are in dk with the press of a button. The blade allows you to navigate to any of the lists in dk, with a image preview shown to the right incase you've forgotten the title of the list. It looks something like this:

As of now, when you enter the menu the skin is swapped out, which causes a noticable delay. I've decided to instead incorporate this into the current skin, which will allow for instant display and deployment. It's not the most original idea in the world, but it's something that a lot of fe's are severely lacking.. namely a quick way out of where you currently are.

While we are on the subject, let's talk about how dk's list structure has evolved since the last public beta. Check out this screen shot:

Hmm, I don't remember a mame game named "played games"... We'll it's actually an example of two new list features. First off, dk now allows shortcuts to other lists to be added to any gamelist. This means you can do all sorts of crazy stuff with directory structures now, like replicating the before-mentioned menu blade with a "master list," making shortcuts to toggle clones on and off, having a catlist-based hierarchy of sub-linking setup so you can filter as you navigate or whatever you can think of! Maybe I should show you the inner-workings (which thanks to a utility I'm working on you'll hopefully never have to deal with). Here's the vd entry for the above gamelist:

searchstrings:-1=1=&&&& Played Games;5=MAME;0=pacman
filters:6=*mature*;9=*Working No*;6=BIOS;9=*Status Prelimenary*

Longtime dk users will find most of this familiar, but there are some important new additions. The logo entry is nothing new, it determines which logo the logo element in a skin will display (actually the logo element can now display other stuff as well, but that's a discussion for another time). Caption, again is nothing new and also quite obvious, it'll be what the list is called in the menu blade and the path caption of the skin. Dynamic... now here's where it gets fun. Before all lists were made at once and they didn't change. Due to the new bookkeeping options (I'll explain those in a sec) this is no longer acceptable. Turning on the dynamic switch has dk filter together a list on-the-fly as you navigate to it. The speed is actually quite decent. While a huge list like every single mame game will cause a slightly noticable delay, most of your special-case lists are going to load instantly. Also, dynamic lists won't be created when you re-generate the master gamelist, which will speed up that process. Hidden is also new and was added as a companion for all of the new list-linking you can do. It became obvious during testing that the traditional list changing method (next and prev list keys) wouldn't cut it if you had several lists caused by a catlist hierarchy or what have you. The solution was to "hide" all of these extra sub-lists from the list collection. When you make a list hidden, it won't show up in the menu-blade and you won't be able to navigate to it unless you use a shortcut link. So for a hierarchy of all mame's cats, you'd make the primary list normal ("Mame") and all the sub-lists (Driving, Platformers, ect..) hidden. In the primary list, you'd link to all the sub-lists. Of course that's all optional, you can make them normal lists if you want. It's all part of the new, more flexible, list system.

Of course clones is pretty obvious and nothing new as are the last two. But check out this entry:

-1=1=&&&& Played Games

This is how we link to other lists. The "-1" tells dk we are searching for a list, in this case the list is list #1 and we want to call the shortcut "Played Games" (The &&&& is just a magic tag to ensure the entry gets added to the top of the list). We could do this other ways as well, like link to the List's caption, the "next list" or what have you. I'll go into more detail as the syntax is finalized and I get the list-builder up and running, but it's really quite useful.

Now for the second part. How exactly does dk make a list of played games? Via the new bookkeeping features of course! Dk now monitors your play habits, recording which games you play, how often you played them, how many times.. ect all to a nifty ini file which the list system can use, in conjunction with special tags, to make lists.

Here is the vd entry for the Played Games list:


Notice that the search sting this time is "-2=mrp." The "-2" tells dk it needs to search the bookkeeping and "mrp" is a magic tag for the 25 most recently played games. There are other magic tags in bookeeping like the longest played, if it's been played at all, ect... And of course these magically created lists can be filtered off just like any normal list. This takes building a "favorites" list to a whole new level as, with a bit of adjustment you can let dk automatically determine which games you like the most and automatically fill a list with them!

The new list features are really the crowning feature of the release as I've always said that a goodbackbone is far more important than any graphical features. (I've still got a few of those to show, don't worry)

Anyway, raster fonts are pretty much working atm, so I'm now moving on to tweaking the above features for optimum speed. As always, I'll keep you posted.

Stuck in the Middle.... 
Friday, February 15, 2008, 04:58 AM - Dragon King
Well the cleanup of my raster font code is coming along nicely. When I first added it to dk ages ago, all raster fonts had a ttf dependant that was used to determine postion and scale. At the time I didn't expect fonts to get very fancy and I figured this would save me a lot of calculations on centering, multi-lined text and other misc issues. Of course, as I experimented with video game fonts the limitations of this dependancy became apparent. The biggest issue was centering. I used the good old ".textwidth" function in vb to determine the width, seeing as how I had to manually determine the starting point of a centered line of text. Well when the ttf font was wildly different from the raster font, this width would differ, and what you'd get was "funky" centering.

I've rolled out my own ".textwidth" function that works with the raster dimensions and a arbituary pixel height. This seemed to do the trick as you can see by the text below:

The only thing that the raster functions use the ttf fonts for at this point is the height (the height I send to the rastertextwidth function is determined via .textheight). I may actually keep it that way. Right now you determine the textheight in dk via the fontsize, which makes sense as 90% of your skins are gonna use plain old tt fonts. It seems silly and confusing to me to have a seperate, pixel-based text height setting and I don't see as how the height would be any different between one font and another or at least not to a degree that it'd effect character placement. I'm welcome to feedback on that one though.

Raster Fonts! 
Wednesday, February 13, 2008, 08:25 PM - Dragon King
Finally out of the pure hell that is the skinner, I've decided to focus work on some of dk's more interesting features. One of the things I'm really excited about because it adds a new element to skins is raster fonts. What are raster fonts? Well another name for them is bitmap fonts because that's what they are, fonts in bitmap format instead of ttf. This is good for us because video games use raster fonts exclusively and we can rip them and put them in our skins for a more authentic look.

Sometimes it's better to just show you, so here are som random video game fonts applied to a very basic skin:

How do you add raster fonts? Well fortunately sprite rippers have done most of the work for us. There are various bitmap font "standards" flaoting around the net and dk comes packed with a utility that can convert most of them to a format that dk can use "automagically". This utility can also make raster fonts out of a true-type font that you can in turn edit in photoshop for a dramatic effect. On top of this, I also plan on having the converter support the most famous raster font type, namely the SDL font, which is what mame uses! I'll post a tutorial on how to do all of this (quickly without having to edit each character manually) at a later date.

Ragardless, for now I'm cleaning up the raster font code and I'll keep you posted.

1 comment ( 27 views )   |  related link

Time for a quick update...... 
Saturday, February 9, 2008, 01:00 AM - Dragon King
Ok the internal skinner is just about done at this point. I need to add in two more random settings, implement some way to edit custom lists (which involves thinking about how to add the interface more than anything else) and clean up the menus in general. On thing that still needs implemented for two or three settings is the ability to type text for captions and such. The idea is that I'll use the "high score" navigation that dk currently uses to search for games in that up and down cycles through the letters and left and right changes postion, like when you enter a high score on a video game. I could also add a directy keyboard method I think, but I dunno if anyone would find it useful. I'd appreciate some feedback on that one.... do you guys think using a keyboard to edit settings is a viable option?


I'd say I'm on track for getting it done by the end of the weekend like I said in the last entry! This means I can get to fixing some of the more interesting features, which means you get a preview of some of the more interesting features!
1 comment ( 11 views )   |  related link

UGH! (Part 3) 
Wednesday, February 6, 2008, 10:15 PM - Dragon King
Yup, still working on the skinner. Yup, it still sucks. I had some serious issues getting some of the list options to work, but those seem to be fixed, so I can add the remaining options and finally put that behind me. I'm not getting in any hurry on this part though (as it is extremely boring) so don't expect me to post something new until next week. The skinner anoyances have put me about a week or so behind, so the release might end up being slighty after the end of this month, but not by much. In the mean time, stay tuned for more updates as they arrive.
2 comments ( 8 views )   |  related link