Game Development Community

Frisbee or Disc Flight

by Vinh Tran · in Torque Game Engine · 05/09/2005 (9:03 am) · 7 replies

I'm working on a project where I need to have a character throw a frisbee. The character can adjust the power and the angle of release on the frisbee and I want a realistic throw. At the moment I don't have any wind or outside factors on the disc. At some point I want to allow the user to influence flight of the disc through mouse movement during flight. I'm not sure how I need to go about handling this.

For now, the character is using the shapebase:ThrowObject (i think this is the name) function and I've changed it up a little bit. This gets the disc out of my character's hands and inventory and into the world, however it looks like I need to modify this. I understand this part, but what about adjusting the disc mid-flight. How can I get the disc to tilt to the right or arc around trees and things?

Any help would be much appreciated, thanks.

ps. I have a paper on frisbee physics and some sample code from a different project (not using the torque engine) that I can draw from.

#1
05/09/2005 (9:30 am)
Good to hear that you have that paper, because the flight dynamics model for a frisbee is kind of interesting to say the least!

My suggestion here would be to derive a new class from the Projectile class, and use that inheritance chain--it has baseline physics and updates already included, and would give you a good basis to modify your dynamics.

Based on your description you probably don't actually want the frisbee itself as the control object (which would be the first guess implementation), so you'll need to re-wire a bit of the movement event system to have moves passed on to the projectile itself from the Player object (shouldn't be too hard really, but will take some understanding of the moves model and input primitives). A less elegant solution, but very good for initial prototyping would be to have some commandToServer functions that the user could call via a keypress to modify the flight behaviour--once that works well, you could move the input controls to the mouse I would imagine rather easily.
#2
05/09/2005 (9:35 am)
Sweet! Are you working on a disc golf or ultimate game? I always thought an ultimate game would be a blast to play (would play like a combination of FIFA and Madden)
#3
05/09/2005 (9:39 am)
Thanks Stephen, I am pretty sure I understand what you are saying about the commandToServer functions and keypress mouse mappings. Seems like that would be a great way to prototype implement the modification of a disc.

I'm not that worried about midflight player modification to the disc as I am getting the disc to fly properly. Such as if I throw the disc at an angle, I want the disc to arc in the air. I doubt the engine can handle that without some modification...
#4
05/09/2005 (9:40 am)
@Andy

Its a disc golf game, currently its just for a school project. However, after that I believe the team will be turning it into a full blown game.

Ult frisbee would be great, i've seen a few games out there for that.
#5
05/09/2005 (11:00 am)
@Vinh: Yes, you will certainly need to modify the projectile physics to get this to work properly--currently the projectile work is related to a ballistic trajectory based on gravity, etc., and you'll want to work on the movement of the frisbee as a projectile at that level.

Sounds really interesting, if you have any deeper questions as you get into it, don't hesitate to ask!
#6
05/10/2005 (7:30 pm)
I've got a little follow up question. I've been looking at the code for both Projectile and Item. Is there a reason why I would want to modify projectile over modyfing item? For now I've got the item being throw from my player's hand with onthrow. What benefit do I gain from using the projectile over the item?
#7
05/10/2005 (10:22 pm)
@Vinh your answer is in the first post.