Game Development Community

Reducing Bandwidth

by Jason "fireVein" Culwell · in Torque Game Engine Advanced · 03/14/2009 (9:26 am) · 4 replies

I'm the developer for a game called PrototypeB (www.vimeo.com/2160040, www.youtube.com/watch?v=XOfWEaL4ZLE, viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID=4146...) and I have come here today to seek advice on reducing bandwidth for the game.

At any given moment in time, there can be quite a bit of projectiles on the screen. Actually, "massive amount" can better describe it. The video is old and the screen shots simply don't do the game justice. Although I have done much play testing to balance out how many projectiles there can possibly be, I am still in need of freeing up some bandwidth to ensure that the game is an enjoyable experience.

Right now the game is aimed at only 2 players with a max of 30-40 bots. The server, and one connected client. I was hoping to up that to 3 players, but I don't foresee that happening.

In order to keep the game play smooth, thus far I have upped the packet rates and sizes and upped the projectiles' update priority by 0.2(to reduce the delay of projectiles showing up client side). The server sends roughly 14kb/s per client. Pretty high, I know, but quite necessary and not too bad with just 1 connected client. I have also removed a couple of things that the Player class sends across the wire, such as mHead. I didn't see a whole lot that I felt I could safely omit from being sent across. So, any advice in this area would be appreciated.

I also understand that it is completely possible to bypass the weapon images' state system. So, assuming 32 weapon images, with 3 states, sending updates all at different intervals ranging from 0.2 to 2.5 seconds, would it be worth it bandwidth wise to just skip out on the weapon images' state system? I could use the weapon images for display purposes only, and just send a bit across the wire that tells it when to start shooting, and when to stop shooting. The projectiles would be spawned like normal via script.

Anything else that anyone can think of would be greatly appreciated. The game is nearing feature complete and I am almost ready to start beta testing, so getting bandwidth requirements ironed out is crucial.

About the author

http://www.microdotproductions.com - I am a self taught programmer that has been hacking away at code for a little over 10 years now. I am a very passionate and persistent programmer, and gamer. I love challenges and problem solving.


#1
03/14/2009 (12:36 pm)
I only got to watch most of the video before a ceiling tile dislodged and fell on my head. Dont worry i am quite ok, but did get some dust in my eyes.

Now, i truly have very little knowledge about network behavior in torque, after spending near a year programing what i thought were cleaver little script functions only to find they only work in single player games. That was a long time ago and i have successfully completed therapy to deal with the crushing disappointment issues I had that no one told me how these things work, and im obviously one of the few people born without the knowledge. Im such a freak....

Ok, what i do know, is i have read several things about people disregarding the projectiles as a networking object, and just casting rays. I did not bookmark what is obviously a gem of information, always expecting to be able to use the search function to find it when i needed it.

PS: you project look supper cool, love all the flashing and bright colors! Something Serous Sam'ish with them bots running at you like that did you program your own AI or use a resource?
#2
03/14/2009 (12:45 pm)
I agree with Caylo, your project looks very flashy. ;)

I would suggest reading articles by Valve on this, as they are generally quite informative and applicable in the type of game you're making. Our game is a hack n' slash game much like the Diablo series, and we're down to a range between 8-24 bytes/s per connection, and 4-8 bytes per second per AI entity that is scoped to each connection. Projectiles take up 0.125 bytes/s for each time they are fired, and nothing when they travel.

Move away from anything that uses the script networking structures, as that will severaly increase your requirements. You'll also have to move away from the Torque way of updating movement, and give clients some more room for interpolation and authority. We've had clients with upwards of 400-600 ms ping, and they've had a playable experience.

Gamasutra has the articles. Have fun :)
#3
03/14/2009 (12:52 pm)
Unfortunately, due to the nature of the game, using raycasts, or hitscans as I've seen them called, is not a viable solution. Projectiles really are the best solution for the type of gameplay that I am going for. For the most part, they are fairly light weight.

Thanks for the kind words! I've never played Serious Sam, but I've heard about it. I think I might go check it out. The AI is mostly custom, aside from using the AIPlayer class, and Dan Keller's A* pathfinding resource. Really nothing complicated. The rest is just a system of spawn spheres that spawn bots when they are off screen. It uses a spawn table, similar to how a loot table in an RPG would work. This allows me to have some randomness in the levels with the types of bots that are spawned, as well as change what kind of bots are spawned on the fly. In my current build the bots will also hide behind corners when they get low on health, or back away if you get too close, mostly attributed to Dan Keller's resource.
#4
03/14/2009 (12:54 pm)
Hi, Stefan. Thanks for the reply and I will surely check them out!