Author |
Message |
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat May 02, 2009 4:49 pm Post subject: <C> ball_motion |
|
|
|
|
I've got a module together to handle most of the work related to accurately dealing with the position of the ball at all times.
Through a C interface, it can report:
- Position/velocity of a ball at a given time.
- When the ball will come to rest or bounce
- When the ball will intercept a line/rectangle/tile/elvl-region
- Exposes a callback to allow you to conduct your own tests on the ball each tick
Example uses:
Angled walls: Angled bounces off 'angled' walls, by disabling BallBounce in config, and entering all coordinates into a config (building this into an editor would be awesome), and then firing the ball anew in whatever direction you want when it hits the wall. <Edit: I made this but it works badly for players with high pings because of the delayed physics>
Dodgeball: Not out if you touch the ball after a bounce. Out if you touch it before it (truly) comes to a rest
Bots: Allow a bot to know where the ball is and where it's going.
If you want to know if or how this can be helpful for your project, just ask.
<Edit:>
The module uses macros arnk put together (in akd_asss.h). They might not be compiling outside of hz. If you like the macros, don't use them; check out Arnk's ACE scripts. They're much better for the purpose: http://forums.minegoboom.com/viewtopic.php?t=8629
Contains: ball_motion.c, ball_motion.h, akd_asss.h
ball_motion.zip - 8.28 KB
File downloaded or viewed 281 time(s)
Last edited by Goldeye on Sat Jul 03, 2010 7:17 pm, edited 1 time in total |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat May 02, 2009 5:01 pm Post subject: |
|
|
|
|
sounds cool
didn't know someone figured out the ball physics O.o _________________ (Insert a bunch of dead links here)
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Mon May 25, 2009 7:01 am Post subject: |
|
|
|
|
I unexpedited since no one asked.
|
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Mon May 25, 2009 6:14 pm Post subject: |
|
|
|
|
Goldeye wrote: | I unexpedited since no one asked. |
This:
Bak wrote: | 5 stars for no attachment |
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Mon May 25, 2009 10:16 pm Post subject: |
|
|
|
|
So now all we need to do is remove the friction and we have bomb tracking.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Tue May 26, 2009 12:53 am Post subject: |
|
|
|
|
Initrd.gz wrote: | So now all we need to do is remove the friction and we have bomb tracking. | Except that a bomb doesn't trigger any event when it's triggered, which is the main reason why tracking a bomb is not reliable. The rest is just simple linear stuff.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Thu Jul 01, 2010 10:06 pm Post subject: |
|
|
|
|
uber bump...
Nothing yet?
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Thu Jul 01, 2010 10:31 pm Post subject: |
|
|
|
|
Ooh, interest!
I'll see about getting it here tomorrow
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat Jul 03, 2010 7:17 pm Post subject: |
|
|
|
|
Done. See first post.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Feb 27, 2011 10:48 pm Post subject: |
|
|
|
|
8 months later: I'm finally getting around to using this...
I plan to use it for 2 things for now:
-Detect an actual shot towards the goal vs a simple pass or a missed shot
-Detect when the ball hits the post
The first one is simple, since I can call the function when the ball is thrown.
However, I'm not sure how to do the second one... I can use BallBounce(...) to know if the ball should eventually hit the post, but is there some way to get a callback when it does hit the post? Or do I need to start a timer, and make sure no one touches it while the timer counts down?
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sun Feb 27, 2011 11:08 pm Post subject: |
|
|
|
|
I wrote a module that can do both of those (with one function).
Will try to bring it out sometime soon.
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat Mar 12, 2011 5:10 pm Post subject: |
|
|
|
|
Ball motion is that module...
You'd use GoalTime to detect if it will hit the net, and either RegionIntersect or LineIntersect (depending on which angles you want to check) for the post.
The IntersectData returned by either function should contain a time of 0 to indicate no intersect at all.
There are potentially physics errors in this module. Or they might be in our modules using this one. Not sure
PS. Bomb tracking shouldn't be that hard...
|
|
Back to top |
|
|
Guest
Offline
|
Posted: Sun Apr 03, 2011 8:43 pm Post subject: |
|
|
|
|
Does this don't have a python interface? When I try load it, it says there isn't. Would you be willing to add it?
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sun Apr 03, 2011 10:08 pm Post subject: |
|
|
|
|
It's tricky to make a python interface because of the data structures.
If someone's very familiar with pyint, maybe they're willing to take a shot at this?
It'll be a long long time before I can work on it.
However, if you describe your exact use, I may be able to make 'wrapper' functions that just return ints.
|
|
Back to top |
|
|
|