Hi,
kobos {l Wrote}:Brief of what i think so far:
Pure Client Server : cons{latency, cost}, pros{easy}
Cons: will not work in WANs.
Client Side Prediction : cons{Cost, difficulty}, pros{Hard to cheat, latency}
What exactly do you mean with Cost? Communication cost? And difficulty means implementation difficulty?
Pros: Bandwidth requirements only increase on server if number of clients increases.
Peer-to-Peer : cons{difficulty, cheating}, pros{cost}
Cons: bandwidth requirements increases on all clients if the number of connected peers increases (which is significant since most adsl connections offer a significant lower upload speed than download speed). Also I am not entirely sure if your p2p approach involves prediction. If not, and you want to do basically frame-by-frame exchange of steering information etc then I can tell you this will not work: we implemented this previously (it was intended for wired LAN usage), and became (from reports) unplayable the moment someone with a wireless network connection joined - not to mentioned latencies you will see when using WAN.
So the only option we can literally afford is p2p, all other options require a dedicated server that means hardware, bandwidth and maintenance aka money.
I don't agree with that. We need a server (which we already have - the addon server) to group people together, after that one of STKs of a player becomes the server. People can at the end vote a server up or down (perhaps including some warnings printed by the clients if certain inconsistencies are detected, e.g. too high speed etc.).
Cheating will be an issue, but remember this is open source and there isn't much we can do about it.
As I have written before - anything that just involves editing a simple (well documented) text file is imho too easy and should be discouraged. Cheating by actual code changes is indeed nearly impossible to prevent.
We can have a system of distributed authority where if a player seems to go too fast or be just that little bit too accurate then the nodes can detect this and flag it; given enough flags the player gets booted.
Yes, certain conditions could be checked, but this is going to be difficult - kicking someone off because he drives too accurate will result in complains

I did alot of research into networking api's such as RakNet and its base UDT not to mention ENET etc, I realized all they can provide is crossplatform sockets and not much else. I don't really want to be the one with the task of implementing an efficient p2p layer with all the accompanying work load so I went in search of an existing p2p layer and came across the SpoVNet project.
SpoVNet is an architecture for establishing “spontaneous virtual networks” that enable distributed end to end communication across a wide range of different protocols and infrastructures. For example if Player-A connects to the public Server-1 and then Player-B behind a NAT now connects to Server-1, then players A&B and Server-1 now form a spovnet. So if Player-A needs to send a message to Player-B then can do so without routing everything through Server-1 or say if Player-B was geographically closer to Server-1 than Player-B then Player-A can route its messages through Player-B. The advantage of this routing mechanism is scalability, in a very basic implementation of p2p all parties have to connected to each other so if there were 8 peers than each peer would have to send any update messages to each and every peer, this adds considerable overhead and restricts scalability.
Yes. But if you add other peers to forward/piggyback messages, you remove the advantage of low latency you mentioned above (assuming that your 'cost' is this), instead you get a higher latency than with client/server.
But the organization of the network isn't predetermined or necessarily mono-dimensional, you can view the network from a number of perspectives such that you could organize the network in terms of how close people are in that do their interactions affect each other? etc. etc.
The key concept behind spovnet is that the nodes in organize themselves into clusters, so if we had 3 clusters each with 4 players with one control player in each cluster, the control players would form a cluster that is a superset of all players. so if a player in one of the clusters needed to broadcast a message to all other players it would only need to be broadcast to the players in its cluster, upon reaching the control player for its cluster that message would then be broadcast to all members of the super cluster which would in turn disseminate said message down to all other players.
That is indeed a nice feature, but remember that this means the latency will in the scenario you describe increase 3-fold compared to a simple p2p approach, and it's 50% higher than client/server.
I will certainly have a look at SpoVNet (once we get 0.7.3. rc1 out), and the other libraries you've found - nice work.
...
From the application perspective we build the message and event infrastructure and then a network manager that interfaces with the spovnet API and then done.

The games state is modified through the passing of messages, so as long as all changes by each client are propagated then all clients will have the same state. This doesn't include a mechanism for when the physics is processed on the client side! We'd have to create a p2p prediction & correction system for that to happen otherwise its sending positions.
I don't really understand this - if all clients have the same state, this would include the position of the karts(?) If each client only handles its own physics, who is responsible for collision handling? Collisions are handled in bullet by a collision detection and correction algorithm: if two objects are intersecting, their position (and velocity, ...) are adjusted so that at the end of the physics step no more intersections exist. Who will do this in your p2p implementation?
I can't reach this page atm, will try again later.
But generally, if you think that p2p is the way to go, feel free to go ahead, I am certainly not a game networking authority

I am more than happy to create a branch for you - just let me know. I won't have time to do much for networking, since in the 0.8 releases I want to get the physics finalised first, but I am happy to help you with any questions you might have.
Cheers,
Joerg