• 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.

shmaLbus

UDP vs. TCP

4 posts in this topic

i was just wondering what is prefered when writing with sockets fer games (in c/c++). also i have a little sample app that works alright but i was just wondering how everyone else does there apps. just a basic concept or some pseudo code would be alright. i''m just tryin to get some ideas. and can i get the address of incoming data on UDP or even TCP? that would be most helpful. and how can i send a datagram to a specific address? i guess that if i had the address i could change to that, send, then switch back to recieving from any address. i''m new at this type of programming but i''m learning. writing your own HTTP server and stuff is a bit different than making a game out of it heh.
0

Share this post


Link to post
Share on other sites
UDP vs. TCP is a well discussed topic on this forum. I would suggest looking in the past 90 days for a thread with similar titles. There aren't that many threads in multiplayer programming so it wouldn't be that hard.

When accept()ing an incoming TCP connection you can fill an sockaddr sturcture which will contain the IP address of the client. I believe you can get similar data from a recvfrom() call for UDP.

You send a datagram to a specific address with the sendto() function.

[* This message editted for spelling errors *]

Edited by - SiCrane on 2/23/00 7:51:55 PM
0

Share this post


Link to post
Share on other sites
It depends on the type of game you''re writing....

TCP is what is known as a "connection" oriented protocol. It promises to get packets to their destination and in the correct order, so long as the connection is not lost. It''s reliable and easy to use, but best suited to slower paced games. Think board games, puzzle games or turn based strategy.

UDP is known as a "connectionless" protocol. That means you can send a UDP packet to anybody on the Internet without first creating a connection (which is sometimes a security concern). UDP packets can arrive out of order, or even worse, not at all. Sometimes this is what you want, since UDP won''t log jam like TCP will when it tries to resend lost packets. All of the Quake and Unreal games use UDP.

You might want to check out this article by Dan Royer for more details and source code: http://www.flipcode.com/network/
0

Share this post


Link to post
Share on other sites
SiCrane is right. One of the parameters for a recvfrom call is a pointer to a sockaddr structure. After the call completes, this structure contains the address of the packet''s origin.

- genovov
0

Share this post


Link to post
Share on other sites
ok thanks, that''s exactly what i needed.
oh jeez, i can''t believe i never even noticed that you could look at older threads. i never saw that drop down box and i''ve been coming here how long?
sorry bout that.
0

Share this post


Link to post
Share on other sites