First, this is a question not only about network lag, but delay from wireless controllers and delay to TVs/Monitors. For a fast-paced action game, how do you compensate for these things? Has anyone come up with a reusable way to do this? If so, I haven't seen one. I'd like to see a game framework that includes this out of the box.
If there is no previous examples available, how would one implement this into an Update(float deltaTime) loop? Would it be possible to disguise or hide lag?
Dead Reckoning: Latency Hiding for Networked Games
Valve Developer Communnity: Source Multiplayer Networking
Ah!, it has been asked previously: Dealing with Latency in Networked Games
Voting to close.
Related
I'm trying to write an app that will be able to see when a lot of people are close inside a single area. I was thinking to use BLE. I don't have a good knowledge of this technology and I have a single, but big question. In modern days, how easy is it to see a BL device that is actually transmitting and discoverable in places like streets, etc...? It's my idea very dumb? Will my idea work with the spread of contact-tracing apps?? Thank you.
You can scan the Bluetooth frequency bands to detect devices that are advertising themselves, so yes, this is possible.
What might be more difficult is making sense of it all. If I run a Bluetooth scanner in my study, I get dozens of devices, most of which I have no idea what they are. A lot of them will probably belong to the people living next door; some advertise their name (Apple TV, for example), but most don't. If you look at the signal strength you can probably rule out a fair few devices that are too far away for your purposes.
I've currently developed a BLDC motor controller and it generally works fine. During some events however the microcontroller locks up (e.g. stopping the motor or fast changes of duty cycle). Because of this, I want to isolate the microcontroller from the power side (i.e. isolated supply and optocoupled signals) the issue however is I'm using sensorless control and am wondering what the best way of relaying the phase values back to the microcontroller would be?
I currently detect the zero crossing in software and use this to commutate my phases (as per the Microchip AN970 amongst others). I'd rather not use comparators on the power side and optocouplers to send back a digitized version of the phase voltages as I want to have the ability to change the trigger point.
I've looked at isolation amplifiers but they seem pretty expensive and I was wondering if there were any potentially cheaper solutions.
Thanks
Maybe have a look at this document:
https://www.silabs.com/documents/public/application-notes/AN614.pdf.
We use this design, but in a total different application. I dont' really know much about BLDC motors but maybe it helps.
kind regards
I'm making an online billiard game. I've finished all the mechanics for single player, online account system, online inventory system etc. Everything's fine but I've gotten to the hardest part now, the multiplayer. I tried syncing the position of each ball every frame but the movement wasn't smooth at all, the balls would move back and forth and it looked "bad" in general. Does anyone have any solution for this ? How do other billiard games like the one in Miniclip do it, I'm honestly stuck here and frustrated as it took me a while to learn Photon networking then to find out it's not that good at handling the physics synchronization.
Would uNet be a better choice here ?
I appreciate any help you give me. Thank you!
This is done with PUN already: https://www.assetstore.unity3d.com/en/#!/content/15802
You can try to play with synchronization settings or implement custom OnPhotonSerializeView (see DemoSynchronization in PUN package). Make sure that physic simulation disabled on synchronized clients. See DemoBoxes for physics simulation sample.
Or, if balls can move along lines only, do not send all positions every frame. Send positions and velocities only when balls colliding and do simple velocity simulation between. This can work even with more comprehensive physics but general rule is the same: synchronize it at key points. Of course this is not as simple as automatic synchronization.
Also note that classic billiard is turnbased game and you do not have all the complexity of players interaction. In worst case you can 'record' simulation on current player client and 'playback' it on others.
I would like to create an FPS game but need to manage bandwidth on servers. What things do I need to design in to do this?
For example should I use TCP or UDP?
What data do I need to send and should I compress it somehow?
I'm thinking I need position, heading, pitch, firing gun boolean.
Other considerations I've missed?
Any help is appreciated.
Thats not true. How you can say, that all all real-time action games using UDP. You can't know, because you don't have write these games and only the networkprogrammer of these games knows, what they are using.
I personally know, that 2 realtime network shooter (one of them are mmo) definitly use TCP network. Its save and better to handle. And at last. If you program UDP to make a game, you must code 80% of the protocols TCP to make your packettransfer save. So, UDP is unacceptable today.
Best Regards.
May I direct you to the best online resource I've found on this subject?
Networking for Game Programmers
I highly recommend creating a 2D networked game before you even think about making a 3D one. Once you've read Fiedler's articles, you'll have a much better idea of how to accomplish this.
Some general notes:
All real-time action games use UDP. No exceptions.
In order to hide client-side input lag, implement client-prediction.
In order to hide any other lag, implement interpolation and extrapolation.
Have fun!
I'm making a two player 3D game, and need to synchronize the location of the remote player. Only one object, the avatar representing the player, needs to be synchronized between the two games.
I thought this would be pretty straight forward, but it turns out even in a local network the remote player is moving in a stuttery way when playing on two different machines (two instances of the game on the same machine looks fine).
In the current approach one game is the server, while the other acts as a client, sending coordinates as text strings over a dedicated port. They are basically streaming avatar coordinates to each others, each time the avatar is actually moving.
Any idea how resolve lag related issues when sending/receiving coordinates? Only needs to work over a local network.
Glenn "Gaffer" Fiedler's series of articles on Networking for Game Programmers are pretty much the go-to guide for basic game network programming. He also has an article on Networked Physics.
Many of the techniques described in that series of articles (eg: reliability) are already implemented for you in libraries like Lidgren.
Basically the techniques you want to use are interpolation, extrapolation and prediction. There's a good explanation of them in this article in the aforementioned series, plus the Networked Physics one. Basically you take the unreliable, laggy stream of position data, and use that to make a visually plausible estimate of the actual path of the object.