suggestions for handling combat in a top down RPG

Started by
5 comments, last by graveyard filla 19 years, 12 months ago
high, im working on a top down RPG ( futuristic, urban cyber punk style). anyway, the focus of this game is to make combat FUN. im trying to figure out how i should handle combat. i DEFINETLY want to do real time combat, because its more fun then sitting there and just pushing the same button over and over again. but how do i handle the combat? heres my 2 choices: REAL real time vs ''fake'' real time REAL real time : what i mean by "REAL" rt, is having the player AIM by himself. meaning, there is no auto- aim. the player has to target the enemy himself (like in a FPS, cant think of a 2d example). the way im thinking is, the player would have to line up with the enemy perfectly on the y or x axis for this to work. because doing this, bullets would only be able to go strait at all times. otherwise, how could you aim at an angle? to aim at an angle: ''fake'' real time, of course! the only way to solve this problem, would be 2 ways: the player could press a button, and the enemy would be high-lighted. then, the player pressed another button, and the player would fire at this enemy. the player could press a different button to cycle through which enemy to target. the only other way to do this (that i could think of) would be to have the player target the enemy by mouse input. the player would click on the enemy with the mouse, and he would shoot at that enemy (or? the player just shot in the direction that he clicked? then it wouldnt even have to be enemy specific!) so, does anyone have any suggestions for me? how would you handle combat? thanks for any help also, how would i figure out what angle to shoot the bullet at so that it would hit the mouse curser? im thinking this would be the most fun / closest thing to "real time aiming". what would be the math to figure out the EXACT angle that the mouse is, relative to the player? im trying to figure it out in my head, but i dont know much about math. (never got past basic algebra in highschool and im up to College Algebra in school right now, we just learned what a mathmatical function is and what a quadratic equation is, ETC.) im kind of scared this will take advanced math to do, or maybe just : if(mouse.x > player.x) bullet.x++; else bullet.x--; if(mouse.y > player.y) bullet.y++ else bullet.y-- im thinking maybe this would work, but wouldnt shoot smoothly? maybe it would "jerk" along down its path in a rigidy kind of way because the x and y difference wouldnt be equal each time? thanks again for any help! mouse.x - player.x = x_steps; mouse.y - player.y = y_steps; bullet.x+=x_angle; bullet.y+=y_angle; if(mouse.x - player.x = 4)
FTA, my 2D futuristic action MMORPG
Advertisement
i forgot to post, ''fake'' ''fake'' real time was my other alternative. for this, if an enemy was on the screen, the player could press a button to highlight (target) that enemy. then, he could press another button to fire. in this case, there would be no visiable bullet on the screen. instead, a random chance to hit or miss would go into play. if the ''hit'' went through, the enemy would lose life. if the ''hit'' missed, it would make a missing sound effect or whatever. this is a nice alternative because it requires absolutly NO collision detection !!! collision detection == pain in the ass, so im still considering this. althought it wouldnt be AS fun, anytime you can avoid doing collision detection is really great. what is your opinions on this style of combat?

Donkey Punch Productions.net
FTA, my 2D futuristic action MMORPG
Why would aiming at an angle be a problem? Let the player wander around the field and shoot stuff, as well as dodge attacks. If you want battle scenes with a lot of action, that's the way to go. Add some cool moves to avoid stuff (like sliding out of the way) and stuff like that, and you've got yourself a pretty sweet topdown 2D game.

Edit: If you want to aim with the mouse, read up on line-drawing algorithms and use that to calculate the direction of the bullet. It's something a little like...

X = |PlayerX - MouseX| / Step
Y = |PlayerY - MouseY| / Step

Where "Step" would represent the speed of your bullet. Basically, this gives you the amount by which to increase the bullet's X and Y in order to go from PlayerX/Y to MouseX/Y in Step steps.

[edited by - RuneLancer on April 21, 2004 2:33:51 PM]
If this is an RPG, where does the character''s ability come into play with regards to combat? If you''re basing hits or misses on the player''s ability, you''re almost talking about a 3rd person shooter, not an RPG. I would use what you''re calling ''fake'' ''fake'' real time. Give the entities abilities like marksmanship, dodge, etc and use those abilities to determine hits and misses.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

thank you guys for your suggestions!

yes, this is definetly going to be an RPG. of course there will be a skill system. for this, i would combine ''fake'' real time and ''fake''''fake'' real time.

what i mean is, it would work exactly as i described ''fake'' RT. the player would have to click with the mouse, then the bullet would go where the mouse is. if it hit an enemy, thats where ''f''''f'' RT comes in. if a bullet hit, this wouldnt automatically make the enemy lose health. rather, once the bullet hit, THEN a chance to deal damage would come based on skill. understand? it would look like this:

player clicks on enemy
bullet fires, and hits the enemy
skill check goes into play : players pistol skill vs enemys armor skill (plus randomness).
hit? enemy loses health
miss? no health loss.

go back to step 1

understand? i want to make an RPG, but, it wont be a normal RPG. it will be an action/RPG. i want combat to be FUN. not a big click fest, and not a boring skill vs skill combat, but a combination of both. understand? thanks for anymore suggestions!

FTA, my 2D futuristic action MMORPG
Sounds like your concept would easily become a clickfeast, yeah...

You could try something a little like Parasite Eve. Although the PSX had no mouse (AFAIK), it managed something a little like what you have in mind (I think). You could basically run around while your little "oh cool I can hit stuff now" bar filled up (think turn-based RPGs). During that time, enemies could attack you, so it was a wise idea to run around and keep your distances.

To avoid having the player keep far, far away from the enemies and picking them off one by one with their weapon, a number of systems were introduced. First, you only had limited range with your weapons. On top of that, some weapons had a certain delay before they''d fire. So if you were to use that big-ass rifle, you''d have to get in close and get roughly a full second of peace before firing. Second, you were confined to a given "fight" area, often because you weren''t fighting in a wide-open region (so it''s not as though you were stuck in an area delimited by imaginary walls). So it was impossible to run to a relatively safe distance from the enemy. Finally, you had limited ammo. If you''d run out (not exactly easy to do, though; they kinda botched up on that) you were forced to rely on short-range weapons. Oops.

Targetting was automatic: you pick an enemy and hit the trigger. Wether you hit or miss depends on your stats. As did damage (though it mostly depended on your weapon).

The second Parasite Eve was more of a surival horror/RPG hybrid. The only constraint was firing rate (and range). However, ammo was somewhat more limited, enemies were more agressive to make up for your lack of an OCICHSN bar, and aiming was no longer as automatic as in the first one.

You should look into those. Very cool games and pretty good battle system. Rent them for a weekend or something. They''re both pretty short, too, unfortunatly.
thanks for the advice
i think im going to wind up just doing fake fake real time combat. where there will be no collision detection needed (WHOOOHOOO), and basically isntead of collision detection it will be luck/skill based. maybe ill add in collision for certain things, like bombs and grenades....
FTA, my 2D futuristic action MMORPG

This topic is closed to new replies.

Advertisement