RPG Battle Action

Thread Solved

Join Date: Oct 2006
Posts: 128
Reputation: LaMouche is on a distinguished road 
Solved Threads: 19
LaMouche's Avatar
LaMouche LaMouche is offline Offline
Junior Poster

RPG Battle Action

 
0
  #1
Oct 30th, 2006
This is a split from another thread. I'm trying to think of a good way to simulate action other than just a hit/miss list. I want more complicated results andalso so that the character doesn't always die...

Hmmm... okay.

So I think I would do it like this:

my_str = weapon # fists default!
my_life = 10
weapon = fists
fists = 1
dagger = 2
short_sword = 3
broad_sword = 5

So when the character picks up a new weapon, you change the self.weapon variable... this could apply to armor, too.

What about hit/miss system?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,947
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 914
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: RPG Battle Action

 
0
  #2
Oct 30th, 2006
Sorry LaMouche, I think we were thinking the same thing at the same moment.
Take a look at http://www.daniweb.com/techtalkforums/thread59965.html

I was thinking of changing the hitlist itself depending on weapon, armor or monster.
Last edited by vegaseat; Oct 30th, 2006 at 11:15 pm.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 71
Reputation: mruane is an unknown quantity at this point 
Solved Threads: 1
mruane mruane is offline Offline
Junior Poster in Training

Re: RPG Battle Action

 
0
  #3
Oct 31st, 2006
I like vegaseats Idea for the list usage, but maybe it could be altered alittle bit, say

my_str = weapon # fists default!
my_life = 10
weapon = fists
fists = 1
dagger = 2
short_sword = 3
broad_sword = 5

def battle():
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 149
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: RPG Battle Action

 
0
  #4
Jan 7th, 2008
Since this is a discussion about the battle system in an RPG, I would like to touch on the turn base aspect of it. LaMouche asked about it in the thread from Vegaseat here http://www.daniweb.com/techtalkforums/thread59965.html.

Here is what I've come up with. In most standard RPGs where there is a battle between the player's team and a few monsters or boss, they each get a turn. Some games allow for a wait or active mode. The wait mode allows each entity in the fight to perform their action before the next one performs theirs. On the other hand you have an active battle system mode which others are performing their actions while you are deciding on what your character is to do. Active mode in my opinion is more fun and more difficult to program. So the question is how do I manage everyone's request during the fight and when they get to perform these actions.

The first thing that jumped in my mind was to create a queue. That way who ever was the fastest could add their action and move on. Just to step aside for a moment and talk about timing in the turn base system. Each entity will have their own statistics that determine how it interacts with its environment. For the turn base system you would use Agility to determine who acts first, second and so on. Sounds like it would work, but only for a basic approach. If you ever played Final Fantasy 7 and executed a limit break you might see where I'm going with this.

In FF7, whenever someone performs a limit break, it seems they skip the others requests to act in the battle and do their thing first. Lets say Tifa was first and has been assigned to attack MonsterA, but Cloud executes his limit break. Then all of a sudden Cloud goes before Tifa. Well a queue can't do this. Its function is First In First Out, so a queue is inadequate for the job. I would like to know what would be better. I've looked at a Deque in C++, but I'm not sure. It does act like a vector in the way you can access values via index and that it could be re-allocated during run-time. However, a vector is contiguous in memory where a deque isn't, so you can't use pointer arithmitics. The reason why I'm not sure about the deque is if you execute something in the middle, can you remove it without causing a gap in the queue?
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 149
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: RPG Battle Action

 
0
  #5
Jan 7th, 2008
I talked with one of our CIS instructors who had no problem answering how to handle higher priority actions in a battle. His solution was to create two queues. The first being the high priority actions and a second for normal actions. Whenever the game loop runs through just query for any actions in the priority queue first and execute them before the normal actions. He also told me that this scenario is only good for one exception, if there were more he recommended using some sort of tree data structure.
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 608
Reputation: jrcagle is on a distinguished road 
Solved Threads: 150
jrcagle jrcagle is offline Offline
Practically a Master Poster

Re: RPG Battle Action

 
0
  #6
Jan 7th, 2008
Let's assume that you're implementing the queue with a simple list.

In the specific case of a limit break, it would be easy to implement without a double queue:

  1. if action == limit_break:
  2. action_queue = [character] + action_queue
  3. else:
  4. action_queue.append(character)

That is, if the character casts the limit break, he jumps to the front of the line.

Jeff
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 149
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: RPG Battle Action

 
0
  #7
Jan 12th, 2008
So is the second line a re-allocation of the queue?
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 22
Reputation: python user is an unknown quantity at this point 
Solved Threads: 0
python user's Avatar
python user python user is offline Offline
Newbie Poster
 
0
  #8
2 Days Ago
Originally Posted by Geek-Master View Post
So is the second line a re-allocation of the queue?
hope u make that battle sys
If at first you don't succeed... run the code again.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC