View Single Post
  #2  
Old 11-14-2018, 10:20 AM
Secrets Secrets is offline
VIP / Contributor

Secrets's Avatar

Join Date: Oct 2009
Posts: 1,354
Default

Quote:
Originally Posted by maskedmelon [You must be logged in to view images. Log in or Register.]
trying to decide a direction to go for building the client-server communication interface system (netcode?), and have been tiptoeing into related information, but thought I'd solicit some opinions. Any thoughts on which of these would work better, or if i should just make my own thing with liek binaryformatters and UDP or something? My experience is super limited and I know next to NOTHING, so any/all feedback is appreciated and feel free to ridicule me!

also, im using c# and while i would prefer a c# amenable solution, im not opposed to learning another language if it would work much better or be simpler or otherwise offer a robust set of advantages of c#.
UDP is unreliable. You can get away with having UDP if you implement your own version of TCP on top of the protocol. This normally requires a lot of knowledge of bitflags and optimization. By far, it's the fastest though. If it's your first project, I don't recommend that. It can get confusing.

You could do a RESTful API (ie; json messaging over HTTP), but it won't be synchronous like an MMORPG server would require/prefer. If you're going this route, make sure the server is the only one who makes important calls to the API like managing inventory, stats, etc - and make sure the player has one session at all times. It's normally easier said than done. Still would need a type of netcode on top of that.

Raw TCP sockets are great for server to server communication. Not so much for other things like gameplay. Look into stuff like websockets if you must use TCP; it works with C# nicely.
__________________
Engineer of Things and Stuff, Wearer of Many Hats

“Knowing yourself is the beginning of all wisdom.” — Aristotle