new to multiplayer progamming, some questions.

Started by
5 comments, last by OrcSlayer 19 years, 11 months ago
1.what should I use? DirectPlay or Winsock? what is more comfortable, and easy to use? 2.do I need to learn threads for making an multiplayer game? because I heard I need to create threads, if not it''s very slow... TIA.
Advertisement
1. Winsock is quite good. Maybe not the easiest but once you figure it out howto use it, there is no problems to use it.

2. Not necessary need threads. Peronally Ill use select based system and seems work well for my project.

Making online game is quite large project and could take years to complete if you do it alone, I know this one. Ofcource this depends genre of your game.

X
I highly recommend winsock (raw).

Threading is an essential concept and programming tool. Learn it because it can be very beneficial later on.

Kuphryn
I find that, after you learn to use threads (which is important), you try and use them everywhere.

Sometime later, you''ll start realizing that threads often cost more than they gain you, and you''ll learn to use threads only where necessary, which is even more important!

I''d recommend winsock and select(), which makes for an easy-to-port program with high performance and without threads.
enum Bool { True, False, FileNotFound };
SDL_net
Raduprv:
I''m using DirectX, I dont want to use another library...

I decided I will use Winsock.
I did some research and I found there are 2 types, Asynchronous Sockets, and Non Blocking.
what should I use?
Someone can correct me if I''m wrong, but blocking and asynchronous means that one call blocks whereas the other does a check and returns right away. Which one to use totally depends on your architecture.

DirectPlay is an overkill for most cases. Winsock is simple enough.

Threads are usually slower for most network-related applications. Select is usually faster and lets you avoid concurrency issues, which are always a pain.

This topic is closed to new replies.

Advertisement