221 karma · joined June 17, 2016
Maybe worth noting that if your world has some known starting state (eg after map load), it might be worth the client and server using that as the implicit initial state, even when a client joins a game in progress.
I really wish someone would make a header only C++ audio library, that would be soooo nice.
The point of the article isn't about c++ or why it's a good language for doing this sort of thing, but I'm a real time graphics and game engine programmer, so it's my language of choice.
One thing I have noticed is that when you post things, they get a lot more attention than when I do hehe.
Thanks for that (:
You would end up returning a size_t[4], which would have the results of your 4 searches in it, which ran in parallel.
Regarding the ternary operator, you can always check your assembly (here's some that shows it https://godbolt.org/g/BM6tfc), but the article also shows how to do it with a multiply instead of the ternary operator.
The biggest thing sticking out of this as being slow would be the cache unfriendliness of binary searching, but the link at the end shows how to clear that up (which is not the point of the article, but the ideas are compatible and combinable).