• 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.
Sign in to follow this  
Followers 0
savail

ENet RTT different from own measured RTT?

6 posts in this topic

Hey,

I'm using ENet in my game and found out that the method ENetPeer::roundTripTime returns much higher RTT from the genuine value I guess. I measured RTT by my own - sending a reliable packet and getting it back took about 40 - 50 ms while ENetPeer::roundTripTime returns about 300 ms. Why is that happening? I guess the right value is 40 - 50 but why ENet gives so high RTT? It lacks documentation on this matter and I'm not sure whether it's my fault or I don't understand sth?

Edited by savail
0

Share this post


Link to post
Share on other sites

There are many mysteries surrounding ENet, I took up the same questions 8 threads down but nobody has posted an answer yet :/

0

Share this post


Link to post
Share on other sites

hmm, recently I thought that maybe the value returned by ENetPeer::roundTripTime divided by 8 will be the genuine RTT? It would match the RTT measured by myself. Maybe it's senseless tongue.png but when creating a host in the tutorial:

client = enet_host_create (NULL /* create a client host */,
    MAX_PLAYERS_IN_ROOM /* only allow MAX_PLAYERS_IN_ROOM outgoing connections */,
    2 /* allow up 2 channels to be used, 0 and 1 */,
    57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */,
    14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */);

the outgoing and incoming bandwidth are specified and divided by 8 too tongue.png. I don't understand why they need to be divided by 8, but maybe it's same with ENetPeer::roundTripTime...

Edited by savail
0

Share this post


Link to post
Share on other sites

The bandwidth is divided by 8 because it translates from "bits per second" to "bytes per second." That probably has nothing to do with the RTT.

 

Have you read the code that calculates RTT within ENet and figured out how it's calculated? It may start with some high guess, and then successively improve that guess as traffic flows, which means it may take a time to get a good value. (This is just speculation on my part -- I haven't used/read it personally.)

2

Share this post


Link to post
Share on other sites

hplus, you are great! Thanks a lot for your tip! It's highly dubious that I could figure this out soon enough :P and you saved my time and nerves. Indeed, it turned out that the right RTT is calculated over the course of time. I measured ENetPeer::roundTripTime after being connected for 1 sec and after being connected for 10 seconds. The results were alright in the second case - it seems 1 second isn't enough to calculate RTT appropriately in ENet.

 

Anyway, I understood that it was translated from bits to bytes per sec but the commented lines confused me, for example:

57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */

it's written that 57600 equals 56 Kbps but 56Kbps = 56000 bps so why there's 57600 instead of 56000? Maybe I'm dumb, sorry if that's the case :P

0

Share this post


Link to post
Share on other sites

In this case, "K" is 2^10 == 1024. Which is actually 57344, so the comment is wrong anyway.

 

This has to do with how asynchronous serial systems were designed a long time ago, with a base baud (line change) rate of 75 baud, then 300 baud, then 1200 baud etc. 57600 is 48 times 1200, so it's a common serial port speed in asynchronous serial ports. Meanwhile, once modems went above 2400 bps or so, they started to use advanced signal processing to send more than just "1" and "0" in a single line state change. up to 14400 bps, they used QAM, and over that, "trellis" coding. You can Google for "V.34" and "V.90" for more historical arcana :-) 

 

The "56 kbps" modems were actually sending at a rate approximating 56,000 bits per second when working at full output power on clean lines, but that was actually not standards compliant and the transmission rate was limited in actuality to 53,300 bps downstream. (Upstream was typically limited to 33.6 kbps.) To drive them, you'd typically use a 57600 (or faster) baud rate on your serial port. The inclusion of 57600 may have been a confounding of the two similar speeds on the part of the original author.

 

That being said, those are some pretty low limits to use for games of today. Modem games do not support FPS play for 20 players. You'll want to bump up those numbers with the stated goals of your game, and require all players to have at least some kind of "broadband" connection.

2

Share this post


Link to post
Share on other sites

Thanks a lot for all this info! I totally forgot that 1 K is 1024 not 1000 in IT :|

0

Share this post


Link to post
Share on other sites

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  
Followers 0