Football play-maker

Lord Vader
Unregistered
 
Post: #1
I am tring to make an application for football plays.
What I need to know is how to let the user draw out a play,
and then have the player they want fallow a cartain path made in the play.
Any ideas?

Thanks,
Joshua Terrasas
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
Store a list of locations and the respective times, for a given time find which location it is after and before then tween between them like this.

time diff = after_time-before_time
tween factor = (current_time-before_time)/time diff
location = before_location*tween factor + after_location*(1-tween factor)

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Moderator
Posts: 439
Joined: 2002.09
Post: #3
Some ideas.

1. Divide the football field in small squares or hexes. As the player drags their mouse, you store (and light up) each cell they hit. (Make sure you handle the case where they double-back.)

2. Same idea, but at the pixel level. just record each mouse movement in a dynamic vector. I did something like this for WordBeGone, but in your case the movement would be jaggy. You'd want to smooth it, or fit a curve to the points. Also, this would be resolution-dependent. #1 would be a better approach, I think. You could record a play at 640x480 and play it back at a different resolution, for instance.

3. Less directly, you could let the player move some control points around and this would bend the curve. This would guarantee smooth movement and the path would be fully editable. But it would feel indirect to some players.

4. None of the schemes above handle controlling the speed of the runner very well. The snazzy way would be to record the time spent on the mouse movements and "play it back" so to speak. But giving it some thought I think this would be annoying. The slightest jiggle of your mouse and you'd have to start over. I think it would be better for the player to assign speeds to the path in some other way. Maybe a linear timeline where they move the mouse horizontally to demonstrate the desired speed.

Other thoughts:
- You'd want to have some built-in paths that they could start from or reuse.
- It would be very nice if they could edit the path. Drawing and storing a path (#1, 2 above) are easy, but don't address editing.
- Regardless of the scheme, a quick playback of what they entered would let them tweak it. Maybe a way to overlay it on what the other runners of the play are doing so the player can avoid collisions.

Is this part of a larger football game, or is this simply for storing plays? If the latter, the user is going to want exquisite control over everything. Runners will be told to make sudden stops, double-back, and so on. My suggestions above are more appropriate for a casual football game, where the player wants to design new plays but that's not the entire game and it would be worth losing some player control in order to streamline the interface.

A more precise control scheme would be to handle each segment of a run on a timeline. "Run 20 feet up the field, stop short as if to double-back, then go long." Each part of the run handled discretely.

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #4
Just as an aside, could you please be sure to label your future threads with more detail?
"openGL" inside of the "openGL" folder doesn't exactly explain what you're looking for
( =
Quote this message in a reply
Post Reply