Sign in to follow this  

Network API

This topic is 3744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this