Tag Info

New answers tagged

1

According to the answers on this page, about 512 is a safe amount for ipv4 because nearly all consumer's hardware will be able to support that size. For ipv6, 1500B is the maximum safe packet size. Subtract 40 + 8, the ipv6 and UDP header sizes, and you get 1454B maximum data inside that packet. If you send something over the limit, it's most likely going to ...


0

A more reliable and efficient method of syncing new players is delegating this task to another player. Since Photon's servers aren't authoritative, this is the next best option to catch someone up. One method is to send an RPC to the master client telling it to catch you up on the game state. The master client then sends you a stream of data giving you ...


1

I don't understand why you use server client model, if your server has 0 authority and lacks capability to enforce rules. Your server have to know the map. How else could it stop player from walking through walls. You say "client side is unmodifiable", I say you are misinformed. There is no such thing as "unmodifiable client". You are trusting too much on ...


2

It's actually the other way around. Games are made deterministic to be online. The basic idea is to send commands rather than game state. If you have a function F(X) = Y and you need everyone's Y to be the same, you can send X instead of Y. The reason why this happens in the first place is because sometimes commands are more efficient than game states ...


0

The easiest way to implement interpolation correctly is by using fixed time steps. Basically, if you know you're going to get a new position about 10 times a second, you can interpolate from the last position to the current one in the time it takes to get a new position (.1 seconds). In reality, there are things like jitter that make your job harder so ...


1

I would suggest making a separate buffer for each player that is responsible for squashing commands together. Basically, it should reduce a set of network packets into an approximation of user's input, which is sampled only once per game update that should result in equally significant change for every player. The question is, what should be sampled from ...


1

Your game shouldn't depend on the speed at which the packets are sent as it will vary depending on your internet connection regardless of what rate you attempt to send them. Instead your server should move the character depending on the user actions (e.g. while they are pressing (sending) W move them forward, or if you are counting mouse clicks then send ...


0

Be aware that a RPC function has to be unique within a scene. I wrote an blogpost explaining this in detail: http://parttimeindie.com/2015/05/08/understanding-and-using-rpcs-in-unity/ To Summarize the blogpost: A RPC Method Signature has to be Unique inside a Scene, you can not have multiple instances of one script or Two Scripts with a Method with the ...


3

From the documentation: RPC calls are always guaranteed to be executed in the same order as they are sent So, yes, it's guaranteed to execute A then B as your code defines it.


0

Clumsy, for Windows Vista & 7.


1

If you're using, for example, Unity's standard networking without an authoritative server, an RPC would be better because syncing something every frame can be VERY expensive because the packet header is some 20-40 bytes of bandwidth overhead in addition to the identification of the object being synced. You end up sending a lot more data than necessary. ...


0

The server contains the actual running model of the game (the only source of truth). Each player sends commands to be executed in the server's model, and when they see those actions take place, it's a result of the server accepting that command and echoing back the effect of it. This echo is also broadcast to all other players in tandem. If Player A is ...


0

It turns out Resources.FindObjectsOfTypeAll where T is GameObject, returns all game objects "resources" in the project. In other words this gets all your prefabs. They do not have to be in a "Resources" folder. Using this list I can now search them by some sort of ID( either assigned by me, or Unity ), then send that ID over the network and find the prefab ...


1

Can you? Yes. You would need to capture all the packets sent from a client, and the return packets expected from the server. This is a super long and tedious process to decipher packets, if encrypted packets, you need to decrypt. You would then need to write the entire server logic to interface with your newly understood packets. The process usually ...


0

The key to large-scale synchronization is determinism. Basically, if you can plug X into a function and get the same Y on all computers, you can send X instead of Y. For example the de facto RTS game sends commands rather than health, positions, rotations, etc. since syncing 500+ positions can use up quite a bit of bandwidth. For example, the command ...


0

You can also combine approaches from other answers (esp. splitting work into chunks, and finding bottlenecks in code) with implementing the most CPU-intensive tasks in asm.js - it's (a subset of) JavaScript, and it's fast on Fx and Chrome (and IE support is coming later).


-1

Try a hash of your entire "synchronized game state" instead of averaging data. There are some nice benefits to it, and is basically the standard for the RTS genre.


0

I highly recommend RakNet; it's relatively lightweight and implements a virtual connection over UDP for you (you don't have to manually send acks). I've had great success in using it across multiple projects.



Top 50 recent answers are included