Dec 29 2008

An update on bitmap fonts

Tag: VectorStormtrevor @ 8:56 pm

Just a few quick notes;  I’ve fixed bitmap fonts to word wrap properly in VectorStorm, if a maximum width is passed into the CreateString() or CreateStringInDisplayList() functions.

Additionally, I’ve fixed the autogeneration of bitmap fonts from TrueType fonts such that they’re scaled to the largest glyph actually incorporated into the bitmap font, instead of according to the largest glyph in the TrueType font.  This means that if you draw a font with a size of 20, then the tallest glyph in the font (usually an exclamation point or a capital letter) will draw upward twenty units from the baseline.  Descenders (such as the bottom of a lower-case ‘g’ or ‘y’) are not counted.  So when drawing a string, be sure that you’ve positioned the string such that there’s space for any descenders to extend downward.  (This isn’t an issue for the vsBuiltInFont class, as its glyphs have no descenders)


Dec 28 2008

Bitmap fonts

Tag: VectorStormtrevor @ 10:57 pm

bitmapfonts

Well, I said my goal was to get bitmapped fonts in today (autogenerated from TrueType fonts), and I snuck it in right under the wire.  Note that while this is all checked into the public trunk of VectorStorm, the code is in a very early state, and the API is liable to change a bit over the coming weeks.. but it’s basically working.

The new vsFont class uses almost exactly the same API as the old vsBuiltInFont class, except that you don’t specify a separate “capSize” for capital letters, as you now have actual, real capital letters available!  Text justification works, you can set the size (irrespective of the size of the font texture), etc.  The only real feature which hasn’t been implemented yet for these new fonts is automatic word-wrap.  Shouldn’t be difficult to do;  just ran out of time in the day.

Also note that if you want to make your own font pages, that’s done by “vsFontMaker” (which is not built by default or included in the prefix file), and that class requires SDL_ttf.  If you’re just going to use data which already exists in VectorStorm font format, then SDL_ttf isn’t required.

Note that in the screenshot above I’m using the bitmapped fonts as though they were vector sources;  they’re drawing additive, exactly like regular VectorStorm graphics.  They’d just as easily draw opaque, though, if that was called for.

And for those international folks who’ve asked about Unicode support for VectorStorm in the past..  this code is about 80% Unicode compatible.  I only need to make a few very minor modifications to get full support.  (Primarily, just modifying the font generation code to actually include the required accented and etc. characters in the font texture map)


Dec 28 2008

Initial design thoughts

Tag: #6: Lord, Save Us,Game in a Weektrevor @ 11:36 am

Dr. HorribleSo after a day of consideration, I’m putting forward my current musings on a design for GiaW #6 (currently work-in-progress-titled “Lord”).

As a reminder, the theme quote this time is:  “Lord, save us from that horrible land!”, a lyric taken from the novel Dune.

First, some constraints that I need to keep in mind during this game.  As I’ve recently added 3D support to VectorStorm, it’d be really good to use them in this game.  However, there are a few issues:

  1. I have no 3D collision library in place, and I probably don’t have development time during the week to learn and integrate one.  If I go 3D, the game will need to have either simplistic or no collision requirements.
  2. I still have no bitmapped/truetype font rendering support.  This would probably take me about a day to implement, so could realistically be done if needed for this game (but I’d need to start on it soon — only six days in total remain, including today!)
  3. VectorStorm’s shader backend is very simplistic;  it currently is either “on” or “off”, and it always performs a full-screen bloom pass.  If I wanted to do something that was non-glowy-vector, I’d either need to turn off the bloom entirely, or devote some time to revamping it so that I can apply the bloom to a single layer, instead of to the whole rendered scene.

So with that in mind, let’s talk about game designs.

Meerkat pointed out in the last article that the quote theme is a dead ringer for the game Lemmings.  Which means that I don’t want to do it that way;  not interested in doing remakes, here!  :)

My most expansive idea was to cast the player as the deity of a poor farming village, consisting of about five families.  The parents till the earth, the kids do small chores around the house.. and they all pray to be freed of the tireless and difficult work for various reasons;  some so that they can go to school, some so that they can go shopping, some so they can go to the casino, etc.  Give the player some divine powers to help or hinder (or indeed, to smite), and then give the player no score at the end (“It is not for you to judge My wisdom.”)  I still really like this idea;  it’s kind of a less-Lovecraft variant of I Fell In Love With the Majesty of Colors, and everything I did here would be directly applicable to MMORPG Tycoon 2.0.  But I worry that there’s too much work to be done;  that I wouldn’t have time to complete it.

In a more bizarre bent, I tried speaking the theme phrase with the emphasis on the word “land”, and ended up with this little pitch:  The water level has fallen, and the poor fish are flopping about helpless on the exposed beach!  As Poseidon, lord of the seas, you must use your mighty trident (with seaweed cabling attached) to spear the floundering fish and drag them back to safety!

This game would be played from a side-on 2D view, and would be basically an Artillery-style game, except that a direct hit on a fish would leave you with a grappling cable connected to the fish, and would allow you to drag the fish back toward the water.  Everything here would be implemented using Box2D, including fish flopping about on the shore.  I really like the core concept here; the “Oh no, the fish are dying — quick, save them by spearing them with your trident!” thing.  But I’m not wild about the actual gameplay.

But I do like that I’d finally have made a game which used Box2D, after all the time I spent integrating it into my game engine.

The thing I keep coming back to when I consider the theme statement, though, is the word “that”.  “Lord, save us from that horrible land!”  Kind of implies that the person doing the pleading isn’t actually on the land that’s horrible, but is either afraid of the horrible land, or wants to avoid going to the horrible land.

Of course, when you put together “Lord” (in a religious sense) and “horrible land”, it’s difficult not to think of Hell.  But I don’t think I want to go there.

So as is often the case, after a day of brainstorming, I haven’t picked the final theme yet.  But I have a number of interesting directions to go.  My goal for today is to get bitmapped font rendering into VectorStorm, as I suspect I’ll be wanting that.  I’ll update tonight/tomorrow with progress.


Dec 26 2008

Even though the prospect sickens, brother here we go again

Tag: #6: Lord, Save Us,Game in a Weektrevor @ 9:40 pm

I have a confession to make.

I never liked Dune.

Now, I’m not talking about the father of the modern RTS genre, nor am I talking about the frequently-incomprehensible David Lynch film, nor even the John Harrison miniseries (although I never particularly liked any of those, either).  No, I’m talking about Frank Herbert’s Dune, the original novel.  I’m not going to go into the precise reasons why, here, but I thought it was important to mention that I’m not really a Dune fan, even if I will joyously misquote the “Fear is the mind-killer” mantra given even half a chance.

However, when it came time to select a topic for a new Game in a Week, Dune was the first book that leapt from my bookshelf, and it’s offered up a doozy of a quote.  Dune is Copyright 1965 by Frank Herbert, and my particular copy is a paperback edition, and was printed by Clays Ltd.  No printing date is specified on the book.

For those who haven’t seen me do this before, the topic selection process for Game in a Week games is simple;  I select a book at (more or less) random, open to a random page, and take the first complete sentence at the top of the left page.  I am then free to interpret the sentence (or portions thereof) in any way I wish, to construct the theme for the game.

In this case, the page was number 138.  And the first sentence on that page is:

Lord, save us from that horrible land!

(It’s actually a lyric taken from the middle of a song, apparently referring to the harsh desert of Arrakis.. although as mentioned above, I’m not really a fan of Dune, so I didn’t check very closely to make sure that my interpretation of the quote was correct)

As always, I’ll make a few initial thoughts about how this sentence can be applied to a game.. though I think there are some pretty obvious ones.  We could take the whole sentence as the topic;  the player is God, and is tasked with protecting his minions from some sort of dangerous terrain.

Alternately, we could do any sort of rescue game if we just took “Save us”, or any sort of God game by just taking “Lord”, or an evil deathtrap game by taking just “horrible land”.  But right now, I’m really taken with the idea of using the whole quote, and maybe even using it as the name of the game.  I’m not quite sure what’s so horrible about the land that we need to protect people from it, but.. I’m sure something will occur to me.

And it will give me a chance to continue working with the terrain rendering which I’ve been playing with for the past little while, so that ought to be a good thing too.

But that’s all the gameplay consideration that I’m allowing myself tonight.  Proper design work on Game in a Week number six starts tomorrow morning, and the playable game is due by the end of January 3rd.  I’ll be posting updates here, as events unfold.

Wish me luck!


Dec 15 2008

A mystery at Murder Manor

Tag: VectorStormtrevor @ 11:33 pm

There were seven guests at the dinner party tonight.

Sam runs a business with his friend Billy.  He was hosting dinner for a few of his employees;  Tom, Daisy, and Mr. Green.  Also in attendance is Sally (a secretary who works for both Sam and Billy), and Sally has brought along her father as well.

There are some tensions among the employees;  they don’t really get along very well (presumably, they’ve been competing for promotions), and Sally’s not very happy with Sam, due to some workplace indiscretions.

By the end of the evening, Sam is dead.

So I took a little break from 3D maths tonight to work on the motive generation algorithm for a follow-up to Nicholas Spratt;  it generates characters and relationships between them, along with motives for murder.  And it surprised me just how well it’s working (the above is the very first plot+characters+situation generated by the system).  Where the original Nicholas Spratt game was a gameplay concept to see whether a murder could be unravelled solely based upon the memories of the suspects (with one suspect lying), adding motives will provide extra clues, and give individual guests secrets for the player to discover over the course of each game.

Also today, I fought my way through Gnomeregan with a few friends.  I find that for me, WoW is kind of a more social version of Bejeweled;  Non-stressful and not particularly challenging.  But it’s a good excuse to spend time with your friends at the end of a long day.


Next Page »