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

Handling Extra Messages

7 posts in this topic

I have a message queue that pumps out messages as long as the queue isn't empty and there is available bandwidth. But what do I do when I have more messages than the bandwidth can handle? I don't want to discard them but not sure what else to do. I think I might be able to slow down how many messages are added to the queue but things would start getting laggy.
0

Share this post


Link to post
Share on other sites

If you mean like a server sending updates, im afraid youre going to have to reduce the quality, at least for some of the clients (if you have more important clients, like ones with a membership)

 

Possible solutions:

-Reduce non-necessary packets (fewer position updates, fewer 'visuals' updates...)

-Activate a laggy compressor to make the packets smaller by sacrificing some CPU under low bandwidth

-Slow down the simulation speed (depends what youre working on)

0

Share this post


Link to post
Share on other sites
Thanks, I've come up with this to adjust the message queue update rate:

[source]
if(m_updateMessages.Count * messagesize < m_bandWidth * 3.2f)
{
m_updateThresh = Mathf.Lerp(3.2f,0.2f,1.0f / (m_updateMessages.Count + 1.0f));
}
else
{
//shutdown. Too laggy.
}
[/source]

this only currently handles update messages though so messagesize is constant.
This happens after the messages are processed so the count would be excess messages that bandwidth couldn't handle.

Is this a decent solution, or should I try something else?
0

Share this post


Link to post
Share on other sites

If you need to send more data than the network can tolerate, then you will fail, and you might as well disconnect the users.

If you don't need to send the data, then why are you sending it?

The main challenge is to reduce the number of messages you need to send; the secondary challenge is to reduce the size of each message you send.

No matter what you do, you have to be prepared for falling behind. The available bandwidth may at some point go close to zero, for various reasons (none of the good,) and you need to know what to do in that case. Typically, send a message to each connected client that there's a problem, and then disconnect all users.

Oh, and send email to the pager of whoever runs the servers to have them wake up and look into it, as they weren't on the ball as available bandwidth was starting to go down :-)

0

Share this post


Link to post
Share on other sites
I was thinking I would start disconnecting players instead of shutting down. The update messages are pretty much positional updates plus a couple other things that are lerped between on the client side. They do need to be sent at a decent rate for the game to be playable as it's an action type game, but if players decide to clump up there's nothing sane I can do to prevent that. The code above will decrease messages sent up to 16 times before I shutdown or start booting players. I'd have to test how the game plays at an update rate of once per 3.2 seconds, but I'm thinking it won't be remotely playable. I'd have to start booting way before that. There's no set upload bandwidth since the servers will be player ran. I think the lowest update rate I can get away with is 1 per second, but not sure until I test it out.
0

Share this post


Link to post
Share on other sites

The code above will decrease messages sent up to 16 times before I shutdown or start booting players.


Decreasing the rate you send messages isn't going to help if you still generate messages faster than you can send them.

You have to decrease the rate at which you *generate* those messages. For example, do not generate a new update for an entity if the previous update for that entity is still pending in the queue -- that would auto-balance the network to send no faster than it could support.

The next question is: what do you use as an indication that you "can't send" a packet? Are you using TCP or UDP? If UDP, then your local network interface can send messages very quickly without blocking, but those get dropped as soon as they hit your upstream cable modem / DSL router / ISP interface if you exceed capacity.
1

Share this post


Link to post
Share on other sites
Sorry, that's what I meant, the threshhold variable slows down the rate the messages are generated, not sent.
0

Share this post


Link to post
Share on other sites
Thanks, I decided to use your method of checking for previous updates in the queue.
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