I wrote a fighting-game move-combo system

Started by
31 comments, last by grasshopa55 19 years, 7 months ago
Quote:Original post by CGameProgrammer
There will indeed be multiple characters, with different moves. One will specialize in fire-based attacks, so he's the one with the fireball. But I did plan on just hard-coding them. Since the attacks themselves need to be hard-coded, and setting the moves and firing the attacks is very simple, there seems little point in moving it out of the code. For coming up with the combos, I don't need to actually test it; I just press keys on the keyboard and see what seems good for an attack.


For a simple game, I see your point, but what if you wanted to do a full blown fighter, Capcom/SNK/Sammy style hard-coding may be much. I know in the old days, they would hard-cord all of that, but now, with total number of playable characters numbering in the 20's, you could image just how immense that is. For my project, I'm looking at about 10 playable characters, so I could hard code the move sets, but, as I mentioned before, I prefer a more modular approach.

Anyway, all opinions aside, your little demo is well done. Good luck.
-----------------------------kevin@mayday-anime.comhttp://www.mayday-anime.com
Advertisement
Well I can always move it out of the code later. Since the code for setting a combo is so simple, it would be really easy reading the parameters from a file:
// in the file:"FIREBALL"{  min 0, max 1: W pressed                D pressed, W released                A pressed, D released                W D pressed, A released}// in the code:MoveCombo[MOVE_FIREBALL] = LoadCombo("FIREBALL");

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
or just make it serialisable with xml.. oh wait.. c++... :D
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Original post by CGameProgrammer
Original post by davepermen
quote]


-

Yeah but i think you should make it more simpler. ALl the combos are nice :P but i would preffer pressin ctrl and shift maybe a space bar 2 jump,, just suggesting stick with the original game controls that are out instores

hope that helps

otherwise good job:) u should complete it 2 make it rich :)
Quote:Original post by Slick-Player
i would preffer pressin ctrl and shift maybe a space bar 2 jump

I'll need more keys than that, but using ctrl, shift, and alt is a good idea because you can have all of them pressed while also having regular keys pressed... you can't reliably use more than 2-3 regular keypresses at the same time, as more won't be detected, but the shift keys are handled differently.

On my keyboard, Ctrl, Z, and Alt can be easily handled from my left hand, and Shift and X can be hit pretty easily too. So I'll use those keys from now on.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Quote:Original post by CGameProgrammer
On my keyboard, Ctrl, Z, and Alt can be easily handled from my left hand, and Shift and X can be hit pretty easily too. So I'll use those keys from now on.


Using the ALT key in a game is just asking for trouble IMNSHO. Unless you dig out some groovy code for disabling certain system keystrokes (which many games I have played have NOT done) the alt key tends to get hit by accident in conjunction with other keys, causing system menus to pop up.

The worst case of this was this one game that used control, alt, AND delete, where you could NOT remap the keys. Sometimes I'd have reason to be pressing all 3... which as you can probably guess had a rather annoying effect.
Quote:Original post by MaulingMonkey
Quote:Original post by CGameProgrammer
On my keyboard, Ctrl, Z, and Alt can be easily handled from my left hand, and Shift and X can be hit pretty easily too. So I'll use those keys from now on.


Using the ALT key in a game is just asking for trouble IMNSHO. Unless you dig out some groovy code for disabling certain system keystrokes (which many games I have played have NOT done) the alt key tends to get hit by accident in conjunction with other keys, causing system menus to pop up.

The worst case of this was this one game that used control, alt, AND delete, where you could NOT remap the keys. Sometimes I'd have reason to be pressing all 3... which as you can probably guess had a rather annoying effect.

Haha. Well the game doesn't use Tab or Escape (except for quitting) and no system command is Alt+[Letter]; that's reserved for applications to use. Usually they use it for their menus, but they don't need to.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Wow your demo looks very cool. I'm working on a beat-em-up game too. So I've been thinking about this sort of thing but I have not tried to implement a combo system yet.

How would you handle combos made up of special moves, where each special move consists of multiple input combinations. Also, what about combos where each move must make contact with an enemy before you can do the next move?


Quote:
Wow your demo looks very cool. I'm working on a beat-em-up game too. So I've been thinking about this sort of thing but I have not tried to implement a combo system yet.

How would you handle combos made up of special moves, where each special move consists of multiple input combinations. Also, what about combos where each move must make contact with an enemy before you can do the next move?


Oops I forgot to include my nick
-OmegaRedIsDMan
Quote:Original post by Anonymous Poster
How would you handle combos made up of special moves, where each special move consists of multiple input combinations.

I'm not sure what you mean, but I'm pretty sure it already does whatever you're talking about. If you mean something like "punch, then kick, then press X+Y", you wouldn't define the combo that way; you'd just define it by the keys that get pressed. For example, you can spout flame by hitting the Jab key repeatedly. Since that happens to be the Alt key, the combo is defined as what you do with the Alt key. You know?

Quote:Also, what about combos where each move must make contact with an enemy before you can do the next move?

The combo system doesn't bother checking that, at the moment... the caller does it manually. For example, if the combo to pick up an enemy is entered, the code basically looks to see if an enemy is near by and picks him up if so.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement