tynet-lichat/shirakumo - IRC Chatlog
Search
10:45:14
shinmera
https://mastodon.tymoon.eu/@shinmera/110026887966659868
11:03:37
shinmera
https://mastodon.tymoon.eu/getting-started
11:03:54
shinmera
https://mastodon.tymoon.eu/@shinmera/110026956117760536
15:12:48
selwyn
as a physicist id like to say that this isn't cute or funny
15:13:00
selwyn
cubes only do that when they're extremely stressed
15:28:40
shinmera
how about this then https://mastodon.tymoon.eu/@shinmera/110027973934211060
20:29:51
shinmera
mood: selwyn: gingerale: https://github.com/Shirakumo/trial/pull/38
20:29:56
shinmera
Once again, reviews and thoughts are welcome.
20:30:04
shinmera
I'll work on cleanup and docs in the coming days
20:31:11
selwyn
where will you stay in amsterdam
20:31:21
selwyn
couldn't immediately see a convenient place
20:38:35
selwyn
ill look at it tonight on the train back
20:39:17
gingerale
I'll have to try it out when I'm not tired
20:39:29
shinmera
sure, there's absolutely no rush.
20:39:53
shinmera
this last part of making things work has been some of the most frustrating debugging I've ever done
20:41:34
selwyn
for someone who doesn't like maths
20:41:51
selwyn
1) it's very impressive 2) you must have really hated doing it
20:42:20
shinmera
it helps that the math here is actually pretty simple, and that I just copied a reference implementation for the most prat.
20:42:42
shinmera
if I had had to come up with it all from scratch I probably wouldn't have been able to do it.
20:44:15
shinmera
well, it also helped a lil' that I had a uni class on this crap.
20:44:35
shinmera
though I am dreading implementing GJK and ESA for the general polyhedra case
20:44:41
shinmera
so if someone else can do that ... :v
20:45:16
selwyn
i don't like that there is no way to specialise integrate on an integrator argument (that could have internal state associated to it)
20:45:48
selwyn
we might want rk4 or a symplectic integrator
20:46:05
shinmera
then you can just subclass rigidbody
20:46:44
selwyn
why should the integrator you use be coupled to rigidbody
20:46:45
shinmera
implementing rk4 would also require more far-reaching changes.
20:47:09
selwyn
i claim these changes would make it better
20:47:12
shinmera
since you need to be able to get access to the acceleration change, which would require changing shit in the resolution, too.
20:47:38
selwyn
but i also don't know what these changes are for, or how sophisticated you want to make things
20:47:51
shinmera
I am extremely skeptical that RK4 would ever actually be benefical for game physics.
20:48:15
selwyn
it was taught as 'the' method in my game programming book
20:48:53
selwyn
the euler method has its disadvantages
20:49:21
selwyn
the optionality to easily implement another method would be useful later on imo
20:49:31
selwyn
it is not entirely about rk4 being flashy
20:50:25
shinmera
I would have to be convinced that the tradeoff of complicating (and expensifying) the interface would be worth such a remote chance.
20:57:40
shinmera
Like, the chance of not just having that implemented, but having that implemented *simultaneously* with the old integration scheme.
20:58:01
shinmera
I wouldn't be opposed to changing the integration scheme if it can be shown that it's a good tradeoff.
20:59:52
selwyn
maybe it is genuinely a different situation in game physics
21:00:21
selwyn
but i spent like a month during my phd checking out different integrators
21:00:34
selwyn
because the gain would have been worth it
21:01:35
selwyn
the problem is that euler integration usually does not exactly preserve quantities that ought to be preserved
21:02:41
selwyn
its considered harmful when you don't preserve those
21:03:23
selwyn
i had to learn what a gauss legendre method was
21:04:02
shinmera
I mean, what I implemented here is not euler, but verlet.
21:04:12
shinmera
and verlet does conserve energy, iirc.
21:07:08
selwyn
you should have said something :p
21:07:16
shinmera
Verlet is extremely common for games because it's cheap and good enough.
21:07:34
selwyn
well in that case im more satisfied
21:07:48
selwyn
im not even sure if rk4 conserves energy
21:07:53
shinmera
I didn't say anything because Verlet is also called 2nd-Order Euler, so I wasn't sure if you were just abbreviating.
21:08:16
selwyn
there is probably more than one second order euler method
21:11:41
shinmera
Anyway, that second term is going to be extremely small almost always, since we have a default timestep of 0.01, so 0.0001*a.
21:12:04
shinmera
And at that point I'd be more concerned about floating point precision, since everything is still stuck with single floats.
21:12:21
shinmera
So if I were you, and worried about accuracy, I'd get to work on that 3d-vectors/etc. rewrite, first.