-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTODO
More file actions
73 lines (53 loc) · 2.78 KB
/
TODO
File metadata and controls
73 lines (53 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ideas: ultimate hodor bot
parameter optimizing strafebot
record inputs from demoes for playback -> look into saving / writing playerstate in snapshot / clientsnapshot
apparently ps.stats[13] will show keypresses or usercmd stuff from in demoes, investigate other demo stuff
auto copy over python files, including a folder structure, including libs
some maffs https://dimit.me/blog/2017/08/08/defrag-strafe-theory/
fix small 0.005 ish angle offset that happens with current conversion setup
(probably have to revert to using usercmd.angles, except without ever converting them
probably need some internal conversion function which IS symmetric?
stop on timer hit broken in frame-by-frame
demo saving broken in frame by frame?
set up asynchronous calculation that runs while paused, and unpauses when done
fix threading not working for pausing every frame to wait on calcs
seems to be threading issue with embedded python interpreter
look into injx stuff for basic cgaz math
create system to rewind the client+server to previous frame states at any frame recorded in the past or any arbitrary saved frame
another df mod offset: 957848 .25 cgame for pps -> in cgame ?
pitch matters, center on 0 by default unless overridden! probably do this in usercmt_t class when pitch is set!
on botscript allow adding arbitrary python functions to be ran inbetween or something?
for xpc solve f(x) = -c * sin(a + b - 2 x) + w * sin(b - x) = 0 -> need solver
xpc math:
https://cdn.discordapp.com/attachments/643916692262617098/660160256344719372/unknown.png
note: it doesn't account for clipvel, snapping, a2s2a (and degree/rad conversions)
float calc_fric_coeff(float speed) {
if(speed < 1) {
return 0;
}
float control = speed < 100.0 ? 100.0 : speed;
float drop = control * 6.0 * 0.008;
if(speed - drop < 0) {
return 0;
}
return (speed - drop) / speed;
}
double proj_vel_objective(unsigned n, const double *w, double *grad, void *data) {
double theta_w = w[0];
const double theta_d = 3*M_PI/2;
vec3_t v = {cl.snap.ps.velocity[0], cl.snap.ps.velocity[1], 0};
float speed = VectorLength(v);
float f = calc_fric_coeff(speed);
double theta_v = atan2(v[1], v[0]);
float a = Com_Clamp(0, 10.0*0.008*cl.snap.ps.speed,
cl.snap.ps.speed - f*speed*cos(theta_v - theta_w));
// update gradient to account for lower bound by 0
// if(grad != NULL) {
// if(10.0*0.008*cl.snap.ps.speed + f*speed*cos(theta_v - theta_w) <= cl.snap.ps.speed) {
// grad[0] = 10.0*0.008*cl.snap.ps.speed*sin(theta_d - theta_w);
// } else {
// grad[0] = cl.snap.ps.speed*sin(theta_d - theta_w) - f*speed*sin(theta_d+theta_v-2*theta_w);
// }
// }
return f*speed*cos(theta_v - theta_d) + a*cos(theta_w - theta_d);
}