Jump to content
  • Advertisement
Sign in to follow this  
lodoss118

Street fighter and input manager

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

was wondering wats the best way of creating an input manager for a street of fighting game like best way to register hadokens and stuff?

Share this post


Link to post
Share on other sites
Advertisement
I'm currently developing a game in C# and I just finished writing the input manager. I use a "command" object which ties to a specific event handler.

I then "bind" the command object to 1 or more keys. When one of these keys is pressed, the manager will trigger the event and call the function.

In your case, you would have to store all the commands in a small buffer, which you clear, say, every second. So, if DOWN+FORWARD+KICK means your player will slide over the floor, you shove these 3 values into the buffer when pressed.

Then, we looking into the buffer, you "detect" the combo of keys, and execute the special move.

Toolmaker

Share this post


Link to post
Share on other sites
When I was attempting this, I simply used a linked list of key objects to store combos. I checked the current key input to each combo and set a pass or fail for each combo, if a combo failed, its list iterator was reset.

I also added in little features such as max and min wait times and child nodes to indicate that multiple buttons must be pressed at once.

Share this post


Link to post
Share on other sites
Quote:
Original post by Toolmaker
I'm currently developing a game in C# and I just finished writing the input manager. I use a "command" object which ties to a specific event handler.

I then "bind" the command object to 1 or more keys. When one of these keys is pressed, the manager will trigger the event and call the function.

In your case, you would have to store all the commands in a small buffer, which you clear, say, every second. So, if DOWN+FORWARD+KICK means your player will slide over the floor, you shove these 3 values into the buffer when pressed.

Then, we looking into the buffer, you "detect" the combo of keys, and execute the special move.

Toolmaker


That's pretty close to how I would do it. I would, instead of using a timeout for the buffer, include a timeout along with each keypress. This way you can keep track of the time between each keypress of the series, allowing for longer or shorter windows of time to enter sequences.

Share this post


Link to post
Share on other sites
ahh this is a really cool question. I love fighters, I just say the best thing is to leave it up to you lol. the way you handle input will make your game's feel unique, good luck. I think the best was is to program many different systems and use the one you feel more comfortable with yourself. don't just pick the most sophisticated solution or the simplest, I definitly agree that some error in the input should be allowed, but how you determin which type are allowed will influence highly influence your game. I'm just talking out loud this is a problem I've always wanted to try to solve, but never had the opertunity to. it's fun tho. only in a fighter is controls so important. =)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!