Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
soccer ball friction
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  Insight into TM_Baw Plugin? Post :: Post TWCore Soccer  View next topic  
Author Message
Dege
Newbie


Age:38
Gender:Gender:Male
Joined: Mar 16 2003
Posts: 5
Offline

PostPosted: Mon May 17, 2004 9:58 pm    Post subject: soccer ball friction Reply to topic Reply with quote

i believe that VampZ made a post on here a while back asking for the soccer ball friction/acceleration formula, the topic seems to be cleared now. I remember someone posting the formula, but couldnt remember what it was. I was wondering if someone could please post it again? icon_smile.gif
this would be used mostly for HZ bots, i'm guessing.
thanks
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Mon May 17, 2004 10:26 pm    Post subject: Reply to topic Reply with quote

Speed is in pixels per 10 seconds. So if you have speed of 500, thats 50 pixels per second.

Acceleration, I don't remember, but I would assume that it is 1 pixel / (10 seconds)^2, since SS is everything done in either 10 seconds or 10 milliseconds. Have to check with someone else.
Back to top
View users profile Send private message Add User to Ignore List Send email
Guest



Offline

PostPosted: Tue May 18, 2004 2:46 am    Post subject: Reply to topic Reply with quote

It's not... because what they give you is "friction". I did some tests and it looks like acceleration isn't constant... please check with your person MGB though... the real forumla would be superb
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 18, 2004 9:01 am    Post subject: Reply to topic Reply with quote

Learn ASM and rip it from VIE client.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Tue May 18, 2004 12:00 pm    Post subject: Reply to topic Reply with quote

Hmm, so soccer is friction. Well, formula for friction is F=u*r, where F is the force, u is friction, and r is the downward weight of the object. If you would be able to record a couple of position packets that include the ball's speed/position, and tell me the initial speed/friction of the ball, it wouldn't be hard to figure out what the r in the formula would be.

Or you could go Ekted way and rip code. I still prefer my mathematical approach. If you do want me to help you out, just record the data into a nice format that something like Excel could read.
Code: Show/Hide
Time   XCoord   YCoord   XSpeed   YSpeed

Use tabs between each value.
Back to top
View users profile Send private message Add User to Ignore List Send email
Guest



Offline

PostPosted: Wed May 26, 2004 1:24 am    Post subject: Reply to topic Reply with quote

When I look at the packets with MERVBOT as they get received it's just the same numbers. Maybe the client uses the initial X,Y, and velocities to come up with the new position?!? What should I do then... short of learning ASM and taking from the client?
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 26, 2004 11:12 am    Post subject: Reply to topic Reply with quote

You also need to implement bounces.
Back to top
View users profile Send private message Add User to Ignore List
VampZ
Guest


Offline

PostPosted: Thu May 27, 2004 12:13 am    Post subject: Reply to topic Reply with quote

So it seems like just storing the initial position and velocity would be a terrible way of doing it... since when you put friction to zero and fire a ball that never gets caught would be a growing problem...
Back to top
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Thu May 27, 2004 12:18 am    Post subject: Reply to topic Reply with quote

I'm not sure what all your talking about; but SSCX Omega Fire had the soccer ball never stop (ie: no friction); the only problems occured: you couldn't pick it back up, and goaling if the player is offline (I forget what happens)
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Goldeye
Novice


Gender:Gender:Male
Joined: Dec 15 2003
Posts: 57
Offline

PostPosted: Mon Jan 10, 2005 6:52 am    Post subject: Reply to topic Reply with quote

Bump tongue.gif
I want to calc this once and for all.
Experiment to do it:
Two ships lined up and motionless with *warpto, both with 1 pixel prox.
Log the time, ball position, and the ball velocity when it is fired; and the time and position when it is caught.
Of course, the exact time the packet is recieved is unknown to an client except the one firing it. Solution: Log the time the ball-caught packet is sent. Then do all the joyful math to calc acceleration or friction, whichever it turns out to be.
If anyone can supply an arena in a zone with unencrypted packets, or a better idea for getting the recieved time, please tell icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List Send email
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Mon Jan 10, 2005 4:33 pm    Post subject: Reply to topic Reply with quote

you could use a bot
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Jan 10, 2005 6:55 pm    Post subject: Reply to topic Reply with quote

the packets are NOT updated. you only get the initial spot and initial velocity.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Underlord
Novice


Gender:Gender:Male
Joined: Feb 17 2004
Posts: 55
Offline

PostPosted: Mon Jan 10, 2005 7:15 pm    Post subject: Reply to topic Reply with quote

soccerballspeed = 2500 pixels/10s
soccerballfriction = 12
distance ball travels shot from stationary ship = 745 (+-5)

changed to soccerballfriction = 6
distance = 965 (+-5)

just some quick approximate measurements
coefficient of friction calculates to about 1.5 (estimate)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Jan 12, 2005 7:42 pm    Post subject: Reply to topic Reply with quote

I'm certain VIE/Cont calculate ball position discretely. Every 10ms the ball is moved some amount based on its current dx/dy, and then dx/dy is decreased based on friction. Internally, all units are * 1000 so speed and position can be handled smoothly without all kinds of rounding errors. This also saves you from having to recalculate possible bounces and/or catches every tick.
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Fri Mar 24, 2006 7:17 am    Post subject: Reply to topic Reply with quote

I did a quick look through subspace.exe. There's only one place Friction is accessed in the entire file:

Code: Show/Hide

0043FFC6 0FBF4301                movsx eax, word[ebx+01]
0043FFCA 8D4CED00                lea ecx, dword[ebp+8*ebp+00]       // ebp is ship type
0043FFCE 8D0480                  lea eax, dword[eax+4*eax]
0043FFD1 C1E104                  shl ecx, 04                 
0043FFD4 8D0480                  lea eax, dword[eax+4*eax]          // fancy way to do settings.ship[type].friction
0043FFD7 0FBF9190D84700          movsx edx, word[ecx+0047D890]      // friction loaded from settings
0043FFDE 8D0480                  lea eax, dword[eax+4*eax]
0043FFE1 895337                  mov dword[ebx+37], edx             // stored here


This value is then only used from this new location in one place:

Code: Show/Hide

0043FBB9 2BFD                    sub edi, ebp            // friction is substracted from a single value


All coords internal are *1000 so that sub-pixel motion can be performed without using floating point math. In PB, friciton is 4. So my guess is every iteration (10ms) 4 is subtracted from the motion vector, not dx and dy separately. In PB, ball speed is 4000. If my guess is right, and 4 is subtracted from this 4000 each iteration, then the ball would come to rest in 10 seconds. Even if I'm wrong it seems pretty close.

I didn't spend the time to figure out the exact formulas for everything. It's pretty messy since I think this is the main physics code used by all objects.
Back to top
View users profile Send private message Add User to Ignore List
Underlord
Novice


Gender:Gender:Male
Joined: Feb 17 2004
Posts: 55
Offline

PostPosted: Fri Mar 24, 2006 8:06 pm    Post subject: Reply to topic Reply with quote

did a few tests in ss to confirm

soccerballspeed=4000
soccerballfriction=4

ball stops 10 seconds after passing it

soccerballspeed=4000
soccerballfriction=10

ball stops 4 seconds after passing it

used a combination of ballpassdelay setting, stopwatch, and bot timers to measure it within a few milliseconds

both results match the 'subtract friction from ball speed every 10ms theory'
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BlueGoku
Novice


Age:38
Gender:Gender:Male
Joined: Jul 05 2005
Posts: 87
Location: Toronto
Offline

PostPosted: Fri Mar 24, 2006 8:38 pm    Post subject: Reply to topic Reply with quote

Awesome, thanks Ekted and Underlord. There were more than a few cool things we couldn't do before without the formula. Proper offsides tracking, for one.
_________________
Owner of SSCE Hockey Zone.
SSC Billing Operator
Back to top
View users profile Send private message Add User to Ignore List Visit posters website Yahoo Messenger MSN Messenger
Guest



Offline

PostPosted: Sat Mar 25, 2006 7:01 am    Post subject: Reply to topic Reply with quote

unless my math is totally rusty i dont think thats 100% accurate. the ball has some weird behaviors when its close to stopping. for some reason when the ball is fired diagonally the smaller velocity seems to reach 0 sooner than the other. it is hard to see with standard settings but it does happen at the very end. however in hz is really easy to see. im wondering if this happens because the values go too low for continuum and it converts them to 0? still kinda weird.
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 25, 2006 7:15 am    Post subject: Reply to topic Reply with quote

Of course. I would expect that. Remember the math is being performed in interger space, not floating point. Rounding at the 0.001 level is done every iteration.
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Mar 25, 2006 8:57 am    Post subject: Reply to topic Reply with quote

Ok so by your theory:
Quote:
soccerballspeed=2500
soccerballfriction=12

ball stops 2 seconds after passing it.

When you can easily see it takes about 7 seconds.

Edit: Also I wouldn't expect friction to remain constant. It has to be relative to the speed of the object or terminal velocities wouldn't exist.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 25, 2006 9:09 am    Post subject: Reply to topic Reply with quote

Are you sitting still when you shoot it?
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Mar 25, 2006 10:17 am    Post subject: Reply to topic Reply with quote

Yes. And facing directly down too. I used the default settings that came with asss, which are mostly SVS.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 25, 2006 11:10 am    Post subject: Reply to topic Reply with quote

Are you making these changes in-game on an asss server? I tried testing these in PB (asss) and setting changes to friction have no affect. I think there's a bug in the creation of the settings packet. Likewise, many prize weights are all messed up.
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Mar 25, 2006 1:19 pm    Post subject: Reply to topic Reply with quote

I didn't change any settings and I just tested it on subgame with the same results. (If this is an april fools joke you're pushing it a bit far...).

You have to be careful when changing settings and include'd files in asss, the settings only reload when arena.conf changes, but you can use "?reloadconf ar" to force a reload (the second parameter is a filter).
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 25, 2006 1:24 pm    Post subject: Reply to topic Reply with quote

I'm talking about changing settings by command.
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 81 page(s) served in previous 5 minutes.

phpBB Created this page in 0.522731 seconds : 49 queries executed (92.1%): GZIP compression disabled