Another RPG for Gamers

01-03-2002, 01:28 PM
Well, my old game seems to have dissapeared in this new format of the website, so I am reposting my RPG which dissapeared a little while ago. It's great for source code for anyone stuck in making their RPG's, or if they need Graphics, (so long as I'm in the Special Thanx Section (lol)), anyway, the game isn't done, the battle doesn't really work, but you can see how it's mostly going to work, because your Character breathes at the Ready. It's a one player game, and this could be used as a demo, and will be a Multidisk (floppy disk, or on one ZIP disk, I'm not sure), and different characters will have their own disks, and meet at the end or something (not sure, but I'm going on a Tangent). Anyway, I'm also not good with the Mask method, and need help on it, so please download this game, and tell me what you think of it, and possibly help with Mask, thanks.

01-03-2002, 05:11 PM
According to the Webmaster, the old attachments are still there but were not imported into into the new forum correctly. I think he is going to try to import them.

01-03-2002, 07:29 PM
Actually, he had posted his game only a few days ago, but the data in this forum is older than that (almost a week), so that's why it wasn't transfered. I think Bob said the data was all lost, but Brad may have a way to salvage it... we'll wait and see.

01-04-2002, 03:09 AM
not bad rpg
but a little old style

01-05-2002, 08:36 PM
it's nice. a little weird how the screen is so small, but that might be cause my resolution's up so high. hmm i'll look at the code later, if the input mechanism is how i suspect, you might want to do something about the sensitivity of the keyboard, but like i said, i'll have to get back to you.

01-06-2002, 08:05 AM
i think you did it that way. you know the short pause after taking the first step when walking? that's because it's treating it as though you're typing, and the repeat hasn't kicked in yet. try this: in the keydown, check which key is down, then set a flag, or better yet, do it in an array, then you don't need a conditional check. on keyup, set the flag (boolean) to false. then have a timer set to a quick interval. have it check the flags and move you coorosponding to them. also, i think it might not be freeing up all the resourses when it finnishes. well i'm just trying to help so sorry if i sound like i'm complaining.

01-08-2002, 08:17 AM
Well, the reason that it was so small is because on my OLD computer, it didn't run so well, but now on my new computer, I could have a very large screen, I'm thinking of updating it. And the tiles are only 18 X 18 pixels. So it should be small.

01-08-2002, 04:19 PM
alwayz making excuses about size. well sounds like you didn't upgrade a minute too soon! maybe you should make the rest of the game fit the new screen. nice art btw.

01-12-2002, 06:49 PM
Is there an API or something that I can use for playing Midi's without using Direct X? I'm a bit hesitant on using it, because if there is a good API for using it, that makes the game more universal. I heard of a way of using Window's Media Player, but I don't know how to use it, can anybody help me?

01-13-2002, 11:42 AM
Yes there is, using the MCI interface. Click here (MCI Command Post) ( for more info.


01-28-2002, 02:22 PM
I haven't had too much luck with that MCI interface, and was wondering if anyone knew about a good Sound API that I could use that can play Midi's. If anyone knows of a Simple API where I could play Midis when needed, it would be appreciated, thanx

01-31-2002, 03:55 PM
um the windows media player thing you were talking about there is a button to make a windows media thing on your form like a cmdbutton that goes on the toolbar but and i know how to make that play but not all that great but someone else might be able to help there because i made a mp3 player and i used the windows media player thing and it works but i had to select the song every time but there is probably a way to make it play

02-01-2002, 08:36 PM
What do you mean, you had trouble with MCI? What was the problem? What have you tried? Show us the code and we might be able to fix it.

02-04-2002, 03:55 PM
Yeah, I wasn't specific enough, so I'll tell you what my problem is/was...

Okay, I look at example programs to see how these things work, it's how I learn things...

I couldn't find any samples on the internet, but I found one today...

I've declared it, and it runs without an error, so I don't think the declaring part is the problem. However, when I run the game, there is no sound at all, I have posted my code below

Midi = mciSendString("Open " & App.Path & "\" & Game.Location & ".mid type sequencer alias Music", 0&, 0, 0)
Midi = mciSendString("Play Music", 0&, 0, 0)

*Note that the tidbit of code above is in the formload, because I had expected it to load when the Map booted up. I haven't posted any kind of components with this game, so I am not sure if I need something else besides declaring this to run. If anyone can help me, or guide me in the right direction, it would be greatly appreciated.

02-04-2002, 07:11 PM
Well, I figured out that it was a simple bug in my programming, and that my path can't contain a space (like a person on another post said, BTW, if anyone knows how to get around that, I would like to know how)

But I was wondering, with MCI, is it possible to loop music? I have battle / world music, and it would not be to appealing if the music stops, would it?

Oh well, if anyone knows how to loop music, please tell me.

02-05-2002, 07:13 AM
I'm not too familiar with the MCI control, but I do know that the Windows Media Player supports MIDI file looping. You should be able to find a "loop forever" checkbox under the Media Player's custom properties box. This should loop properly designed MIDI files. Some files aren't meant to be looped (especially ones with fade outs). And with filenames, it seems to work when you put in the MS-DOS filenames like "" with the ~1.

Whew... I hope this is helpful. (Big reply :) )

02-08-2002, 12:39 PM
Since I'm programming an RPG, and trying my hardest to make the quality as high as possible, during my battles, I intend on having a few things moving at once:

The Hero Breathing
The Enemy Breathing or Sometype of moving
(Possibly the clouds in the background scrolling along)

Since this could cause some lag on some slower machines (possibly), I saw that people use what's called "Mainloop", and put the whole do events in there.

Is Mainloop just a universal thing in programming, like the prefixes for objects? Or is it something that you need to declare when using the DoEvents call?

And if I use the DoEvents call, could I say something like:

Do While Enemy.Life > 0
Do Events

(Other Code...)

Well, I think I have asked a few questions which will help me in the next few stages of making my game, so there is my two cents, thanks for reading,

02-08-2002, 01:40 PM
MainLoop is not a Visual Basic keyword, it's just a commonly used name for the Main Game Loop in a game program.

The DoEvents call is a Visual Basic keyword, and it can be used anywhere in your project code. All it does is give control back to the Windows operating system for a cycle, to allow it to take care of things like minimizing a window, switching applications, hitting the Start Menu, etc. Without the DoEvents call, your game would essentially 'Take Over' all operations of the machine until the program was terminated.

Your Main Game Loop could include code such as the following:

While Enemy.Life > 0
(insert drawing, movement, and game logic calls here)

02-14-2002, 02:44 PM
Okay, It's been a long time, and I've been working on a lot of this, so here is a major updated version.

You still can't fight (in theory), but now you can check out the tech move, which I've been working on for the past couple of days, and I have a save with a maxed out character.

Even though a damage label appears, you don't damage the enemy, so you could do the tech all day long, without him fighting back. When you fight, the Ninja tileset needs to be fixed, and I've added some more World Map, but it doesn't amount to much, since it needs a little better designing, but oh well, it's just a game.

So Please Download it if you haven't before, or if you have eariler, and please tell me what you think.


02-14-2002, 03:43 PM
Nice job on the tech move. Too bad it runs so fast on my machine that I can hardly tell what's going on. It looks like he's rolling into the enemy and striking with his sword, but I can't tell for sure.

02-14-2002, 03:58 PM
Thanks for the reply, Teric, I know it does run kinda fast, I have a really fast machine too, but yeah, that's pretty much what he's doing, kind of rolling / flipping at the enemy, and is flipping his sword around too. (weird to think about, but the picture is on the Battle Form, and it makes sense)

There is one little thing also that I didn't fix, when you use a Tonic, Ether, (and I haven't finished full cure), the color of the font is green, and when it's done, it's supposed to go back to white, a couple of lines will fix it, but I won't have a chance to work on the game for a little while.

Thanks for the reply, and am looking to update the game much more in the near future, and hope to have more people evaluate the game.


02-15-2002, 04:16 PM
For my ATB bar in this game, I use a picture box, and use this equation in a timer to make it fill...

Private Sub TmrBar_Timer()
PicBar.Line (Bar, 0)-(Bar, 309), RGB(255, 255, 255)
Bar = Bar + 15

Bar is a variable that I use to set / return the value of where the ATB is (in twips), and I tell the computer that if Bar is greater than the width of the picture box, then make the options visible.

Now this all works out perfectly fine, with the exception of one little problem. When you open another window over this, or minimize the game, the bar get's empty, or has blank areas. Is there a way to make that go away?

If you don't get what I'm asking, because it's probably not that clear, just download my game, and while the bar is filling, minimize the game, and you will see what I mean.

If anybody can help me, please do,

02-18-2002, 07:53 AM
Is the AutoRedraw on PicBar set to true?

02-18-2002, 07:24 PM
Hey Teric, that worked out, thanks, I didn't know that AutoReDraw would do the trick.

03-06-2002, 03:44 PM
Okay, well, I figured that since Teric's game is on hold for the moment :( I figured that since I've been active on my game for a little while, I'd post it up, so gamers wouldn't get bored from lack of RPG's or anything ;) , even though side scrollers have been popular, but I feel an RPG is needed in the section, so here is an updated version...

New updates...

1. The battle is almost complete...There is a bug with the enemy breathing, but it's nothing big at the moment, and he doesn't do anything, so when playing, take your anger out on him, lol...

2. You can't use the FIGHT option in the battle, but the tech works, and it displays damage, however, I didn't make them sprites, so it looks a bit weird when your character hits him, and the damage doesn't register, it just displays it.

3. You start the game very weak in the continue option, and you can use any item in the battle, or outside of the fight, if you want animation, do it in the fight.

4. IT'S MORE FUN!!! YAY!!!

Well, there's my 2 cents

03-16-2002, 03:34 PM
This game is really impressive! I'm actually working on an RPG and I really like your map system. For my game I've been using long arrays to define my tiles and making a formula to assign every space a value.

However, I am really curious into your row/column reference idea. This is something I have long wanted to do but I can't figure it out. Do you think you could give me the rundown on how you accomplished this? I really want to be able to reference my tiles by their row and column values. Thanks

03-16-2002, 04:14 PM
Computer_Guy, isn't it hard to code without any indents?

Just a thought.

03-16-2002, 04:45 PM
Well, maybe indenting is good for *MOST* people, and it does give the code a professional look, and I should have done that, but I don't do it. It's easy for me, and I don't enjoy indenting, because it takes forever to set up a simple system. Sometimes I have to work out a minor error with something, like too many Select Case statements or something, but yeah, I'm going to recopy my game, and repost rundowns for the people using this game for source code. The changing of town to worldmap is very complicated to think about, however. But I'll explain a basic algorithm now. BTW, if you can't understand, that means that people can't steal my code, lol

Okay, with the maps:

When you start the game, or whatever, I have two variables, Start1 and Start2. Both of these are numbers, which are loaded in from a notepad. Once the map is loaded, it says to start you at those coordinates. Then, in the keydown event, I enable the timer, and tell the computer what the Direction variable is. After that, in the timer, I make it so that the directions will add or subtract a row, or a column if the character moves left/right. Then I make the computer use BitBlt, and make it display the centerpoint, 5 rows up, 5 rows down, 5 cols left, and 5 cols right.

The only problem with this system is that you could go into the negative Rows/Columns, or go over the max rows and columns, so what you must do is in the notepad, make 5 rows at the top unwalkable, 5 rows at the bottom unwalkable, 5 rows to the left unwalkable, and 5 rows to the right unwalkable.

If you have any other questions, I'll gladly explain some more logic.

03-16-2002, 05:26 PM
Yeah. That's a good overall explaination, but I'm more curious into the coding. How exactly are you using those variables (start1 and start2) to reference a point on the map. In other words, how does the program know what to display at point (5,2). I understand the idea of loading from a text file as I already do this.

The main difference in your program is your use of World(R,C). This is the part I can't figure out.

If your still confused to what my question is let me try to explain it a different way. In my program I have a screen that displays a 10 by 10 tileset.

Then I have arrays, each containing 100 values. Each value corresponds to a specific tile to place. If the array has a 1, then grass tile is displayed, a 2 displays water, etc....

The main problem is my arrays are linear. That is, I can refer to a tile on the screen as the tile in row 4, column 3. Instead I had to make a mathematical formula relating the array index to the x and y coordinates where I wanted to place the tile on the screen.

I would be much easier if I could do what you did and have the program understand a row/column reference system that your program uses.

If your still confused let me know. I just really want to know how you did this.


03-16-2002, 06:45 PM
Okay, I'm assuming you mean the DrawMap sub. I'll do this, and explain everything:

Dim R%, C%, X1%, X2%, Y1%, Y2%, Index As Byte,CharNdx% 'Creates the variables, R and C being the tile coordinates in the loop

Y1 = 0
For R = Row - 5 To Row + 5
X1 = 0
For C = Col - 5 To Col + 5
'These 4 lines just start the loop, and X1 and Y1 are where we are going to BitBlt to on the screen (PicScreen).

Index = World(R, C) 'During the loop, this adds to find what coordinate we are looking for in the 2-d array of indexes that make up the World/Town.

X2 = (Index Mod 4) * 18
Y2 = (Index \ 4) * 18
'These two take the index number (ie. 0 = Grass), and finds what tile coresponds with the chipset, since the chipsets are 4X4 tiles, making 16 tiles in all. They are multiplied by 18, because the tiles are 18 pixels each, and so multiplying in the number by the pixels gives you the edge of the tile you desire.

BitBlt PicScreen.hdc, X1, Y1, 18, 18, PicTile.hdc, X2, Y2, vbSrcCopy
'This BitBlts the tile to the screen, after finding the coordinates and everything else required.

X1 = X1 + 18
Next C
Y1 = Y1 + 18
Next R
'This part adds 18 pixels, so that you are at the next edge to BitBlt the next tile onto your map.

I hope I have answered more questions

03-16-2002, 08:25 PM

Computer guy, are you going for the 'world widest forum reply' contest!

When you use code, it's doesn't autowrap, so if you going to write a paragraph of text and put code tags around it, it's makes the reply very very wide....

Just a thought. :D

03-16-2002, 09:29 PM
Okay. I think I understand everything but I have one more question. Could you please explain the OpenMap() sub like you did the DrawMap().

Thank you so much for your help.

03-16-2002, 11:33 PM
All right, I didn't know that underneat Code tags that it didn't automatically create a new line, I'll have to remember that one.
But anyway, here's the OpenMap(), and if anyone has wording that I might be incorrect, please say so...but here it is:

Private Sub OpenMap()
Dim FileNum%, I%
'This declares two variables necessary for opening notepads.

Dim R%, C%
These two variables give coordinates to write indexes of the map
during the loop.

FileNum = FreeFile
'This number assigns the next available number, making the
Filenum ready to use to open another file.

Open App.Path & "\" & Screen & ".txt" For Input As FileNum
'App.Path is the path of the application, so this path isn't hard
coded, hence it can be opened from almost any drive or folder.

Input #FileNum, MaxRow, MaxCol, MaxWalk, Game.Location, Start1, Start2, Tower, City, WI
'After opening the file, there are numbers along the tops of the
notepads. VB will take those numbers, and assign it to that order
of Variables listed. Remember to have the # in front of FileNum.

ReDim World(MaxRow - 1, MaxCol - 1)
'After getting the coordinates from the notepad, we tell the
computer how large the map is, to prevent any errors.

For R = 0 To MaxRow - 1
For C = 0 To MaxCol - 1
'This initializes the loop

Input #FileNum, I
'Now after this file has been opened, it gets a line down after
inputting the variables in, so now we're in the grid for the World.

World(R, C) = I
Using the coordinates, I = the index from the Notepad, and puts
it in the Matrix.

Next C
Next R
'Ends the loop

Close FileNum
'Closes the file, remember to close all files.

If Game.Location = "World" Then
Fight = Random(50, 70)
FrmStatus.LblSave.Visible = True
ElseIf Game.Location = "Tower Then
Fight = Random(50, 70)
FrmStatus.LblSave.Visible = False
FrmStatus.LblSave.Visible = False
End If
'That whole chunk of code is for my game, obviously. What it does
is, I have a string variable called Game.Location, and it tells you
where you are on the map, since you can only save the game on
the World Map, not in a town, or the Tower, which is yet to be put

PicTile.Picture = LoadPicture(App.Path & "\" & Screen & ".gif")
End Sub

Well, I hope I cleared more things up for you.
Good night

03-17-2002, 02:23 PM
Hey Thanks Computer_Guy.

I got it to work. This makes the tile system much easier! Thanks for your patience and for being so thorough with your explainations. =)

03-17-2002, 03:02 PM
It wasn't a Problem, or anything like that. I'm glad you got your tile system working. I posted this game/code so that at least ONE person could learn from it, and you did, so I've fulfilled my goal, but I'm always willing that make that number Two or Three, lol

03-17-2002, 03:10 PM
Speaking of TWO, what happened to the two cents in every post?:)

03-17-2002, 03:41 PM
There's 4 cents, but I'm glad that this post is active again, and I have to change my lines, except my signature, and avatar, every now and then.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum