Project 1999

Project 1999 (/forums/index.php)
-   Off Topic (/forums/forumdisplay.php?f=19)
-   -   Semi-mmo (rpg) Netcode: WCF or GRPC (/forums/showthread.php?t=310741)

maskedmelon 11-13-2018 10:39 AM

Semi-mmo (rpg) Netcode: WCF or GRPC
 
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#.

Secrets 11-14-2018 10:20 AM

Quote:

Originally Posted by maskedmelon (Post 2807572)
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.

Izmael 11-14-2018 10:33 AM

Using TCP means any minor network hiccup will result in lag spikes that you can't really do much about - the lost packet / retransmission / reordering logic is handled by the OS, not you.

Using UDP means managing it all is up to you. Like Secrets said, it is obviously a lot more work, but you get to adapt the netcode to the precise needs of your application.

For anything even remotely ressembling an FPS or a 3D MMO, UDP is IMO the only reasonable approach.

You can look at the ioquake3.org project. The project is opensource and the netcode is done by John Carmack who is basically a demigod as far as 3D multiplayer gaming is concerned. Suited for fast-paced FPS. Very efficient, and fault tolerant on bad networks. Hard to scale past 64 players (will require a lot of reworking).

EqEmu is also opensource and also relies on UDP netcode. Better suited for larger scale games, such as *surprize* Everquest, but has nowhere near the efficiency of the above.

It might be worth checking the iodoom3 project as well. Basically it's the next generation of the ioquake3 engine. I think it's in C++ and not in C though (like ioquake3). Not sure how much better it is, if at all.

Secrets 11-14-2018 03:31 PM

Also relevant: https://arstechnica.com/gadgets/2018...-be-using-tcp/

maskedmelon 11-16-2018 02:35 PM

thank you both. That helps a LOT. i was meandering in the direction of asynchronus sockets because it seemed that everything I'd read indicated it was the fastest and I hadn't even considered the issues of making sure all the clients are synchronized.

I'll look into the we sockets and eqemu's udp system. will be helpful to study some working code rather than just random tutorials :3

Izmael 11-16-2018 03:53 PM

Or you can use Unity and skip, at least for now, the need for worrying about the netcode (which may very well end up being a steep mountain to climb).

maskedmelon 11-16-2018 04:10 PM

yeah, I thought about that, but then I'd have to invest my time in learning unity, which isn't really transferrable and i find most of the things i want to do are easier to just write then find a way of integrating with unity. It's probably just a lack of familiarity, but liek for example with the animator I wanted to figure out how to animate a sprite sheet once and swap out textures for different armors and stuff. It's super simple to write on its own, but in unity, you have the interface where you plug all your cells and the animator class doesn't allow acces to the images (get/readonly iirc), so I'd have to work some weird IO magic on the side to swap the files or something goofy. whereas with monogame I can just uniform animations based on my sprite sheets and then swap/layer as I liek ^^ also I would have to stop coding and get to working on more art/content and I am currently super limited on time.

you might be right though, it may be a better route, it i don't feel I would learn as much and may end up spending a bunch of time to build a poorly functioning game on a proprietary platform without having learned much about creating software. I've been working with monogame and am happy with what it allows me to do without diving too low or being too removed. ^^

Secrets 11-16-2018 07:09 PM

Quote:

Originally Posted by Izmael (Post 2809324)
Or you can use Unity and skip, at least for now, the need for worrying about the netcode (which may very well end up being a steep mountain to climb).

Netcode in MMORPGs is the #1 important thing to be worried about, especially if you are concerned about cheating. Validation on the server and knowledge about what the client and server are actually doing is going to be key in stopping undesirables and making an optimized gameplay experience.

Unity doesn't offer a solid netcode solution, or historically hasn't at least. I don't know about now, but Unity's netcode solutions were limited to "Photon" or "Make your own" from what I last looked. UE4 requires a bit more hand-on with replication and client/server functions but is ten times more secure (also ten times the effort, which is not good for indies)

Izmael 11-16-2018 09:05 PM

Thing is, someone who is obviously not proficient at TCP/IP programming has ... pretty much zero shot at building a reasonably good netcode solution for an MMO from scratch.

Or at least not in a reasonable time span. So much stuff to learn before even starting.

Existing engines such as Unity or UE offer a degree of abstraction from that concern which may allow the OP to build something that actually works to an extent (before he realizes it will take him many, many years to ship something usable ;)


All times are GMT -4. The time now is 04:44 PM.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.