Author |
Message |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat May 02, 2009 4:49 pm Post subject: <C> ball_motion |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
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 262 time(s)
Last edited by Goldeye on Sat Jul 03, 2010 7:17 pm, edited 1 time in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Samapico No, these DO NOT look like penises, ok?
![](images/avatars/fe2cb2afc48e5b6adff2cbb0b8f4be4244e1d8a6eec26.png)
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat May 02, 2009 5:01 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
sounds cool
didn't know someone figured out the ball physics O.o _________________ (Insert a bunch of dead links here)
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Bak ?ls -s 0 in
![](images/avatars/404997118f1ce7de4ddd04696735dba8452b42d283d73.png)
Age:25 Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Mon May 25, 2009 7:01 am Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
I unexpedited since no one asked.
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Hakaku Server Help Squatter
![](images/avatars/9120dd93f5e5f7e24bdbaff18d563ad6451870d9316b9.png)
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Mon May 25, 2009 6:14 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
Goldeye wrote: | I unexpedited since no one asked. |
This:
Bak wrote: | 5 stars for no attachment ![icon_smile.gif](images/smiles/icon_smile.gif) |
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Mon May 25, 2009 10:16 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
So now all we need to do is remove the friction and we have bomb tracking.
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Samapico No, these DO NOT look like penises, ok?
![](images/avatars/fe2cb2afc48e5b6adff2cbb0b8f4be4244e1d8a6eec26.png)
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Tue May 26, 2009 12:53 am Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
Initrd.gz wrote: | So now all we need to do is remove the friction and we have bomb tracking. ![icon_smile.gif](images/smiles/icon_smile.gif) | 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 |
|
![](templates/subSilver/images/spacer.gif) |
Samapico No, these DO NOT look like penises, ok?
![](images/avatars/fe2cb2afc48e5b6adff2cbb0b8f4be4244e1d8a6eec26.png)
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Thu Jul 01, 2010 10:06 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
uber bump...
Nothing yet?
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Thu Jul 01, 2010 10:31 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
Ooh, interest!
I'll see about getting it here tomorrow
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat Jul 03, 2010 7:17 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
Done. See first post.
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Samapico No, these DO NOT look like penises, ok?
![](images/avatars/fe2cb2afc48e5b6adff2cbb0b8f4be4244e1d8a6eec26.png)
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Feb 27, 2011 10:48 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sun Feb 27, 2011 11:08 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
I wrote a module that can do both of those (with one function).
Will try to bring it out sometime soon.
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sat Mar 12, 2011 5:10 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Guest
Offline
|
Posted: Sun Apr 03, 2011 8:43 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Goldeye Novice
Gender:![Gender:Male Gender:Male](templates/subSilver/images/icon_minigender_male.gif) Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Sun Apr 03, 2011 10:08 pm Post subject: |
![Reply to topic](templates/subSilver/images/lang_english/reply_mini.gif) |
|
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|