The Daily Click ::. Forums ::. Klik Coding Help ::. Beat-em-up/Swordfighting engine
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
7th March, 2005 at 08:28:57 -

I need a swordfighting style engine. I got some theories on how to do it, ie. making the animations and the swords seperate and having the sword animate according to to the sprite animation and the hot spot of sword being on the action point of the sprite... but, it's very tedious, and in my experience with clicking, it'll be extremely buggy.

I've heard a few swordfighting/beat-em-up engines out there... so, does anyone have any links to one or any ideas? Thanks.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  441234

VIP MemberLikes TDCKitty
9th March, 2005 at 19:05:32 -

I did that once, it works much better for keeping animation levels down...
I lsot the engine....so i don't got anything...just more or less telling you it's a better idea then adding the sword into the characters animation.

It also allows you do to some neat tricks with a sword.

 
thinking is like pong, it's easy, but you miss sometimes.

Weston L



Registered
  16/12/2002
Points
  1603
10th March, 2005 at 00:22:06 -

But then when you jump, the sword and character are not in sinc right? That's always been the problem I've had. I suggest drawing the sword into the animation, but also having the sword be a seperate object that is INVISIBLE. Then test collisions with the seperate object ones, but keep the sprites looking nice by drawing the sword in... although I'm no expert on this at all.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
10th March, 2005 at 01:22:13 -

If the game was beat em up and not sword vs. sword, then couldn't you just put an invisible detector on the action point of the sword. And then put the action point of the sword on the tip?

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Pyro



Registered
  22/05/2003
Points
  110
10th March, 2005 at 06:40:21 -

It's really hard to make objects stay together and look right, on the directions and animations it always looked a bit funky to me.

 
n/a

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
12th March, 2005 at 07:07:38 -

Don't use a built in movement if you can help it. The built in movement engines move faster than the events, so an 'Always' event won't actually keep up with it, making it appear to not quite keep in sync with the character.

If you are using a built in movement, create an invisible object to have the character's movement, and then the graphic for the character with no movement. Then add an "Always: Set character graphic to 0,0 from invisible movement object", then "Always: Set sword to 0,0 from character graphic (action point)".

This way both the sword and the character will have their position's set at the same time, so if they can't quite catch up to the movement object, neither of them will, so they'll always appear to be in the same position. Providing the movement object isn't ultra fast, the lag between then won't be enough to affect gameplay.

In my Zelda engine I've used a separate object for both the sword and the shield, and you'd believe they were actually part of the sprite, but the advantage is that, as well as combat being much easier to do with the separate sword object, you can have multiple different swords and shields, and mix and match them without having to have a thousand different sprites of the main character.

 
http://www.fzgames.com

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
15th March, 2005 at 23:16:37 -

OK, so how do you stick both the sword and a shield, or two swords, or two fists, etc onto a character?

Hmm... AA's idea about putting that invisible detector's OK, and the invisible sword idea looks nicer too... but the main problem I'm having here is trying to minimize the work I need to do to get the sword in that guy's hand and have it sync with the movement. Do I really have to animate the sword and guy-with-sword seperately and join the two parts together, or is there an easier way? And what about that shield, and having attacks bounce off blocks, etc...

Swordfighting engines are hell. Along with physics, conversation, XYZ movement engines, text-based engines, etc . No wonder there's so many 2D platform games and top-down shooters in the community...

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
16th March, 2005 at 07:52:48 -

a good idea to make it not to stiff is to have the sword separatly, and make the main character jump a bit forward to make it look like he really swings it, just move the hot spot a few pixels forward in a few animation frames. about the hot-spot to action-point method, make the action-point go around the main character in a half-circle path when swinging, then just make the sword always face away from him.
Always
-look in direction of []
-set direction to (direction of [sword])+16

Image Edited by the Author.

 
n/a

_rydin



Registered
  06/06/2004
Points
  317
19th March, 2005 at 01:18:13 -

What you do to get it in sync good, is to draw the animation as the character with the sword at first. Then just cut out the sword part and make it a new object with the same animation speeed as the "attack" animation of the character.

Keep the same picture dimentions for the sword animations as the character, and put the hot spots in the same place as the character as well.

Then
"always"
-set position of (sword) to 0,0 of (character)

"upon attacking"
-play animation "attack" (character)
-make sword visible
-play animation "attack" (sword)

"animation 'attack' (sword) is over"
-make sword invisible

This should work, although I am not going to try it.

 
"Computers in the future may perhaps only weigh 1.5 tons."
-Popular Mechanics, forecasting the development of computer technology, 1949

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
19th March, 2005 at 17:02:12 -

Swordfighting engines are hell? Believe me, you ain't seen NOTHIN mate.

Rydin, your method is similiar to what I have used in the past. It's quite effective.

Weather to use the sword as a separate object or the invisible sword detection mask really depends on how your game is intended to work.

 
http://www.fzgames.com

clwe



Registered
  17/12/2002
Points
  702
19th March, 2005 at 19:41:14 -

I really wouldn't recommend built-in movement for something like this. Custom movement not only gives you greater control (assuming you know what you're doing), but would also eliminates the problem of the sword not always following the character precisely.

However...even then, it's a recipe for a major headache. The animations in TGF/MMF don't always play at the exact same speed, and you'd have to do a lot of trial and error until the character animation and the sword positioning matches. Therefore...I'd recommend making the character and the sword as one object, then copying and pasting it so you have two. Blank out the character in one of the objects and blank out the sword in the other (using the transparent colour). You can now use the two objects for attacking and player collisions, assuming you set the animations for both to play at once.

EDIT - Which is pretty much what Rydin said. Nevermind.

Image Edited by the Author.

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
22nd March, 2005 at 23:32:33 -

Built-in movement sucks. Mainly because you don't have control over something fully. Gives plenty of space for bugs that you don't see.

Rydin:
That was my original idea, but well, if you have a dozen animations for a thrusting attack, that would be times 2 (for sword) for left/right. And then if you have a few other more attacking/blocking animations with a dozen movements each, it'll be even worse doubling it all.

However, I thought of making sword at action point, not hot spot, so I offer thee a dozen event lines of thanks for pointing out that I could just make the hot spot the same .


Now, my real problem would be blocking. How to make it attack and block smoothly, rather than have the attacking character's attack animation just set to bounce off when the attack is blocked? I don't think even the 3D Prince of Persia series managed to pull it off right, and it kinda makes the game look cheap .

I want a nice looking sword/staff fight. Is that too much to ask?

Swordfighting engines be only one of the few Hells of Click Engines. There be many more, and I must succeed the trials of each in order to create the Ultimate Game! I hope it gets more hype that ED .

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

c-jayf



Registered
  06/07/2003
Points
  274
23rd March, 2005 at 00:35:17 -

I'm working on a custom engine right now that I call the lallapalooza, and it's almost done. This is a platform engine that is going to support double jump, and is going to be featured in my game Bastians Tale. Unless of course Baka is going to program me one tommarow. Anyways, I am putting an action point at the tip of the sword, and for the shield, I'm going to have a point that will stay permanently in one place. Truth be told, if you keep the sheild in relatively the same place all the time, you don't need the shield's detector to move.

 
I hate witty signatures.

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
23rd March, 2005 at 02:00:16 -

I couldnt be bothered to read this whole thread, so this may have already been said. Put the sword in the animations, but have an action point invisible hit detector.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click