Jump to content
  • Advertisement
Sign in to follow this  
Dinner

A bit of a math query

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

Thought id ask here, since im not that good with math, and want a newbie answer to my newbie question ^.^ Im more loooking for yes or no, not the math formulas behind it or even possible sdk's i might use to do it I think i can do it all, but I sometimes make silly mistakes, so Id rather ask first ^.^ (research it myself, wont cut it for a correct responce ^.^) If I had a model with a sword in the scarcarb on there back, and I define the point of the handle to the sword sprapped to there back, can I tell the model to reach for that object, in a logical manner that would follow the natural way someone would do it in rl And if that model had a base strength stat, and the sword had a base weight stat, is it more or less possible to tell how much force the sword would have if it was drawn then swung down, so there strengh + weight = how much force the weapon has (and in a side note, maybe how much energy they might use in the process) Thankyou, I did my best to make it understandable, but it is near 3 am so if something isn't clear enough then say and ill reply later with futher details (the end result, i want a character to be able to use a sword and having it work out how to get the sword between defined points, without telling it to use say a arc manually, juding how hard they hit there enemy, and how tired they got from swinging the sword)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Dinner
If I had a model with a sword in the scarcarb on there back, and I define the point of the handle to the sword sprapped to there back, can I tell the model to reach for that object, in a logical manner that would follow the natural way someone would do it in rl


Scabbard. (You might have gotten the word muddled with "scarab", which is a kind of beetle.) Not easily. You pretty much have to define what "in a natural way" means.

Quote:
And if that model had a base strength stat, and the sword had a base weight stat, is it more or less possible to tell how much force the sword would have if it was drawn then swung down, so there strengh + weight = how much force the weapon has
(and in a side note, maybe how much energy they might use in the process)


Sort of, but force doesn't equal damage. Even power ( = force * velocity) doesn't necessarily translate directly into damage very well. You're probably best off to just make up your own mechanics that behave intuitively. The real property you're looking for is that there's a "sweet spot" for weapon weight that maximizes damage for the character, and that spot is heavier for stronger characters.

Share this post


Link to post
Share on other sites
I completely agree with it being way too much extra work to get the math realistic... but if you wanted to get it right this hopefully will give you an idea of what you'd need to do:

First off, as the sword fell (since they're drawing off their back I assume it falling to hit the target) it would accelerate at 9.8 meters per second squared (for most of earth at least, it varies a bit depending on what your elevation is).

Second you would have to add how much force the character is applying to the sword. This is much more complicated (in real life) then it might seem. Since the player is applying force at the handle and not at the striking point how much additional force being applied to the target by the sword would actually be influenced by the torque not directly by how much force the character applied. Being several years out of physics classes I'm not even sure how one would start. Basically far too much effort for the pay off. However much force this was would be added to the force applied by gravity.

The mass of the object would affect how much the velocity, remember velocity is a vector, so it has three changed. Since it takes more force to incease the speed of a massive object then one with a very small mass.

After figuring how much the character changed the objects velocity you would add that to the velocity given the object by gravity.

Having figured that you would then take the object's velocity (if you wanted to be very technical this would be velocity at the striking point, since it would be different for each point along the sword) and multiple that by its mass. This would give you the amount of force applied by the sword. Notice that I said mass not weight, the two are very different (mass is constant no matter what the gravity where as weight is affect by how much gravity the object is subjected to, kilograms are a measurement of mass, pounds are a measurement of weight).

Since strength is going to be arbitrary, how much force the character adds would also be arbitrary. Also, how well the armor resisted the attack, and how deep a cut the sword causes on the person would also be arbitrary. Well, that is unless you wanted to do extensive research on how different kinds of armor worked against different kinds of attacks (piercing, bludgeoning, and slicing, the same ones you have in most RPG's that bother to seperate physical damage types).

In the end its alot of work for something the players will never notice...

Share this post


Link to post
Share on other sites
Thanks for the replies, I really didn't add enough information in my starting post
but you gave a helpful reply for it

That is about what id expect to happen, I better start brushing up on my maths

By natural, I meant the character doesn't break apart of there body doing something (say putting there hand directly thru there body to grab the hilt of there sword), I dont plan on giving the player direct control of their character, so im hoping that will remove some complexibiltys with having the character stand and swing there weapon

Share this post


Link to post
Share on other sites
You may want to look into Inverse Kenematics. From what I understand(ie I haven't implemented it, only read about it)
it allows you to use a skeletal animation system and animate by where you want the ends of joint systems to be at some time.
So, you say where you want the hand to start, where you want it to pass through, and where you want it to end up,
and the IK system drives the hand around acording to the limits on the arm joints, untill it reaches the end point.
Doom 3 did this to keep the feet of creatures in natural positions on the floor while walking.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!