Server Help

ASSS Custom Projects - <C> ball_motion

Goldeye - 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. icon_smile.gif

<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
Samapico - Sat May 02, 2009 5:01 pm
Post subject:
icon_surprised.gif

sounds cool

didn't know someone figured out the ball physics O.o
Bak - Sat May 02, 2009 6:05 pm
Post subject:
5 stars for no attachment icon_smile.gif
Goldeye - Sat May 02, 2009 8:31 pm
Post subject:
Samapico: Smong figured it out from subspace.exe (a day before I would have, I always mention -_- ):
http://forums.minegoboom.com/viewtopic.php?p=76456#76456

Bak: I said I'd put it out faster if anyone wants it.
Goldeye - Mon May 25, 2009 7:01 am
Post subject:
I unexpedited since no one asked.
Hakaku - 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 icon_smile.gif

Initrd.gz - 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. icon_smile.gif
Samapico - 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. 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.
Samapico - Thu Jul 01, 2010 10:06 pm
Post subject:
uber bump...

Nothing yet?
Goldeye - Thu Jul 01, 2010 10:31 pm
Post subject:
Ooh, interest!

I'll see about getting it here tomorrow
Goldeye - Sat Jul 03, 2010 7:17 pm
Post subject:
Done. See first post.
Samapico - 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?
Goldeye - 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.
Goldeye - Sat Mar 12, 2011 5:10 pm
Post subject:
Ball motion is that module... tongue.gif
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...
Anonymous - 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?
Goldeye - 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.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group