QB Express

Issue #10  ~  May 26, 2005

"A magazine by the QB community, for the QB community!"

In This Issue



From The Editor's Desk

Written by Pete

Twenty-four hours ago, QB Express #10 looked like it was going to be a standard issue -- the regular tutorials, articles, project announcements and editorials. It was business as usual.

But then yesterday evening everything changed. The Qmunity was dealt a terrific blow when QBasic News, its central message forums, were unexpectedly shut down. Thousands of messages -- volumes upon volumes of valuable QB history, tutorials, questions and news posts -- were instantly destroyed. And over 1600 QB/FB programmers were left without a home.

But instead of taking this as a deathblow, the QBasic News debacle just motivated QBers to save their community. After the dust settled, the Qmunity sprung into action. The QB/FB scene has been at its busiest and most productive in months -- just trying to restore what was lost when Wildcard, the QBasic News administrator, snapped.

In the last day, the entire face of the QB community has changed. New splinter communities made up of QBasic News refugees are forming all over the web. Meanwhile, people are trying to sort out what exactly happened -- and why. In this issue, I'll do my best to explain the situation surrounding the QBasic News shutdown, and let you know about the huge upsurge in new QB forums and site updates as a result of this unfortunate event.

Meanwhile, we still have the regular goods, including NINE tutorials and SEVEN articles / editorials, in addition to the regular columns and QB / FB news. I'm not going to summarize everything for you since that would just be repetitive -- but I'm sure you're gonna love it. Even if the rest of the Qmunity is in chaos right now, you don't have to worry about QB Express. We're not going anywhere.

Submit To QB Express

You all know the drill. This magazine can't exist without people SUBMITTING articles, editorials, tutorials, reviews, news and feedback. This is not just a solo effort by me... it's a group effort by people throughout the QB community. If you have anything to submit, or have time to write something, DO IT!

If you want to write about something, but can't think of a topic, or need inspiration, email me! I'm good at thinking of stuff to write about, and I know quite a bit about the QB community and about QB programming. If you're interested in getting your own monthly column or just want to write an article or two, by all means, do it! Anything that is submitted will be included!

I also want feedback and letters to the editor regarding this magazine. I want suggestions and critiques. What do you like? What don't you like? What could be done better? Let me know!

All submissions and feedback can be sent to pberg1@gmail.com. You can also PM me on the Pete's QB Site or QBasic News message forums. If QB Express is going to continue to be so good, YOU need to contribute!

-Pete



Letters

Letter From MystikShadows

Hi Pete,

Well, a wise man once said, he who reads QB Express #9 shall find find himself enlightened and enriched. Hmmm I think that it was me who said that to the wise man...;-). Every time I know QB Express is to release a new issue, I jump into what I like to affectionately call, my "Johny 5 is alive" mode. I need, want and crave input, information, you name it. lol. And so far, QB Express has always answered that call of the binary wilderness successfully, taming down the beast within me that needs to read, learn, acquire new knowledge, solve problems and the likes. After reading #9, I'm calmer now, I've finally managed to sleep some, cut down on half the caffeine intake I've been having anticipating the arrival of #9. QB Express' #1 fan you say, YES INDEED ;-) and I hold that title with great pride (and selfish joy might I add). But realistically, I don't print all my articles so I have to humbly accept position #2 and give position #1 to Lurah ;-). As the saying goes "Anticipate denotes intelligence" Quoted from "The 5th Element", if that's so, then for about a week's time around each release of QB Express, I'm as brilliant as I can get ;-). lol

As far as the Number one contributor, well I've been pondering that ;-). Sure I can submit alot of stuff, there's still plenty I haven't written yet, and will be writing. But due to the nature of the tutorials I present, and in relations to QB Express' orientation (although that is changing too, more on that later in this letter ;-). I'm not sure all that I submit qualifies as true QB Express material. What I've seen in QB Express is that it is a game oriented magazine. the Qmunity is indeed one of game development. I haven't seen many accounting systems, databases management systems, word processors applications and other "business related or commercial software related" stuff in QB Express or anywhere else in Qmunity.. However, I do think that what I submit is good stuff as far as it's quality goes. But as far subject matter, for the game developers out there in the Qmunity some might wonder what my submissions are doing there as in how do they related to their projects. My programming background isn't from the gaming world (although I do have a game in the making ;-) it is my first attempt at a game. My background is more in the business application and commercial application development level. From that background comes some knowledge that I feel is important to share to those game programmers that might want to add a bit to their game. Sure some of what I cover may seem out of bound to the Qmunity...As I told you before, I like to cover the boring part of programming. Why? because to any programmer, game or otherwise, I think they can benefit from the submissions I have made and if I can make the boring side at least a bit less boring by the way I teach it, then I call that a successful submission. I believe I'm the only one that covers that side, it's a dirty job, but somebody's gotta do it. I can't make a 3D space ship do it's thing, but I can make sure it does it well, all the time ;-). It's that side that I offer to Qmunity the behind the scene side. Whether the game is to be of personal, Qmunity or even commercial value, I think that what I mention in my tutors and articles are worth reading just to help the developers at least think about a few things just to help their games get the edge.

I totally agree with Lachie Dazdarian, the articles he liked were as fascinating and brilliant as he puts it. One thing about Lurah that I can say is that maybe english isn't is native tongue, but his convictions and ideals are very strong and well founded that makes him more than credible for any discussion/debates about what he likes to talk about :-) and with his game, Tales form Argania in the making he'll be proving that everything that he believes in, is indeed, true. :-) (no pressure there Lurah right? lol). Lurah is a very realistic and down to earth kinda person, he'll tell things how they are, even bluntly if he has to, to get his point across some might find that his point is usually right too. I could also relate, in a non game fashion, to "What QB means to me". although I started coding long before QB, heck long before any basic lol. the situations he mentions were still there back then. Very insightful and nostalgic in some way, at least to me ;-).

I have at least 3 other submission ideas, 1 of which will probably be a series, once again...so I'm far from done writing articles and such...as I told you before, these require coding before I go ahead and write about them...so since I have submissions a plenty for the upcoming issues, I got in coding mode, get these things done so I can write about them ASAP :-). So don;t worry Qmunity, there's plenty of boring stuff to talk about ;-). But I think that you'll agree that in programming, just like in math, two negatives really do make a positive ;-). Remember what I told you about the Qmunity growing and focusing and such, projects emerging and the likes in my last letter? Well I think the reviews and projects you talk about in #9 is already a good proof of that. Games are awesome, and there's till people coding tools for game makers, basically, it's always great to see all this happening. Makes me wish I was in the QB community from day one so I wouldn't have missed a single moment of it. I mean don't get me wrong, I was in the community as in I was a QB coder in it's very start and all, but I was never online, didn't know there were groups forming and all since about 10 or 11 months ago...so I missed alot :-). But I'm glad to be here now :-).

I'd like to commend Rattrapmax6, his horse humor was much better this time around. Oh and you should see is 400x400 scolling text map editor he's working on, there's something for QB Express #10 for sure you can read about it here: http://textworld.adaworld.com/forum/viewtopic.php?t=51&start=0 and awesome piece of work if I do say so myself. Umm errr, I just did didn't I? ;-).

Thank you so much for announcing our competition on http://www.ascii-world.com in QB Express. I don't know about the others, but I'm sure, in advance, that any success this competition has will be greatly thanks to you and QB Express and whatever forum we'll announce it on ;-). I for one hope that it will be a great success.

Congratulations again Pete for continuously outdoing yourself in the way things are organized and presented in every issue, like Lachie said your positive approach to the Magazine, the Qmunity and the humor make QB Express the success it is. oh and the contributors of course have 50% of the honors :-).

And now that I've made this letter as big as my average article, I'll stop ;-)...

Signed, the number one errr two Fan ;-).

MystikShadows
Stephane Richard
http://www.ascii-world.com

Thanks again for all the kind words, man! I agree with you that the Qmunity is mostly a game programming community -- but there are many people interested in non-gaming types of programming as well. GUIs, for example, or graphics demos. Just look at this issue -- we have a GUI tutorial and Adigun's running a FB graphics demo competition. Plus, business / professional program development is a very important skill to have if you ever want to get a legit programming job. I'm glad to run those tutorials!

There are no ifs, ands or butts about it, you're still the most dedicated and productive writer that QB Express has. Every month you submit three to four tutorials, a letter to the editor, some announcements, etc. Truly remarkable. Without people like you, I couldn't pull this magazine off.

-Pete

Letter From Jacob Palm

Hi Pete Berg!

First of all, I'd like to say that I read every single article in every single issue of QB Express. It's simply the best QB zine ever, no doubt!

Well, I'm kind of a GUI-guy, so I was wondering if the magazine could have some GUI related stuff? I'd be more than happy to contribute with some reviews, tutorials etc.

Keep up the good work with QB Express and Pete's QB site!

Jacob Palm

JacobPalm.dk

QB Express has had quite a bit of GUI stuff in the past, if I do say so myself: a two-part series on QB GUI programming by VonGodric (Issue #3 & #5) - on buttons and textboxes, and a two-part FB GUI series by Nekrophidius that ran in Issue #6 & #7. But obviously, that's not meeting the demand. :)

Therefore, I encourage anyone with knowledge in GUI programming that's interested in writing to buckle down and write an article or tutorial for QB Express. Clearly there's a captive audience! If you want to write but don't have a topic, GUIs are a great place to start.

Anyway -- shortly after he sent this letter in, Jacob sent me an article on QBasic GUI Development. So it looks like he's taking up his own suggestion.

-Pete

Letter From aetherFox

Hey Pete,

Excellent work on QB Express #9. As usual, it was a good read on the most part, and I wanted to commend you for the excellent job you did (and have been doing, and will do) in keeping the magazine in what generally is excellent shape.

My biggest problem is that it doesn't render properly in Firefox, which is a shame because I think a lot of people in the community use that browser. I am sure it is a simple fix, running the CSS through the W3C compliance check should tell you what is wrong.

It's nice to see that some people appreciate what na_th and I have done, and it's awesome to see that the game was well recieved by some people. While Joseph's review was information-wise terribly flawed, both na_th_an and I recieve criticism well; however it is a little pointless to review a text adventure game when you clearly don't seem to enjoy them. Nevertheless, Los Monos del Obús is cooking something pretty interesting for out next release. I'll be writing you an article this next issue hopefully, I have exams coming up and time is kind of sparse, but I'll do what I can.

Keep up the excellent work,
Avinash Vora a.k.a. aetherFox
http://avinash.apeshell.net

I know all about the FireFox errors. The CSS is valid, but FireFox has a bug (something to do with its Gecko engine) that causes it to put big gray boxes everywhere. (That's probably what you're talking about.) I've been searching for a long time to find a better solution to this problem, but I've yet to come across one that works better than the current solution. So if there are any CSS geniuses out there that know of a better way to make textboxes that are both Pre-formatted and have text wrapping -- let me know!

About Joe's review -- I know that it was intentionally biased, since he wrote it right after you two had your flame war at QBNews. He later admitted that his review was intentionally close-minded and harsh -- and then he claimed it was a joke. (I say "claimed" since nobody really found it all that funny...) There was a huge discussion about this in the QBasic News thread that I would reprint some quotes from, but since Wildcard shut down QBN it is now no longer available. So I say we just let the issue rest.

Thanks for the letter -- and I'm glad you and Na_th_an handled Joe's negative review so well.

-Pete

Letter From nitro2k01

Why the heck do you have that pikachu guy as a favicon?

/nitro2k01

That icon isn't Pikachu...but it sure looks like him. :)

It's actually an "Electric Rat" from DarkDread's The Secret of Cooey 2. When I redesigned my site, I decorated it with sprites from popular QB games that had been reviewed on my site in the past. Since DarkDread's Electric Rat was the perfect size (16x16 pixels, I believe), and I liked the picture, I made it my favicon.

Look here: Secret of Cooey 2 Review

-Pete

Letter From anarky

Where are they now?

Last month's WATN article promised an interview with Eric Cowles, better known as 1000101. I have unfortunately not been able to interview Eric before the deadline. After posting on the forums, and emailing a nunber of people, I received two interested parties. DarkDread and Gianfranco of QBGames. DarkDread isn't online at the time of writing the article, and I have not been able to get him at a point where he is not too busy. Gainfranco emailed me recently, but since I have only just received the letter, I have insufficient time to compose the article. Therefore, in issue 11 of QBExpress, expect another interview by either one of the three people above. Apologies for the inconvenience.

>anarky

Hey man, no problem at all. You don't even need to apologize. If you can't meet the deadline, your article can just wait for next month. Or even better - you could do two interviews for the next issue to make up for it. :)

-Pete


Have a letter for the editor? Send all your rants, raves, ideas, comments and questions to pberg1@gmail.com.


Express Poll

Every issue, QB Express holds a poll to see what QBers are thinking. The poll is located on the front page of Pete's QBasic Site, so that's where you go to vote. Make sure your voice is heard!

What is the most overrated QB game?

GenreVotesPercentGraph
Bob Saget Killer 2000
M \ K Productions
714.9%
Dark Ages I
Michael Hoopman
24.3%
The Game
Tsugumo
36.4%
FoX
Terminator_Z
36.4%
Elysian Fields
Pantera55
48.5%
Lianne in...the Dark Crown
DarkDread
24.3%
Legend of Lith II
DarkDread
12.1%
Hack-Man 3
WisdomDude
510.6%
Mini RPG 2 / 3
Jaws-V-Soft
1021.3%
Dark Woods 2
Jocke The Beast
1021.3%
47 Total Votes

A lot of people hold very high opinions of various QB games that -- when you look back on it -- aren't really all they're chocked up to be. In Issue #2, I wrote an article about Tsugumo's much-lauded RPG, TheGame...which amounts to little more than an RPG engine demo. Yet when it came out, the Qmunity considered it the best thing since sliced bread. All of the games nominated on this page are considered by some to be highly overrated. I decided to nominate the ten games the most people think are overblown and take a vote. As you can see from the results, people are pretty split on this issue.

The results are a bit surprising. I thought that Bob Saget Killer 2000 would easily take the top prize, considering how highly it was rated back in the day, considering how stupid and senseless this game really is. Sure Bob Saget sucks, but you can only kill him so many times. Vance Velez even wrote an editorial at V Planet! about how BSK2000 isn't even really a game.

Instead, the top vote getters were the MiniRPG series by Jaws-V-Soft and Dark Woods 2 by Jocke The Beast -- which are, as far as I'm concerned, excellent games. They certainly are popular among the Qmunity, but I think that their popularity is warranted. MiniRPG 2 and 3 are just oozing with style -- the animation and sprites just have so much character to them. And Dark Woods 2 is one of the most addictive QB games ever released, with a huge fan following that made custom maps and even a graphical remake. I can certainly see how someone who didn't enjoy these games could see them as overrated... but compared to TheGame or BSK2000, these games are masterpieces.



News Briefs

News from all around the QB community, about the latest games, site updates, program releases and more!

Site News

The QBasic News Debacle

QBasic News was shut down yesterday for absolutely no good reason, and it REALLY pisses me off. That forum was the best collection of QBasic help, tutorials, questions, answers, news, debate, information and just good ol' conversation in the history of the QBasic scene. It is an irreplacable resource and historical document, and if it is not restored, the community made up of 1650 users -- and almost 100,000 messages will be lost forever. And according to Wildcard, it's NOT coming back. Nobody really knows exactly what happened except for Wildcard. For now, I'm not even gonna try to explain it. I guess he just snapped.

NOTE: I had a much longer news report planned for this, but I've run out of time and have to leave a on an extended 4-day trip. When I return I plan on doing a special update to QB Express #10 to give you the full story (or as much of it as I can find). Until then, I leave you with this news report, courtesy of the ASCII-WORLD guys:

UPDATE (5/31): Well, now that I'm back from my trip it looks like the whole QBasic News thing has blown over. Wildcard restored the site in full over the weekend and then announced his retirement from QBasic News. Although the site is restored, however, the damage has already been done. The once thriving community has been diffused over a half dozen new or recovering QB/FB forums, and QBasic News is now missing the majority of its active and respected senior members. The new owner of the website is Sumo Jo, the guy behind Quickhost and Freebasic.tk. Hopefully he will be able to restore QBasic News to its former glory, but I don't see it happening anytime soon. So much can change in just a matter of days.

QBasicNews, What the ... ?

A Newsbrief by MystikShadows and Lurah

Where to begin, not sure, but the most established online forum to our beloved QB Community, QBasicNews has come to a harsh, unpredictable, definitaly avoidable end, in my most humble opinion. From what i've seen, it would seem many posts aimed at helping were misread or simply disregarded, some jumped to conclusions they shouldn't have, hell almost broke loose, next thing you know a post about "QbasicNews is shutting down" surfaces.

How did it all happen? on the surface and from what users can read, it seems that what started out as a thread about a competition, ended as a public debate about what's doing (or not doing) what to help make QBasicNews a better place. After a few exchance of ideas/criticism/suggestions/comments WildCard seemed to have decided to close the boards. In my opinion this decision was absolutely uncalled for and was the result of either the powers that be are unable to accept criticism of any kind (thinking they are above it or something, yeah right). or the admin, WildCard, was looking for a way out of QBasicNews and decided that that thread that started a debate was going to be his way out. in both cases, it just doesn't make sense and showed the immaturity of the board administrator(s).

All I know is that the comments that were made, most of them were to help and give tricks and tips about what could be done, not just by my but by others, in their own special way ;-). But it seems the admins and mods had a very different concept of what a moderator and administrator should do or have to do. All this lead to what we can read now on QBasicNews.

From the quick time it took to come to the decision to close this board, all I can think is those two reasons I mentionned. No other reason would cause such a quick reaction of this nature.

MystikShadows and Lurah

http://www.ascii-world.com

QB Forum Wrap-Up

There have been about a trillion new QB forums started within the last 24 hours, and there's no way in hell I'm going to create separate news items for all of them. :) But they are worth mentioning, especially if you're looking for a new home in the wake of QBasic News's shutdown yesterday. So here you go:

  • The Basic Network (http://www.basicnetwork.net)

    Nekrophidius and Rhiannon resurrected The Basic Network within minutes of when Wildcard shut down QBasic News, and this forum has quickly become the most active QB/FB forum on the 'net. There are already over 500 posts and 34 NEW members who have registered in the last 24 hours. This is the closest thing to the old QB News forums that's going right now.

  • Bad-Logic (http://ratatoskr.dragonhill.cc/forum/)

    Marzec started this forum a while ago, but until yesterday it was just a back-up version of the old Bad-Logic.com forum that was popular last year until the website went down. Therefore, it is starting out with a rich archive of past posts and started with 42 users. Now it has 43 though, heheh. :) It's been fairly active in the past day.

  • QBasic Network (http://www.qbasicnetwork.com/)

    Anarky actually started this website a few weeks ago, but it's been little more than a forum since then. (It also has a bit of Legend of Aquarius info -- about an RPG in the works). But otherwise it's a new QB forum that has has a tiny bit of activity and an annoying default skin (Blue Steel). Hopefully this site will expand become more active soon.

  • FreeBasic.net Forums (http://www.freebasic.net/forum/)

    V1ctor, oh great one, god among men, the holiest of holy and creator of FreeBasic started this forum in response to the QB News FreeBasic forums shutting down. I guess you could say it's the spiritual successor of the QBN FB forums...but it's not nearly as active yet.

  • FBTK.net (http://www.fbtk.net/)

    Okay, so FBTK.net really isn't new (it's just FreeBasic.tk with a new address and a new server) -- but it did move yesterday, the same day as all hell broke loose. So update your freakin links!

  • FBForum (http://www.fbforum.tk/)

    VonGodric made this PHPBB forum in the exact same style as the old QBasic News forums -- it has the Smart Dark skin and the exact same forum headings. As of right now, though, it has very few members and is not really been active (maybe because it just started less than an hour ago, heheh).

I suggest that everyone congregate at a single QB forum and try to repopulate the old QB News crowd elsewhere, rather than spreading ourselves thin on lots of different forums. For now, The Basic Network is the most active one, so I'm going to throw my support behind them as the new QBN home.

Lachie Dazdarian begins QBasic games archive
Lachie Dazdarian, a HUGE QB gaming fan, began an enormous effort recently to collect all the good (or decent) QB games ever made into one gigantic searchable archive -- and he's made a lot of progress so far. A few weeks ago, he posted a preview version of the future site on the QBasic News forums and it was exciting and inspiring to see all of those great QB games collected together, rated and described. Somewhere on the web you can still access this preview version, but I don't know where to find it now that the QBasic News forums have shut down. The original post used to be at: this address. Maybe in the next issue I can give you more info.
QB45.com and V Planet! coming back within a week!
I have read in numerous places that the people in charge of QB45.com and V Planet! will be returning within the next few days. Fling-master and Jofers have posted about this at the QB45.com board, and Joe King (who is helming the V Planet! return) has also said that VP will come back by the end of the month. Now I know that these announcements have been made many times in the past and not come true, but once again I'll hold on to hope that it will actually happen this time. And if it does: HOORAY!!
FreeBasic Wiki Started!
V1ctor has started a FB Wiki, which is already become a great information source. I encourage everyone to contribute! http://www.freebasic.net/wiki/wikka.php?wakka=FBWiki

Project News

Dark Prevail unleashes an ArKade game
Dark Prevail recently released an arcade shooter game with old school wireframe graphics and a frenetic pace. It's also got a very simple name: ArKade. It's worth a download just to see the menu screen (it's actually really cool). The game's not bad either. :) Download it here (987KB).
Space Impakto makes an impact

Relsoft released a demo of an awesome space shooter on May 9th that apparently goes by the name Space Impakto. Like all of Rel's releases, this is very graphically impressive. Colorful, detailed enemy and gunfire sprites dart around the screen (complete with Mode7 2D effects) on top of nice backgrounds -- and even though it's at just 320*240 resolution, it still really impresses.

At this stage in development, it's really still just an engine demo -- and there's no real way to win (you just play until you run out of health). Rel posted this early release in order to get feedback and FPS reports from the Qmunity -- not that it's really necessary. The latest version runs at a full 60fps on a Pentium 233. That's pretty darn good. Download it here.

Mazerun by loking1235
Loking1235 released a cool FB minigame a few weeks ago where you guide your mouse cursor through mazes. It's called Mazerun. Here's his description: "Mazerun Can you make it through the maze? Use your mouse to move the little green ball to the red goal. Do not touch the walls or you will have to start over again. " Simple but addictive. You can get it at this website.
Z!re Gets Bored
If you're looking for a simple game, Z!re's BORED v1 is as simple as they come. Basically, don't let your mouse cursor hit the wall -- that's all there is to it. This game is a fun distraction for a few minutes... you can find out more at this address.
GFXLib Gets Alpha Capabilities
Angelo Mottola's FB graphics library that allows you to use the old QB graphics commands (and much, much more) got another new feature on May 13th -- Alpha channels in your PUT sprites. For more info, check out lillo's thread: here.
FBIde v0.4 Released!
VonGodric's much-heralded FreeBasic IDE had a new version released on May 18th -- you can read his news posts here and here, among other places. Version 0.4 features tabbed coding windows, quick run, code highlighting and a whole lot more. If you'd like to see a screenshot, there's one HERE. :) But you should really visit FBIde.sourceforge.net for the full scoop and to get a copy of this supremely useful FB coding tool.
FreeTile Library for FreeBasic

Xerol announced his plans to open up a FreeTile Library for FreeBasic where users will be able to share sprites for use in game projects through a database-driven website. I think it's a great idea. Here's some more info from Xerol:

Ok, while slaving over a 32x32 badly made grass tile in Paint last night, I really wanted to find a place where there'd be a bunch of tiles just ready to use.

The concept is that all these tiles would be free to use, in any project, commercial or not, as long as they were used with a FreeBasic game. (Or non-game program that for some reason uses sprites.) I'll provide the hosting myself unless the size gets out of hand.

Check out this thread to get involved.

MariuZ announces an RPG ... a Pure QB RPG!
There aren't too many of these getting announced anymore and they used to be a dime a dozen...pure QB RPGs. But they're not a completely extinct species. MariuZ just announced one at Jocke The Beast's board. The game will be written in pure QB except for sound, will have "selfmade music" and "hopefully about 5 hours of gameplay". You can see a screenshot here. I wish MariuZ luck!
Zero Divide releases new QB GUI

Zero_Divide released CycloNe v1.5 recently, a GUI library for QB 4.5. It has a nice Windows 95 look to it and is one of the better QB GUIs I've seen. You can find out about it at Zero_Divide's Site. Here's a list of features:

  • Work with high resolutions from 320?200 to 1280?1024 in 256 color palette
  • Loading of BMP pictures in deph 8 bit
  • Support XMS Memory
  • Whole Support of mouse
  • All elements have its own features and can be changed as well
  • Built using SVGAQB v2.6

Other News

Dark Ages II: Engel gets new demo release (!)

As many of you may recall, back in 1998, Michael Hoopman's Dark Ages I: The Continents was the talk of the town. It was one of the first finished QB RPGs, and it got a lot of recognition (it was even included on the pack-in CD of a mass market PC gaming magazine - PC Gamer or PC World or one of those mags). So when Hoopman started making a sequel to Dark Ages, it was big news. QBasic: The Magazine (the reigning QB zine of the time) spent quite a bit of time hyping it up, including a huge preview in December 1998 and constant updates. DA2 got quite the fan following in the QB scene.

But that was 1998. Now it's 2005. I'm sure most people assumed that Dark Ages II was just another dead project, abandoned somewhere in mid-development and never to see the light of day. Well, it turns out that DA2 never ended up dying like we all assumed. It ended up being ported to Visual Basic and is actually STILL in development.

On May 15th, Michael Hoopman released a new beta release of the game at his website, Dark Knight Software. As a huge fan of the first game, I was amazed when I heard this news and rushed to check out ... what ended up being a fairly lackluster demo that hasn't changed much from its QB demos back in 1999. And it still features the same old sprite graphics that look incredibly dated these days. Oh well. Maybe one day when it gets finished it will manage to live up to the simple fun of the first one.

New QBXL Audio Edition

SJ Zero has *finally* released a new QBXL audio version after more than a year. Like the previous three audio editions, this features satire and parody news with a Daily Show-like radio delivery style. This latest issue made fun of several things around the Qmunity, and even mentioned myself and QB Express in its report on Adigun A. Polack's FreeBasic Demo Competition. You can find the new edition here: qbxl.net/downloads/qbxlAudio4.ogg



Gallery

Written by Pete

Every issue QB Express features a preview and exciting new screenshots from an upcoming QB game. If you would like your game featured, send in some screenshots!

ASCIIQUEST Editor v1.0


The following information was reprinted from http://qb45.think-new.com/asciiquest.php.

Jace Masula (better known as momoguru on some forums) has been working on an incredible looking ASCII RPG / "quest" editor for the past few months that everyone should definitely check out. Last month, a beta version was released on his website, and version 1.0 is due out soon. (The official release date according to the website is June 17th, though I have heard through the grapevine that this program may bre released as early as TODAY, May 27th.

I had time to briefly check out a special preview copy of v1.0, and I must say that it is one powerful piece of software. Everything you need to create an awesome ASCII game world is here, and the presentation of this package is excellent. This app has a great map editor (with a lot of awesome demo maps included of dungeons, castles and grassy overworlds), a music editor, an enemy / object editor, and an ASCII paint program. The interface is very intuitive and is mouse driven, and you should have no problem finding your way around the program. Also included is a giant FAQ / Readme which is very extensive. This is a very impressive package, and everything is well thought-out.

I didn't have the chance to try making a game with ASCIIQUEST in the short time that I had to check it out (ugggh, deadlines)... but when v1.0 is released, I encourage everyone else to give it a try -- and actually make an ASCII quest game with it.

Due to deadline constraints, I've reprinted the description of ASCIIQUEST from the QBasic Lab website for your reading pleasure (rather than rewriting it). Enjoy!

-Pete

ASCIIQUEST is an ascii game creation package. It contains everything you need to created and play you very own ascii character rpg / puzzle games. You can create maps that are scripted to events. The easy to use event scripting allows you to build simple or complex game events.

ASCIIQUEST is easy to use and the game engine makes the games you create easy to play. This program is 100% free and only displays 2 small lines of credits at the bottom of the game engine credits screen.

The ASCIIQUEST Game editor / engine
These 2 main components will allow you to create and play your very own ASCII character RPG type puzzle games. The Download comes with a simple manual which will help you get started creating your first game. Keep in mind that the editor and engine are somewhat simple…
if you are looking for an advanced RPG game maker, this is NOT it. However, the ASCIIQUEST game engine can do some neat stuff. (once you get the hang of how it works)

Some of the basic things you can do with ASCIIQUEST are: change maps, healers, inns. taverns, quests, gate triggers and ifgate checking, teleporting, combat spells, unlimited items, objects, weapons, armor, spells and quests. cutscreens, and more.

There are a few additional programs that I have included to help you construct various elements used by the game engine. ASCIIPAINT will help you create game screens and ascii graphics. QBPLAY will assist you in creating sound and music for the game. and EDIT, which will allow you to edit your enemy.DAT and objects.DAT files.
Keep in mind these are separate programs. You may want to check for newer versions.

Everything you need to created your very own ascii game is included. I still plan do update this here and there as I get time. If you encounter any errors, do your best to work around them until I cant get them fixed.


Visit the Jace Masula's QBasic Lab for more information.


Review of Battle Pong by Lithium

Written by Adigun Azikiwe Polack

SURE there has been countless and countless many Pong clones out there every which way you look these days, but I mean, hey, only few of the QB games of this type have *really* stood out from the crowd, including Pong: Battle Royal by Budfish Software (remember that one?). But now since the very advent of FreeBASIC, game programming has finally broadened and exploded into a whole entirely new level already! And I am so glad to say that Battle Pong by Chris Adams (aka Lithium) uses that power so well, and has taken the ordinary Pong game into a whole new direction for FB!!!

G A M E • S Y N O P S I S


When you first rev up the game, you are taken immediately to a title/menu screen where you have some excellent options to choose from like the enemy AI of the opposing player, the number of maximum balls to be placed on-screen (up to five!), the color of your paddle that you want (Silver, Blue, or Pink), the time limit, the score limit (number of pts. needed to win), and even the odds of an item appearing on the screen. Very cool stuff, Lithium, as it truly is a great start for you here!

When the game finally starts with the two paddles entering the arena, it may look like ordinary Pong on the surface, BUT, when the power-up items begin to fly off of at least one of the paddles, you know the game is gonna be some truly hot stuff!! Why? Because the power-ups do consist of the following:

Machine Gun ::: Lets you fire off rapid shots in order to chip away at the opposing paddle to dish out some damage in your favor.

Freezer Item ::: When this weapon is used on enemy paddle successfully, it simply slows it down, giving you some advantage!

Missile ::: Gives you the ability to fire them rockets to score some bigger destruction on the opposition, because they are much more poweful than the Machine Gun alone!

Death Ray ::: The ULTIMATE weapon!! When this is fired on an enemy paddle, it simply destroys it completely. Period. Beware, however, for you have only TWO (2) shots of ammo on this, so make ‘em count!!

In addition, there are other items just waiting for you to grab, including ones marked “25”, “50”, and “100” that replenish some to a lot of health to you, as well as “Shrink” and “Expand” items that adjust the size of your paddle, and if that ain’t enough, there is even an item that puts an additional ball into play when gotten! Watch out though, as your opposing paddle can ALSO grab the same items as well, causing it to possibly do you some damage. With all of this going on and more, it simply adds depth and big challenge to the game, I believe!

T H E • B R E A K D O W N


As a one-player game, Battle Pong really is some awesome stuff right there, *especially* in the Enemy AI that plays some serious games with you in serving the ball and keeping it in play! Smart, truly well-balanced and challenging stuff!!! (Now let us see other games in FB that do that! ) In addition, bring a friend, fire up the two player game, and watch this game REALLY rock!!! d==b ! Hey, you can even watch the computer play against itself, too!

The keyboard-based play control here is nothing short of excellent, and the speed at which your paddle is moving is handled just right, the way is should DEFINITELY be for such an original Pong-based game as this in FB!! (^_^)v

The graphics are some pretty good caliber stuff, clean and simple, albeit being done in SDL and some high-res graphics, and the candystriped-like blue-and-black background is much easier on the eyes and does not even distract the intense gameplay action one bit! Nicely done now!

As for the sound effects, they are AWESOME, from the sound of the ball to the intense warfare of gunfire and even to the sound of your opponent being covered in ice or even exploding under the prey of your shots, too, only they are all being done so very wonderfully here! Lithium sure knows how to take his own time in choosing the right sounds for the right moments in this game, and I am truly proud of him on that!!

The minor small problems I had were absolutely no music at all, and that the opposing paddle you are facing in a one-player game can sometimes be no more than just a sitting duck while waiting for the ball to come to it, leaving it open prey for your continuous machine gun shots. That takes away some of the challenge a bit. Still, I highly recommend this game personally, especially for you Pong maniacs out there who want some pizazz and excellent long-lasting gameplay to take you out of the ordinary, and Battle Pong by Chris Adams (aka Lithium) does exactly that and more, making it the first TRULY GOOD ball-and-paddle game ever created in FreeBASIC!! Take a bow, Lithium!!! !!

T H E • F I N A L • V E R D I C T


8.7/10

With loads of features, excellent power-ups, a *perfectly* well-balanced enemy AI, mass-destructive weaponry, great SFX, and awesome gameplay that lasts and lasts, Battle Pong by Lithium is an real intensely good time for 1 or 2 players that takes the original Pong game to a much higher and better level in FreeBASIC!!! =b !


Download Battle Pong, or visit the AAP Official Projects Squad.


AI: Artifical Stupidity

Written by aetherFox

First of all, this is going to be an extremely short and completely theory based tutorial. The reason I will not provide code on implementing the techniques discussed below is that they are (in my opinion) implemented differently for whatever situation they are coded for. There are many source examples on the Internet should you care to look hard enough.

Artificial intelligence is one area where many games fail to make a big impression on gamers. Many people complain about the dull and (ironically) robotic AI, that is so predictable and monotonous that it hinders the overall impact of the game.

There are many ways to make the artificial intelligence of a game more interesting and ways to make it part of the core gameplay - enemies that seek the player out, attempt to defend territory, heal when injured, or flee when dying. You might think this is complex and difficult to achieve, but through two quite standard and simple techniques - Finite State Machines (FSM) and Probability Distributions (PD), you can make your game a much more enjoyable experience.

Finite State Machines - A behaviour model that simulates intelligence wherein the "machine" (object) can act in only a finite number of ways.

Let's use a simple example - a shooter. Your basic enemy will be a fighter, that might have 3 states. Find, Flee, Attack. Using the principle of FSM, you would take information from the environment of the machine and from that information, invoke one of the states. In psuedo-code, using our shooter example:

The problem with this is that you suffer from the same problem that was the cause of writing the tutorial, predictability. The player would immediately see the states and every single enemy would become part of a "flock" an do the exact same thing in the same scenario.

The way to overcome this is to use Probability Distributions:

Probability Distributions - A list of probabilities assigned to various states of an object.

To implement it to our shooter example, instead of invoking the Attack subroutine when PlayerIsNear is true, you would raise the probability of attacking the player and reduce the probability of finding the player. Then, you could choose a random number from a range (one that is suitable for your game's difficulty), and depending on the number, invoke one of the states.

This leads on to many interesting things. If you introduce more states, then you could have very complex NPC's. Imagine in a shooter, where if you injure the enemy, and then the enemy runs off, but might alarm others if it is brave enough? Using the probabilities, it opens up a whole range of possibilites. You might have the problem that in a state where fleeing is the dominant probability, attacking, which is the least probable state, is chosen. No worries, this enemy might be a rogue brave fighter. Similarly, you could have fighters that flee at sight of you, making them seem cowardly.

The words "brave" and "cowardly" I have used there are personifying a few lines of computer code. With time and practice, you could come up with perfect probabilites to have a range of possibilites that your "AI" might take as a course of action.

This is just a short bit of theory that shows a little about a very underused (in the amateur game community) technique for implementing clever NPC's. It is also such a generic technique, it can be applied to every style of game where a certain level of intelligence is needed. An NPC in an RPG town who might react differently to different situations - if the evil king is defeated, he might be scared. Or maybe in your FPS you might have a group of zombies who when they are together have the guts to face you, but when they are alone they might just run away, alert others and call them to your location. If you look at it from other perspectives, it may seem that your game is "intelligent," but from the fairly simple code you wrote to implement them, you'll see that AI is actually pretty stupid.

Avinash "aetherFox" Vora
avinashvora [at] gmail [dot] com.
http://avinash.apeshell.net

Download a copy of this article.


ASCII-WORLD Competition Follow-Up

Organized by lurah and MystikShadows

Last month, QB Express brought you news about ASCII-WORLD's first competition, which had a summer theme. You can read all about it in this article.

This month, lurah brings us some updated rules and deadline information.

-Pete

We, Stephane Richards and I have received some questions about date what is last one to submit demos.

So here is, a bit modified but clear informations about submitting, voting and declaring winner.

  1. The 30th of June is last day to submit demos.
  2. Voting of winner starts the 2nd of July.
  3. We announce about voting practically in every site that we can imagine.
  4. Winner is declared on QBExpress #11
  5. Winner should get hes/her prize in same month, no matter where on earth he/she lives =)
  6. Stephane Richards is offline for a week (approximately) so if any one has questions about our contest, then fastest way to get ansver is to email at virtanen.kristian@lemmikkini.net or go in our forum at www.ascii-world.com.

    Regards, lurah



So What The Heck Is Fun Anyways?

Written by Deleter

In my last article, I stressed the need for fun in a game without really defining what fun is. So, what is it? My good friend, the online Merriam Webster dictionay, tells me that fun is "what provides amusement or enjoyment." There you go, thats it! Go and make your fun games now =D. Oh, that isn't enough, you say? Of course not, if that was enough, you wouldn't have opened this article in the first place.

So how do we really define fun? Let me start with a poem:

Once there was a programmer,
He didn't have the best grammer,
He couldn't rhyme worth a damn,
Couldn't keep a good rythym,
Couldnt't keep it flowing,
Couldn't.........

(Crickets) Ahem. So, why did I just put you through that horrifying experience? Here's why: I hate poetry. I hate writing it, reading it, and especially anyalyzing it. Therefore, I had no fun whatsoever writing the above passage, and I surely hope you didn't have any fun reading it. So, what does writing poetry have to do with game programming? Not much actually. But here's what I'm trying to say: if its not the type of game you would want to play, not only is it going to be a type of game you don't want to program, people aren't going to want to play it, either.

Hmm, so I've picked a genre I know and love, now what? Well hyar naje rgw danw abs rgwt qukk akk kicw tiy. You get that? Didn't think so. If your design and implementation confuse the driving force of your game (what makes it fun), just like my writing that message all wrong, people are NOT going to get anything out of it.

So, you made a clear design with the backdrop of your favorite style of game, and and and and and and yoooooooooooooooooooooooooooooooou hhhhaaaaaavvvveeee mAdE thhhhee game. Make sure you DEBUG it all the way. Don't let things slide, and for sure don't be ignorant enough to leave any code/game resource untested. A simple bug can ruin a whole game.

Ok, I thought you were going to tell me what to do, not what not to do.... That I did. So now that I have the basic.....erm.....BASIC and design stuff out of the way, whats fun? What takes a game from a lifeless collection of pixels moving on a screen to an enjoyable and interesting use of code for entertainment? Want to know what the answer is?

NOTHING!

Thats right, nothing makes a game fun. Perhaps I should rephrase that, no one thing will make your game fun for everyone. Why? Everyone likes different things. What sort of world would it be if everyone played the exact same games? Boring as heck, for sure.

So, then how do I make it fun? Well, since different people think different things are fun, you need a target audience, in other words, you need a group of people whom find what your making fun. The RPG crowd will never like you if you give them an RTS, FPS'ers won't accept your SIM.

So, the question then become, which group? Easy, remember my poem? The idea works with groups as well. Make games for the groups you consider yourself to be a part of.

Ok, I've got all that down, but my game just isn't right. There aren't bugs, its my favorite genre and I kept it simple and limited complicated code, but after awhile, it just gets flat out boring. For this problem, I'm going to give you three short narratives:

1) You're going down a flat, broad river. Your boat dips and rises with the almost nonexistent current. The hot, bright sun beats on you as it has for the last five weeks. The shore is stagnet. Nothing moves, the heat causing all to stay still.You sit back against the raft, half asleep. a cloudless sky offers nothing to watch.
2) A waterfall looms several hundred meters before you, you know it will be your death. You fall down it!!!!! As your boat hits the river, you thank God you're still alive.
3) The river's current rushes past your boat, suddenly active with energy from an unknown source. You become alive with energy as your boat picks up speed. A quiet noise comes to your attention. As you clench the sides of your boat with white fists, your attention is captivated by the noise, which is growing ever louder and more ominous. You can't see where its coming from, but you know that whatever it is, it can't be good. The unknown menace hides behind the thick trees lining the shore that bends in front of you. With panic, you stare wide-eyed as your boat turns around the bend.

Which did you like best? The last one, I hope. Why did I drag you through more of my literature? Flow. No, not river flow, Game flow. The flow of the river in these did indeed represent the ways in which your game can flow. How do you apply this to game flow? Lets briefly examine my literature and see how.

In the first piece, you are presented with a situation where nothing happens, there isn't a dilemma of any sort. If in a game, there is no motive it will quickly turn monotonous and people wont play for very long.

In the second piece, there is a dilemma, however, the player isn't given enough time to work up to it and get interested before its all over. If in a game, you rush the player, forcing this or that, end it real fast, or have things happen prematuraly, your player is going to get frustrated and quit.

The third piece has: A dilemma: check. Enough time for the player to care: check. Enough content to keep the player interested: check. Properly implemented events: check. I wrote player instead of reader, because this directly translates to gaming.

Basically, flow is pushing the player at the right speed, while giving him enough to be interested in to want to go at that speed. This is easier defined in an RPG with progressing the story, but can be applied to other games as well. FPS, for example. Ease of maps to avoid long stalls, new monsters and guns to keep them interested, and usually some sort of boss battle to build up to and look forward to.

So, to sum it all up:

  1. Interest - make something you're interested in
  2. Clear Design / Debugging - Don't let sloppy plans or code ruin your awesome game
  3. Release to the right people - Not really important to the game's fun so much as its acceptance/success
  4. Game flow - One of the hardest elements of programmer/designing. This includes all elements of game creation. Design - Making sure your game idea won't stall and the player won't 'snag' on any parts of your game. Programming - Not only bugs, but simply programming choices (player speed/power, for example) can affect the flow of your game. And finally Implementation & Story: Implementation is the content creation (maps, sprites, models =P, etc.). Map design is the most important as it directly affects the player's experience and can't be looked over. Story is mostly RPG's, since all other games don't rely to heavily on the story. Basically, your story ought to follow my example above, allow enough time between start and climax, have interesting content that keeps the player hooked, events at the right time, and a worthy climax.

That's all I can think of, and I know its a lot more than you wanted to read, so I'll end it here *hears cries of relief*. Thanks for reading! Remember: Please send comments/suggestions/insults to my email (barbarian_roleplayer@yahoo.com) Also, if you have any ideas for upcoming articles, feel free to suggest them to me.


Visit Deleter's new site, Random Musings of a QBasic/FBasic Game Programmer.


The BASIC User's Guide to English Spelling and Grammar

Compiled by DrV, Unofficial Master of the English Language

I've seen all of these incorrect uses of English repeatedly on multiple forums and various pages on the World Wide Web. Please pay close attention and take notes. :)

(I realize that not everyone speaks English natively and that not everyone has had a decent English education, but I feel the need to share my knowledge and experience in order to improve the level of aptitude among forum posters and others whose writing appears on publicly accessible Internet resources. I'm not trying to be elitist or flaunt my superior language skills. I'm sure I would get bashed immediately for my grammar and spelling if I tried to write in some other language. If you still feel the need to send me large quantities of inflamed commentary on my high-falutin' approach to educatin' the populace, feel free - you can reach me at the QBN forums.)

Commonly Misspelled Words

Word
Common Misspelling(s)
definitely
definately (I see this one two or three times on an average day...if you don't get anything else out of this, remember this one!)
tried
tryed

Commonly Misused Words

Word
Common Misuse
decent
recursive decent parser (should be "descent")
there,
they're,
their
All three of these are commonly interchanged when they shouldn't be. "There" is a location, "they're" is a contraction for "they are", and "their" is a possessive adjective.
then,
than
"Then" and "than" are interchanged often. "Then" is a time or conditional ("I ate lunch, and then I went home"); "than" is an adjective ("I ate more than George.").
it's,
its
Commonly interchanged. "It's" is a contraction for "it is" ("It's cold outside."); "its" is a possessive adjective ("Its wheels were round.").
who's,
whose
Commonly interchanged. "Who's" is a contraction for "who is" ("Who's eating the apple pie?"); "whose" is a possessive adjective ("Whose apple pie is that?").
to,
too
"To" is a preposition; "too" is a comparative adjective. "I went to the store"; "I drank too much."
your,
you're
"Your" is a possessive adjective ("This was your idea.");
"you're" is a contraction for "you are" ("You're so smart.").
Zelda
Usually used by Nintendo newbies when speaking of Link in the Legend of Zelda series.
effect,
affect
"Effect" is a noun meaning "the result of an action" ("The effect of excessive drinking is a hangover."); affect is a verb meaning "to manipulate in some way" ("I wish my ranting would affect these people.")
good,
well
"Good" is an adjective ("You are a good reader.");
"well" is an adverb ("I did well on the test.").

Just Plain Wrong Words

Word
Why it's wrong
themself
This word does not exist in the English language. "Them" is plural; it cannot be used to refer to one person. Therefore, "themself" cannot logically exist. "Themselves" is the usual correct replacement, but the structure of the entire sentence must be considered in such a situation; an entirely different word or phrase or even restructuring of the sentence might be in order.

Conclusion

I'm sure I haven't caught everything here, but these are the most overtly ridiculous and often-occuring examples of poor grammar and spelling encountered by yours truly.


(If you didn't notice, some of this wasn't entirely serious, but if you take most of it to heart, you'll live a more enjoyable and productive life and impress people with your mad English skillz. Ignorance is not bliss. For great justice!)


You can find DrV at the QBasic News Forums.


QBasic GUI Development

Written by Jacob Palm

Intro

Have you ever been annoyed by Windows taking up way to much RAM and CPU power, and felt like switching to DOS, but then haven't because of the lack of a graphical interface? I know I have. That's why I decided to make a graphical interface (GUI for short) myself. When you make a GUI yourself, you can leave out all the stuff you newer use anyway, which will make the GUI faster and smaller, allowing it to run on old computers, too.

Of course you don't necessarily have to replace Windows or DOS with your GUI. You can make one just for fun, or maybe for other people to use. The reason I make a GUI is that I think it's funny to see how much I can get the computer to do, how nice I can make it look, how far I can push QBasic and such. I've also really learned a lot about computers while making a GUI. But whatever reason you may have to make a GUI, I'll do my best to tell you something about QBasic GUI's. Don't expect to find any code here, this article is purely theoretical. I'll write some stuff about what a good GUI should have, and give some tips. Maybe I'll write a tutorial for the next issue of QB Express.

Excuse me if my english isn't perfect, don't forget that I'm only 15 years old and from Denmark. This is the first article I've ever written. I hope you'll find it interesting.

What a good GUI should have

What your GUI should contain of accessories is fully up to you. But there is some accessories the user would expect to find in a GUI. Below I've made a list of some accessories every GUI should have.

Of course there's more than what I've listed here. This is just a list of some of the most common things users expect to find in a GUI. You could of course release a SDK (Software Development Kit) for your GUI, allowing users to write their own accessories which fit in to the GUI nicely. Some users actually send their creations to the author of the GUI, which in some cases include it in the GUI, making it even better.

Tips

I've listed some tips below which you may find useful in the development of a GUI.

  1. Many people like it when the GUI displays some icons. If your GUI is made up of text and windows only, it might be a little boring to look at. But don't just make some icons, they should fit in to the correct places. For example, an icon of a cow doesn't belong in an error-message (unless it's a dead cow, maybe)
  2. Split up your GUI in several EXE's. This will help improve the stability of the GUI. For improved stability, each accessory should be in it's own EXE file. Then, when an accessory makes an error and exits, the user will still return to the program launcher. Splitting up the GUI in several EXE files will, however, make it a lot harder to do multitasking(thank you to Todd Suess for this tip)
  3. Use screen modes with page-support. It will drastically reduce flicker in your GUI if you draw the screen on a videopage before you show it on the screen. The best screen mode for GUI's (which support pages) would be screen 9, since it has a high resolution (640x350 pixels). You can also use the statement "WAIT &H3DA, 8" (without the quotes) to wait for the next screen redraw before drawing something. Don't use it in a loop, though, that would drastically reduce the speed of the GUI.
  4. Use a font routine which doesn't display capital letters only. IT'S VERY ANNOYING TO READ TEXT WITH UPPERCASE LETTERS ONLY, as you may see.
  5. If possible, provide an e-mail address or website where the user can get support if he/she has a problem or question regarding the GUI.
  6. Try to make the interface as easy to use as possible. It's not easy using a program if the buttons only have pictures on them which doesn't tell what the button does. The best way would be to add text to the button, or a tooltip.

There are more ways to optimize your GUI, but most of them isn't GUI related, but works in all QBasic programs (some of the tips above work in all QBasic programs, but they're very useful in GUI's, so I decided to list them anyway)

Links to GUI pages

There are some QBasic GUI related pages out there, but not that many. I've listed below some of my favorite sites (and my own, of course).

There used to be more GUI sites, but most of them are closed now.

That's it for now

Well, I don't have much more for you this time. I hope you enjoyed reading this article, and found the contents useful. If you have any questions or comments regarding this article, feel free to e-mail me at hvalrossen@jacobpalm.dk. You can also post in the forum at my website. Good luck with your GUI programming!

Jacob Palm
(The Walrus at some forums)


Make sure you visit JacobPalm.dk, Jacob's great QB GUI site and last month's QB Express Site of the Month!


Monthly Awards

Written by Pete

Every month, QB Express hands out two awards to recognize QB or FB coders and websites that have done exceptional work in the last month. They are not awarded for work done in the past, only for work that has been released since the last issue of the magazine. Z!re and I have teamed up to bring you these awards on a monthly basis to help give credit where credit is due.

Site of the Month

The Basic Network
http://www.basicnetwork.net

Webmasters: Nekrophidius & Rhiannon

Since its relaunch less than 24 hours ago, The Basic Network has really made waves in the Qmunity. In its first half-day of life, this new QB forum has had nearly 400 posts, and has become a haven for QBasic News refugees seeking a stable, active forum. If any QB forum is going to become the new QBasic News, The Basic Network is it. I encourage all QBasic News members looking for a new forum to join The Basic Network today. Of all the forums out there, I think this one has the best chance of becoming the new center of the Qmunity.

Programmer of the Month

VonGodric
http://fbide.sourceforge.net/

This month, VonGodric released version 0.4 of his awesome IDE for FreeBasic, FBIde. The interface of this IDE turns the scary & unfriendly (to newbies) command-line interface of FreeBasic into an experience not unlike the user-friendly IDE that made QB so popular.

FBIde features tabbed editing, code highlighting, quickrun (just like pressing F5 in QB), and a sleek Windows interface.

VonGodric was also a highly respected and very helpful member of the QBasic News forums, helping QB and FB coders alike with their questions. Shortly before QBN was now shut down, VonGodric was appointed moderator of the forums for his outstanding dedication the Qmunity.



FreeBASIC Ultimate Demo Compo:
the brighter new gala of the FB demoscene!

Written by Adigun Azikiwe Polack

Are you psyched and ready for a whole new and freshly different breed of compo by yours truly? You better be now, because you are looking at an ever-promising new gala that is even more brighter than my three QuickBASIC Caliber Programming Compos. And the gala is entitled the FreeBASIC Ultimate Demo Compo, which is *entirely* so different from my previous compos in many different ways.

Here is why:


(Left to right:The Final Frontier” by Qasir; and “Digital Reality” by Plasma.)

And also, Pete Berg of QB Express is so wonderfully honored to sponsor this very special event. =b ! Remember too that this compo is aimed primarily for those who simply want to create such fresh and imaginative new demos like never before in FB, as well as for anybody at all that wants to enter to take on the ultimate challenge, too.

The special prize plaques are set for the winners as follows:


Grand Prize” plaque (for 1st place!!)

Silver Prize” plaque (for 2nd place)
 

Bronze Prize” plaque (for 3rd place)

The official compo deadline is set to Wednesday, August 31, 2005, so that you have plenty of time to dig in and create your most inspiring entry!! After the deadline is up, I will be launching a very special thread in the QBasicNews.com forums to let YOU decide which demo will take home the Grand Prize indeed!!!

For a full description of this compo and all the details, please go to http://dhost.hopto.org/aapproj/fbgfx/compo.html and do enjoy the festivities.

See you there, and BEST OF SUCH AWESOME DEMOCODING TO ALL OF YOU!!! d==b !


WITH MY ABSOLUTE BEST REGARDS,


Adigun Azikiwe Polack
Official Founder of the “FreeBASIC Ultimate Demo Compo

Visit the FreeBASIC Ultimate Demo Compo!


Comics

By Rattrapmax6

Rattrapmax6 is back this month with another QBasic Horse Humor comic.









I.F. Games Chapter 5:
"Teaching English to our computer"

Written by Na_th_an

Y'ello, guys and girls. One more month and one more chapter in which will become a true Quixote. Originally I had planed just 3 chapters, but you see. Things are gotten out of hand, mainly 'cause I've found that some things really HAVE TO be explained in depth. If I had just thrown in a bunch of code in the last chapter, covering the whole engine, you would have ended with an IF engine which would be worth nothing, tutorial-wise. I have two main objectives with this series, the first of them being you learning to write proper text adventure games for yourself, and the second, underlying one which is teaching people to produce better code. That's why this series will take much longer than expected, I just want to discuss every bit, how it works and why is it coded that way, 'cause the goal is that you are able to write your own engine instead of having to use mine.

This chapter we're discussing about the parser module. First of all we'll make a quick reminder on what we want this module to do and then we'll see how.

Coding the Parser Module

Our parser module will be comprised of two, clearly differentiated parts. As they both use the same subroutines for string slicing and formatting, we've decided to place them both together in the parser module 'cause they both, in different ways, parse stuff: these two parts are the scripts interpreter and the player's command interpreter. Before diving into these parts, let's examine and explain the auxiliary subroutines we are gonna use. These subroutines will be kept internal, i.e. they won't be referenced in the .bi file as we won't need them outside (read the previous chapter to refresh your mind about this topic).

All the snippets in this chapter should go inside a file called "parser.bas", for example. The exported SUBs/FUNCTIONs will be in "parser.bi".

Auxiliary functions

If we need to parse a string containing several words (which can be a natural language sentence, or a line of code - think in tokens and values as words), the first thing we need is a subroutine which slices the string into words and return them conveniently formatted. If we are gonna try to understand what's in the sentence, we need to easen the things a bit to the computer: we need trimmed words (with no whitespace) in lowercase. This is what the next piece of code does: it takes a sentence, slices it, and stores each word in an array index.

We will set this array (the one which will contain each word in the sentence) as a shared variable so it is accessible from any subroutine or function in this module. The string containing the whole sentence will be a shared variable as well, which should be able to be modified or read from the outside, so we'll create a SUB and a FUNCTION to do such tasks which will be exported in the .bi:

Const phraseLENGTH = 50 Dim Shared words(phraseLENGTH) As String Dim Shared phrase As String Sub Parser.setPhrase (newphrase As String) phrase = newphrase End Sub Function Parser.getPhrase () Parser.getPhrase = phrase End Function

I think that 50 words is far enough. In fact, I doubt that you will need more than 10.

The slicing function will read the string character by character, stopping when finding a space and storing what he got so far as an array element. It will do a couple things more: it will take track of multi-proposition sentences (such as "get book and read it", or "get pen, open the case and put the pen inside it"), and will split the sentence accordingly.

This can be done in a relatively easy and simple way: we will only parse the sentence until we find a separator (such as a comma, a stop or the "and" word), then we'll wipe out what we have parsed, so the next time we call the subroutine the next portion of the phrase will be parsed. For example, imagine that phrase contains "get pen, open the case and put the pen inside it":

1.- The first time we call to the function, we get:

words(0) = "get", words(1) = "pen", words(2-50) = "" phrase = "open the case and put the pen inside it"

2.- Next time:

words(0) = "open", words(1) = "the", words(2) = "case", words(3-50) = "" phrase = "put the pen inside it"

3.- And the next one:

words(0) = "put", words(2) = "the", words(2) = "pen", words(3) = "inside", words(4) = "it", words(5-50) = "" phrase = ""

You'll see how it works later with a simple (coding) example. The code is as follows:

Sub Parser.Parse Dim word As Integer Dim i As Integer Dim m As String ' To make things easier, we make a first pass changing every separator ' for a common symbol, which happens to be "&": For i = 1 To Len (phrase) If i < Len (phrase) - 1 Then If Mid$ (phrase, i, 3) = "and" Then If i = 1 Then phrase = "&" + Right$ (phrase, Len (phrase) - i - 2) ElseIf i < Len (phrase) - 2 Then phrase = Left (phrase, i - 1) + "&" + Right$ (phrase, Len (phrase) - i - 2) Else phrase = Left (phrase, i - 1) + "&" End If End If End If m = Mid$ (phrase, i, 1) If m = "." Or m = "," Then phrase = Left$ (phrase, i - 1) + "&" + Right$ (phrase, Len (phrase) - i) End If Next i ' Okay, after some string slicing now we have all the separators replaced by "&". ' Sometimes I wish BASIC had the regular expression managing Perl has :P ' Now break up the phrase into words. Stop at & and return the remaining. ' This will allow to use . and , to tell the Parser.Parser several actions ' from within the same command, as explained. word = 0: words(word) = "" ' word will keep track of the array index For i = 1 To Len (phrase) ' loop for every char in the string m = Mid$ (phrase, i, 1) ' get it If m = " " Then ' Whitespace found If words (word) <> "" Then ' If current word is not empty word = word + 1 ' Go to next word. If word = PHRASELENGTH + 1 then ' If no space left in the array phrase = "" ' clear phrase. Exit For ' exit. End If Words (Word) = "" ' Initialize next word End If ElseIf m = "&" Then ' Separator found If i < Len (phrase) Then ' Trim if more chars in phrase: phrase = Ltrim$ (Rtrim$ (Right$ (phrase, Len (phrase) - i) ) ) Else phrase = "" End If Exit For ' Let's get outta here. Else words (word) = words(word) + lcase$(m) ' Any other char gets added to the ' current word. End If Next i End Sub

You can see this in action with the following testing code:

Dim o As String Do Input o Parser.setPhrase o Do Print Parser.getPhrase Parser.parse Loop Until Parser.getPhrase = "" Loop

It's important that you fully understand how this sub works. This a fairly good example of string slicing works, complete with substring replacement. It's also important that you understand how to make it work: First you must feed the sentence to the engine using Parser.setPhrase, then you call to Parser.parse until getPhrase returns the empty string. When we put together the main loop, we'll have to run the common actions and the post-input exceptions until getPhrase returns the empty string. The diagram we saw two chapters ago ends having this shape:

' Main loop in pseudo-code DO DO DO parse phrase. interpret phrase. [ | |] LOOP UNTIL phrase is empty LOOP UNTIL LOOP

Once we've seen the auxiliary functions we're ready to go ahead to the important things, for example the interpreter. But before...

We need a dictionary!

The dictionary in our game will serve two purposes. The most important and basic is to be able to identify which kind each word is, i.e. it is a verb, a noun or and adjective. The second one, not less important, is to be able to have synonyms. Check Chapter #1 again for a deeper discussion about the meaning of this all.

We start, as always, defining data types, constants and module-level shared arrays.

CONST MAXWORDS = 1000 ' Max. number of words in the dictionary. CONST WTVERB = 1 ' Word types CONST WTNAME = 2 CONST WTADJ = 3 Type DictionaryType id as Integer ' Word ID (useful for synonyms) w as String * 20 ' Word. typ as integer ' Word type (1 = verb, 2 = noun, 3 = adjective). End Type Dim Shared D (MAXWORDS) As DictionaryType

As with the location descriptions, we'll store the dictionary in a separate text file with an easy to parse format. We just need id, the word itself, and a numeric type. The easiest way of doing this is having a word per line with those data separated by commas, i.e.

1,n,1 1,north,1 2,s,1 2,south,1 3,e,1 3,east,1 4,w,1 4,west,1 5,ex,1 5,examine,1 5,look,1 100,book,2 101,jewel,2 200,red,3 201,green,3 202,big,3 203,empty,3 9000,it,2 9000,them,2

(remember that you should include "it" and "them" as synonyms and names).

With the data stored in such an easy format, loading it into the D array is really simple, we just create an idex variable as iterator and fill the D array until we reach MAXWORDS or the end of file. This function will be exported in the .bi file:

Sub Parser.Load (fileName As String) Dim f As Integer Dim wrdIdx As Integer ' Just load the dictionary from the file. f = freeFile Open fileName for Input as #f wrdIdx = 0 While (Not(Eof(f))) And (wrdIdx <= MAXWORDS) input #f, D (wrdIdx).id input #f, D (wrdIdx).w input #f, D (wrdIdx).typ wrdIdx = wrdIdx + 1 Wend Close #f End Sub

Coding the interpreter

The interpreter is the heart of the first part of the Parser. It is in charge of translating from English to the language the engine understands, which is a very "simple simplification" of English with just one verb per sentence, and whether one or two nouns each one with an optional adjective, provided they are in the dictionary (check back chapter #1 for a more complete explanation). Every other word is wiped out. At a later time, the common actions and the exception manager will rely in these "important words" extracted from the player input. So the first thing we need is adding a few module-level shared variables:

Dim Shared Verb As String, Noun1 As String, Noun2 As String, Adj1 As String, Adj2 As String Dim Shared PrevNoun As String, PrevAdj As String

This function is also in charge of doing some dirty hacks needed for the English language and its phrasal verbs. Note that we have to find the "verb" 'cause we are gonna use it as a "command" for our engine. In other languages, you have a word for each verb. In English you have very different meanings depending on the preposition which comes with the verb, i.e. "look for" and "look after" have completely different meanings (in Spanish we have different words: "buscar" and "cuidar", i.e. interpreting is easier), so to decide which action the engine should perform we can't only focus on the verb. As prepositions may come in different positions inside the sentence (you can write "put the shirt on" or "put on the shirt") we have to "fix" it, or, better expressed: we can't just extract the verb from the words array, we have to figure it out. Basicly, if we find a phrasal verb we scan the rest of the words for prepositions, then we change the verb accordingly. For example, if we find "turn", we scan the rest of the words. If we find "on" in the sentence, we change the verb for "turnon"; if we find "off", we change the verb for "turnoff". That way, a sentence which is "turn the lamp on" will become "verb: turnon, noun1: lamp".

We need a simple function that finds a word in the array "words" starting from a given position:

Function Parser.findFrom (from As Integer, w As String) As Integer Dim res As Integer Dim i As Integer res = 0 For i = from To PHRASELENGTH If words(i) = "" Then ' We find an empty word: no more words Exit For ' in the sentence. End If If words(i) = w Then ' We found it! res = -1 ' Return true Exit For End If Next i Parser.Findfrom = res End Function

This interpreter subroutine introduces the first finite state machine (FSM from now on) we are gonna use in this engine. Basicly, a FSM is just "something" that has a state and reacts to something external, changing its state for another one depending on what happened. FSMs are very used in parsing. In this scenario, that "something external" is the symbol being read, in this case a new word; imagine that we put each word in a transporting tape and we have a machine that gets them one by one, sequentially, and processes them. We'll define four states for our machine which will be "init", "found verb", "found noun1", and "phrase complete". In the following diagram there's an explanation on how this FSM works, according to the state it is in and the word read:

If we run out of words at any time, the FSM is killed as well.

There's some other important things that this Subroutine do:

This is the code. Pay special attention to how the FSM flows.

Sub Parser.Translate Static Dim state As Integer Dim i As Integer, j As Integer Dim word As Integer Dim assignA As String, assignN As String ' * Identifies the synonyms and word type (verb, noun, adjective) ' According to the dictionary file. ' * Whipes out unneeded words from the words() array, such as "the, as"... ' * Substitutes "it", "them"... etc by the remembered word. ' * Updates remembered word. ' Phrasal verbs force me to do some kinky hacks to get this working. ' I mean, some verbs change its meaning depending on the preposition ' used, and that preposition isn't always just after the verb, i.e. ' "turn the torch on". ' This SUB does the "dirty work" of simplifying simple English. ' Note that this is the most difficult SUB to adapt when translating ' an IF. In fact, you could only translate this one, as it is, ' in fact, some kind of "ENGLISH TO ENGINE" translator :P ' Phrase always follows the same structure: ' VERB [[ADJ1] NOUN1 [[ADJ2] NOUN2]], ' we have to wipe everything out but this. ' We can do this with a very easy FSM (Finite State Machine): state = 0 ' 0 = Init ' 1 = Found Verb ' 2 = Found Noun1 ' 3 = Phrase complete ' Let's analyze word by word. ' Don't forget the good ol' initialization: Verb = "": Adj1 = "": Noun1 = "": Adj2 = "": Noun2 = "" For i = 0 To PHRASELENGTH ' Dirty optimization: As soon as we find an empty word, it ' means that the phrase has finished, so we exit: If words (i) = "" Then Exit For ' Find words (i) in the dictionary. Linear search. We could make ' this in a better way, for example sorting the dictionary alpha- ' betically and using a binary search which is O(logN). Anyway, ' O(N) is not that bad for this: word = -1 For j = 0 TO MAXWORDS If D (j).w = words (i) Then ' Found in the dictionary! word = j: Exit For End If Next j If word <> -1 Then ' If word was in the dictionary: ' Find 1st synonym: For j = 0 TO word ' This snippet just selects If D(j).id = D(word).id Then ' the first word that's in the word = j: Exit For ' dictionary with the same id End If ' as the word the player entered Next j ' ie. the 1st synonym. ' Found, what type? (verb, noun, adjective?) Select Case D(word).typ Case WTVERB: ' Found a verb If State = 0 Then ' We only want a verb in state 0. verb = D(word).w State = 1 ' Here comes the hacks! ' I can think of takeoff puton turnon and turnoff ' Basicly we look for the preposition further in the phrase. Select Case verb case "take": If Parser.findFrom (i + 1, "off") Then verb = "takeoff" End If case "put": If Parser.findFrom (i + 1, "on") verb = "puton" End If case "turn": If Parser.findFrom (i + 1, "on") Then verb = "turnon" ElseIf Parser.FindFrom (i + 1, "off") Then verb = "turnoff" End If End Select End If Case WTADJ: ' found adjective ' This way we can use more than 1 adjective per object, i.e. ' "small green box" will result on adj1 = "smallgreen" and noun1 = "box", ' as long as words are well defined in the dictionary. If State = 1 Then Adj1 = Adj1 + D (word).w If State = 2 Then Adj2 = Adj2 + D (word).w Case WTNOUN: ' ¿Pronoun? it/them... etc, just check "it" if we set up the synonyms correctly. If D(word).w = "it" Then assignN = prevNoun assignA = prevAdj Else assignN = D (word).w assignA = "" End If ' Depending on the FSM state ... If state = 1 Then noun1 = assignN If assignA <> "" Then adj1 = assignA state = 2 ElseIf state = 2 Then noun2 = assignN If assignA <> "" Then adj2 = assignA state = 3 End If End Select End If Next i ' Remember for "it"/"them"/etc: Always remember noun1/adj1 unless noun2/adj2 exists and ' was previously used: If noun2 = "" Then prevNoun = noun1 prevAdj = adj1 Else If prevNoun <> noun2 Then prevNoun = noun1 prevAdj = adj1 else prevNoun = noun2 ' This is redundant and not needed, prevAdj = adj2 ' but here for readability. End If End If ' This way, this (which makes sense) can be entered: ' > get box ' > open it ' > put pencil into it ' > close it End Sub ' PHEW!!

We just need a way to retrieve the verb, nouns and adjectives from outside.

Function Parser.getVerb () Parser.getVerb = verb End Function Function Parser.getNoun1 () Parser.getNoun1 = noun1 End Function Function Parser.getNoun2 () Parser.getNoun2 = noun2 End Function Function Parser.getAdj1 () Parser.getAdj1 = adj1 End Function Function Parser.getAdj2 () Parser.getAdj2 = adj2 End Function

How the player command interpreter works

We have seen a tad of subroutines and you may feel a little puzzled. Before we start with the scripts interpreter, I think we should stop a bit on explaining how does this all work.

Let's define what we want to do: we want to read what the player has entered, and extract the important information from there so we know what to do. The command interpreter just reads the player's input and guesses what he or she wants to do. We need a simple but descriptive way to pass this information to the Objects Manager. Just five words (maximum): "verb adj1 noun1 adj2 noun2" are enough. So the command interpreter translates the player input (in natural language) to these 5 words. And this is done in several steps:

0.- Initialize: We just call "Parser.setPhrase" passing a string with the player's input. The local variable "Phrase" stores it. This input may contain more than one sentence, delimited using separators.

1.- Slice the string: The subroutine Parser.parse takes the string containing the player's input (stored in the variable Phrase), and breaks it into words, which are stored in the local array "words ()". If Phrase contains more than one sentence (delimited with separators such as "and"s, commas or stops), the subroutine just considers the first sentence (from the beginning to the first separator); then it "consumes" this sentence from the string (leaving the rest right after the first separator). At any time, we can read the "Phrase" from outside this module calling to the function "Parser.getPhrase".

2.- Translate words (): The subroutine Parser.translate reads the words and extracts the info from them: verb, adj1, noun1, adj2 and noun2. For this subroutine to perform this action correctly, a correct dictionary file has to be present on memory. Note that this file should contain every word you want the engine to understand. Ever word found in the array words not found in the dictionary won't be taken in account.

3.- At this point we would call the Object Manager's functions and/or run scripts with exceptions, just to execute the player's will examining these five words produced by Parser.translate. This will be covered on future chapters.

4.- If Phrase is not empty yet, go back to 1 to process the next sentence.

Tips for creating a dictionary

You don't need all the English language in your dictionary array, just the verbs you are gonna obey to (which most of the time are just north, south, east, west, ..., examine, get, take, drop, put, wear ... etcetera), and all the nouns and adjectives used to identify all the objects (common and fixed) and non playing characters in your game.

Every word has an ID. synonyms have the same ID. This ID is an integer, so it can climb to 32767 in QB or way more than 2 billion in fB. To keep things tidy, I begin assigning numbers from 1 onwards for verbs, for 1000 onwards for nouns and for 2000 onwards for adjectives. Special stuff at the end, i.e. the prepositions, which I give a 9000. This is not done "just because". Note that verbs are the most used words in the game, then nouns, then adjectives. As we search the array linearly, it's good practice to order the stuff from "most used" to "less used". A good improvement to the engine would be to have the dictionary alphabetically sorted and use a binary search, but I'll leave that as an excercise for the coder.

Let's begin with our dictionary. We'll start with the directional commands:

1,n,1 1,north,1 2,s,1 2,south,1 3,e,1 3,east,1 4,w,1 4,west,1 5,ne,1 5,northeast,1 6,se,1 6,southeast,1 7,nw,1 7,northwest,1 8,sw,1 8,southwest,1 9,up,1 10,down,1 11,enter,1 12,exit,1

Note the use of synonyms: "se" and "southeast" are synonyms so they use the same ID. Note how this works: if the player enters "southeast" as a comment, the translator will find it in the dictionary, and then find the first synonym (first word found in the array with the same ID): "se", so "verb = se". That way we just have to code the engine to obey "se", not both "se" and "southwest". I tend to do this, i.e. have the shortest form of each word as the first synonym. That way I have to type less when coding the engine :P It is also faster, as less characters have to be compared. Other people think that it is more intuitive to have the most expanded word as the first synonym, just for readability, as they prefer to read:

If verb = "north" Or verb = "south" Or verb = "east" Or verb = "west" Or ... Then movePlayer If verb = "examine" Then doExamine ...

rather than

If verb = "n" Or verb = "s" Or verb = "e" Or verb = "w" Or ... Then movePlayer If verb = "ex" Then doExamine ...

Just decide what's your favourite approach. You know what's mine :P <- lazy coder.

Back to the dictionary. Now we're gonna add the verbs corresponding with the actions we are gonna allow in this game plus their synonyms:

13,i,1 13,inventory,1 13,objects,1 14,ex,1 14,examine,1 15,look,1 15,description,1 16,x,1 16,xx,1 16,exits,1 17,get,1 18,drop,1 18,leave,1 19,put,1 20,take,1 21,puton,1 21,wear,1 22,takeoff 22,unwear,1 23,turn,1 ...

Note the synonyms again: "inventory" or "objects" will be changed for "i". "examine" for "ex". In the same way you can use "put trousers on" which will get extracted to "verb = puton, noun1 = trousers". If the player wants to ask for the exits, he can whether write "exits", "xx" or "x", which will be translated to "x". In our engine (the objects manager and the exceptions scripts), we'll have to respond to those first synonyms, i.e. "i", "ex", "n", "x", etcetera. Again, if you prefer having this the way around and enjoying of a more readable piece of code, go ahead. I prefer this way: less typing, faster engine.

Take special attention to this paragraph, 'cause this is a side effect of the hack we use for phrasal verbs: all those phrasal verbs HAVE TO be in the dictionary, but not the prepositions that come with them. For example, if we allow "turn off" in our game, "turn" should be in the dictionary, but not the word "for" (after all, FOR is a preposition which we DON'T NEED). Note how it works: 1.- The translator finds "look", 2.- if we have defined it as a phrasal verb (take a glance at the code - you have to manually add each phrasal verb in the 'here comes the hacks' section) it searches the rest of the words for a preposition. 3.- If it finds "for" (again, blatantly hard-coded, check code), it changes the verb from "look" to "lookfor". So adding "for" to the Dictionary is whether futile (if you add it as a verb it will be ignored once we exit "state 0" in the FSM) or error-prone (if you add it as a name or adjective really nice odd stuff could happen). Plus the more words in the dictionary, the slow the engine will be - just avoid adding words that are not going to be used ;)

There are more restrictions with phrasal verbs and their synonyms. I'll try to show you this with an example. Let's consider the construction "put shirt on". To make it work, "shirt" (noun) and "put" (verb) have to be in the dictionary. The translator will replace then "put" for "puton" when it finds "on" further in the words array. Okay, that worked great, in our objects manager we'll do the correct actions reacting to verb = "puton". But what if the player prefers to use "wear shirt"? It's clear that we have to define "wear" as a synonym of something. "put" is in the dictionary, why not use it? No way, our engine will only react to "puton", so puton must be in the dictionary as well, and "wear" should be synonym of "puton". Note that you can't do this the way around (i.e. "wear" as 1st synonym and "puton" as synonym of "wear"), 'cause once the engine substitutes put for puton (after finding that "on" is in the words array) it won't look for synonyms. So for actions that can be expressed with a phrasal verb, make sure that this phrasal verb plus the preposition is the first synonym, then add the remaining, then add the phrasal verb without preposition with a different ID. With "puton" we have "puton", then "wear" with the same ID, then "put" with a different ID. After all, "put" alone is also used (to "put" something inside a container), so it is in the dictionary anyway.

Once you've finished adding verbs, let's begin adding nouns. Note that if you begin to ID the nouns from 1,000 onwards, you'll be able to add more verbs at a later time. Begin entering the objects first, then the fixed objects. Same with adjectives. You should add every noun and every adjective that you think the player could think on entering. Note that the better response your IF has, the greater it is. IF players love to be responded to almost everything they might enter. That's why betatesting is so important when coding an IF. Let your friends play to it and note all the things they write that don't get a proper reply, just to add them later! :D

-oOo-

I was gonna explain the scripts interpreter for the exceptions now, but I've just noticed that this article is really long and I don't want to take half the e-zine for (it can take as much as this!) me so... See ya in the next chapter!


If you missed them, check out part #1, part #2, part #3 or part #4!
You can contact Na_th_an at this link.


Coding Techniques in FreeBasic: Part 1
Variables and Var Initializers

Written by VonGodric

Hello to you all, it's been awhile since I wrote something for QBE, but here it is now once again. Before I continue I'd like to stress out few points about this small tutorial. First: do not take it all as absolute truth, Second: since FreeBasic is ever-changing then these snippets work with FB 0.13 so older ones may not work. And lastly: if you notice mistakes or misleadings then please do not kill me. And now to the point.

1. Variables and Var Initializers

FreeBasic as we all know is very compatible with several older Microsoft Basic variants. Thus also including a lot of hacks from them and I'd personally advise to avoid them. For one of them is no need for defining variables prior their use. While in a very small programs it may simplify things, then in big programs this can be one major source of bugs due misspelled identifier or just being for example out of bounds of the variable's reach. (like in another sub/function for instance). So the solution is to use OPTION EXPLICIT in your code. This forces the need to declare variable prior it's use thus we never have problems like I described before because compiler will give an error during compile.

Another aspect of defining variables is FB's feature that allows you to declare several variables of the same type. Like this:

DIM AS STRING i, j, k

This way all variables that follow are STRING type. This method can also be used to declare user defined types for example. Rule is:

DIM AS [type] var_1, var_2, ..., var_n

Inside Type fields just don't put DIM Like this:

TYPE test AS INTEGER i, j, k AS STRING m, s, t END TYPE

Another new feature of FreeBasic are var initializers. This allows you to give a variable value when it is declared. But here's small problem. Outside of subs and functions only constant values can be given, but inside function / sub you can assign also non constant value. Also outside of function/sub you cannot assign dynamic length strings

DIM J AS INTEGER = 10 DIM S AS STRING = “non fixed” DIM m AS STRING * 10 => “Fixed”

You might notice that for last example I used => instead of just =. They both are equal, but only time you have to use => is with fixed length strings.

While this is pretty straightforward it is also possible to assign values to created arrays and user defined types.

DIM i(5) AS INTEGER = {1,2,3,4,5}

It is pretty simple just use { and } to group them together. Now multidimensional array.

DIM i(5, 5) AS INTEGER = {{1,12,13,14,15}, _ 'i( 0, x ) {2,22,23,24 }, _ 'i( 1, x ) {3,32,33,34,35}, _ 'i( 2, x ) {4,45 }, _ 'i( 3, x ) {5,52,53,54,55}} 'i( 4, x )

As you see it's just a matter of grouping into { and } inside another group. Also you don't need to specify all variables. And like in FB in general -their value will be 0. And now to last major type of var initializers -user defined types.

TYPE var i AS INTEGER s AS STRING * 11 m(5) AS INTEGER END TYPE DIM i AS var = ( 10, "hello world", {1,2,3,4,5} )

It's just simple as that. Note that user defined types are grouped together with ( and ) while arrays are grouped with { and }. Here's one more example:

TYPE udt1 i(2) AS INTEGER s AS STRING * 5 END TYPE TYPE udt2 k(2) AS STRING * 10 j AS udt1 END TYPE DIM i AS udt2 = ({"k(0)", "k(1)", "k(2)"}, _ 'k(_) ( {1,2,3}, "udt1" )) 'j as udt1

One thing you should keep in mind that var initializers work in the same order as you define elements in user defined type.

This shall now conclude this first part of this small tutorial series I plan to write. If you are interested in some certain subject then please let me know -- and now farewell and thanks for reading it!


Download a copy of this tutorial in RTF format!


THE ART OF DATA VALIDATION

Written by Stéphane Richard (Mystikshadows)

INTRODUCTION:

When you think of data validation, what's the first thing that comes to your mind? Is it, by any chance, to enter numbers when an application is expecting numbers out of you, the user? If so, then you're already well under way to grasping the full understand of just what data validation is all about. In essence data validation is about having valid data for a given type of variable and wether you are creating a business application or a game, good data validation will add a certain level of professionalism to your programming endeavours. There's more to data validation that simply validating the data, alot more as you'll see there is alot of things that can be done to help in the data validation process.

In this document, we will cover all you'll ever need to know about data validation, what it really means, how to use it effectively and ultimately how to minimize the use of data validation while still assuring that the data is indeed valid. So get ready, the journey begins here.

DATA VALIDATION DEFINITIONS AND CONCEPTS:

Data validation, as explained above, is making sure that all data (whether user input variables, read from file or read from a database) are valid for their intended data types and stay valid throughout the application that is driving this data. What this means is data validation, in order to be as successful as it can be, must be implemented at all parts that get the data, processes it and saves or prints the results. Let's take the time and list those parts here and explain why they should be considered.