Advertisement Jump to content
Sign in to follow this  
Zotoaster

Better sword combat in my 2D platformer

This topic is 1826 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

Evenin',

 

I'm working on an action adventure platformer in 2D and I've just about finished up the first level, and I'm fairly satisfied, except for the sword combat. On the first quest the only thing you have to fight are simple crabs that move back and forward over their territory, and if they touch you you take some damage. This is okay because it's part of the design. But I definitely need to work on the player's combat.

 

Here's the problem. I'm using a spritesheet for the player, and all attacks are animated in that spritesheet. Each frame is only 64x64 pixels, so there's not an awful lot of room for sword attacks. For this reason I've had to keep the sword pretty short and the only animation I managed to fit was a simple stab.

 

The game doesn't have much immersion when it comes to combat. The stab doesn't appear like it should do much damage. The reaction to a stab is the crabs take a couple of steps back and a sound bite plays. But I'm just not sucked into it enough.

 

What are some key design points that I should focus on here? What makes for interesting and immersive sword fights? I'm new to the psychology of games so I'd like to hear your opinion.

 

I think it's too late to change my engine to use bone-based animation at this point, and if the character was any bigger, he'd be too big, so these are my restraints at the moment.

 

Thanks for reading

Share this post


Link to post
Share on other sites
Advertisement

I haven't gotten very far into looking at combat so I have no idea if I'll have problems later or how useful the direction I'm going will be. But the way I've set myself up with my current project is that the player sprite can go into an attack pose and the sword is an additional sprite with its own collision boundaries that appears for a short time in a position relative to the player sprite (and depending on direction facing). I have it so that when the sword collides with an enemy, that enemy takes damage and moves a few steps back.

Share this post


Link to post
Share on other sites

That sounds workable actually. Do you animate the player's arm when attacking, or do you have the arm as part of the sword image and move it all together?

Share this post


Link to post
Share on other sites
It would be easier to give feedback if we could see how the animation looks like, and how it's arranged in the 64x64 frame.

Share this post


Link to post
Share on other sites

I suggest watching some Guacamelee gameplay videos.  It's not swordfighting but it will give you a good idea on how decent animated 2D fighting looks.  Notice that almost the entire frame changes every time.  Dragon's Crown is another good example (here's the Fighter video, with sword).  I know you don't have a team of artists at your command so you can only do so much but the more you animate properly, the better the game will feel, automatically.  Also keep things in mind like characters being pushed back a little from damage and damage effects (like what Street Fighter also does).

 

Also, there are some decent animation tutorials on line if you're interested.  Stuff like this.  Google around to get some tips.

Share this post


Link to post
Share on other sites
  • A general ui feedback when chopping (special attacks do more visual impact). Look at "damage taken" effects in shooters, the screen goes red. The effect could be applied both at damage dealt and damage taken
  • Add a sprite on top of the player with fx. A fx could be as simple as a colored circle that expands or something. 
  • Add sound effects.
  • If possible, add "swosh" lines or some blur to the sword. I don't know if it's possible due to the engine restrictions.

Share this post


Link to post
Share on other sites

Hello.
I think you have sufficient space on your frames to accommodate a more expressive sword-swinging sequence.
What comes to mind is resorting to the illusion of depth so that you have your character swinging his sword accross his body (not in front of it) with a visible trail to convey the speed.
 
Look at the following sprites from the Mega Man games. They use "energy" swords, so they have a larger trail, but the style would be similar:

mega_Man1.png

mega_Man2.png
 
One issue that might arise is that since you won't be centering your character on the frame anymore, you will need to specify the local "handle" coordinates of the frame so that your game engine can offset the sprite properly when displaying it.

In case you don't understand this concept, take a look at the following sprites.
- The one on the left is centered on the frame, with the handle at the bottom, between the feet. 
- The one on the right is very wide because of the extended leg and the body is not centered on the frame anymore, so the handle is displaced to remain at the character's feet.
If you don't make use of handle coordinates for your frames, the character may appear to slide when performing certain animation sequences.
 
axis0.gif                              axis1.gif

Another aspect which would help (and works best with that local handle feature) is adapting your engine to take frames of different sizes.

Edited by Kryzon

Share this post


Link to post
Share on other sites

Thank you for all your replies. I clearly need to learn a bit more about animation.

 

I found on the internet an idea to detect pixels with a designated colour and store their positions in each frame. Using this method, I can put two of them on his hand for each frame, and that should serve to define the sword's position and orientation

Share this post


Link to post
Share on other sites

The best sword combat would be one that mimics use of an actual sword - or at least that's what we think ;-)

 

Here is a controller we have developed 

.

 

Although I realize that your particular game has limited game mechanics in terms of attack, defense etc. would be interested in hearing yours and others thoughts. Do you think this could be a viable UI UX for games in the future?

 

Has anyone wanted a sword based game that works this way?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!