Which is better?
Is it better to use basic winsock for online games or is it better to use directplay ? whats the difference?
September 29, 2002 02:57 AM
Check the FAQ for this forum, and do a search on this forum, because there are about 20 topics in this forum exactly the same.
Personal opinion only, not expecting a flamewar :D :
Use Winsock. To me, it feels cooler. Why? Technically, it's lower level, you have much more control over the efficiency of the communication (and unfortunately the lack thereof as well).
Besides the novelty of avoiding directplay and being able to say "yeah I actually wrote some code on my own", you will have a MUCH easier time with portability IF you play your cards right.
[edited by - Xori on September 29, 2002 4:15:16 AM]
Use Winsock. To me, it feels cooler. Why? Technically, it's lower level, you have much more control over the efficiency of the communication (and unfortunately the lack thereof as well).
Besides the novelty of avoiding directplay and being able to say "yeah I actually wrote some code on my own", you will have a MUCH easier time with portability IF you play your cards right.
[edited by - Xori on September 29, 2002 4:15:16 AM]
DPlay will do everything for you out of the box. Winsock requires you do all the work yourself like streaming TCP packets and UDP handling. It''ll take you weeks or months to do what DPlay would have going as soon as you initialize it which takes only an hour or two.
Portability is overrated but it is kinda cool running my current server in a text window with absolutly no Windows dependent functions. Especially considering what goes on under the hood.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
Portability is overrated but it is kinda cool running my current server in a text window with absolutly no Windows dependent functions. Especially considering what goes on under the hood.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
September 29, 2002 07:53 PM
Portable network code isn''t overrated. Just look in a server query type program for just about any popular client-server game out there and see how many servers are running on linux. ''Nuff said.
If you want to run your server on Linux, code it for Linux.
If you want to run your server on Windows, code it for Windows.
If you want it to run on both, code two servers dedicated to their respective OS.
For my own project the Windows client won''t run on Linux since it uses DirectX. However the code is OO and the netcode uses Winsock so if someone wanted to write a Linux client, they could by ripping out the DirectX class and popping in OpenGL or the SDL or whatever instead.
What''s overrated and ineffient (as demonstrated by the slow and crappy SDL) is writing a single code base that works for multiple platforms. All you get is bloat with zero benefit. Software needs to be fast. Not multiplatform.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
If you want to run your server on Windows, code it for Windows.
If you want it to run on both, code two servers dedicated to their respective OS.
For my own project the Windows client won''t run on Linux since it uses DirectX. However the code is OO and the netcode uses Winsock so if someone wanted to write a Linux client, they could by ripping out the DirectX class and popping in OpenGL or the SDL or whatever instead.
What''s overrated and ineffient (as demonstrated by the slow and crappy SDL) is writing a single code base that works for multiple platforms. All you get is bloat with zero benefit. Software needs to be fast. Not multiplatform.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
quote:
Original post by KalvinB
If you want it to run on both, code two servers dedicated to their respective OS.
I couldn''t agree more. The only way to create a properly optimized server, is to specifically use features of the underlying operating system to get the most out of the hardware. Believe it or not, but Windows has a vastly different architecture to Linux or just about any other OS out there and you''re going to get shocking performance if you write your server to the "lowest common denominator".
At the same time, I wouldn''t recommend DirectPlay, even though it''s apparently quite fast and in fact is designed to work with large multiplayer servers. Personally, I''d feel safer knowing that I''ve made the most of the features of the OS, rather than hoping that I wrote my DirectPlay code the way the authors of DirectPlay were expecting me to...
If I had my way, I''d have all of you shot!
codeka.com - Just click it.
Portability doesn''t have to refer to system dependent architectures such as the Winsock (NOT 100% portable anyways), and DirectPlay debate. It is possible to write code that requires a minimal amount of system dependencies while maintaining a high level of performance on multiple system types. Portable code also tends to be ''correct'' code, as typically only standard stuff is supported across the board. Portability has been a requirement on every server I''ve worked on professionally...
If you already know everything there is to know about Network programming, and you want to run servers on windows, then use DirectPlay. If you want to know what is actually going on with the network, want to have options on where to run the servers, and want something you could use as a demo (e.g. to find a job), then I''d suggest using WinSock.
If you already know everything there is to know about Network programming, and you want to run servers on windows, then use DirectPlay. If you want to know what is actually going on with the network, want to have options on where to run the servers, and want something you could use as a demo (e.g. to find a job), then I''d suggest using WinSock.
Actually, DirectPlay is great for those who DON''T know anything about the workings of networking but want to learn how to write a messaging system that can do advanced concepts like packet compression, prediction, scripting, ect to write fast net code.
Winsock is for the people who know everything (or enough) there is to know about how to write an efficient messaging system and need to get to a lower level to get any faster. Starting with Winsock forces you to learn more than you need to at once.
"...want something you could use as a demo (e.g. to find a job), then I''d suggest using WinSock."
Concepts vs implementation. It''s the SAME concepts that make an efficient messaging system with DPlay as Winsock. Moving to Winsock from DPlay was/is cake.
I''d like an example of when someone who could code a very fast Client/Server (with the advanced concepts of compression, prediction, ect) project in DPlay who was turned down a job just because they never coded the low level operations themselves in Winsock.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
Winsock is for the people who know everything (or enough) there is to know about how to write an efficient messaging system and need to get to a lower level to get any faster. Starting with Winsock forces you to learn more than you need to at once.
"...want something you could use as a demo (e.g. to find a job), then I''d suggest using WinSock."
Concepts vs implementation. It''s the SAME concepts that make an efficient messaging system with DPlay as Winsock. Moving to Winsock from DPlay was/is cake.
I''d like an example of when someone who could code a very fast Client/Server (with the advanced concepts of compression, prediction, ect) project in DPlay who was turned down a job just because they never coded the low level operations themselves in Winsock.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement