few weeks back I thought about create a mmorpg game using react three fiber since I thought about it’ll be fun since I have never tried anything like that and I am not that great in three js so it’ll be good experience and I have managed to network users through socket io and sending there positions. But after that I was thinking about creating video conferencing app where users can move around in game like space will be connected through video call based on their characters proximity (not a original idea ik since lots of same app already in market but its for fun), and I have managed to do that too but I have realized that its not performant way and since I have achieved the basic functionality , I would like to make it more performant. So what could be the way I can make it more efficient?
Something that comes in my mind is that I can use physics library to know if some is in user’s proximity instead of using calculating distance between all the users in game loop but issue is that I am using react three cannon for physics and I am positioning other users using positions instead of using velocity and when I use position on api, collision detection stops working, is there a way around this? also are there any way to make socket connections efficient? like I am sending x and z coordinates in game loop when ever user is moving, pretty sure this is not a good way of doing this. Suggest some good learning sources where I can find good understanding and patterns for achieving this.
Thank you!