The online racing simulator
Speedup a insim
(5 posts, started )
Speedup a insim
Hey,

I had a idea but tho I have no idea if it would make any difference.

I'm currently working on a insim with loads of buttons etc, wich makes the insim goes a bit slower.

Does the lfs host support multithreading?

For example:

Instead of 1 insim connection, I make 2, 1 I use the receive packets (so that the most important thing is always right) and another insim connection, to the same server to sent all my buttons etc...

Would this help? Or would it stay the same...
You _could_ connect multiple programs on the same port, but that wouldn't help anything. It's not going to speed up the way LFS sends and receives packets. Assuming you're connecting it to a local server, there should be no "lag" with sending buttons, only at the client's end. What you could (and should) do, is make your program multi-threaded, to receive and send packets on different threads. Set each important receive/send event on it's own thread, and leave everything else in the main program thread. Should help a bit if there's heavy CPU work being done
Quote from dougie-lampkin :You _could_ connect multiple programs on the same port, but that wouldn't help anything. It's not going to speed up the way LFS sends and receives packets. Assuming you're connecting it to a local server, there should be no "lag" with sending buttons, only at the client's end. What you could (and should) do, is make your program multi-threaded, to receive and send packets on different threads. Set each important receive/send event on it's own thread, and leave everything else in the main program thread. Should help a bit if there's heavy CPU work being done

Hmmm ok, gona be a lot of work but I'll try to fix it that way... thanks anyway
As long as you don't kill the hosting company with the new insim :P we are alright.
Sending and receiving packets asynchronously won't make a difference to performance if the bottleneck is the natural latency that occurs sending the buttons from the program to the host to the client. Also if you're using an established InSim library, or have even read a networking tutorial, this will already be being done.

The InSim program should be on the same machine as the host though, as you will be almost doubling the latency of the network connection if it's not. Many big InSim apps, like CTRA, send lots of buttons without too much issue, so I think the solution to this problem may lie outside of InSim itself, and may have more to do with how your network is arranged.

Speedup a insim
(5 posts, started )
FGED GREDG RDFGDR GSFDG