• 13
• 27
• 9
• 9
• 20

# Character control programming ?

This topic is 4932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello. "gameplay" programming tutorials/articles/... are a bit hard to find, so I'm posting here so maybe you guys can help me. Do you guys have any links to pages where it is thoroughly explained ? With "gameplay" I mean, analyzing user input, moving a 3D model or sprite with a specific speed, special input detection like a hadoken combination (down, down-forward, forward + Punch), anything that has to do with input and the way your character moves.I know if I write them myself without reading something about it I'll make something complex and slow, wich I absolutly don't want to.Someone else will see my code and will start laughing out load because there are much easier and less complex algorithms available or because there's some "standard" and widespread way of doing such things. I mean just like if you saw someone else writing weird and complex collision detection routines because they don't know much or didn't read some paper about it.I hope you guys understood what I meant. Thank you in advance !

##### Share on other sites
Quote:
 Original post by Haido...special input detection like a hadoken combination (down, down-forward, forward + Punch)...
Recognition of Handwritten Gestures. If you store the extent of deflection as a vectors, you can provide far more robust and accessible combination detection than with a digital "down", "down-right", "right" -type scheme. If you want the latter, however, you merely need pattern recongition on data in the input buffer with fixed interval sampling.

##### Share on other sites
Quote:
 Original post by OluseyiIf you want the latter, however, you merely need pattern recongition on data in the input buffer with fixed interval sampling.

I wouldn't even go this far and simply use a tree/trie structure:

down +-> down-fwd. -> fwd.-punch => hadoken     |       +-> up-fwd. -> fwd.-kick => lightning kick    ...     |     V    duck (...and process the rest of the input chain)

Are you aiming at a 3d fighting game like the Tekken-series?
Maybe this thread will provide some help.

Pat.

##### Share on other sites
I had a input function which recieved keyboard intput and a player class, and I used it this way:

1) Tanslate all keyboard input into character commands (duck, jump, punch, move etc).
2) Send the new command to the player instance
3) The player class saves the command into a list holding the last few commands (however many you need, 5 should be enough).
4) In the player update() function check the current list for special moves, if one is found then set the player to do that, if you don't find any just execute the current base move as normal.

This allows you to bind any keys to execute the commands because inside your player thinking function you just look at commands - and your AI can just pass in commands to the player its controling and you don't need any special code to deal with it. It works for all sorts of games and is quick and simple.