Game Reviews 42 RPGs 55 Arcade 34 Puzzle 18 Platform 10 Strategy
Sections QB News Site Archives Game Guides Our Projects Entertainment Awards QB Links
Interact QB Chatroom Mailing List Submissions Link to Us Job Openings
(10/16/2002) Looking for a library for your next QB project? Richard Harris gives his case on why UGL could be right for you.
Ever since UGL was released on May 5, there has been a debate about what it stands for. On August 21, co-creator Blitz posted it's name on his website: Useless Game Library. After a couple of uses, you'll realize why it's actually the exact opposite.
UGL is totally different to previous QB libraries, which is probably why many coders are having problems with it. Created by skilled assembly coders v1ctor (who created qb->internet routines and the floating point number fix) and Blitz, this lib uses a totally new way of storing data. Instead of arrays, your sprites are now stored in DCs.
DCs are "surfaces" that hold data - and reside anywhere in memory. It doesn't matter if it involves EMS, video or conventional, 8, 16 or 32-bit colours. Whatever the size, the programmer only needs to see it as a DC. UGL handles memory and conversion automatically. What's more, EMS is pretty much just as fast as conventional memory to access.
To make it even easier for the coder, UGL can create arrays of DCs, or load up bmps (even compressed bmps) into them. DCs destroy the old array system of storing sprites in terms of speed, efficiency and ease of use.
The only problem is that because DCs are based on the system Windows uses to hold sprites, it is designed for low-level programming. So when you set up your DCs, you'll have to use handles to refer to them. It's not a big problem unless you're a QB newbie.
You can choose any resolution you like, any color depth. A full SVGA library, VESA-compatible. And with UGL's speed, you should be able to run 2D games in higher resolutions at high frame rates. There is one reason why you might not want to try high res; I'll address that later.
UGL has more great innovations, though. For example, the UAR (UGL archive) system is better than DQB's format, although you can't encrypt it. Any UGL function that takes a filename can take a file from a pack. You just specify it:
bmp = uglNewBMP(UGL.EMS, UGL.32BIT, "graphics\tiles.pak::snow/snow1.bmp")
You can also search, extract and add files to these archives, as easily as you would modify normal files. The pak format itself is the same as the one used in Quake, and PakExplorer is included with the UGL distribution.
UGL even has its own font formats, UBF and UVF (Vector and Bitmaps). I believe true vector fonts are a first in QB, and it works great. You can even convert TTF fonts to UVF. (UBF support is missing at the moment).
There are also Quad routines (quadrangles) - another first - and the fastest Tri routines around. If you're looking at 3D, UGL is the way to go. It supports flat, textured or gouraud-shaded triangles or quadrangles, as well as beziers and curves, with sub-pixel accuracy. Sub-texel might be on the works, too.
Great mouse, keyboard and timer routines round it off. You just need to set up a TYPE var holding the information, and make sure it's static. Keyboard routines are particularly simple - anytime you like, just poll the key object. UGL can even handle multiple keys.
I know this all sounds like an advertisement for UGL, but it's just so damn good that every QB coder must try it! (Free knife-set if you order within 28 days!) The only problems are compatibility, and that you must change your coding somewhat.
First, the coding. We've already addressed that - the DCs are a new system in QB, but they aren't hard to pick up. More grave is the compatibility, with severe problems on Voodoo (and ATI) chipsets. v1ctor and Blitz insist that UGL is Vesa-compliant, and it's 3Dfx's error. It's hard to pin-point who's to blame, but the fact is under a Voodoo card only 320x200x8, and possibly 640x*x16 is supported.
At the moment, this means creating your game to work with any res (which most people would do anyway). When UGL detects Voodoo or any other non-compatible card, it will select 300x200x8 13h. So people who can't use SVGA will play it under VGA mode.
I've got word that some ATI cards can now run it SVGA with the latest drivers...but Blitz himself is sceptical. "ugless is great for svga, people say" he said, "but sucks for mode 13h. SVGA doesn't even work on 70% of the cards with ugless."
"So it's worthless."
I disagree, UGL has potential. It's the fastest lib out there and the product of more than a year's efforts by v1ctor and Blitz. I highly recommend it, compatibility is rising and with all of UGL's functions, even in 13h it beats other libs.
Rico beta-tested UGL since it's inception. He recommends people with issues visit #dot!net-studios on EFnet. If v1ctor and Blitz are missing from #dot!net-studios, Rico suggests looking for gangly, shady men outside 3Dfx offices armed with sniper rifles.
Article Written by Richard Harris
V Planet! Archive