Game Programmer Seeking Help. 
Author Message
 Game Programmer Seeking Help.

First of all if I violate any major rules for this newgroup.   I am a
newcomer here and did not find any F.A.Q for this Group.  I have for
the past 5 or so months became really interested in programming Rpg
Text games primarily in Qbasic.    They are quite basic (parden the
pun) due to the fact that most were written when I thought Input
Variable$ and print Variable were two of the neatest things in the
world.  * Gasp *

Well I have read a few quality books and looked at some interesting
source code for games.   Yet I am stumped and reflect a common problem
I assume with Intermediate programmers.   I still can not figure out
the details of the Data Command.   I also tried doing graphic work by
hand,  No luck there and am getting tired of about a thousand
pset(x,y),color for a single graphic,   Putting aside graphic work I
am still struggling with how to hold large amount of variables that
are needed in a Rpg I am building.  stuff like hit points, magic
points,spell names,cost, Basic Stuff but I am trying to make it in a
efficiant matter.   Please anybody here who has similer cases and
figured a way to solve it.


messages posted on the usenet.).  Also Advice on how to hold Room data
for a basic map would be appreciated.



Thu, 30 Mar 2000 03:00:00 GMT  
 Game Programmer Seeking Help.

Quote:

> I assume with Intermediate programmers.   I still can not figure out
> the details of the Data Command.   I also tried doing graphic work by

You can store data inside a program or outside of it. If you store it in
another file (you choose an extension like *.dat) you can access it by
opening and getting the data. If you store data inside your program you
place it below an optional marker, like:

 restore myData   ' point to marker (not needed for only one data
construct)
 for i%=1 to 2    ' enter loop to access all the data
   read myWord$   ' get the data stored below
   print myWord$  ' and show it
 next 'i%

 myData:
 Data "Hello","World"

I don't know if that's the correct syntax and all, because I'm out of
practice, but basically that's it.

Quote:
> hand,  No luck there and am getting tired of about a thousand
> pset(x,y),color for a single graphic,   Putting aside graphic work I

You don't need to write graphic coordinates inside the program. You
better store them extern, like in a gif file. Then you can draw with any
program you want, all you need is a QB gif loader.

Quote:
> am still struggling with how to hold large amount of variables that
> are needed in a Rpg I am building.  stuff like hit points, magic
> points,spell names,cost, Basic Stuff but I am trying to make it in a
> efficiant matter.   Please anybody here who has similer cases and
> figured a way to solve it.

Use the type command. This puts together a group of variables:

 type character
   gender as string*1
   called as string*10
   posX   as integer
   posY   as integer
   health as integer
   status as string
 end type

Then declare a variable as the type you declared:

 dim hero as character
 hero.gender ="m"
 hero.called ="Artus"

Quote:
> messages posted on the usenet.).  Also Advice on how to hold Room data
> for a basic map would be appreciated.

You need a two dimensional map, and best make it a byte. But since that
cannot be done directly start with an integer.

dim room(30,30) as integer

'''' open fileName$ for input
for x%=lbound(room,1) to ubound(room,1)    ' will go through whole array
from lower (l) to upper (u)
  for y%=lbound(room,1) to ubound(room,1)
   '''get data you saved somewhere to store into room(x%,y%)
...

That's about it.

--
http://www.geocities.com/SiliconValley/Lakes/7784



Thu, 30 Mar 2000 03:00:00 GMT  
 Game Programmer Seeking Help.



Quote:
> source code for games.   Yet I am stumped and reflect a common problem
> I assume with Intermediate programmers.   I still can not figure out
> the details of the Data Command.   I also tried doing graphic work by

Here's a few suggestions.

1.  Forget about the Data command.  It's an archaic holdover from the
very earliest days of Basic.  Store all your data in disk files.

2.  Use BSave and BLoad to store and retrieve bitmaps.  Use Get and
Put to move them around in memory.  Learn how to use screen pages.

3.  Learn how to use arrays and User-defined Types effectively.  Try
to design your programs along Object-Oriented lines, even though
QB is not an object-oriented language.

Hint:  You can have arrays of User Defined Types:

Type Room
  IDNumber As Long
  LongDescription as String * 255
  ShortDescription as String * 60
  Eastroom As Long    '  pointers to adjoining rooms.  0 if nonexistent.
  Northroom As Long
  Southroom As Long
  Northroom As Long
      etc.
      etc.
End Type

Common Shared aRooms(64) as Room

Get the idea?  My example is by no means meant to be
a representation of the ideal way to structure a room.  It's
just to get you started thinking of possibilities.

John Morrison



Thu, 30 Mar 2000 03:00:00 GMT  
 Game Programmer Seeking Help.

On 12 Oct 1997 15:55:21 GMT, "John D. Morrison"

Quote:

>Here's a few suggestions.

          alternate    

Quote:
>1.  Forget about the Data command.  It's an archaic holdover from the
>very earliest days of Basic.  Store all your data in disk files.

1. Store MOST of your data on disk. Use DATA statements for testing and a few
of those array and variable values that get the program started.

Quote:
>2.  Use BSave and BLoad to store and retrieve bitmaps.  Use Get and
>Put to move them around in memory.  Learn how to use screen pages.

2. There are MUCH more efficient ways to store and retrieve data than BSave
and BLoad by using interrupts. If you're interested, let me know and I'll send
you the/some info.

Quote:
>3.  Learn how to use arrays and User-defined Types effectively.  

I agree.

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian



Fri, 31 Mar 2000 03:00:00 GMT  
 Game Programmer Seeking Help.

Quote:
> I have for
>the past 5 or so months became really interested in programming Rpg
>Text games primarily in Qbasic.

Me too! :) But I started learning QBasic a month ago.

Quote:

>Well I have read a few quality books and looked at some interesting
>source code for games.   Yet I am stumped and reflect a common problem
>I assume with Intermediate programmers.   I still can not figure out
>the details of the Data Command.   I also tried doing graphic work by
>hand,  No luck there and am getting tired of about a thousand
>pset(x,y),color for a single graphic,

I found a tutorial on that at :
 http://www.geocities.com/TimesSquare/Dungeon/8064/index.html

Try this:

DIM arrayname(1 TO 10, 1 TO 10) AS INTEGER    'array name is                  
                                            'obviously what you want it to be
FOR y = 1 TO 10
      FOR x = 1 TO 10
             READ z
              arrayname(x, y) = z
       NEXT x
NEXT y
FOR y = 1 TO 10
       FOR x = 1 TO 10
             PSET(x, y), arrayname(x, y)
        NEXT x
NEXT y
END

DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00

There, now use INSERT to insert the numbers you want for the colors you want.
 To make a tile like grass make it a pattern so you can repeat it. To repeat,
 do this before the END statement:

GET (0, 0)-(9, 9), arrayname     'if 0,0 doesn't word amke it 1, 1 and        
                                                'make 9, 9   10, 10
PUT (0, 20), arrayname              ' mess with this until you've got it      
                                                  'down

Keep in mind, I'm still new to Qbasic myself so not everything might work. If
 anybody has a better way please e-mail me, I really want to learn as much as I
 can about QBasic. :)

BholdR Dragon
--==(UDIC)==--



Sat, 01 Apr 2000 03:00:00 GMT  
 Game Programmer Seeking Help.

Are you crazy?
I fully agree with you, but these tips are for
medium programers, not for a new one...

He didn't asked you to show him you know QuickBasic
very well...



Sat, 01 Apr 2000 03:00:00 GMT  
 Game Programmer Seeking Help.

<SNIP>

  I may have spoken in haste about giving an example of how to read/write data
easier than BSAVE/BLOAD for you QBers. I can't find a small code snippit I
thought I had that makes all this work slick. (Not surprising as WinTrash has
crashed 3 times in the last two weeks:( )  The missing piece of this puzzle
(maybe someone can find it) is how to get DOS's file handle when in QB.

  For those of you using PB v3.x it's duck soup. If you want an .OBJ file that
works with pointers and/or any memory area give me a shout and I'll fire it
across.

Here's 'the rest of the story' for what it's worth.

QB uses REG.? type and INTERRUPTX

The array can be (un)loaded from ANY position within the array for as many
bytes of data you wish. It is NOT necessary to start and end at any particular
element. The only restriction is that Bytes& can NOT exceed 64k in one gulp.

'--------------------------------------------------------------------------
%AX = 1    ' constants for PB
%BX = 1
%CX = 3
%DX = 4
%DS = 9

DIM B%(Whatever%)

OPEN "B", #1, FileName$
  Handle% = FILEATTR(1,2)

  ' load the array as you will from whatever source

  SEEK #1, Whereever&    ' set the file pointer
  IF fWriteBlock%( Handle%, B%(whereever%), Bytes?? ) > 0 THEN ERROR

'--------------------------------------------------------------------------
FUNCTION fWriteBlock( BYVAL Handle AS INTEGER, _
                        SEG Block  AS INTEGER, _
                      BYVAL Bytes  AS WORD     ) LOCAL PUBLIC AS INTEGER

  FUNCTION = fDOSblockRW%( &h4000, Handle%, Block%, Bytes?? )

END FUNCTION

FUNCTION fReadBlock( BYVAL Handle AS INTEGER, _
                       SEG Block  AS INTEGER, _
                     BYVAL Bytes  AS WORD     ) LOCAL PUBLIC AS INTEGER

  FUNCTION = fDOSblockRW%( &h3F00, Handle%, Block%, Bytes?? )

END FUNCTION

FUNCTION fDOSblockRW%( BYVAL Service AS INTEGER, _
                       BYVAL Handle  AS INTEGER, _
                         SEG Block   AS INTEGER, _
                       BYVAL Bytes   AS WORD     ) LOCAL PRIVATE AS INTEGER
  REG %BX, Handle%
  REG %CX, Bytes??
  REG %DX, VARPTR(Block%)
  REG %DS, VARSEG(Block%)
  CALL INTERRUPT &h21

  IF REG(%Flags) = 0 THEN EXIT FUNCTION            ' all went well
  IF ( REG(%AX) AND REG(%CX) ) THEN FUNCTION = 61  ' partial write only

END FUNCTION

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian



Sun, 02 Apr 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. New Game Programmer seeks CivNet-like code---NOW!

2. Experienced Game Programmer Looking for Assistance with 2.5D Game

3. Amateur programmer seeking amateur programmer

4. 3D game/multimedia seeking your help

5. 3D game company is seeking for help.

6. Zelda game programmer needs some help!

7. VB game programmers help

8. Begginer VB4 Programmer seeks help.

9. New VB Programmer seeks help

10. Help: Seek command won't seek

11. Game designed for Programmers

12. Chapter 13 of Visual Basic Game Programmer Tutorial is online

 

 
Powered by phpBB® Forum Software