Network API

Started by
6 comments, last by Detroit Rock 16 years, 7 months ago
Is there an API that is used to make networks for games? Maybe some sort of OpenNL (open network library) or something? I'm using OpenGL, OpenAL, and SDL right now and I'm trying to keep things cross-platform, so if there's a cross-platform API that would be great :)
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
Advertisement
Well, the Multiplayer and Network Programming FAQ is usually a good place to start. (Check Q8)
Check out my devlog.
ah very nice! thanks! after a quick glance, it looks like my choices would be between OpenPlay (for high-level programming) or SDL_net for a smaller simpler API. Which would you recommend? Any experience with either of these? Any other API suggestions from that list that may be a better approach?
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
After looking at the list a bit more, it looks like Pegasus Network Library is similar to the naming convention of OpenGL and such; how is that library?
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
It's worth noting that traditional sockets work pretty much identically across all platforms. A couple of #defines lets your Windows code compile on Linux and vice versa.

It's also worth considering Net2 as a layer on top of SDL_net, if you were going down that path already.
traditional sockets? like something like simple winsock? Also, is there maybe a tutorial or some examples I could look at? I'm not sure exactly how networking is handled... Is it just sending data that you specifically need other clients to see, such as your player movement, when you shoot, etc. and need to receive what other players do?
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
Winsock is essentially a Windows implementation of Berkeley Sockets, which is the de facto way of doing TCP or UDP connections with other computers. You'll find that many network libraries offer surprisingly little over just using plain sockets, often to the point of making you call just as many functions to get the job done.

Networking can be simple or it can be complex. In terms of information transfer, it's no more difficult than having one program write a file and another one read it, and the code would be remarkably similar. The difficulty comes in how you choose to encode your information, how you deal with the length of time it takes to arrive, and so on. There's probably no single tutorial that can tell you "how to do networking", because essentially it just handles the transfer of information - you have to decide what information to send, how often to send it, who to send it to, and what to do when you receive it. So it's more of an area you need to read up on, and then make the implementation choices based on your needs.
Quote:Original post by BloodLust666
traditional sockets? like something like simple winsock? Also, is there maybe a tutorial or some examples I could look at? I'm not sure exactly how networking is handled... Is it just sending data that you specifically need other clients to see, such as your player movement, when you shoot, etc. and need to receive what other players do?


Networking will be whatever you need it to be. Does your multiplayer game need to know about other players movements and actions in real time? If so, you'd better write code to send and receive that information in real time. If you want in-game chat, code up a way for that to work, too. If you just want a high score board for a puzzle game, you need to write code that'll connect to the high score server, submit the score, etc.

This topic is closed to new replies.

Advertisement