We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D maze in browser controlled by Small Basic
#23
(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.
[-] The following 1 user Likes litdev's post:
  • stevantosic
Reply


Messages In This Thread
RE: 3D maze in browser controlled by Small Basic - by litdev - 02-01-2025, 01:41 PM

Forum Jump:


Users browsing this thread: 9 Guest(s)