QB ON ACID
[smalogo.gif]
November 1999
Welcome one and all to the first issue of QB ON ACID. Thank
The_Specialist for our deprav...er, unique name. We are putting
EVERYTHING on this page for this month, so enjoy the download time.
Actually, there's not many images here so...err, I'll stop rambling on
now!
_________________________________________________________________
FIRST ARTICLE:
OBJECT SYSTEMS!
If you are new to RPG's this article is not about how to make a tile
engine so close this damned browser right now. Yeah, you heard me,
this isn't for new people, so close this now. Yup.
The hardest thing that RPG makers face nowadays is the object system.
The object system is everything from a soda can to the guy who sells
magazines behind the counter in the dirty book store (yeah, we all
know you put one in your game, don't be shy ;)). Anyways, I see awful
examples of such an object system every day of my life. I see NPC's
that just sit there...and don't do anything. I see NPC's that are
incapable of nothing more than a random movement and message. I see
objects that are limited to their original script. I see many things
that are horrible and should be eliminated from each and every engine
on this planet.
The first thing that a person should do if they want to make a
complete RPG is make a complete and totally functional object system.
A functional and complete object system will allow NPC's to walk
through doors, activate scripts, be controlled, hold items, talk, and
drop items. Instead of having one character and other "npcs" which are
controlled through some other routine, we should put all of the
objects and the character on the same exact level. Here's an example.
(Psuedo code, do not copy into your program or it will screw up )
SUB UpdateNPCS
FOR uNF=1 to ActiveNPCS
SELECT CASE uNF
CASE CurrentlyControlledCharacter
MoveNPC uNF, Keyboardismovinghorizontal, Keyboardismovingvertical
CASE ELSE
SELECT CASE ObjectData(uNF)
CASE RandomlyMoves
MoveNPC uNF, RandomPlaceX, RandomPlaceY
CASE IsMovingToAPoint
MoveNPC uNF, ObjectPointToMoveTo(uNf,0), ObjectPointToM
oveTo(uNF,1)
CASE IsStandingStill
AnimateNPC uNF
END SELECT
END SELECT
NEXT
END SUB
SUB MoveNPC Number,MoveToX,MoveToY
Test=Map(MoveToX,MoveToY)
select CASE TEST
case Walkable
ObjectLocation(Number,0)=MoveToX:ObjectLocation(number,1)=MoveT
oY
case IsAScriptTile
ActivateScript
END SELECT
END SUB
(End of psuedo code)
With this example (you REALLY need to change it to suit your own
coding style) you can EASILY make moving npcs and npcs that can do
everything from activate scripts to whatever. And, to control a
different object, just change the CurrentlyControlledCharacter
variable. This allows a person to update over 200 npcs in a VERY short
time, causing a very professional look to your object system. Also, in
the SELECT CASE ObjectData(unf) you can make it so that objectdata(5)
(NPC #5) is a value of 3. Let's say that an NPC with the attribute of
3 goes after the player and tries to attack him. All you have to do is
add in code under there and it's nice, neat, and organized and will
work very quickly without sacrificing code speed. Now you can have
differently behaving NPCs in your engine, which will impress your
players =].
Not so hard, eh? I bet you didn't think that a totally efficient and
active object system would be so short. Now that you have this out of
the way, you can add things like an items list for each NPC (watch
your RAM usage!!). Then, you could possibly trade and sell items to
every NPC.
By QbProgger
Back 2 Top
_________________________________________________________________
SECOND ARTICLE:
USING ZSVGA
INTRODUCTION
Zephyr's SVGA Lib is a full-featured lib for QuickBasic with great
SVGA functions. Though it has good capabilities, it isn't well used
much by QB programmers. Sure it's slow and buggy at times, however the
lib has potential. Through a series of articles I'll be explaining how
to use various functions of ZSVGA. In this first article, I'll explain
how to install and use the basic functions of this lib. You can pick
up this lib at:
http://neozones.quickbasic.com/basfiles/svgaqb25.zip
GETTING ZSVGA IN YOUR PROGRAMS
First off, the ZSVGA lib doesn't come in a Quick Library form, so you
have to compile in manually. To compile to a QLB file simply enter:
LINK /QU SVGAQB.LIB, SVGAQB.QLB, NUL, BQLB45.LIB
Then, to start the QB IDE using the library, type QB /L SVGAQB
To use ZSVGA in your programs you must use a specific header. At the
top of all ZSVGA programs enter:
DEFINT A-Z
'$INCLUDE: 'SVGABC.BI'
There ya go, your now ready to use ZSVGA functions in your programs.
START USING SVGA MODES
ZSVGA requires a 386+ CPU, so you may want to use the WHICHCPU
function to check for a 386 or higher. I'm not going to bother going
into that since I doubt you'd try to run your prog on less than a 386.
=] Now, before you can use any SVGA functions you must first call the
WHICHVGA function. This will detect and ready your video card. For
example:
IF WHICHVGA THEN
PRINT "SVGA Video Card Detected!"
ELSE
PRINT "SVGA Video Card Not Detected!": END
END IF
Now let's get into hi res modes! Yippee! =]
For most of these articles I will be using 640x480 modes, you should
have at least 1 meg of video ram which can be checked via WHICHMEM. To
enter a video mode simply use:
IF Res640 = 0 THEN PRINT "Could not enter 640x480 mode!": END
PUTTING PIXELS
Now you should be in 640x480 256 colors mode! Yay! Now let's begin
taking advantage of this mode by plotting pixels.
To plot a single pixel you can simply use the DrwPoint function. The
syntax goes like this:
DrwPoint (Mode%, Color%, X%, Y%)
Simple, eh? =]
You may wonder what Mode% is. Well, it's nothing but the pixel write
mode. You don't really have to worry about it at this point (Pardon
the pun), just set it to 1 for now. =] In case your interested the
pixel write modes go like this:
1 = SET
2 = XOR
3 = OR
4 = AND
Now, let's plot da pixels! Here is some example code:
RANDOMIZE TIMER 'Seed the random number generator
FOR i = 1 TO 250 'Begin our FOR loop
x = INT(RND * 639) + 1 'Randomize the x axis position
y = INT(RND * 479) + 1 'Randomize the y axis position
c = INT(RND * 255) + 1 'Randomize the pixel color
DrwPoint 1, c, x, y 'Plot the pixel!
NEXT i 'End our loop
PUTTING LINES
That should plot some wonderful pixels on the screen. Yummy =] Now
let's elevate the next level, into...LINES! To plot lines onto the
video page simply use the DrwLine function (Duh =p). Its syntax goes
like this:
DrwLine (Mode%, Color%, X1%, Y1%, X2%, Y2%)
Like, the point function this is pretty much self-explanatory. Like
the DrwPoint function, set Mode% to 1 for now. Here's some more
example code:
RANDOMIZE TIMER 'Seed the random number generator
FOR i = 1 TO 100 'Begin our FOR loop
x1 = INT(RND * 639) + 1 '\
y1 = INT(RND * 479) + 1 '|Randomize all the points!
x2 = INT(RND * 639) + 1 '|
y2 = INT(RND * 479) + 1 '/
c = INT(RND * 255) + 1 'Randomize the color
DrwLine 1, c, x1, y1, x2, y2
NEXT i 'End our loop
CLOSING
When you're finished with SVGA be sure to use ResText before ending
your program. Like this:
Null = ResText
That's it for this article of ZSVGA. It's short, due to time
constraints, but the next one should be bigger. In the next article
I'll explain more graphic functions including using page flipping for
smooth animation. Until then, be sure to explore SVGABC25.TXT to learn
about other functions. Signing off...
CONTACTING ME
Here's some ways to annoy me:
ICQ: 18050607
Email: DigitalDude@BizzareCreations.com
IM: BBTMG512
You can usually find me on IRC in #quickbasic, on Efnet. I use the
nick DigitlDud.
By Digital Dude
Back 2 Top
_________________________________________________________________
THIRD ARTICLE:
THE GREAT LIBRARY WAR
Okay people, this has got to be the most hilarious argument since the
argument about how good DarkAges I was. The question should not be
about if libraries are good or not, it should be about how does a
library help the programmer.
You will hear time and time again how libraries encourage laziness,
they're not "real" programming because you're using somebody else's
code, so on and so forth. From the other side of the argument comes
the people who claim that the use of libraries have made them much
better programmers. Let's look at both sides of the argument.
Let's be honest: if you use a library, that is code you didn't write.
Accept it. However, you also did not write the code behind SCREEN 13,
PRINT, and the legions of other QB commands that exist. There are a
ton of arguments from there..."Libraries are not true QB code because
they didn't come with QB", "You gotta write yer own code!", and my
personal favorite "Libraries in QB are written by amateurs, real
programmers use pro libs". Don't make me laugh people. These same
people will write a Windows-based program, or a DOS program in C++.
How many libraries do each of these require? Have any of these people
actually looked into what really goes into a Windows program for
example? How many DLLs and components from things like DirectX go into
these applications? "But, those are professional libraries!" Who
cares, it's CODE YOU DIDN'T WRITE! I don't care if they were written
by Bill Gates himself, it is still code you didn't write...yet not
only do you use it, but you shun QB coders who use libraries like
Dash. Does the word "hypocrisy" ring a bell at this point? QB
libraries have, without a fraction of a doubt, raised the standards of
QB programs over the last two years, and this will continue to
persist.
Now...on the other hand, we have legions upon legions of "newbies"
entering the QB world, each with no experience and no common sense.
They see a library advertised on a webboard or website and think "Wow!
All my troubles are already fixed!!". These kids don't even know how
to use PRINT yet, and they can rattle off every known function in
DirectQB for example. These people anger me more than the hypocrites
who oppose libraries. I get so many emails and ICQ messages from these
people, begging for help because they can't figure out why the newest
library function doesn't work, when all it usually is is that they
forgot a simple little thing they needed to do in QB code to solve it.
For example, it usually helps to set the screen mode before using
GSsprite. This is a concept these people don't understand. They figure
"Hey! The library is supposed to do that kind of work for me!! I don't
understand!". Hence the reason libraries are dangerous to the newbie.
They have not yet grasped the functionality of the language and yet
they try to wield such power. And in almost every case, this will
backfire on them, driving home even further the arguments that
libraries are bad.
The key point to this is this: Libraries are a powerful tool that in
the right hands, can have great use, but in the wrong hands, can be
painfully destructive. These arguments will persist, and there will
never be a victor. Period. So, whichever side you're on, you're just
going to have to deal with that truth.
By Nekrophidius
Back 2 Top
_________________________________________________________________
GAME REVIEW:
HACKMAN III
Hack-Man III Screenshot
Do you miss the old Pac-Man games? Do you wish there would be a sort
of a "resurrection"? Well, look no further, here he is! Hack-Man is a
very unique series of Pac-Man spinoffs, with 3 being the most recent
(and best). Here's a rundown on all it has to offer the player:
-Interesting graphics
-Challenging gameplay
-Good sounds
-High replay value
What is it missing?
-Background music
-Better character control
-More useful options (like, turning off the sound!)
Hack-Man 3 overall is a very good game, from a player's perspective.
From a programmer's perspective, there is room for improvement, mainly
in the speed department. I have seen a review of this game on a
website, and all throughout the review the guy made references to
Wetspot II, why I don't have any idea, but he obviously had a certain
person stuck waaay too far up his @$$.
The skinny: Download this game if you enjoy a "rebirth" of sorts, or
are looking for something to kill some time with. It is fun to play,
and that's what we play games for in the first place.
You can pick up the Hack-Man series at WidomDude's Domain
Review by Nekrophidius
Back 2 Top
_________________________________________________________________
THE GALLERY:
KALDERAN
Submitted by DigitalDude. This is a picture of the inside of a castle
it appears. For those who don't know, Kalderan is an SVGA RPG being
written by a team of members known collectively as Bizzare Creations.
Kalderan screenshot
This pic is unique, It is very rare to have games in QB with
weather-effects, it's raining!
Kalderan screenshot 2
Back 2 Top
_________________________________________________________________
QUOTE OF THE MONTH:
TEJ
Said on EfNet channel #quickbasic on November 10th, 1999:
"Look, I am not, under any circumstance, goin to write my own rotation
sub"
Basically what this person is saying is that they would rather rely on
the work of others, rather than their own. They would do well working
for Microsoft.
Back 2 Top
_________________________________________________________________
SHORTEST REVIEW IN THE HISTORY OF QB:
XLATB'S REVIEW OF CODEVIEW
And I quote:
it_sucks_my_wang!
Back 2 Top
_________________________________________________________________
RECOMMENDED VIEWING:
RECOMMENDED SITES
WOTSIT.ORG
File formats and more.
PROGRAMMER'S HEAVEN
TONS of example code in all languages, a great source of information.
QUICKBASIC RPGS
Follow the latest news on the QBRPG scene. Almost 100 RPGs available
for download, all done in QB.
THE ALL BASIC CODE ARCHIVES
If it's BASIC, they got it. Thousands of downloads for all kinds of
BASIC.
Back 2 Top
_________________________________________________________________
NEAT CODE EXAMPLE:
PASCO'S GRASS
This is an interesting animated grass routine written in about 1K of
pure QB code.
DEFINT A-Z
TYPE grasspoint
x AS INTEGER
y AS INTEGER
angle AS INTEGER
END TYPE
RANDOMIZE TIMER
ngrass = 1000
DIM SHARED grass(ngrass) AS grasspoint
DIM SHARED presin(360) AS INTEGER
FOR lp = 0 TO ngrass
grass(lp).x = RND * 320
grass(lp).y = RND * 200
grass(lp).angle = (grass(lp).x MOD 360) + RND * 30 - ((200 - grass(lp).y) ^
.5) * 10
NEXT
FOR lp = 0 TO 360
presin(lp) = SIN(lp * 3.14159 / 180) * 128
NEXT
SCREEN 7
PALETTE 0, 4
OUT &H3C8, 4
OUT &H3C9, 0
OUT &H3C9, 23
OUT &H3C9, 0
PALETTE 1, 1
OUT &H3C8, 1
OUT &H3C9, 0
OUT &H3C9, 16
OUT &H3C9, 0
DO
SCREEN 7, , d, (d + 2) MOD 4
CLS
d = (d + 1) MOD 4
FOR lp = 0 TO ngrass
grass(lp).angle = (grass(lp).angle + 350) MOD 360
LINE (grass(lp).x, grass(lp).y)-(grass(lp).x + ABS(presin(grass(lp).angle))
\ 60 + 1, grass(lp).y + 1 + ABS(presin(grass(lp).angle)) \ 60), 1
NEXT
FOR lp = 0 TO ngrass
LINE (grass(lp).x, grass(lp).y)-(grass(lp).x + ABS(presin(grass(lp).angle))
\ 60, grass(lp).y - 2 + ABS(presin(grass(lp).angle)) \ 100), 2
NEXT
LOOP UNTIL INKEY$ <> ""
By Pasco
Back 2 Top
_________________________________________________________________
THE END
So, there ya have it folks...the very first issue of QB ON ACID comes
to a close. Feel free to send us email with your thoughts, comments,
questions, suggestions, viruses, you name it. We print what we receive
so feel free to give us a piece of your mind =)
Thanks for reading, and prepare for the next issue, out November 24th!
Send us Email