(02-01-2025, 12:34 PM)stevantosic Wrote: WebSocket is more suitable for browser game communications. HTTP has a header load for each request/response.
Yes I agree, but I don't think this is available on my current ISP without buying a VPS.
PS
The js-php communication with AJAX I am using is not really the bottleneck I don't think (although it may be faster with sockets) - for me the client/server round trip (send and receive) only takes 2 or 3 frames when running at 60fps - some of that is database handling of the data. My understanding is that sockets are just 'always open' AJAX. There is also a delay in sending and receiving messages over the web (the round trip for this send and receive is also around 2 or 3 frames). Finally my understanding is that HTTP is similar performance to TCP, and maybe faster for direct communication to php. I use 100 ms to ensure good chance of full synchronisity in my SB code - this is typically about 6 frames at 60 fps.
The control would be a lot easier if we can just tell the 'robot' to move to a certain coordinate or look in a specific direction rather than start and end moving with uncertainty exactly how much movement/rotation will take place, but it is a fun excercise to do it.