• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Jeremiah

data mingling

14 posts in this topic

How does sockets deal with this problem: two clients send a server information at the same time. how does sockets keep both clients data seperate?
0

Share this post


Link to post
Share on other sites
Are you asking how to code so that you don''t have data mingling? Or are you asking how the IP stack works?
0

Share this post


Link to post
Share on other sites
if a server can have multiple sockets open to different clients right? well, with only one modem to transfer data back and forth, how does the data not mingle.

this isnt a programming question, just a how does it work question.
0

Share this post


Link to post
Share on other sites
Each packet sent through TCP has addresses within it. The TCP/IP stack reads those so it knows which socket to send the data to, thereby giving the appearance of multiple ''lines'' over one phone line, network cable, etc..
0

Share this post


Link to post
Share on other sites
I apologize for not fully understanding.

If two clients try to send a packet of data each to the server, how does the sockets keep one from interupting the others data?

Like if three people had radio transmittors.
person 1, 2, and 3. Lets say Persons 1 and 2 want to talk to person 3 at the same time over the transmittor. How would person 3 keep 1 and 2 from talking over each other, and to wait their turn before they can talk?
0

Share this post


Link to post
Share on other sites
Simplification:
Network communication works on several levels. The lowest level is physical, this encodes the data into 1''s and 0''s. Devices on the same physical connection have a protocol in understanding the 1''s and 0''s called a data-link protocol. On a data link layer, devices send back and forth little bundles of information called frames. At this level you can only communicate with machines on your physical medium. However, if you want to send an IP packet, you wrap it in a frame and send it to the router on your datalink. (For a modem user, this is just the modem server.) The router figures out where the packet is going, wraps it in a new frame, and sends it down a datalink to the next router towards the destination. Communicating via packets is called network layer.

So the server is receiving two packets from different clients. The router servicing the server gets the two packets, and wraps one packet in a frame and transmits it to the server and then wraps the other packet in a frame and transmits it to the server.

Only one thing is communicating with the server: the router, not the clients directly.

If you have more computers on your data-link than just the server and the router, say on an ethernet, there''s a protocol where machines wait their turn to talk on the wire.
0

Share this post


Link to post
Share on other sites
Nothing ever *really* happens "at the same time". Ever.

But some people deal with what you describe by multi-threading, and giving each client a separate thread. The other popular solution (which we use) is the "message queue" approach. Essentially, you just "round robin" each of the client sockets and process whatever input they''ve received since the last time you came around.

DavidRM
Samu Games
0

Share this post


Link to post
Share on other sites
quote:
Original post by DavidRM
Nothing ever *really* happens "at the same time". Ever.


Sure it does. At least in networking. Transmission stomping occurs all the time on physical media. That''s why we have protocols like CMSA/CD and CMSA/CA. The end user is (and programmer, for the most part) is simply shielded from it, because network engineers do their job right.
0

Share this post


Link to post
Share on other sites
Hey? What about broadband. This topic has been discussed ALOT here in Sweden, everyone''s talking about it and every damn company offers it (at a too high expense though) but not many people really knows what broadband really is.

Broadband is the ability to send data with full duplex simultaniously over a cable in different channels, like cable tv does. The technique when only one line exists and you have to do CMSA/CD and CMSA/CA like SiCrane said, or tokens in a token network or whatever, is called baseband.

(I hope the definition of broadband and baseband is clear, since I translated it from swedish )

Daniel Netz, Sentinel Design
0

Share this post


Link to post
Share on other sites
This question relates to your other question Jeremiah. Thinking of the single process responses you might want to use the message queue style. If you have a client that is more important than another client you could always add priority to the queue and use a priority queue instead of just a plain queue. Any basic algorithm book should have priority queues detailed in them. When you program using a message queue make sure that you select() is timing out. You would not want your code to hang in the middle because your sitting there waiting on a client socket that is never going to answer.

Kressilac
ps Again I point to either the links mentioned here or a good MUD. MUDs are free source and usually have tried algorithms for handling sockets. Many muds handle up to 500 players at a time as well and probably could easily handle many more.

pps Where are you from in KY. I am from Louisville.

0

Share this post


Link to post
Share on other sites
I'll have to go check through some MUD source then. =)

that should definately help in my chat server I am going to create. Another thing though, is that my AI World will need to send roughly 15 [1K each] a second to EACH client.
thats 15K/sec, and Im not sure if thats possible under a 56K modem. or whether the server can handle that much bandwidth and processing.

[btw I am from the Elizabethtown area]

Edited by - Jeremiah on 2/10/00 10:45:46 AM
0

Share this post


Link to post
Share on other sites
You can usually find ways to minimize bandwidth requirements. You will also have to test it and as you get familiar with the speeds you are getting and lag, etc., etc. you will be able to program for the networking conditions you are facing. A lot of times bandwidth issues are trial and error.

Kressilac
0

Share this post


Link to post
Share on other sites
You probably already know this, but you should _only_ send data that the client cannot figure out himself. For example if a character is walking in a straight line you only need to tell the client that once. After that the client can figure out where it will be at a later time, given that it nows the speed of the character.

0

Share this post


Link to post
Share on other sites
There is an article on either this site or Gamasutra regarding statistical prediction for use in dead reckoning which is what the post by spellbound is getting at.

Kressilac
ps Apply the only-send-what-is-needed attitude all the time and you will inherently minimize some of the data you are sending.

0

Share this post


Link to post
Share on other sites