RPG Help - Battle Engine
RPG Help - Battle Engine
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
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
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
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
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
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
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.
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.
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
That game made me trash my TV!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.
"But...It was so beutifully done"
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
I think he was making a point, or it was the best way he could describe it..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.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
dear god, i hope you didn't play sword of mana on your tv... it's a gameboy game!!!Mitth'raw'nuruodo wrote:That game made me trash my TV!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.
I have no sig.
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact: