Code: Show/Hide Time XCoord YCoord XSpeed YSpeed |
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 |
Code: Show/Hide 0043FBB9 2BFD sub edi, ebp // friction is substracted from a single value |
Quote: |
soccerballspeed=2500
soccerballfriction=12 ball stops 2 seconds after passing it. |
Anonymous wrote: |
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. |
Goldeye wrote: |
I will try to experiment with the position sometime soon, either finding a program to take screenshots of a moving ball at regular intervals or writing a module for recording start and end ball positions (and approximating the time) |
Goldeye wrote: |
[..]
What you see as weird is perfectly normal, that velocity component is so low that you don't notice it any more. Keep in mind that the ball is probably still moving at a subpixel level. |
Anonymous wrote: |
[..]
nah, the ball does a perfectly visible "curve" when a velocity reaches a certain value, and that definately isn't "normal" in vector math. it is really easy to see in hz. while not moving, shoot the ball at 181 degrees (or 21 continuum degrees.. anyway one pixel more than facing down/up/left/right) and the curve i'm talking about is really easy to spot. |
Smong wrote: |
[..]
Not many people realise this but only the client knows the end position so a module wouldn't be able to do that directly. What I suggest is use a ship with a known ball prox, fire a ball directly at it. Move the ship gradually further away from the fire point until it no longer picks up the ball - this will be where it stops. You can use the ball fire/pickup callback to time it. To overcome the glitches in moving ships per pixel, you can decrease the ball prox gradually. When you have decreased it by 16 pixels, move the ship 1 tile further away and reset the ball prox. |