Board index DeFRaG How to DeFRaG

velocity snapping

Users helping users.

Re: velocity snapping

Postby TittenIgnition » Apr 25th, '11, 5:36 am

<hk> wrote:Would you mind uploading it into the forum?

http://setup.dagobah.cz/quake/demos/cga ... 1%5d.dm_68

not quite "uploaded to the forums", but its downloadable

courtesy of setup ;)
wtf i have a signature?
User avatar
TittenIgnition
 
Posts: 454
Joined: Jun 4th, '10, 1:24 am
Location: QuakeNet

Re: velocity snapping

Postby <hk> » Apr 25th, '11, 11:23 am

You don't need magic to attach a file.
External files tend to fade away some day.
You do not have the required permissions to view the files attached to this post.
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: velocity snapping

Postby setup » Apr 25th, '11, 3:52 pm

In the demo, see frames where the angle between acceleration vector and velocity is smaller than
acos((g_speed - g_speed * pmove_msec / 1000) / speed).

You should find there several such frames.

Generally velocity snapping is alpha and omega of "pro strafe bots". "Normal bots" just use the formula mentioned above without caring of velocity snapping.
Luck is evil.
setup
 
Posts: 19
Joined: Jun 7th, '10, 10:41 pm

Re: velocity snapping

Postby amt-morbus » Apr 25th, '11, 9:21 pm

Thats probably the key to wesp-gaz-strafes map...
Image
User avatar
amt-morbus
 
Posts: 231
Joined: Jun 4th, '10, 8:28 pm

Re: velocity snapping

Postby <hk> » Apr 25th, '11, 9:36 pm

mmm... I think that was already known back then, when he mapped that thing.
Setup, you tell us :)
Is there more to w3spgaz bot strafing than strafing at perfect angle + velocity snapping?
It looks like you aren't even ramping the last pad.

The run we are talking about as a video and demo:
http://defrag.sockenbuegeln.de/data/vid ... otlane.mp4 (x264 50 MB)
You do not have the required permissions to view the files attached to this post.
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: velocity snapping

Postby setup » Apr 26th, '11, 12:19 am

amt-morbus wrote:Thats probably the key to wesp-gaz-strafes map...


The answer depends on how you see velocity snapping. If you consider it as a special "postprocess" effect on the velocity then yes, it's the key to the w3spgaz_strafes midline. However you should probably look at it as one integral aspect of strafing (quake movement in general). If you see it this way, then perfect strafing (whatever it means in this case) is the key to the line.

<hk> wrote:mmm... I think that was already known back then, when he mapped that thing.
Setup, you tell us :)
Is there more to w3spgaz bot strafing than strafing at perfect angle + velocity snapping?


Strafing at perfect angle is too vague term. What is the perfect angle? Is it the angle that gives you in the current frame the biggest speed boost? Is it the angle that changes your velocity in a such way that in a subsequent frame you will actually gain more speed (because of velocity snapping)? Is the speed (or only its forward component) really that important? What about travelled distance? Shouldn't you aim for that primarily?

When the line was released Gaz was so kind to post the necessary values for the first 5 jumps:
409 (take off), 587.8, 735.6, 838.2, 943.5, 1035.4.


Compare it with my values:
411.3 (take off), 588.7, 734.9, 838.5, 935, 1033.


At first I didn't know the velocity snapping will be the key to the line for me. I tried and failed with some other approaches before. In the end I actually used quite naive algorithm. I precalculated complete line, every jump (98 frames) was calculated alone. I used state space search with branch and bound optimization. The algorithm was exponential to the number of frames. I believe there is much more elegant way how to calculate it but I didn't have time to come back to it again. The only reason why I don't release the code nowadays is because its code quality is too low to see the public. ;)
Luck is evil.
setup
 
Posts: 19
Joined: Jun 7th, '10, 10:41 pm

Re: velocity snapping

Postby <hk> » Apr 26th, '11, 12:37 am

By "perfect angle" I meant the basic square root formula you can find everywhere. The one you'd expect when this was really just math and not engine code.

So you defined an aim. Like: "maximise the speed when touching the next pad". Then you ran every frame through cgame multiple times with different angle settings. Wow, that's pretty brute force.

hm... I would have started out facing the pads directly and then switching sides in the view on every frame. Now this is not a very good way to do this and most likely won't work(due to so often mentioned velocity snapping).
Using that as a baseline one can alter the angles of every switch a bit via brute force and see how the speed improves. If it does, keep the change and use it as a new baseline. I wonder what would come out of that.
:teasing-blah:

Actually, this is a pretty interesting topic(botting). I am looking forward to checking it out.
One can even compute it massively parallel on a cluster :)
Rarely a algorithm scales that well.

I don't know what I am saying here. I am already asleep. :geek:
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: velocity snapping

Postby TittenIgnition » Apr 26th, '11, 12:49 am

even after i realized (somewhat) what velocity snapping was, i didnt know that there was so much that goes into those bot lanes.

i never really thought that you would have to think of the future jumps, and how to set them up perfectly, so that you get the most speed via velocity snapping. i thought it could just be finding the most acceleration in each individual frame, without any regard to the rest of the run (only concentrate on the current frame).

i want to learn how to code sooo badly >: (
wtf i have a signature?
User avatar
TittenIgnition
 
Posts: 454
Joined: Jun 4th, '10, 1:24 am
Location: QuakeNet

Re: velocity snapping

Postby setup » Apr 26th, '11, 7:12 am

<hk> wrote:So you defined an aim. Like: "maximise the speed when touching the next pad". Then you ran every frame through cgame multiple times with different angle settings. Wow, that's pretty brute force.


I ran it only through ripped of version of strafing code.

<hk> wrote:hm... I would have started out facing the pads directly and then switching sides in the view on every frame. Now this is not a very good way to do this and most likely won't work(due to so often mentioned velocity snapping).


That was one of my first attempts. See attached demo.

<hk> wrote:Actually, this is a pretty interesting topic(botting). I am looking forward to checking it out.
One can even compute it massively parallel on a cluster :)
Rarely a algorithm scales that well.


I wanted to change the code to support parallel computation and run it on a cluster, but lack of time killed this idea again.
You do not have the required permissions to view the files attached to this post.
Luck is evil.
setup
 
Posts: 19
Joined: Jun 7th, '10, 10:41 pm

Re: velocity snapping

Postby AL!EN » Apr 26th, '11, 2:34 pm

Interesting :think:
"strafe is the most important 'weapon' in defrag" - <hk>
User avatar
AL!EN
 
Posts: 282
Joined: May 2nd, '09, 8:26 am
Location: Poland

PreviousNext

cron