Wednesday, April 20, 2011

My First Steps In Utilizing Glimmr

Work on the "interactive dreaming" game has begun. Rather than jump head-first into everything thing all at once, I've been trying to outline the story as much as possible a solid system for the user interface. A few lines of Inform7  code have been written in a small project to test manipulating the graphics.

With proper planning, I should get an interesting alpha version with a few rooms done by around the end of May or early June. The story of this game will branch in many directions depending on the actions of the player, and I would like to avoid "good ending or bad ending" conclusions. One reason for this is replay value. Replaying a lot of the story just to get to one or two forks in the plot for a good or bad ending isn't something that I think would make someone want to play the game again in most cases. Again, proper planning will be the only way to ensure this goes smoothly.

That said, on to my first attempts at putting simple graphics into an Interactive Fiction. I'm currently using the Glimmr Drawing Commands, Simple Graphics Window, and Bitmap Font by Erik Temple extensions to get this done. In addition to the bars shown in this crude prototype of the user interface, I would like to also add graphics displaying of a visual of some destinations or scenes, a compass rose, and perhaps some other bells and whistles.

Here is the first "test room". Note the empty blue bars on the right:

Now, the player types in the command "look at fish". In this test, doing this action raises the "lucidity level" to 50%, and filling the box with red color:

Once I had the extensions installed, I looked at the source code of Glimmr Drawing Commands for the "retro" example to help me get started. I was pleasantly surprised with the ease of drawing and positioning simple graphics. The next day, I had written a line of story code to redraw the boxes and words and draw an additional rectangle into one of the bars by using "every turn" rules. 

While in Inform7, the redrawing phase goes fairly slowly (especially in the Gnome version). However, when loading the exported gblorb file in the Gargoyle interpreter to actually play it, the graphics are redrawn instantly. Hopefully, I won't run into performance issues or bugs when coding the rest of the "every turn" rules to manipulate all positions of the 2 status bars. 

I know it isn't very pretty, but it's a start. Making things more fancy will come much later after getting more of the basic mechanics and framework finished and tested.

More to come...