RPG Help - Battle Engine

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply

Best battle engine technique?

Pokemon Style: Random Enemy Generation
1
25%
Zelda Style: Visible enemies with predetermined movement
3
75%
 
Total votes: 4

Anonymous

RPG Help - Battle Engine

Post by Anonymous »

Okay, I'm writing an RPG. I have a simple tile engine I wrote myself. The tiles are 15x13, and the tiles are based upon an 20x20 screen map. There is no scrolling other than screen-by-screen. All graphics are in data statements because I can't seem to get BSAVE to work correctly with all this. So currently, the game appears to have a high memory usage...but I'll figure it all out soon enough.

Anyways, my question: how would I go about implementing a battle engine? Currently, after all the tiles/bitmaps are drawn to the screen and the world is loaded, a loop begins checking for keystrokes for movement. So far, what comes to mind is a SUB/GOSUB at the start of the loop.
Pseudocode:

LOOP
gosub checkstatus

[movement stuff]

END LOOP

checkstatus:
check health
if 0 then reset to starting screen
else check for enemy encounter

CONFUSION STARTS HERE
return

So, does that seem correct so far? I'm not sure how to check for enemy encounters. I have two ideas....something like Pokemon Red where enemies randomly appear, or something like Zelda: Link's Awakening where the enemies are apparent on the screen. Doing something like Zelda seems more difficult because I'd have to draw each monster, determine preset paths, and check coordinates for encounters....correct?

Okay, so yea...suggestions/comments are appreciated. Also, will someone point me to what they think is one of the best graphics tutorials? I want to have tiles that look a little better, have them animated, and have those half-tiles that can be half-grass and half-dirt and such...i believe it had something to do with the pages.

A_T
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

Hi Axessterminated,

So far I would say you're on the right track (maybe turn the gosub into independant subs would be better) However that structure would be acceptable.

For a battle engine, take a look here http://www.petesqbsite.com/sections/tut ... GameDesign

There's alot of material there that might help you.

hope this helps
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Mystic seems to have help with the prob, but you question,.. hmm, I like both styles, Pokemon style is fun if your catching random monsters, but if you have a zelda style RPG, then zelda style... really depends on what you want to come up with.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

I like random enemies you can see with set paths! :D

It keeps the game fresh...but...also makes it so you don't get stabbed in the back either. :wink:
"But...It was so beutifully done"
User avatar
lurah-
Veteran
Posts: 206
Joined: Mon Nov 01, 2004 10:47 am
Location: Finland
Contact:

Post by lurah- »

Well, about those two choises i dont wana take either :lol:
Anyway, as Mystik told, youre in right way.

But ill give my vote for zelda... :wink:
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

axessterminared's sig wrote:Geek isn't just a four letter word, it's a six-figure income.
:lol: So true, altho I heard that 1 b4, its still a good saying, heh heh heh!!! :lol:

I'm still mixxed on the idea, Mitth's got it, do both!! 8)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Rattrapmax6 wrote:
axessterminared's sig wrote:Geek isn't just a four letter word, it's a six-figure income.
:lol: So true, altho I heard that 1 b4, its still a good saying, heh heh heh!!! :lol:

I'm still mixxed on the idea, Mitth's got it, do both!! 8)
Ya, on both points! :D
"But...It was so beutifully done"
barok
Coder
Posts: 38
Joined: Sat Jul 24, 2004 4:32 pm
Location: Frozen bushlands of Saskatchewan

Post by barok »

there are much more styles than that... for example, chrono trigger uses a very good technique where there are enemies in certain places with predetermined movement. However, you don't get in a battle with any of the enemies unless you touch them. Then you get in a battle... on the main screen.

Sword of Mana has random enemies. When you step into an area, enemies would pop up randomly. When you finished off all the monsters, a few seconds later more random monsters would pop up. Of course, they were predetermined places so they wouldn't get stuck in walls or such, but it's RANDOMLY predetermined. ;)

Also, random battles aren't "pokemon style." 10 - 1 it wasn't pioneered by these games, but they are most common and well known in final fantasy and dragon warrior. What game pioneered this accursed and overused style though, I don't know.
I have no sig.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

barok wrote:Sword of Mana has random enemies. When you step into an area, enemies would pop up randomly. When you finished off all the monsters, a few seconds later more random monsters would pop up. Of course, they were predetermined places so they wouldn't get stuck in walls or such, but it's RANDOMLY predetermined.
:shock: That game made me trash my TV!
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

barok wrote:Also, random battles aren't "pokemon style." 10 - 1 it wasn't pioneered by these games, but they are most common and well known in final fantasy and dragon warrior. What game pioneered this accursed and overused style though, I don't know.
I think he was making a point, or it was the best way he could describe it.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
barok
Coder
Posts: 38
Joined: Sat Jul 24, 2004 4:32 pm
Location: Frozen bushlands of Saskatchewan

Post by barok »

Mitth'raw'nuruodo wrote:
barok wrote:Sword of Mana has random enemies. When you step into an area, enemies would pop up randomly. When you finished off all the monsters, a few seconds later more random monsters would pop up. Of course, they were predetermined places so they wouldn't get stuck in walls or such, but it's RANDOMLY predetermined.
:shock: That game made me trash my TV!
dear god, i hope you didn't play sword of mana on your tv... it's a gameboy game!!!
I have no sig.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Gameboy through Gamecube dude, through Gamecube... :D
Logic wrote: Game for GameBoy --> GameBoy --> Linky --> GameCube --> TV
:P
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:?: In what way did the game trash you TV,. you hooked it thru the G^3.. :?: :roll: :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Post Reply