News for hackers. Stuff that matters.
Re:Round a direction vector to an 8-way compass by Cthulhu_ on Monday July 25, 2022 @10:25AM (#32224734)
More faster is more better; you only have 16 milliseconds per tick assuming you want to read input 60 times a second, some games poll even faster / have a higher frame rate.
Re:Round a direction vector to an 8-way compass by nmilo on Monday July 25, 2022 @11:17AM (#32225569)
It's still a difference of 38.5 nano seconds. You have a budget 16,000,000 nanoseconds per frame. It's like Jeff Bezos writing about how to save money at Walmart; just pick the readable and stupid approach and move on. Game loops are made fast or slow by the efficiency of their tight loops: the render loop, physics update loop, UI loop, etc. Something that happens once per frame is barely ever worth considering.
Re:Round a direction vector to an 8-way compass by GeoKureli on Monday July 25, 2022 @08:22PM (#32232747)
Agreed, 35ns x4 times per frame is less important than readability.
Re:Round a direction vector to an 8-way compass by sgtnoodle on Monday July 25, 2022 @05:15PM (#32231031)
Ok, but 40ns of 16ms is 0.00025% of your frame time.